4 #include "G4VPhysicalVolume.hh" 5 #include "G4PVPlacement.hh" 6 #include "G4HCofThisEvent.hh" 7 #include "G4TouchableHistory.hh" 10 #include "G4VSolid.hh" 11 #include "G4DynamicParticle.hh" 12 #include "G4ParticleDefinition.hh" 13 #include "G4SDManager.hh" 16 #include "G4PhysicalConstants.hh" 17 #include "G4SystemOfUnits.hh" 29 edm::LogVerbatim(
"FiberSim") <<
"HFChamberSD : Initialize called for " << GetName() <<
" in collection " << HCE;
40 double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
41 int trackID = aStep->GetTrack()->GetTrackID();
42 if (
charge == 0. || trackID != 1 || aStep->GetTrack()->GetParentID() != 0 ||
43 aStep->GetTrack()->GetCreatorProcess() !=
nullptr)
48 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
49 const G4VTouchable* touch = preStepPoint->GetTouchable();
52 double edep = aStep->GetTotalEnergyDeposit();
53 double time = (preStepPoint->GetGlobalTime()) / ns;
55 const G4ThreeVector& globalPos = preStepPoint->GetPosition();
56 G4ThreeVector localPos = touch->GetHistory()->GetTopTransform().TransformPoint(globalPos);
57 const G4DynamicParticle* particle = aStep->GetTrack()->GetDynamicParticle();
58 const G4ThreeVector& momDir = particle->GetMomentumDirection();
66 edm::LogVerbatim(
"FiberSim") <<
"HFChamberSD: Hit created in (" << touch->GetVolume(0)->GetLogicalVolume()->GetName()
67 <<
") ID " << detID <<
" Track " << trackID <<
" Edep: " << edep / CLHEP::MeV
68 <<
" MeV; Time: " <<
time <<
" ns; Position (local) " << localPos <<
" (global ) " 69 << globalPos <<
" direction " << momDir;
89 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
90 return (touch->GetReplicaNumber(0));
Log< level::Info, true > LogVerbatim
std::vector< PCaloHit > PCaloHitContainer
void clearHits() override
void setLocalPos(const G4ThreeVector &xyz)
HFChamberSD(const std::string &, const SensitiveDetectorCatalog &, const SimTrackManager *)
uint32_t setDetUnitId(const G4Step *) override
HFShowerG4HitsCollection * theHC
void Initialize(G4HCofThisEvent *HCE) override
void fillHits(edm::PCaloHitContainer &, const std::string &) override
void setPrimMomDir(const G4ThreeVector &xyz)
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override
void EndOfEvent(G4HCofThisEvent *HCE) override
void setGlobalPos(const G4ThreeVector &xyz)
G4THitsCollection< HFShowerG4Hit > HFShowerG4HitsCollection