13 #include "G4VPhysicalVolume.hh" 14 #include "G4PVPlacement.hh" 15 #include "G4HCofThisEvent.hh" 16 #include "G4TouchableHistory.hh" 19 #include "G4VSolid.hh" 20 #include "G4DynamicParticle.hh" 21 #include "G4ParticleDefinition.hh" 22 #include "G4SDManager.hh" 31 m_trackManager(manager),
39 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalDDDSimulationConstant";
40 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalDDDSimulationConstant\n";
49 edm::LogError(
"FiberSim") <<
"FiberSD : Cannot find HcalDDDSimConstant";
50 throw cms::Exception(
"Unknown",
"FiberSD") <<
"Cannot find HcalDDDSimConstant\n";
60 LogDebug(
"FiberSim") <<
"FiberSD : Initialize called for " << GetName();
69 double zoffset = 1000;
73 std::vector<HFShowerPhoton> thePE;
74 for (
unsigned int i = 0;
i < hits.size();
i++) {
77 hits[
i].
position.x(), hits[
i].position.y(), hits[
i].position.z(), hits[
i].wavelength, hits[
i].time);
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());
91 std::cout <<
"hit size " << hits.size() <<
" npe" << aHit->npe() << std::endl;
92 std::cout <<
"pre hit position " << aHit->hitPos() << std::endl;
93 aHit->setNpe(hits.size());
94 aHit->setPos(theHitPos);
95 aHit->setTime(preStepPoint->GetGlobalTime());
96 aHit->setPhoton(thePE);
97 std::cout <<
"ShowerPhoton position " << thePE[0].x() <<
" " << thePE[0].y() <<
" " << thePE[0].z() << std::endl;
99 LogDebug(
"FiberSim") <<
"FiberSD: Hit created at " << lv->GetName() <<
" DetID: " << aHit->towerId()
100 <<
" Depth: " << aHit->depth() <<
" Track ID: " << aHit->trackId()
101 <<
" Nb. of Cerenkov Photons: " << aHit->npe() <<
" Time: " << aHit->time() <<
" at " 103 for (
unsigned int i = 0;
i < thePE.size();
i++)
104 LogDebug(
"FiberSim") <<
"FiberSD: PE[" <<
i <<
"] " << thePE[
i];
112 LogDebug(
"FiberSim") <<
"FiberSD: Sees" <<
theHC->entries() <<
" hits";
134 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
135 int fibre = (touch->GetReplicaNumber(1)) % 10;
136 int cell = (touch->GetReplicaNumber(2));
137 int tower = (touch->GetReplicaNumber(3));
138 return ((tower * 1000 + cell) * 10 + fibre);
uint32_t setDetUnitId(const G4Step *) override
void clearHits() override
std::vector< PCaloHit > PCaloHitContainer
std::vector< Hit > getHits(const G4Step *aStep, double weight)
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
void Initialize(G4HCofThisEvent *HCE) override
const HcalSimulationParameters * hcalsimpar() const
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override
XYZPointD XYZPoint
point in space with cartesian internal representation
FiberG4HitsCollection * theHC
G4THitsCollection< FiberG4Hit > FiberG4HitsCollection
void fillHits(edm::PCaloHitContainer &, const std::string &) override
static int position[264][3]
void EndOfEvent(G4HCofThisEvent *HCE) override
T const * product() const
FiberSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)