CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HGCalTB16SD01 Class Reference
Inheritance diagram for HGCalTB16SD01:
CaloSD SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

 HGCalTB16SD01 (const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *step) override
 
 ~HGCalTB16SD01 () override=default
 
- Public Member Functions inherited from CaloSD
 CaloSD (const std::string &aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
void clear () override
 
void clearHits () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PCaloHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *) override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
void reset () override
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
const std::vector< std::string > & getNames () const
 
void Initialize (G4HCofThisEvent *eventHC) override
 
bool isCaloSD () const
 
 SensitiveDetector (const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, bool calo)
 
 ~SensitiveDetector () override
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 

Static Public Member Functions

static uint32_t packIndex (int det, int lay, int x, int y)
 
static void unpackIndex (const uint32_t &idx, int &det, int &lay, int &x, int &y)
 

Protected Member Functions

double getEnergyDeposit (const G4Step *) override
 
- Protected Member Functions inherited from CaloSD
bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *)
 
virtual void endEvent ()
 
virtual bool filterHit (CaloG4Hit *, double)
 
double getAttenuation (const G4Step *aStep, double birk1, double birk2, double birk3) const
 
virtual uint16_t getDepth (const G4Step *)
 
virtual bool getFromLibrary (const G4Step *step)
 
int getNumberOfHits ()
 
double getResponseWt (const G4Track *)
 
virtual int getTrackID (const G4Track *)
 
bool hitExists (const G4Step *)
 
virtual void initEvent (const BeginOfEvent *)
 
virtual void initRun ()
 
void processHit (const G4Step *step)
 
void resetForNewPrimary (const G4Step *)
 
void setNumberCheckedHits (int val)
 
void setParameterized (bool val)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *) const
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *) const
 
virtual int setTrackID (const G4Step *)
 
void setUseMap (bool val)
 
void update (const BeginOfRun *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const ::EndOfEvent *) override
 
void updateHit (CaloG4Hit *)
 
- Protected Member Functions inherited from SensitiveDetector
TrackInformationcmsTrackInformation (const G4Track *aTrack)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point) const
 
Local3DPoint FinalStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint InitialStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint LocalPostStepPosition (const G4Step *step) const
 
Local3DPoint LocalPreStepPosition (const G4Step *step) const
 
void NaNTrap (const G4Step *step) const
 
void setNames (const std::vector< std::string > &)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

Private Member Functions

void initialize (const G4StepPoint *point)
 

Private Attributes

double birk1_
 
double birk2_
 
double birk3_
 
bool initialize_
 
std::string matName_
 
G4Material * matScin_
 
bool useBirk_
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Attributes inherited from CaloSD
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
bool forceSave
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
G4ThreeVector posGlobal
 
CaloHitID previousID
 
bool suppressHeavy
 
double tmaxHit
 

Detailed Description

Definition at line 21 of file HGCalTB16SD01.cc.

Constructor & Destructor Documentation

