18 #include "G4LogicalVolumeStore.hh"
19 #include "G4LogicalVolume.hh"
22 #include "G4ParticleTable.hh"
23 #include "G4VProcess.hh"
67 G4String myName =
name;
70 if (myName.find(
"HitsHEback") != std::string::npos) {
72 nameX_ =
"HGCalHEScintillatorSensitive";
76 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
80 <<
"* Constructing a HGCScintSD with name " <<
name <<
"\n"
83 <<
"**************************************************";
91 <<
" with three constants kB = " <<
birk1_ <<
", C1 = " <<
birk2_ <<
", C2 = " <<
birk3_;
95 double r = aStep->GetPreStepPoint()->GetPosition().perp();
96 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
98 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
99 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
100 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
101 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track "
102 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r
103 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
114 double wt2 = aStep->GetTrack()->GetWeight();
116 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
121 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
122 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
128 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
129 const G4VTouchable* touch = preStepPoint->GetTouchable();
132 G4ThreeVector hitPoint = preStepPoint->GetPosition();
133 float globalZ = touch->GetTranslation(0).z();
134 int iz(globalZ > 0 ? 1 : -1);
136 int layer, module, cell;
137 if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
138 layer = touch->GetReplicaNumber(0);
143 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":"
144 << module <<
":" << cell;
147 layer = touch->GetReplicaNumber(3);
148 module = touch->GetReplicaNumber(2);
149 cell = touch->GetReplicaNumber(1);
151 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name "
152 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":" << module
157 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
158 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
159 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":"
160 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":"
161 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":"
162 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":"
163 << touch->GetReplicaNumber(4) <<
" "
164 <<
" layer:module:cell " << layer <<
":" << module <<
":" << cell <<
" Material "
165 << mat->GetName() <<
":" << mat->GetRadlen();
168 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
171 uint32_t
id =
setDetUnitId(layer, module, cell, iz, hitPoint);
175 <<
" is rejected by fiducilal volume cut";
199 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";