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();
133 G4ThreeVector hitPoint = preStepPoint->GetPosition();
134 float globalZ = touch->GetTranslation(0).z();
135 int iz(globalZ > 0 ? 1 : -1);
137 int layer, module, cell;
138 if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
139 layer = touch->GetReplicaNumber(0);
144 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":"
145 << module <<
":" << cell;
148 layer = touch->GetReplicaNumber(3);
149 module = touch->GetReplicaNumber(2);
150 cell = touch->GetReplicaNumber(1);
152 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name "
153 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":" << module
158 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
159 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
160 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":"
161 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":"
162 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":"
163 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":"
164 << touch->GetReplicaNumber(4) <<
" "
165 <<
" layer:module:cell " << layer <<
":" << module <<
":" << cell <<
" Material "
166 << mat->GetName() <<
":" << mat->GetRadlen();
169 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
172 uint32_t
id =
setDetUnitId(layer, module, cell, iz, hitPoint);
178 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
207 <<
" top Level " <<
levelT1_ <<
":" <<
levelT2_ <<
" wafer " << waferSize <<
":"
215 throw cms::Exception(
"Unknown",
"HGCalSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";