11 #include "CLHEP/Units/GlobalSystemOfUnits.h" 12 #include "G4LogicalVolumeStore.hh" 13 #include "G4Material.hh" 28 static uint32_t
packIndex(
int det,
int lay,
int x,
int y);
29 static void unpackIndex(
const uint32_t&
idx,
int& det,
int& lay,
int& x,
60 <<
"HGCalTB16SD01:: Use of Birks law is set to " << useBirk_ <<
" for " 61 << matName_ <<
" with three constants kB = " << birk1_
62 <<
", C1 = " << birk2_ <<
", C2 = " <<
birk3_;
66 auto const point = aStep->GetPreStepPoint();
68 double destep = aStep->GetTotalEnergyDeposit();
69 double wt2 = aStep->GetTrack()->GetWeight();
70 double weight = (wt2 > 0.0) ? wt2 : 1.0;
76 <<
"HGCalTB16SD01: Detector " 77 <<
point->GetTouchable()->GetVolume()->GetName() <<
" with " 78 <<
point->GetMaterial()->GetName() <<
" weight " << weight <<
":" << wt2;
80 return weight * destep;
84 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
85 const G4VTouchable* touch = preStepPoint->GetTouchable();
87 int det(1),
x(0),
y(0);
88 int lay = (touch->GetReplicaNumber(0));
104 uint32_t
idx = (det & 15) << 28;
105 idx += (lay & 127) << 21;
106 idx += (iy & 1) << 19;
107 idx += (
iyy & 511) << 10;
108 idx += (ix & 1) << 9;
113 <<
"HGCalTB16SD01: Detector " << det <<
" Layer " << lay <<
" x " << x
114 <<
" " << ix <<
" " <<
ixx <<
" y " << y <<
" " << iy <<
" " <<
iyy 115 <<
" ID " << std::hex << idx <<
std::dec;
122 det = (idx >> 28) & 15;
123 lay = (idx >> 21) & 127;
124 y = (idx >> 10) & 511;
125 if (((idx >> 19) & 1) == 1) y = -
y;
127 if (((idx >> 9) & 1) == 1) x = -
x;
131 if (
matName_ == point->GetMaterial()->GetName()) {
T getParameter(std::string const &) const
double getEnergyDeposit(const G4Step *) override
Compact representation of the geometrical detector hierarchy.
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
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
HGCalTB16SD01 HGCalTB1601SensitiveDetector
uint32_t setDetUnitId(const G4Step *step) override
~HGCalTB16SD01() override=default
HGCalTB16SD01(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
void initialize(const G4StepPoint *point)
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
static uint32_t packIndex(int det, int lay, int x, int y)
#define DEFINE_SENSITIVEDETECTOR(type)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point