16 #include "G4LogicalVolumeStore.hh" 17 #include "G4LogicalVolume.hh" 20 #include "G4ParticleTable.hh" 21 #include "G4VProcess.hh" 60 if (storeAllG4Hits_) {
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 <<
"**************************************************";
92 edm::LogVerbatim(
"HGCSim") <<
"Reject MosueBite Flag: " << rejectMB_ <<
" cuts along " << angles_.size()
93 <<
" axes: " << angles_[0] <<
", " << angles_[1];
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_;
108 if (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 <<
":" 144 << module <<
":" << cell;
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.)
171 uint32_t
id =
setDetUnitId(layer, module, cell, iz, hitPoint);
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";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setNumberCheckedHits(int val)
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
Compact representation of the geometrical detector hierarchy.
HGCalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
double getEnergyDeposit(const G4Step *) override
uint32_t setDetUnitId(const G4Step *step) override
double mouseBite(bool reco) const
std::vector< double > angles_
const HGCalDDDConstants * hgcons_
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
HGCalGeometryMode::GeometryMode geomMode() const
double waferSize(bool reco) const
std::pair< int, int > waferUV() const
bool isItinFidVolume(const G4ThreeVector &)
bool maskCell(const DetId &id, int corners) const
HGCalGeometryMode::GeometryMode geom_mode_
bool filterHit(CaloG4Hit *, double) override
std::unique_ptr< HGCMouseBite > mouseBite_
int levelTop(int ind=0) const
double getResponseWt(const G4Track *)
double distFromEdgeHex(double x, double y, double z) const
double getEnergyDeposit() const
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.