CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
AHCalSD Class Reference

#include <AHCalSD.h>

Inheritance diagram for AHCalSD:
CaloSD SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

 AHCalSD (const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *step) override
 
bool unpackIndex (const uint32_t &idx, int &row, int &col, int &depth)
 
 ~AHCalSD () 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)
 
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 PrintAll () override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *) override
 
void reset () override
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (const std::string &iname, const SensitiveDetectorCatalog &clg)
 
- 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)
 
 ~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 ()
 

Protected Member Functions

bool filterHit (CaloG4Hit *, double) override
 
double getEnergyDeposit (const G4Step *) override
 
- Protected Member Functions inherited from CaloSD
bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *, const G4Track *)
 
virtual void endEvent ()
 
virtual double EnergyCorrected (const G4Step &step, const G4Track *)
 
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 *)
 
void hitBookkeepingFineCalo (const G4Step *step, const G4Track *currentTrack, CaloG4Hit *hit)
 
bool hitExists (const G4Step *)
 
void ignoreRejection ()
 
virtual void initEvent (const BeginOfEvent *)
 
virtual void initRun ()
 
void printDetectorLevels (const G4VTouchable *) const
 
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 ::EndOfEvent *) override
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *) 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 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 Attributes

double betaThr
 
double birk1
 
double birk2
 
double birk3
 
double eminHit
 
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
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 14 of file AHCalSD.h.

Constructor & Destructor Documentation

◆ AHCalSD()

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

Definition at line 23 of file AHCalSD.cc.

27  : CaloSD(name,
28  clg,
29  p,
30  manager,
31  (float)(p.getParameter<edm::ParameterSet>("AHCalSD").getParameter<double>("TimeSliceUnit")),
32  p.getParameter<edm::ParameterSet>("AHCalSD").getParameter<bool>("IgnoreTrackID")) {
33  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("AHCalSD");
34  useBirk = m_HC.getParameter<bool>("UseBirkLaw");
35  birk1 = m_HC.getParameter<double>("BirkC1") * (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
36  birk2 = m_HC.getParameter<double>("BirkC2");
37  birk3 = m_HC.getParameter<double>("BirkC3");
38  eminHit = m_HC.getParameter<double>("EminHit") * CLHEP::MeV;
39 
40  edm::LogVerbatim("HcalSim") << "AHCalSD:: Use of Birks law is set to " << useBirk
41  << " with three constants kB = " << birk1 << ", C1 = " << birk2 << ", C2 = " << birk3
42  << "\nAHCalSD:: Threshold for storing"
43  << " hits: " << eminHit;
44 }

References birk1, birk2, birk3, eminHit, g, edm::ParameterSet::getParameter(), MeV, AlCaHLTBitMon_ParallelJobs::p, and useBirk.

◆ ~AHCalSD()

AHCalSD::~AHCalSD ( )
overridedefault

Member Function Documentation

◆ filterHit()

bool AHCalSD::filterHit ( CaloG4Hit aHit,
double  time 
)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 101 of file AHCalSD.cc.

101  {
102  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit));
103 }

References eminHit, CaloG4Hit::getEnergyDeposit(), protons_cff::time, and CaloSD::tmaxHit.

◆ getEnergyDeposit()

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

Reimplemented from CaloSD.

Definition at line 46 of file AHCalSD.cc.

46  {
47  double destep = aStep->GetTotalEnergyDeposit();
48  double wt2 = aStep->GetTrack()->GetWeight();
49  double weight = (wt2 > 0.0) ? wt2 : 1.0;
50 #ifdef EDM_ML_DEBUG
51  double weight0 = weight;
52 #endif
53  if (useBirk)
54  weight *= getAttenuation(aStep, birk1, birk2, birk3);
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("HcalSim") << "AHCalSD: weight " << weight0 << " " << weight;
57 #endif
58  double edep = weight * destep;
59  return edep;
60 }

References birk1, birk2, birk3, CaloSD::getAttenuation(), useBirk, and mps_merge::weight.

◆ setDetUnitId()

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

Implements CaloSD.

Definition at line 62 of file AHCalSD.cc.

62  {
63  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
64  const G4VTouchable* touch = preStepPoint->GetTouchable();
65 
66  int depth = (touch->GetReplicaNumber(1));
67  int incol = ((touch->GetReplicaNumber(0)) % AHCalParameters::kColumn_);
68  int inrow = ((touch->GetReplicaNumber(0)) / AHCalParameters::kColumn_) % AHCalParameters::kRow_;
69  int jncol = ((touch->GetReplicaNumber(0)) / AHCalParameters::kRowColumn_) % AHCalParameters::kSign_;
70  int jnrow = ((touch->GetReplicaNumber(0)) / AHCalParameters::kSignRowColumn_) % AHCalParameters::kSign_;
71  int col = (jncol == 0) ? incol : -incol;
72  int row = (jnrow == 0) ? inrow : -inrow;
73  uint32_t index = AHCalDetId(row, col, depth).rawId();
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("HcalSim") << "AHCalSD: det = " << HcalOther << " depth = " << depth << " row = " << row
76  << " column = " << col << " packed index = 0x" << std::hex << index << std::dec;
77  bool flag = unpackIndex(index, row, col, depth);
78  edm::LogVerbatim("HcalSim") << "Results from unpacker for 0x" << std::hex << index << std::dec << " Flag " << flag
79  << " Row " << row << " Col " << col << " Depth " << depth;
80 #endif
81  return index;
82 }

