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

#include <HGCalTB16SD01.h>

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 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 SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false, const std::string &newcolname="")
 
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
 
bool isItFineCalo (const G4VTouchable *touch)
 
void newCollection (const std::string &name, edm::ParameterSet const &p)
 
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 SensitiveDetectorCatalog &clg, const std::string &newcollname="")
 
- 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 SensitiveDetectorCatalog &, bool calo, const std::string &newcollname="")
 
 ~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 (int k=0)
 
CaloG4HitcreateNewHit (const G4Step *, const G4Track *, int k)
 
virtual void endEvent ()
 
virtual double EnergyCorrected (const G4Step &step, const G4Track *)
 
virtual bool filterHit (CaloG4Hit *, double)
 
unsigned int findBoundaryCrossingParent (const G4Track *track, bool markParentAsSaveable=true)
 
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 (int k=0)
 
double getResponseWt (const G4Track *, int k=0)
 
virtual int getTrackID (const G4Track *)
 
bool hitExists (const G4Step *, int k)
 
void ignoreRejection ()
 
virtual void initEvent (const BeginOfEvent *)
 
virtual void initRun ()
 
void printDetectorLevels (const G4VTouchable *) const
 
void processHit (const G4Step *step)
 
virtual void processSecondHit (const G4Step *, const G4Track *)
 
void resetForNewPrimary (const G4Step *)
 
void setNumberCheckedHits (int val, int k=0)
 
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)
 
std::string shortreprID (const CaloHitID &ID)
 
std::string shortreprID (const CaloG4Hit *hit)
 
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 *, int k)
 
- 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 }
 
- Static Protected Member Functions inherited from CaloSD
static std::string printableDecayChain (const std::vector< unsigned int > &decayChain)
 
- Protected Attributes inherited from CaloSD
std::string collName_ [2]
 
CaloG4HitcurrentHit [2]
 
CaloHitID currentID [2]
 
std::string detName_
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
bool forceSave
 
std::vector< std::string > hcn_
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
int nHC_
 
G4ThreeVector posGlobal
 
CaloHitID previousID [2]
 
bool suppressHeavy
 
double tmaxHit
 
std::vector< int > useResMap_
 

Detailed Description

Definition at line 15 of file HGCalTB16SD01.h.

Constructor & Destructor Documentation

◆ HGCalTB16SD01()

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

Definition at line 12 of file HGCalTB16SD01.cc.

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

16  : CaloSD(name, clg, p, manager), initialize_(true) {
17  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
18  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HGCalTestBeamSD");
19  matName_ = m_HC.getParameter<std::string>("Material");
20  useBirk_ = m_HC.getParameter<bool>("UseBirkLaw");
21  birk1_ = m_HC.getParameter<double>("BirkC1") * (g / (MeV * cm2));
22  birk2_ = m_HC.getParameter<double>("BirkC2");
23  birk3_ = m_HC.getParameter<double>("BirkC3");
24  matScin_ = nullptr;
25 
26  edm::LogVerbatim("HGCSim") << "HGCalTB16SD01:: Use of Birks law is set to " << useBirk_ << " for " << matName_
27  << " with three constants kB = " << birk1_ << ", C1 = " << birk2_ << ", C2 = " << birk3_;
28 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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_
Definition: HGCalTB16SD01.h:29
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false, const std::string &newcolname="")
Definition: CaloSD.cc:33
G4Material * matScin_
Definition: HGCalTB16SD01.h:33

◆ ~HGCalTB16SD01()

HGCalTB16SD01::~HGCalTB16SD01 ( )
overridedefault

Member Function Documentation

◆ getEnergyDeposit()

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

Reimplemented from CaloSD.

Definition at line 30 of file HGCalTB16SD01.cc.

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

30  {
31  auto const point = aStep->GetPreStepPoint();
32  if (initialize_)
34  double destep = aStep->GetTotalEnergyDeposit();
35  double wt2 = aStep->GetTrack()->GetWeight();
36  double weight = (wt2 > 0.0) ? wt2 : 1.0;
37  if (useBirk_ && matScin_ == point->GetMaterial()) {
39  }
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HGCSim") << "HGCalTB16SD01: Detector " << point->GetTouchable()->GetVolume()->GetName() << " with "
42  << point->GetMaterial()->GetName() << " weight " << weight << ":" << wt2;
43 #endif
44  return weight * destep;
45 }
Log< level::Info, true > LogVerbatim
Definition: weight.py:1
G4Material * matScin_
Definition: HGCalTB16SD01.h:33
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:727
void initialize(const G4StepPoint *point)
*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

