23 #include "G4LogicalVolumeStore.hh" 24 #include "G4LogicalVolume.hh" 27 #include "G4ParticleTable.hh" 28 #include "G4VProcess.hh" 41 CaloSD(name, cpv, clg, p, manager,
44 hgcons_(
nullptr), slopeMin_(0), levelT1_(99), levelT2_(99) {
58 if (storeAllG4Hits_) {
64 G4String myName =
name;
67 if (myName.find(
"HitsHEback")!=std::string::npos) {
69 nameX_ =
"HGCalHEScintillatorSensitive";
73 edm::LogVerbatim(
"HGCSim")<<
"**************************************************" 77 <<
"* Constructing a HGCScintSD with name " << name <<
"\n" 80 <<
"**************************************************";
83 << eminHit_ <<
" for " <<
nameX_ <<
" detector " 88 <<
"boundary " << fiducialCut_ <<
" at " 91 <<
" with three constants kB = " << birk1_
92 <<
", C1 = " << birk2_ <<
", C2 = " <<
birk3_;
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 =
103 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
105 << lv->GetName() <<
" for Track " 106 << aStep->GetTrack()->GetTrackID() <<
" (" 107 << parCode <<
":" << parName <<
") R = " << r
108 <<
" Z = " << z <<
" slope = " << r/z <<
":" 112 if (r < z*slopeMin_) {
120 double wt2 = aStep->GetTrack()->GetWeight();
123 double destep =
weight_*wt1*wt3*(aStep->GetTotalEnergyDeposit());
124 if (wt2 > 0) destep *= wt2;
127 << wt1 <<
":" << wt2 <<
":" << wt3
128 <<
" Total weight " <<
weight_*wt1*wt2*wt3
129 <<
" deStep: " <<aStep->GetTotalEnergyDeposit()
137 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
138 const G4VTouchable* touch = preStepPoint->GetTouchable();
141 G4ThreeVector hitPoint = preStepPoint->GetPosition();
142 float globalZ = touch->GetTranslation(0).z();
143 int iz( globalZ>0 ? 1 : -1);
146 if ((touch->GetHistoryDepth() ==
levelT1_) ||
147 (touch->GetHistoryDepth() ==
levelT2_)) {
148 layer = touch->GetReplicaNumber(0);
154 <<
" name " << touch->GetVolume(0)->GetName()
155 <<
" layer:module:cell " << layer <<
":" 156 << module <<
":" << cell;
159 layer = touch->GetReplicaNumber(3);
160 module = touch->GetReplicaNumber(2);
161 cell = touch->GetReplicaNumber(1);
164 <<
" name " << touch->GetVolume(0)->GetName()
165 <<
" layer:module:cell " << layer <<
":" 166 << module <<
":" << cell;
170 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
172 <<
" name " << touch->GetVolume(0)->GetName()
173 <<
":" << touch->GetReplicaNumber(0) <<
" " 174 << touch->GetVolume(1)->GetName()
175 <<
":" << touch->GetReplicaNumber(1) <<
" " 176 << touch->GetVolume(2)->GetName()
177 <<
":" << touch->GetReplicaNumber(2) <<
" " 178 << touch->GetVolume(3)->GetName()
179 <<
":" << touch->GetReplicaNumber(3) <<
" " 180 << touch->GetVolume(4)->GetName()
181 <<
":" << touch->GetReplicaNumber(4) <<
" " 182 <<
" layer:module:cell " << layer <<
":" 183 << module <<
":" << cell <<
" Material " 184 << mat->GetName() <<
":" << mat->GetRadlen();
187 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
return 0;
189 uint32_t
id =
setDetUnitId (layer, module, cell, iz, hitPoint);
194 <<
" is rejected by fiducilal volume cut";
220 throw cms::Exception(
"Unknown",
"HGCScintSD") <<
"Cannot find HGCalDDDConstants for " <<
nameX_ <<
"\n";
232 G4ThreeVector &
pos) {
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