23 #include "G4LogicalVolumeStore.hh" 24 #include "G4LogicalVolume.hh" 27 #include "G4ParticleTable.hh" 28 #include "G4VProcess.hh" 65 if (storeAllG4Hits_) {
71 G4String myName =
name;
74 if (myName.find(
"HitsHEback") != std::string::npos) {
76 nameX_ =
"HGCalHEScintillatorSensitive";
80 edm::LogVerbatim(
"HGCSim") <<
"**************************************************" 84 <<
"* Constructing a HGCScintSD with name " << name <<
"\n" 87 <<
"**************************************************";
95 <<
" with three constants kB = " << birk1_ <<
", C1 = " << birk2_ <<
", C2 = " <<
birk3_;
99 double r = aStep->GetPreStepPoint()->GetPosition().perp();
100 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
102 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
103 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
104 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
105 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track " 106 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " << r
107 <<
" Z = " << z <<
" slope = " << r / z <<
":" <<
slopeMin_;
110 if (r < z * slopeMin_) {
118 double wt2 = aStep->GetTrack()->GetWeight();
120 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
125 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
126 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
132 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
133 const G4VTouchable* touch = preStepPoint->GetTouchable();
136 G4ThreeVector hitPoint = preStepPoint->GetPosition();
137 float globalZ = touch->GetTranslation(0).z();
138 int iz(globalZ > 0 ? 1 : -1);
141 if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
142 layer = touch->GetReplicaNumber(0);
147 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":" 148 << module <<
":" << cell;
151 layer = touch->GetReplicaNumber(3);
152 module = touch->GetReplicaNumber(2);
153 cell = touch->GetReplicaNumber(1);
155 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name " 156 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " << layer <<
":" << module
161 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
162 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
163 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":" 164 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":" 165 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":" 166 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":" 167 << touch->GetReplicaNumber(4) <<
" " 168 <<
" layer:module:cell " << layer <<
":" << module <<
":" << cell <<
" Material " 169 << mat->GetName() <<
":" << mat->GetRadlen();
172 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
175 uint32_t
id =
setDetUnitId(layer, module, cell, iz, hitPoint);
179 <<
" is rejected by fiducilal volume cut";
203 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
T getParameter(std::string const &) const
HGCalGeometryMode::GeometryMode geom_mode_
void setNumberCheckedHits(int val)
uint32_t setDetUnitId(const G4Step *step) override
Compact representation of the geometrical detector hierarchy.
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_
HGCScintSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
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
std::unique_ptr< HGCalNumberingScheme > numberingScheme_
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) 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