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 "
52 double zoffset = 1000;
56 std::vector<HFShowerPhoton> thePE;
57 for (
unsigned int i = 0;
i < hits.size();
i++) {
60 hits[
i].
position.x(), hits[
i].position.y(), hits[
i].position.z(), hits[
i].wavelength, hits[
i].time);
63 int trackID = aStep->GetTrack()->GetTrackID();
64 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
65 const G4VTouchable* touch = preStepPoint->GetTouchable();
66 G4LogicalVolume* lv = touch->GetVolume(0)->GetLogicalVolume();
67 int depth = (touch->GetReplicaNumber(0)) % 10;
70 preStepPoint->GetPosition().x(), preStepPoint->GetPosition().y(), preStepPoint->GetPosition().z());
75 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :hit size " << hits.size() <<
" npe" << aHit->npe();
76 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :pre hit position " << aHit->hitPos();
78 aHit->setNpe(hits.size());
79 aHit->setPos(theHitPos);
80 aHit->setTime(preStepPoint->GetGlobalTime());
81 aHit->setPhoton(thePE);
83 edm::LogVerbatim(
"FiberSim") <<
"FiberSD :ShowerPhoton position " << thePE[0].x() <<
" "
84 << thePE[0].y() <<
" " << thePE[0].z();
87 <<
" DetID: " << aHit->towerId() <<
" Depth: " << aHit->depth()
88 <<
" Track ID: " << aHit->trackId() <<
" Nb. of Cerenkov Photons: " << aHit->npe()
89 <<
" Time: " << aHit->time() <<
" at " << aHit->hitPos();
90 for (
unsigned int i = 0;
i < thePE.size();
i++)
121 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
122 int fibre = (touch->GetReplicaNumber(1)) % 10;
123 int cell = (touch->GetReplicaNumber(2));
124 int tower = (touch->GetReplicaNumber(3));
125 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.
std::string const collectionName[nCollections]
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