◆ initialize()

void HGCalTB16SD01::initialize ( const G4StepPoint *  point)
private

Definition at line 93 of file HGCalTB16SD01.cc.

References initialize_, matName_, matScin_, and point.

Referenced by getEnergyDeposit().

93  {
94  if (matName_ == point->GetMaterial()->GetName()) {
95  matScin_ = point->GetMaterial();
96  initialize_ = false;
97  }
98 #ifdef EDM_ML_DEBUG
99  edm::LogVerbatim("HGCSim") << "HGCalTB16SD01: Material pointer for " << matName_
100  << " is initialized to : " << matScin_;
101 #endif
102 }
Log< level::Info, true > LogVerbatim
std::string matName_
Definition: HGCalTB16SD01.h:29
G4Material * matScin_
Definition: HGCalTB16SD01.h:33
*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

◆ packIndex()

uint32_t HGCalTB16SD01::packIndex ( int  det,
int  lay,
int  x,
int  y 
)
static

Definition at line 57 of file HGCalTB16SD01.cc.

References TauDecayModes::dec, heavyIonCSV_trainingSettings::idx, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ixx, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), iyy, x, and y.

Referenced by setDetUnitId().

57  {
58  int ix = 0, ixx = x;
59  if (x < 0) {
60  ix = 1;
61  ixx = -x;
62  }
63  int iy = 0, iyy = y;
64  if (y < 0) {
65  iy = 1;
66  iyy = -y;
67  }
68  uint32_t idx = (det & 15) << 28; // bits 28-31
69  idx += (lay & 127) << 21; // bits 21-27
70  idx += (iy & 1) << 19; // bit 19
71  idx += (iyy & 511) << 10; // bits 10-18
72  idx += (ix & 1) << 9; // bit 9
73  idx += (ixx & 511); // bits 0-8
74 
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("HGCSim") << "HGCalTB16SD01: Detector " << det << " Layer " << lay << " x " << x << " " << ix << " "
77  << ixx << " y " << y << " " << iy << " " << iyy << " ID " << std::hex << idx << std::dec;
78 #endif
79  return idx;
80 }
Log< level::Info, true > LogVerbatim
const int iyy[18][41][3]
const int ixx[18][41][3]
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)

◆ setDetUnitId()

uint32_t HGCalTB16SD01::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 47 of file HGCalTB16SD01.cc.

References packIndex(), x, and y.

47  {
48  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
49  const G4VTouchable* touch = preStepPoint->GetTouchable();
50 
51  int det(1), x(0), y(0);
52  int lay = (touch->GetReplicaNumber(0));
53 
54  return packIndex(det, lay, x, y);
55 }
static uint32_t packIndex(int det, int lay, int x, int y)

◆ unpackIndex()

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

Definition at line 82 of file HGCalTB16SD01.cc.

References heavyIonCSV_trainingSettings::idx, x, and y.

82  {
83  det = (idx >> 28) & 15;
84  lay = (idx >> 21) & 127;
85  y = (idx >> 10) & 511;
86  if (((idx >> 19) & 1) == 1)
87  y = -y;
88  x = (idx)&511;
89  if (((idx >> 9) & 1) == 1)
90  x = -x;
91 }

Member Data Documentation

◆ birk1_

double HGCalTB16SD01::birk1_
private

Definition at line 31 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

◆ birk2_

double HGCalTB16SD01::birk2_
private

Definition at line 31 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

◆ birk3_

double HGCalTB16SD01::birk3_
private

Definition at line 31 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

◆ initialize_

bool HGCalTB16SD01::initialize_
private

Definition at line 32 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and initialize().

◆ matName_

std::string HGCalTB16SD01::matName_
private

Definition at line 29 of file HGCalTB16SD01.h.

Referenced by HGCalTB16SD01(), and initialize().

◆ matScin_

G4Material* HGCalTB16SD01::matScin_
private

Definition at line 33 of file HGCalTB16SD01.h.

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

◆ useBirk_

bool HGCalTB16SD01::useBirk_
private

Definition at line 30 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().