16 #include "G4LogicalVolumeStore.hh"
17 #include "G4LogicalVolume.hh"
20 #include "G4ParticleTable.hh"
21 #include "G4VProcess.hh"
66 G4String myName =
name;
69 if (myName.find(
"HitsEE") != std::string::npos) {
71 nameX_ =
"HGCalEESensitive";
72 }
else if (myName.find(
"HitsHEfront") != std::string::npos) {
74 nameX_ =
"HGCalHESiliconSensitive";
78 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
82 <<
"* Constructing a HGCalSD with name " <<
name <<
"\n"
85 <<
"**************************************************";
97 double r = aStep->GetPreStepPoint()->GetPosition().perp();
98 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
100 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
101 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
102 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
103 edm::LogVerbatim(
"HGCSim") <<
"HGCalSD: Hit from standard path from " << lv->GetName() <<
" for Track "
104 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r
105 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
116 double wt2 = aStep->GetTrack()->GetWeight();
117 double destep =
weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
122 <<
weight_ * wt1 * wt2 <<
" 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);
137 if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
138 layer = touch->GetReplicaNumber(0);
143 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":"
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.)
177 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
206 <<
" top Level " <<
levelT1_ <<
":" <<
levelT2_ <<
" wafer " << waferSize <<
":"
214 throw cms::Exception(
"Unknown",
"HGCalSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";