4 #include "CLHEP/Units/GlobalSystemOfUnits.h"
5 #include "G4LogicalVolumeStore.hh"
17 :
CaloSD(name, clg, p, manager), initialize_(
true) {
27 edm::LogVerbatim(
"HGCSim") <<
"HGCalTB16SD01:: Use of Birks law is set to " << useBirk_ <<
" for " << matName_
28 <<
" with three constants kB = " << birk1_ <<
", C1 = " << birk2_ <<
", C2 = " <<
birk3_;
32 auto const point = aStep->GetPreStepPoint();
35 double destep = aStep->GetTotalEnergyDeposit();
36 double wt2 = aStep->GetTrack()->GetWeight();
37 double weight = (wt2 > 0.0) ? wt2 : 1.0;
42 edm::LogVerbatim(
"HGCSim") <<
"HGCalTB16SD01: Detector " <<
point->GetTouchable()->GetVolume()->GetName() <<
" with "
43 <<
point->GetMaterial()->GetName() <<
" weight " << weight <<
":" << wt2;
45 return weight * destep;
49 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
50 const G4VTouchable* touch = preStepPoint->GetTouchable();
52 int det(1),
x(0),
y(0);
53 int lay = (touch->GetReplicaNumber(0));
69 uint32_t idx = (det & 15) << 28;
70 idx += (lay & 127) << 21;
71 idx += (iy & 1) << 19;
72 idx += (
iyy & 511) << 10;
77 edm::LogVerbatim(
"HGCSim") <<
"HGCalTB16SD01: Detector " << det <<
" Layer " << lay <<
" x " << x <<
" " << ix <<
" "
78 <<
ixx <<
" y " << y <<
" " << iy <<
" " <<
iyy <<
" ID " << std::hex << idx <<
std::dec;
84 det = (idx >> 28) & 15;
85 lay = (idx >> 21) & 127;
86 y = (idx >> 10) & 511;
87 if (((idx >> 19) & 1) == 1)
90 if (((idx >> 9) & 1) == 1)
95 if (
matName_ == point->GetMaterial()->GetName()) {
101 <<
" is initialized to : " <<
matScin_;
Log< level::Info, true > LogVerbatim
double getEnergyDeposit(const G4Step *) override
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(const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
uint32_t setDetUnitId(const G4Step *step) override
uint16_t const *__restrict__ x
T getParameter(std::string const &) const
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)
*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