10 #include "G4VPhysicalVolume.hh"
11 #include "G4PVPlacement.hh"
12 #include "G4HCofThisEvent.hh"
13 #include "G4TouchableHistory.hh"
16 #include "G4VSolid.hh"
17 #include "G4DynamicParticle.hh"
18 #include "G4ParticleDefinition.hh"
19 #include "G4SDManager.hh"
28 m_trackManager(manager),
37 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalSimulationConstants";
38 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalSimulationConstants\n";
47 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalDDDSimConstant";
48 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalDDDSimConstant\n";
58 edm::LogVerbatim(
"FiberSim") <<
"FiberSD : Initialize called for " << GetName() <<
" in collection " << HCE;
69 double zoffset = 1000;
73 std::vector<HFShowerPhoton> thePE;
74 for (
unsigned int i = 0;
i <
hits.size();
i++) {
80 int trackID = aStep->GetTrack()->GetTrackID();
81 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
82 const G4VTouchable* touch = preStepPoint->GetTouchable();
83 G4LogicalVolume* lv = touch->GetVolume(0)->GetLogicalVolume();
84 int depth = (touch->GetReplicaNumber(0)) % 10;
87 preStepPoint->GetPosition().x(), preStepPoint->GetPosition().y(), preStepPoint->GetPosition().z());
92 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :pre hit position " << aHit->hitPos();
93 aHit->setNpe(
hits.size());
94 aHit->setPos(theHitPos);
95 aHit->setTime(preStepPoint->GetGlobalTime());
96 aHit->setPhoton(thePE);
97 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :ShowerPhoton position " << thePE[0].x() <<
" " << thePE[0].y() <<
" "
100 edm::LogVerbatim(
"FiberSim") <<
"FiberSD: Hit created at " << lv->GetName() <<
" DetID: " << aHit->towerId()
101 <<
" Depth: " << aHit->depth() <<
" Track ID: " << aHit->trackId()
102 <<
" Nb. of Cerenkov Photons: " << aHit->npe() <<
" Time: " << aHit->time() <<
" at "
104 for (
unsigned int i = 0;
i < thePE.size();
i++)
135 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
136 int fibre = (touch->GetReplicaNumber(1)) % 10;
137 int cell = (touch->GetReplicaNumber(2));
138 int tower = (touch->GetReplicaNumber(3));
139 return ((
tower * 1000 + cell) * 10 + fibre);