15 #include "G4LogicalVolumeStore.hh"
16 #include "G4LogicalVolume.hh"
19 #include "G4ParticleTable.hh"
20 #include "G4VProcess.hh"
39 (float)(p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<double>(
"TimeSliceUnit")),
40 p.getParameter<edm::
ParameterSet>(
"HGCSD").getParameter<bool>(
"IgnoreTrackID")),
57 if (storeAllG4Hits_) {
63 G4String myName =
name;
66 if (myName.find(
"HitsHEback") != std::string::npos) {
68 nameX_ =
"HGCalHEScintillatorSensitive";
72 edm::LogVerbatim(
"HGCSim") <<
"**************************************************"
76 <<
"* Constructing a HGCScintSD with name " << name <<
"\n"
79 <<
"**************************************************";
87 <<
" with three constants kB = " << birk1_ <<
", C1 = " << birk2_ <<
", C2 = " <<
birk3_;
91 double r = aStep->GetPreStepPoint()->GetPosition().perp();
92 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
94 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
95 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
96 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
97 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track "
98 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " << r
99 <<
" Z = " << z <<
" slope = " << r / z <<
":" <<
slopeMin_;
102 if (r < z * slopeMin_) {
110 double wt2 = aStep->GetTrack()->GetWeight();
112 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
117 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
118 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
124 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
125 const G4VTouchable* touch = preStepPoint->GetTouchable();
132 G4ThreeVector hitPoint = preStepPoint->GetPosition();
133 float globalZ = touch->GetTranslation(0).z();
134 int iz(globalZ > 0 ? 1 : -1);
138 layer = touch->GetReplicaNumber(1);
139 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
140 layer = touch->GetReplicaNumber(0);
143 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":"
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.)
175 <<
" is rejected by fiducilal volume cut";
195 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
Log< level::Info, true > LogVerbatim
HGCalGeometryMode::GeometryMode geom_mode_
void setNumberCheckedHits(int val)
HGCScintSD(const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
uint16_t *__restrict__ id
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
constexpr std::array< uint8_t, layerIndexSize > layer
const HGCalDDDConstants * hgcons_
double distFromEdgeTrap(double x, double y, double z) const
bool isItinFidVolume(const G4ThreeVector &)
Abs< T >::type abs(const T &t)
HGCalGeometryMode::GeometryMode geomMode() const
double getEnergyDeposit(const G4Step *) override
T getParameter(std::string const &) const
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
void printDetectorLevels(const G4VTouchable *) const
int levelTop(int ind=0) const
double getResponseWt(const G4Track *)
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
double getEnergyDeposit() const
bool filterHit(CaloG4Hit *, double) override