18 #include "G4LogicalVolumeStore.hh"
19 #include "G4LogicalVolume.hh"
22 #include "G4ParticleTable.hh"
23 #include "G4VProcess.hh"
66 G4String myName =
name;
69 if (myName.find(
"HitsHEback") != std::string::npos) {
71 nameX_ =
"HGCalHEScintillatorSensitive";
75 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
79 <<
"* Constructing a HGCScintSD with name " <<
name <<
"\n"
82 <<
"**************************************************";
90 <<
" with three constants kB = " <<
birk1_ <<
", C1 = " <<
birk2_ <<
", C2 = " <<
birk3_;
94 double r = aStep->GetPreStepPoint()->GetPosition().perp();
95 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
97 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
98 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
99 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
100 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track "
101 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r
102 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
113 double wt2 = aStep->GetTrack()->GetWeight();
115 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
120 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
121 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
127 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
128 const G4VTouchable* touch = preStepPoint->GetTouchable();
131 G4ThreeVector hitPoint = preStepPoint->GetPosition();
132 float globalZ = touch->GetTranslation(0).z();
133 int iz(globalZ > 0 ? 1 : -1);
136 if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
137 layer = touch->GetReplicaNumber(0);
142 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":"
146 layer = touch->GetReplicaNumber(3);
147 module = touch->GetReplicaNumber(2);
148 cell = touch->GetReplicaNumber(1);
150 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name "
151 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":" <<
module
156 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
157 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
158 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":"
159 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":"
160 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":"
161 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":"
162 << touch->GetReplicaNumber(4) <<
" "
163 <<
" layer:module:cell " << layer <<
":" <<
module <<
":" << cell <<
" Material "
164 << mat->GetName() <<
":" << mat->GetRadlen();
167 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
174 <<
" is rejected by fiducilal volume cut";
198 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";