17 #include "G4LogicalVolumeStore.hh" 18 #include "G4LogicalVolume.hh" 21 #include "G4ParticleTable.hh" 22 #include "G4VProcess.hh" 67 G4String myName =
name;
70 if (myName.find(
"HitsHEback") != std::string::npos) {
72 nameX_ =
"HGCalHEScintillatorSensitive";
76 edm::LogVerbatim(
"HGCSim") <<
"**************************************************" 80 <<
"* Constructing a HGCScintSD with name " <<
name <<
"\n" 83 <<
"**************************************************";
91 <<
" with three constants kB = " <<
birk1_ <<
", C1 = " <<
birk2_ <<
", C2 = " <<
birk3_;
96 std::ifstream fInput(
fileName.c_str());
101 while (fInput.getline(
buffer, 80)) {
103 if (
items.size() > 2) {
106 int phi = std::atoi(
items[2].c_str());
117 double r = aStep->GetPreStepPoint()->GetPosition().perp();
118 double z =
std::abs(aStep->GetPreStepPoint()->GetPosition().z());
120 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
121 G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
122 G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
123 edm::LogVerbatim(
"HGCSim") <<
"HGCScintSD: Hit from standard path from " << lv->GetName() <<
" for Track " 124 << aStep->GetTrack()->GetTrackID() <<
" (" << parCode <<
":" << parName <<
") R = " <<
r 125 <<
" Z = " <<
z <<
" slope = " <<
r /
z <<
":" <<
slopeMin_;
136 double wt2 = aStep->GetTrack()->GetWeight();
138 double destep =
weight_ * wt1 * wt3 * (aStep->GetTotalEnergyDeposit());
143 <<
" Total weight " <<
weight_ * wt1 * wt2 * wt3
144 <<
" deStep: " << aStep->GetTotalEnergyDeposit() <<
":" << destep;
150 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
151 const G4VTouchable* touch = preStepPoint->GetTouchable();
158 G4ThreeVector hitPoint = preStepPoint->GetPosition();
159 float globalZ = touch->GetTranslation(0).z();
160 int iz(globalZ > 0 ? 1 : -1);
164 layer = touch->GetReplicaNumber(1);
165 }
else if ((touch->GetHistoryDepth() ==
levelT1_) || (touch->GetHistoryDepth() ==
levelT2_)) {
166 layer = touch->GetReplicaNumber(0);
169 <<
" name " << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" 173 layer = touch->GetReplicaNumber(3);
174 module = touch->GetReplicaNumber(2);
175 cell = touch->GetReplicaNumber(1);
177 edm::LogVerbatim(
"HGCSim") <<
"DepthsInside: " << touch->GetHistoryDepth() <<
" name " 178 << touch->GetVolume(0)->GetName() <<
" layer:module:cell " <<
layer <<
":" <<
module 183 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
184 edm::LogVerbatim(
"HGCSim") <<
"Depths: " << touch->GetHistoryDepth() <<
" name " << touch->GetVolume(0)->GetName()
185 <<
":" << touch->GetReplicaNumber(0) <<
" " << touch->GetVolume(1)->GetName() <<
":" 186 << touch->GetReplicaNumber(1) <<
" " << touch->GetVolume(2)->GetName() <<
":" 187 << touch->GetReplicaNumber(2) <<
" " << touch->GetVolume(3)->GetName() <<
":" 188 << touch->GetReplicaNumber(3) <<
" " << touch->GetVolume(4)->GetName() <<
":" 189 << touch->GetReplicaNumber(4) <<
" " 190 <<
" layer:module:cell " <<
layer <<
":" <<
module <<
":" << cell <<
" Material " 191 << mat->GetName() <<
":" << mat->GetRadlen();
194 if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
207 <<
" Point (" << hitPoint.x() <<
", " << hitPoint.y() <<
", " << hitPoint.z() <<
") " 213 <<
" is rejected by fiducilal volume cut";
234 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
void setNumberCheckedHits(int val)
HGCScintSD(const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
std::string fullPath() const
double distFromEdgeTrap(double x, double y, double z) const
std::vector< int > tiles_
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
constexpr std::array< uint8_t, layerIndexSize > layer
const HGCalDDDConstants * hgcons_
T getUntrackedParameter(std::string const &, T const &) const
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
int iphi() const
get the phi index
std::vector< std::string > splitString(const std::string &)
bool isItinFidVolume(const G4ThreeVector &)
int layer() const
get the layer #
Abs< T >::type abs(const T &t)
int ring() const
get the eta index
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_
void printDetectorLevels(const G4VTouchable *) const
double getResponseWt(const G4Track *)
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