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(3);
145 module = touch->GetReplicaNumber(2);
149 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" 153 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
154 layer = touch->GetReplicaNumber(0);
157 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" 161 layer = touch->GetReplicaNumber(3);
162 module = touch->GetReplicaNumber(2);
163 cell = touch->GetReplicaNumber(1);
165 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name " 166 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" <<
module 171 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
172 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
173 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":" 174 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":" 175 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":" 176 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":" 177 << touch->GetReplicaNumber(4) <<
" " 178 <<
" layer:module:cell " <<
layer <<
":" <<
module <<
":" << cell <<
" Material " 179 << mat->GetName() <<
":" << mat->GetRadlen();
182 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
191 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
216 <<
" top Level " <<
levelT1_ <<
":" <<
levelT2_ <<
" wafer " << waferSize <<
":" 224 throw cms::Exception(
"Unknown",
"HGCalSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
bool maskCell(const DetId &id, int corners) const
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
void setNumberCheckedHits(int val)
HGCalSD(const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
std::pair< int, int > waferUV() const
HGCalGeometryMode::GeometryMode geomMode() const
constexpr std::array< uint8_t, layerIndexSize > layer
T getUntrackedParameter(std::string const &, T const &) const
double getEnergyDeposit(const G4Step *) override
uint32_t setDetUnitId(const G4Step *step) override
std::vector< double > angles_
const HGCalDDDConstants * hgcons_
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
double mouseBite(bool reco) const
bool isItinFidVolume(const G4ThreeVector &)
double getEnergyDeposit() const
HGCalGeometryMode::GeometryMode geom_mode_
void printDetectorLevels(const G4VTouchable *) const
bool filterHit(CaloG4Hit *, double) override
std::unique_ptr< HGCMouseBite > mouseBite_
double getResponseWt(const G4Track *)
int levelTop(int ind=0) const
double waferSize(bool reco) const
double distFromEdgeHex(double x, double y, double z) const
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.