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),
36 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalDDDSimulationConstant";
37 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalDDDSimulationConstant\n";
46 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalDDDSimConstant";
47 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalDDDSimConstant\n";
57 LogDebug(
"FiberSim") <<
"FiberSD : Initialize called for " << GetName();
66 double zoffset = 1000;
70 std::vector<HFShowerPhoton> thePE;
71 for (
unsigned int i = 0;
i <
hits.size();
i++) {
77 int trackID = aStep->GetTrack()->GetTrackID();
78 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
79 const G4VTouchable* touch = preStepPoint->GetTouchable();
80 G4LogicalVolume* lv = touch->GetVolume(0)->GetLogicalVolume();
81 int depth = (touch->GetReplicaNumber(0)) % 10;
84 preStepPoint->GetPosition().x(), preStepPoint->GetPosition().y(), preStepPoint->GetPosition().z());
88 std::cout <<
"hit size " <<
hits.size() <<
" npe" << aHit->npe() << std::endl;
89 std::cout <<
"pre hit position " << aHit->hitPos() << std::endl;
90 aHit->setNpe(
hits.size());
91 aHit->setPos(theHitPos);
92 aHit->setTime(preStepPoint->GetGlobalTime());
93 aHit->setPhoton(thePE);
94 std::cout <<
"ShowerPhoton position " << thePE[0].x() <<
" " << thePE[0].y() <<
" " << thePE[0].z() << std::endl;
96 LogDebug(
"FiberSim") <<
"FiberSD: Hit created at " << lv->GetName() <<
" DetID: " << aHit->towerId()
97 <<
" Depth: " << aHit->depth() <<
" Track ID: " << aHit->trackId()
98 <<
" Nb. of Cerenkov Photons: " << aHit->npe() <<
" Time: " << aHit->time() <<
" at "
100 for (
unsigned int i = 0;
i < thePE.size();
i++)
101 LogDebug(
"FiberSim") <<
"FiberSD: PE[" <<
i <<
"] " << thePE[
i];
109 LogDebug(
"FiberSim") <<
"FiberSD: Sees" <<
theHC->entries() <<
" hits";
131 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
132 int fibre = (touch->GetReplicaNumber(1)) % 10;
133 int cell = (touch->GetReplicaNumber(2));
134 int tower = (touch->GetReplicaNumber(3));
135 return ((
tower * 1000 + cell) * 10 + fibre);