HGCalTB16SD01::HGCalTB16SD01 ( const std::string &  name,
const DDCompactView cpv,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 45 of file HGCalTB16SD01.cc.

References birk1_, birk2_, birk3_, g, edm::ParameterSet::getParameter(), matName_, matScin_, MeV, AlCaHLTBitMon_QueryRunRegistry::string, and useBirk_.

49  : CaloSD(name, cpv, clg, p, manager), initialize_(true) {
50  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
51  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HGCalTestBeamSD");
52  matName_ = m_HC.getParameter<std::string>("Material");
53  useBirk_ = m_HC.getParameter<bool>("UseBirkLaw");
54  birk1_ = m_HC.getParameter<double>("BirkC1") * (g / (MeV * cm2));
55  birk2_ = m_HC.getParameter<double>("BirkC2");
56  birk3_ = m_HC.getParameter<double>("BirkC3");
57  matScin_ = nullptr;
58 
59  edm::LogVerbatim("HGCSim")
60  << "HGCalTB16SD01:: Use of Birks law is set to " << useBirk_ << " for "
61  << matName_ << " with three constants kB = " << birk1_
62  << ", C1 = " << birk2_ << ", C2 = " << birk3_;
63 }
T getParameter(std::string const &) const
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
Definition: Activities.doc:4
std::string matName_
const double MeV
CaloSD(const std::string &aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:27
G4Material * matScin_
HGCalTB16SD01::~HGCalTB16SD01 ( )
overridedefault

Member Function Documentation

double HGCalTB16SD01::getEnergyDeposit ( const G4Step *  aStep)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 65 of file HGCalTB16SD01.cc.

References birk1_, birk2_, birk3_, CaloSD::getAttenuation(), initialize(), initialize_, matScin_, point, and useBirk_.

65  {
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;
71  if (useBirk_ && matScin_ == point->GetMaterial()) {
72  weight *= getAttenuation(aStep, birk1_, birk2_, birk3_);
73  }
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("HGCSim")
76  << "HGCalTB16SD01: Detector "
77  << point->GetTouchable()->GetVolume()->GetName() << " with "
78  << point->GetMaterial()->GetName() << " weight " << weight << ":" << wt2;
79 #endif
80  return weight * destep;
81 }
Definition: weight.py:1
G4Material * matScin_
void initialize(const G4StepPoint *point)
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:438
*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
Definition: invegas.h:5
void HGCalTB16SD01::initialize ( const G4StepPoint *  point)
private

Definition at line 130 of file HGCalTB16SD01.cc.

References initialize_, matName_, and matScin_.

Referenced by getEnergyDeposit().

130  {
131  if (matName_ == point->GetMaterial()->GetName()) {
132  matScin_ = point->GetMaterial();
133  initialize_ = false;
134  }
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HGCSim") << "HGCalTB16SD01: Material pointer for "
137  << matName_ << " is initialized to : " << matScin_;
138 #endif
139 }
std::string matName_
G4Material * matScin_
*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
Definition: invegas.h:5
uint32_t HGCalTB16SD01::packIndex ( int  det,
int  lay,
int  x,
int  y 
)
static

Definition at line 93 of file HGCalTB16SD01.cc.

References TauDecayModes::dec, training_settings::idx, ixx, iyy, x, and y.

Referenced by setDetUnitId().

93  {
94  int ix = 0, ixx = x;
95  if (x < 0) {
96  ix = 1;
97  ixx = -x;
98  }
99  int iy = 0, iyy = y;
100  if (y < 0) {
101  iy = 1;
102  iyy = -y;
103  }
104  uint32_t idx = (det & 15) << 28; // bits 28-31
105  idx += (lay & 127) << 21; // bits 21-27
106  idx += (iy & 1) << 19; // bit 19
107  idx += (iyy & 511) << 10; // bits 10-18
108  idx += (ix & 1) << 9; // bit 9
109  idx += (ixx & 511); // bits 0-8
110 
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HGCSim")
113  << "HGCalTB16SD01: Detector " << det << " Layer " << lay << " x " << x
114  << " " << ix << " " << ixx << " y " << y << " " << iy << " " << iyy
115  << " ID " << std::hex << idx << std::dec;
116 #endif
117  return idx;
118 }
int iyy[18][41][3]
int ixx[18][41][3]
uint32_t HGCalTB16SD01::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 83 of file HGCalTB16SD01.cc.

References packIndex(), x, and y.

83  {
84  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
85  const G4VTouchable* touch = preStepPoint->GetTouchable();
86 
87  int det(1), x(0), y(0);
88  int lay = (touch->GetReplicaNumber(0));
89 
90  return packIndex(det, lay, x, y);
91 }
static uint32_t packIndex(int det, int lay, int x, int y)
void HGCalTB16SD01::unpackIndex ( const uint32_t &  idx,
int &  det,
int &  lay,
int &  x,
int &  y 
)
static

Definition at line 120 of file HGCalTB16SD01.cc.

References training_settings::idx, x, and y.

121  {
122  det = (idx >> 28) & 15;
123  lay = (idx >> 21) & 127;
124  y = (idx >> 10) & 511;
125  if (((idx >> 19) & 1) == 1) y = -y;
126  x = (idx)&511;
127  if (((idx >> 9) & 1) == 1) x = -x;
128 }

Member Data Documentation

double HGCalTB16SD01::birk1_
private

Definition at line 40 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

double HGCalTB16SD01::birk2_
private

Definition at line 40 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

double HGCalTB16SD01::birk3_
private

Definition at line 40 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

bool HGCalTB16SD01::initialize_
private

Definition at line 41 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), and initialize().

std::string HGCalTB16SD01::matName_
private

Definition at line 38 of file HGCalTB16SD01.cc.

Referenced by HGCalTB16SD01(), and initialize().

G4Material* HGCalTB16SD01::matScin_
private

Definition at line 42 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), HGCalTB16SD01(), and initialize().

bool HGCalTB16SD01::useBirk_
private

Definition at line 39 of file HGCalTB16SD01.cc.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().