17 #include "G4LogicalVolumeStore.hh"
18 #include "G4LogicalVolume.hh"
21 #include "G4ParticleTable.hh"
22 #include "G4VProcess.hh"
34 CaloSD(name, cpv, clg, p, manager,
35 (float)(p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<double>(
"TimeSliceUnit")),
36 p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<bool>(
"IgnoreTrackID")),
48 if (myName.find(
"HitsEE")!=std::string::npos) {
50 nameX =
"HGCalEESensitive";
51 }
else if (myName.find(
"HitsHEfront")!=std::string::npos) {
53 nameX =
"HGCalHESiliconSensitive";
54 }
else if (myName.find(
"HitsHEback")!=std::string::npos) {
56 nameX =
"HGCalHEScintillatorSensitive";
60 LogDebug(
"HGCSim") <<
"**************************************************"
64 <<
"* Constructing a HGCSD with name " << name <<
"\n"
67 <<
"**************************************************";
86 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
87 bool notaMuon = (parCode ==
mupPDG || parCode ==
mumPDG ) ?
false :
true;
89 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
90 edm::LogInfo(
"HGCSim") <<
"HGCSD: Hit from standard path from "
91 << lv->GetName() <<
" for Track "
92 << aStep->GetTrack()->GetTrackID() <<
" ("
93 << aStep->GetTrack()->GetDefinition()->GetParticleName()
94 <<
":" << notaMuon <<
")";
104 double destep = aStep->GetTotalEnergyDeposit();
111 const G4VTouchable* touch = preStepPoint->GetTouchable();
114 G4ThreeVector hitPoint = preStepPoint->GetPosition();
115 float globalZ=touch->GetTranslation(0).z();
116 int iz( globalZ>0 ? 1 : -1);
119 G4ThreeVector localpos = touch->GetHistory()->GetTopTransform().TransformPoint(hitPoint);
124 int layer = touch->GetReplicaNumber(0);
125 int module = touch->GetReplicaNumber(1);
127 std::cout <<
"HGCSD::Global " << hitPoint <<
" local " << localpos
129 return setDetUnitId (subdet, layer, module, iz, localpos);
133 G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
134 G4String particleName;
135 mumPDG = theParticleTable->FindParticle(particleName=
"mu-")->GetPDGEncoding();
136 mupPDG = theParticleTable->FindParticle(particleName=
"mu+")->GetPDGEncoding();
139 <<
" for mu+ = " <<
mupPDG;
160 if (primaryID == 0) {
162 edm::LogInfo(
"HGCSim") <<
"HGCSD: Problem with primaryID **** set by "
163 <<
"force to TkID **** " <<
theTrack->GetTrackID();
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
HGCSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
HGCNumberingScheme * numberingScheme
virtual bool ProcessHits(G4Step *, G4TouchableHistory *)
virtual uint32_t getUnitID(ForwardSubdetector subdet, int layer, int module, int iz, const G4ThreeVector &pos)
assigns the det id to a hit
type of data representation of DDCompactView
static TrackerG4SimHitNumberingScheme & numberingScheme(const DDCompactView &cpv, const GeometricDet &det)
void resetForNewPrimary(const G4ThreeVector &, double)
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
G4StepPoint * preStepPoint
virtual double getEnergyDeposit(G4Step *)
virtual bool filterHit(CaloG4Hit *, double)
int setTrackID(G4Step *step)
ForwardSubdetector myFwdSubdet_
virtual uint32_t setDetUnitId(G4Step *step)
CaloG4Hit * createNewHit()
double getEnergyDeposit() const