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" 23 m_trackManager(manager), hcID(-1), theHC(
nullptr), currentHit(
nullptr) {
26 LogDebug(
"FiberSim") <<
"***************************************************" 30 <<
"* Constructing a HFWedgeSD with name " << GetName()
34 <<
"***************************************************";
38 const std::vector<std::string>& lvNames = clg.
logicalNames(name);
40 for (std::vector<std::string>::const_iterator it=lvNames.begin();
41 it !=lvNames.end(); it++){
43 LogDebug(
"FiberSim") <<
"HFWedgeSD : Assigns SD to LV " << (*it);
53 LogDebug(
"FiberSim") <<
"HFWedgeSD : Initialize called for " << GetName();
64 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
65 const G4VTouchable* touch = preStepPoint->GetTouchable();
67 trackID = aStep->GetTrack()->GetTrackID();
68 edep = aStep->GetTotalEnergyDeposit();
69 time = (preStepPoint->GetGlobalTime())/ns;
73 const G4DynamicParticle* particle = aStep->GetTrack()->GetDynamicParticle();
74 momDir = particle->GetMomentumDirection();
84 LogDebug(
"FiberSim") <<
"HFWedgeSD: Sees" <<
theHC->entries() <<
" hits";
102 std::map<int,HFShowerG4Hit*>::const_iterator it =
hitMap.find(
currentID);
115 <<
" MeV; Time: " <<
time <<
" ns; Position (local) " 117 <<
" direction " <<
momDir;
138 <<
" edep " <<
edep/
MeV <<
" MeV";
149 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
150 return (touch->GetReplicaNumber(0));
std::vector< PCaloHit > PCaloHitContainer
void updateHit(HFShowerG4Hit *)
void Initialize(G4HCofThisEvent *HCE) override
bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory) override
void setLocalPos(const G4ThreeVector &xyz)
const std::vector< std::string > & logicalNames(const std::string &readoutName) const
type of data representation of DDCompactView
virtual void AssignSD(const std::string &vname)
void fillHits(edm::PCaloHitContainer &, std::string) override
HFWedgeSD(std::string name, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)
std::string const collectionName[nCollections]
void setTrackId(G4int trackId)
void clearHits() override
void setHitId(G4int hitId)
HFShowerG4HitsCollection * theHC
void EndOfEvent(G4HCofThisEvent *eventHC) override
void setPrimMomDir(const G4ThreeVector &xyz)
HFShowerG4Hit * currentHit
void setGlobalPos(const G4ThreeVector &xyz)
uint32_t setDetUnitId(G4Step *) override
void updateEnergy(G4double edep)
HFShowerG4Hit * createNewHit()
std::map< int, HFShowerG4Hit * > hitMap
G4THitsCollection< HFShowerG4Hit > HFShowerG4HitsCollection