12 #include <Geant4/G4LogicalVolume.hh>
13 #include <Geant4/G4NistManager.hh>
14 #include <Geant4/G4Box.hh>
15 #include <Geant4/G4SystemOfUnits.hh>
16 #include <Geant4/G4PVPlacement.hh>
17 #include <Geant4/G4VisAttributes.hh>
18 #include <Geant4/G4MaterialPropertiesTable.hh>
19 #include <Geant4/G4OpticalPhoton.hh>
20 #include <Geant4/G4Scintillation.hh>
21 #include <Geant4/G4Cerenkov.hh>
32 OpDet::OpDet(
const G4String&
name, G4double xysiz, G4double zpos, G4double xmid, G4double ymid, G4LogicalVolume *top):
41 G4Box *shape =
new G4Box(name, xysiz/2., xysiz/2., dz/2.);
47 G4Material *mat = G4NistManager::Instance()->FindOrBuildMaterial(
"G4_Si");
48 G4LogicalVolume *vol =
new G4LogicalVolume(shape, mat, name);
51 G4VisAttributes *vis =
new G4VisAttributes();
52 vis->SetColor(1, 0, 1);
53 vis->SetForceSolid(
true);
54 vol->SetVisAttributes(vis);
57 fPhys =
new G4PVPlacement(0, G4ThreeVector(xmid, ymid, zpos-dz/2.), vol, name, top,
false, 0);
60 fRand =
new CLHEP::HepRandom();
83 fEdep += step->GetTotalEnergyDeposit();
86 G4Track *track = step->GetTrack();
87 if(track->GetDynamicParticle()->GetParticleDefinition() != G4OpticalPhoton::OpticalPhotonDefinition()) {
92 fEopt += step->GetTotalEnergyDeposit();
98 G4int ptype = track->GetCreatorProcess()->GetProcessType();
99 G4int pstype = track->GetCreatorProcess()->GetProcessSubType();
106 G4double tim = step->GetPostStepPoint()->GetGlobalTime();
172 std::string leaf = name +
"/D";
173 tree->Branch(name.c_str(), val, leaf.c_str());
183 std::string leaf = name +
"/l";
184 tree->Branch(name.c_str(), val, leaf.c_str());