16 #include "G4LogicalVolumeStore.hh" 17 #include "G4LogicalVolume.hh" 20 #include "G4ParticleTable.hh" 21 #include "G4VProcess.hh" 33 CaloSD(name, cpv, clg, p, manager,
36 hgcons_(
nullptr), slopeMin_(0), levelT1_(99), levelT2_(99),
51 nameX_ = ((name.find(
"HFNoseHits")!=std::string::npos) ?
52 "HGCalHFNoseSensitive" :
"HFNoseSensitive");
60 edm::LogVerbatim(
"HFNSim")<<
"**************************************************" 64 <<
"* Constructing a HFNoseSD with name " << name <<
"\n" 67 <<
"**************************************************";
70 << eminHit_ <<
" for " <<
name;
74 <<
"boundary " << fiducialCut_ <<
" at " 77 <<
" cuts along " << angles_.size() <<
" axes: " 78 << angles_[0] <<
", " << angles_[1];
83 double r = aStep->GetPreStepPoint()->GetPosition().perp();
84 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
86 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
87 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
89 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
91 << lv->GetName() <<
" for Track " 92 << aStep->GetTrack()->GetTrackID() <<
" (" 93 << parCode <<
":" << parName <<
") R = " << r
94 <<
" Z = " << z <<
" slope = " << r/z <<
":" 98 if (r < z*slopeMin_) {
106 double wt2 = aStep->GetTrack()->GetWeight();
107 double destep =
weight_*wt1*(aStep->GetTotalEnergyDeposit());
108 if (wt2 > 0) destep *= wt2;
111 << wt1 <<
":" << wt2 <<
" Total weight " 112 <<
weight_*wt1*wt2 <<
" deStep: " 113 << aStep->GetTotalEnergyDeposit()
121 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
122 const G4VTouchable* touch = preStepPoint->GetTouchable();
125 G4ThreeVector hitPoint = preStepPoint->GetPosition();
126 float globalZ = touch->GetTranslation(0).z();
127 int iz( globalZ>0 ? 1 : -1);
130 if ((touch->GetHistoryDepth() ==
levelT1_) ||
131 (touch->GetHistoryDepth() ==
levelT2_)) {
132 layer = touch->GetReplicaNumber(0);
138 <<
" name " << touch->GetVolume(0)->GetName()
139 <<
" layer:module:cell " << layer <<
":" 140 << module <<
":" << cell;
143 layer = touch->GetReplicaNumber(3);
144 module = touch->GetReplicaNumber(2);
145 cell = touch->GetReplicaNumber(1);
148 <<
" name " << touch->GetVolume(0)->GetName()
149 <<
" layer:module:cell " << layer <<
":" 150 << module <<
":" << cell;
154 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
156 <<
" name " << touch->GetVolume(0)->GetName()
157 <<
":" << touch->GetReplicaNumber(0) <<
" " 158 << touch->GetVolume(1)->GetName()
159 <<
":" << touch->GetReplicaNumber(1) <<
" " 160 << touch->GetVolume(2)->GetName()
161 <<
":" << touch->GetReplicaNumber(2) <<
" " 162 << touch->GetVolume(3)->GetName()
163 <<
":" << touch->GetReplicaNumber(3) <<
" " 164 << touch->GetVolume(4)->GetName()
165 <<
":" << touch->GetReplicaNumber(4) <<
" " 166 <<
" layer:module:cell " << layer <<
":" 167 << module <<
":" << cell <<
" Material " 168 << mat->GetName() <<
":" << mat->GetRadlen();
171 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
return 0;
173 uint32_t
id =
setDetUnitId (layer, module, cell, iz, hitPoint);
180 if (
mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
208 <<
" wafer " << waferSize <<
":" << mouseBite;
216 throw cms::Exception(
"Unknown",
"HFNoseSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
228 G4ThreeVector &
pos) {
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< HFNoseNumberingScheme > numberingScheme_
void setNumberCheckedHits(int val)
HFNoseSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
std::pair< int, int > waferUV() const
uint32_t setDetUnitId(const G4Step *step) override
Compact representation of the geometrical detector hierarchy.
HGCalGeometryMode::GeometryMode geom_mode_
double mouseBite(bool reco) const
bool isItinFidVolume(const G4ThreeVector &)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
HGCalGeometryMode::GeometryMode geomMode() const
double waferSize(bool reco) const
const HGCalDDDConstants * hgcons_
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
bool maskCell(const DetId &id, int corners) const
double getEnergyDeposit(const G4Step *) override
std::unique_ptr< HGCMouseBite > mouseBite_
int levelTop(int ind=0) const
double getResponseWt(const G4Track *)
std::vector< double > angles_
double distFromEdgeHex(double x, double y, double z) const
double getEnergyDeposit() const
bool filterHit(CaloG4Hit *, double) override