8 #include "G4VPhysicalVolume.hh" 9 #include "G4PVPlacement.hh" 10 #include "G4HCofThisEvent.hh" 11 #include "G4TouchableHistory.hh" 14 #include "G4VSolid.hh" 15 #include "G4DynamicParticle.hh" 16 #include "G4ParticleDefinition.hh" 17 #include "G4SDManager.hh" 40 edm::LogVerbatim(
"FiberSim") <<
"FiberSD : Initialize called for " << GetName() <<
" in collection " << HCE;
51 double zoffset = 1000;
55 std::vector<HFShowerPhoton> thePE;
56 for (
unsigned int i = 0;
i <
hits.size();
i++) {
62 int trackID = aStep->GetTrack()->GetTrackID();
63 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
64 const G4VTouchable* touch = preStepPoint->GetTouchable();
65 G4LogicalVolume* lv = touch->GetVolume(0)->GetLogicalVolume();
66 int depth = (touch->GetReplicaNumber(0)) % 10;
69 preStepPoint->GetPosition().x(), preStepPoint->GetPosition().y(), preStepPoint->GetPosition().z());
75 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :pre hit position " << aHit->hitPos();
77 aHit->setNpe(
hits.size());
78 aHit->setPos(theHitPos);
79 aHit->setTime(preStepPoint->GetGlobalTime());
80 aHit->setPhoton(thePE);
82 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :ShowerPhoton position " << thePE[0].x() <<
" " << thePE[0].y() <<
" " 85 edm::LogVerbatim(
"FiberSim") <<
"FiberSD: Hit created at " << lv->GetName() <<
" DetID: " << aHit->towerId()
86 <<
" Depth: " << aHit->depth() <<
" Track ID: " << aHit->trackId()
87 <<
" Nb. of Cerenkov Photons: " << aHit->npe() <<
" Time: " << aHit->time() <<
" at " 89 for (
unsigned int i = 0;
i < thePE.size();
i++)
120 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
121 int fibre = (touch->GetReplicaNumber(1)) % 10;
122 int cell = (touch->GetReplicaNumber(2));
123 int tower = (touch->GetReplicaNumber(3));
124 return ((
tower * 1000 + cell) * 10 + fibre);
Log< level::Info, true > LogVerbatim
uint32_t setDetUnitId(const G4Step *) override
void clearHits() override
std::vector< PCaloHit > PCaloHitContainer
FiberSD(const std::string &, const HcalSimulationConstants *, const HcalDDDSimConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
std::vector< Hit > getHits(const G4Step *aStep, double weight)
const HcalSimulationParameters * hcalsimpar() const
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
void Initialize(G4HCofThisEvent *HCE) override
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