References cuy::col, TauDecayModes::dec, LEDCalibrationChannels::depth, RemoveAddSevLevel::flag, HcalOther, AHCalParameters::kColumn_, AHCalParameters::kRow_, AHCalParameters::kRowColumn_, AHCalParameters::kSign_, AHCalParameters::kSignRowColumn_, DetId::rawId(), and unpackIndex().

◆ unpackIndex()

bool AHCalSD::unpackIndex ( const uint32_t &  idx,
int &  row,
int &  col,
int &  depth 
)

Definition at line 84 of file AHCalSD.cc.

84  {
85  DetId gen(idx);
86  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
87  bool rcode = (gen.det() == DetId::Hcal && subdet != HcalOther);
88  row = col = depth = 0;
89  if (rcode) {
90  row = AHCalDetId(idx).irow();
91  col = AHCalDetId(idx).icol();
93  }
94 #ifdef EDM_ML_DEBUG
95  edm::LogVerbatim("HcalSim") << "AHCalSD: packed index = 0x" << std::hex << idx << std::dec << " Row " << row
96  << " Column " << col << " Depth " << depth << " OK " << rcode;
97 #endif
98  return rcode;
99 }

References cuy::col, TauDecayModes::dec, AHCalDetId::depth(), LEDCalibrationChannels::depth, relval_steps::gen(), DetId::Hcal, HcalOther, AHCalDetId::icol(), heavyIonCSV_trainingSettings::idx, and AHCalDetId::irow().

Referenced by setDetUnitId().

Member Data Documentation

◆ betaThr

double AHCalSD::betaThr
private

Definition at line 27 of file AHCalSD.h.

◆ birk1

double AHCalSD::birk1
private

Definition at line 27 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

◆ birk2

double AHCalSD::birk2
private

Definition at line 27 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

◆ birk3

double AHCalSD::birk3
private

Definition at line 27 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

◆ eminHit

double AHCalSD::eminHit
private

Definition at line 28 of file AHCalSD.h.

Referenced by AHCalSD(), and filterHit().

◆ useBirk

bool AHCalSD::useBirk
private

Definition at line 26 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

HcalOther
Definition: HcalAssistant.h:38
CaloSD::tmaxHit
double tmaxHit
Definition: CaloSD.h:141
AHCalSD::birk2
double birk2
Definition: AHCalSD.h:27
AHCalSD::unpackIndex
bool unpackIndex(const uint32_t &idx, int &row, int &col, int &depth)
Definition: AHCalSD.cc:84
AHCalDetId::irow
int irow() const
get the row number
Definition: AHCalDetId.cc:29
mps_merge.weight
weight
Definition: mps_merge.py:88
cuy.col
col
Definition: cuy.py:1009
DetId::Hcal
Definition: DetId.h:28
AHCalParameters::kRow_
static constexpr int kRow_
Definition: AHCalParameters.h:28
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:683
protons_cff.time
time
Definition: protons_cff.py:35
MeV
const double MeV
AHCalSD::eminHit
double eminHit
Definition: AHCalSD.h:28
AHCalSD::useBirk
bool useBirk
Definition: AHCalSD.h:26
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
DetId
Definition: DetId.h:17
AHCalDetId::depth
int depth() const
get the layer number
Definition: AHCalDetId.cc:43
CaloG4Hit::getEnergyDeposit
double getEnergyDeposit() const
Definition: CaloG4Hit.h:78
AHCalSD::birk1
double birk1
Definition: AHCalSD.h:27
AHCalDetId::icol
int icol() const
get the column number
Definition: AHCalDetId.cc:36
gen
Definition: PythiaDecays.h:13
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
AHCalSD::birk3
double birk3
Definition: AHCalSD.h:27
AHCalDetId
Definition: AHCalDetId.h:13
AHCalParameters::kSignRowColumn_
static constexpr int kSignRowColumn_
Definition: AHCalParameters.h:31
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:34
AHCalParameters::kColumn_
static constexpr int kColumn_
Constants used.
Definition: AHCalParameters.h:27
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
relval_steps.gen
def gen(fragment, howMuch)
Production test section ####.
Definition: relval_steps.py:506
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
AHCalParameters::kRowColumn_
static constexpr int kRowColumn_
Definition: AHCalParameters.h:30
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
weight
Definition: weight.py:1
g
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
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
AHCalParameters::kSign_
static constexpr int kSign_
Definition: AHCalParameters.h:29