16 #include "G4LogicalVolumeStore.hh"
17 #include "G4LogicalVolume.hh"
20 #include "G4ParticleTable.hh"
21 #include "G4VProcess.hh"
67 G4String myName =
name;
70 if (myName.find(
"HitsEE") != std::string::npos) {
72 nameX_ =
"HGCalEESensitive";
73 }
else if (myName.find(
"HitsHEfront") != std::string::npos) {
75 nameX_ =
"HGCalHESiliconSensitive";
79 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
83 <<
"* Constructing a HGCalSD with name " <<
name <<
"\n"
86 <<
"**************************************************";
98 double r = aStep->GetPreStepPoint()->GetPosition().perp();
99 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
101 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
102 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
103 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
104 edm::LogVerbatim(
"HGCSim") <<
"HGCalSD: Hit from standard path from " << lv->GetName() <<
" for Track "
105 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r
106 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
117 double wt2 = aStep->GetTrack()->GetWeight();
118 double destep =
weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
123 <<
weight_ * wt1 * wt2 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
129 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
130 const G4VTouchable* touch = preStepPoint->GetTouchable();
137 G4ThreeVector hitPoint = preStepPoint->GetPosition();
138 float globalZ = touch->GetTranslation(0).z();
139 int iz(globalZ > 0 ? 1 : -1);
141 int layer(0), module(-1), cell(-1);
143 if (touch->GetHistoryDepth() >
levelT2_) {
144 layer = touch->GetReplicaNumber(4);
145 module = touch->GetReplicaNumber(3);
146 cell = touch->GetReplicaNumber(1);
148 layer = touch->GetReplicaNumber(2);
149 module = touch->GetReplicaNumber(1);
151 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
152 layer = touch->GetReplicaNumber(0);
155 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":"
156 << module <<
":" << cell;
159 layer = touch->GetReplicaNumber(3);
160 module = touch->GetReplicaNumber(2);
161 cell = touch->GetReplicaNumber(1);
163 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name "
164 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" << module
169 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
170 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
171 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":"
172 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":"
173 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":"
174 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":"
175 << touch->GetReplicaNumber(4) <<
" "
176 <<
" layer:module:cell " <<
layer <<
":" << module <<
":" << cell <<
" Material "
177 << mat->GetName() <<
":" << mat->GetRadlen();
180 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
189 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
218 <<
" top Level " <<
levelT1_ <<
":" <<
levelT2_ <<
" wafer " << waferSize <<
":"
226 throw cms::Exception(
"Unknown",
"HGCalSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";