17 #include "G4LogicalVolumeStore.hh" 18 #include "G4LogicalVolume.hh" 21 #include "G4ParticleTable.hh" 22 #include "G4VProcess.hh" 69 G4String myName =
name;
72 if (myName.find(
"HitsHEback") != std::string::npos) {
74 nameX_ =
"HGCalHEScintillatorSensitive";
78 edm::LogVerbatim(
"HGCSim") <<
"**************************************************" 82 <<
"* Constructing a HGCScintSD with name " <<
name <<
"\n" 85 <<
"**************************************************";
93 <<
" with three constants kB = " <<
birk1_ <<
", C1 = " <<
birk2_ <<
", C2 = " <<
birk3_;
98 std::ifstream fInput(
fileName.c_str());
103 while (fInput.getline(
buffer, 80)) {
105 if (
items.size() > 2) {
108 int phi = std::atoi(
items[2].c_str());
119 double r = aStep->GetPreStepPoint()->GetPosition().perp();
120 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
122 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
123 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
124 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
125 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track " 126 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r 127 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
138 double wt2 = aStep->GetTrack()->GetWeight();
140 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
145 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
146 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
152 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
153 const G4VTouchable* touch = preStepPoint->GetTouchable();
160 G4ThreeVector hitPoint = preStepPoint->GetPosition();
161 float globalZ = touch->GetTranslation(0).z();
162 int iz(globalZ > 0 ? 1 : -1);
166 layer = touch->GetReplicaNumber(1);
167 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
168 layer = touch->GetReplicaNumber(0);
171 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" 175 layer = touch->GetReplicaNumber(3);
176 module = touch->GetReplicaNumber(2);
177 cell = touch->GetReplicaNumber(1);
179 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name " 180 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" <<
module 185 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
186 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
187 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":" 188 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":" 189 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":" 190 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":" 191 << touch->GetReplicaNumber(4) <<
" " 192 <<
" layer:module:cell " <<
layer <<
":" <<
module <<
":" << cell <<
" Material " 193 << mat->GetName() <<
":" << mat->GetRadlen();
196 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
209 <<
" Point (" << hitPoint.x() <<
", " << hitPoint.y() <<
", " << hitPoint.z() <<
") " 215 <<
" is rejected by fiducilal volume cut";
221 std::string_view pid =
225 double dx =
xy.first - (hitPoint.x() / CLHEP::cm);
226 double dy =
xy.second - (hitPoint.y() / CLHEP::cm);
228 constexpr
double tol = 10.0;
233 <<
", " << hitPoint.y() / CLHEP::cm <<
"); position from ID (" <<
xy.first <<
", " 234 <<
xy.second <<
") distance " <<
diff <<
" Valid " <<
valid 235 <<
" Rho = " << hitPoint.perp() / CLHEP::cm;
254 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
Log< level::Info, true > LogVerbatim
HGCalGeometryMode::GeometryMode geom_mode_
T getParameter(std::string const &) const
constexpr int iphi() const
get the phi index
bool cassetteShiftScintillator(int zside, int layer, int iphi) const
HGCScintSD(const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
void setNumberCheckedHits(int val, int k=0)
std::string fullPath() const
double distFromEdgeTrap(double x, double y, double z) const
std::vector< int > tiles_
constexpr int zside() const
get the z-side of the cell (1/-1)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
HGCalGeometryMode::GeometryMode geomMode() const
uint32_t setDetUnitId(const G4Step *step) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
const HGCalDDDConstants * hgcons_
T getUntrackedParameter(std::string const &, T const &) const
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
double getResponseWt(const G4Track *, int k=0)
std::vector< std::string > splitString(const std::string &)
bool isItinFidVolume(const G4ThreeVector &)
Abs< T >::type abs(const T &t)
bool isValidTrap(int zside, int lay, int ieta, int iphi) const
double getEnergyDeposit(const G4Step *) override
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
double getEnergyDeposit() const
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
void printDetectorLevels(const G4VTouchable *) const
constexpr int layer() const
get the layer #
constexpr int ring() const
get the eta index
int levelTop(int ind=0) const
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
bool filterHit(CaloG4Hit *, double) override