20 #include "G4LogicalVolumeStore.hh"
21 #include "G4LogicalVolume.hh"
24 #include "G4ParticleTable.hh"
25 #include "G4VProcess.hh"
37 CaloSD(name, cpv, clg, p, manager,
38 (float)(p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<double>(
"TimeSliceUnit")),
39 p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<bool>(
"IgnoreTrackID")),
49 if (myName.find(
"HitsEE")!=std::string::npos) {
51 nameX =
"HGCalEESensitive";
52 }
else if (myName.find(
"HitsHEfront")!=std::string::npos) {
54 nameX =
"HGCalHESiliconSensitive";
55 }
else if (myName.find(
"HitsHEback")!=std::string::npos) {
57 nameX =
"HGCalHEScintillatorSensitive";
61 LogDebug(
"HGCSim") <<
"**************************************************"
65 <<
"* Constructing a HGCSD with name " << name <<
"\n"
68 <<
"**************************************************";
85 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
86 bool notaMuon = (parCode ==
mupPDG || parCode ==
mumPDG ) ?
false :
true;
88 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
89 edm::LogInfo(
"HGCSim") <<
"HGCSD: Hit from standard path from "
90 << lv->GetName() <<
" for Track "
91 << aStep->GetTrack()->GetTrackID() <<
" ("
92 << aStep->GetTrack()->GetDefinition()->GetParticleName()
93 <<
":" << notaMuon <<
")";
103 double destep = aStep->GetTotalEnergyDeposit();
110 const G4VTouchable* touch = preStepPoint->GetTouchable();
113 G4ThreeVector hitPoint = preStepPoint->GetPosition();
114 float globalZ=touch->GetTranslation(0).z();
115 int iz( globalZ>0 ? 1 : -1);
118 G4ThreeVector localpos = touch->GetHistory()->GetTopTransform().TransformPoint(hitPoint);
123 int layer(0),
module(0), cell(0);
125 layer = touch->GetReplicaNumber(0);
126 module = touch->GetReplicaNumber(1);
128 layer = touch->GetReplicaNumber(2);
129 module = touch->GetReplicaNumber(1);
130 cell = touch->GetReplicaNumber(0);
145 edm::LogError(
"HGCSim") <<
"HCalSD : Cannot find HGCalDDDConstants for "
147 throw cms::Exception(
"Unknown",
"HGCSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX <<
"\n";
152 G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
153 G4String particleName;
154 mumPDG = theParticleTable->FindParticle(particleName=
"mu-")->GetPDGEncoding();
155 mupPDG = theParticleTable->FindParticle(particleName=
"mu+")->GetPDGEncoding();
158 <<
" for mu+ = " <<
mupPDG;
169 int cell,
int iz, G4ThreeVector &pos) {
180 if (primaryID == 0) {
182 edm::LogInfo(
"HGCSim") <<
"HGCSD: Problem with primaryID **** set by "
183 <<
"force to TkID **** " <<
theTrack->GetTrackID();
T getParameter(std::string const &) const
HGCSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
HGCNumberingScheme * numberingScheme
virtual bool ProcessHits(G4Step *, G4TouchableHistory *)
uint32_t getUnitID(ForwardSubdetector subdet, int layer, int module, int cell, int iz, const G4ThreeVector &pos)
assigns the det id to a hit
virtual void update(const BeginOfJob *)
This routine will be called when the appropriate signal arrives.
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