13 #include "G4LogicalVolumeStore.hh" 14 #include "G4LogicalVolume.hh" 17 #include "G4ParticleTable.hh" 18 #include "G4VProcess.hh" 65 G4String myName =
name;
68 if (myName.find(
"HitsEE") != std::string::npos) {
70 nameX_ =
"HGCalEESensitive";
71 }
else if (myName.find(
"HitsHEfront") != std::string::npos) {
73 nameX_ =
"HGCalHESiliconSensitive";
77 edm::LogVerbatim(
"HGCSim") <<
"**************************************************" 81 <<
"* Constructing a HGCalSD with name " <<
name <<
"\n" 84 <<
"**************************************************";
96 double r = aStep->GetPreStepPoint()->GetPosition().perp();
97 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
99 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
100 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
101 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
102 edm::LogVerbatim(
"HGCSim") <<
"HGCalSD: Hit from standard path from " << lv->GetName() <<
" for Track " 103 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r 104 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
115 double wt2 = aStep->GetTrack()->GetWeight();
116 double destep =
weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
121 <<
weight_ * wt1 * wt2 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
127 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
128 const G4VTouchable* touch = preStepPoint->GetTouchable();
135 G4ThreeVector hitPoint = preStepPoint->GetPosition();
136 float globalZ = touch->GetTranslation(0).z();
137 int iz(globalZ > 0 ? 1 : -1);
142 layer = touch->GetReplicaNumber(2);
143 module = touch->GetReplicaNumber(1);
144 }
else if (touch->GetHistoryDepth() >
levelT2_) {
145 layer = touch->GetReplicaNumber(4);
146 module = touch->GetReplicaNumber(3);
147 cell = touch->GetReplicaNumber(1);
149 layer = touch->GetReplicaNumber(3);
150 module = touch->GetReplicaNumber(2);
154 <<
useSimWt_ <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " 158 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
159 layer = touch->GetReplicaNumber(0);
162 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" 166 layer = touch->GetReplicaNumber(3);
167 module = touch->GetReplicaNumber(2);
168 cell = touch->GetReplicaNumber(1);
170 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name " 171 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" <<
module 176 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
177 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
178 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":" 179 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":" 180 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":" 181 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":" 182 << touch->GetReplicaNumber(4) <<
" " 183 <<
" layer:module:cell " <<
layer <<
":" <<
module <<
":" << cell <<
" Material " 184 << mat->GetName() <<
":" << mat->GetRadlen();
187 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
196 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
223 << waferSize <<
":" << mouseBite;
230 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)
const HGCalParameters * getParameter() const
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_
bool waferHexagon8File() const
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.