13 #include "G4LogicalVolumeStore.hh"
14 #include "G4LogicalVolume.hh"
17 #include "G4ParticleTable.hh"
18 #include "G4VProcess.hh"
63 G4String myName =
name;
66 if (myName.find(
"HitsEE") != std::string::npos) {
68 nameX_ =
"HGCalEESensitive";
69 }
else if (myName.find(
"HitsHEfront") != std::string::npos) {
71 nameX_ =
"HGCalHESiliconSensitive";
75 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
79 <<
"* Constructing a HGCalSD with name " <<
name <<
"\n"
82 <<
"**************************************************";
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") <<
"HGCalSD: 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();
114 double destep =
weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
119 <<
weight_ * wt1 * wt2 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
125 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
126 const G4VTouchable* touch = preStepPoint->GetTouchable();
133 G4ThreeVector hitPoint = preStepPoint->GetPosition();
134 float globalZ = touch->GetTranslation(0).z();
135 int iz(globalZ > 0 ? 1 : -1);
139 if (touch->GetHistoryDepth() >
levelT2_) {
140 layer = touch->GetReplicaNumber(4);
141 module = touch->GetReplicaNumber(3);
142 cell = touch->GetReplicaNumber(1);
144 layer = touch->GetReplicaNumber(2);
145 module = touch->GetReplicaNumber(1);
147 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
148 layer = touch->GetReplicaNumber(0);
151 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":"
155 layer = touch->GetReplicaNumber(3);
156 module = touch->GetReplicaNumber(2);
157 cell = touch->GetReplicaNumber(1);
159 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name "
160 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" <<
module
165 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
166 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
167 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":"
168 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":"
169 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":"
170 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":"
171 << touch->GetReplicaNumber(4) <<
" "
172 <<
" layer:module:cell " <<
layer <<
":" <<
module <<
":" << cell <<
" Material "
173 << mat->GetName() <<
":" << mat->GetRadlen();
176 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
185 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
210 <<
" top Level " <<
levelT1_ <<
":" <<
levelT2_ <<
" wafer " << waferSize <<
":"
218 throw cms::Exception(
"Unknown",
"HGCalSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";