CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
AHCalSD Class Reference
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 DDCompactView &, 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 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 ()
 

Protected Member Functions

bool filterHit (CaloG4Hit *, double) override
 
double getEnergyDeposit (const G4Step *) override
 
- Protected Member Functions inherited from CaloSD
bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *)
 
virtual void endEvent ()
 
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 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 }
 
- 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 24 of file AHCalSD.cc.

Constructor & Destructor Documentation

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

Definition at line 43 of file AHCalSD.cc.

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

46  : CaloSD(name, cpv, clg, p, manager,
47  (float)(p.getParameter<edm::ParameterSet>("AHCalSD")
48  .getParameter<double>("TimeSliceUnit")),
49  p.getParameter<edm::ParameterSet>("AHCalSD").getParameter<bool>(
50  "IgnoreTrackID")) {
51  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("AHCalSD");
52  useBirk = m_HC.getParameter<bool>("UseBirkLaw");
53  birk1 = m_HC.getParameter<double>("BirkC1") *
54  (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
55  birk2 = m_HC.getParameter<double>("BirkC2");
56  birk3 = m_HC.getParameter<double>("BirkC3");
57  eminHit = m_HC.getParameter<double>("EminHit") * CLHEP::MeV;
58 
59  edm::LogVerbatim("HcalSim")
60  << "AHCalSD:: Use of Birks law is set to " << useBirk
61  << " with three constants kB = " << birk1 << ", C1 = " << birk2
62  << ", C2 = " << birk3 << "\nAHCalSD:: Threshold for storing"
63  << " hits: " << eminHit;
64 }
T getParameter(std::string const &) const
double birk1
Definition: AHCalSD.cc:39
double birk3
Definition: AHCalSD.cc:39
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
const double MeV
double birk2
Definition: AHCalSD.cc:39
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
double eminHit
Definition: AHCalSD.cc:40
bool useBirk
Definition: AHCalSD.cc:38
AHCalSD::~AHCalSD ( )
overridedefault

Member Function Documentation

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

Reimplemented from CaloSD.

Definition at line 125 of file AHCalSD.cc.

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

125  {
126  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit));
127 }
double tmaxHit
Definition: CaloSD.h:133
double eminHit
Definition: AHCalSD.cc:40
double getEnergyDeposit() const
Definition: CaloG4Hit.h:77
double AHCalSD::getEnergyDeposit ( const G4Step *  aStep)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 66 of file AHCalSD.cc.

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

66  {
67  double destep = aStep->GetTotalEnergyDeposit();
68  double wt2 = aStep->GetTrack()->GetWeight();
69  double weight = (wt2 > 0.0) ? wt2 : 1.0;
70 #ifdef EDM_ML_DEBUG
71  double weight0 = weight;
72 #endif
73  if (useBirk) weight *= getAttenuation(aStep, birk1, birk2, birk3);
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("HcalSim") << "AHCalSD: weight " << weight0 << " " << weight;
76 #endif
77  double edep = weight * destep;
78  return edep;
79 }
double birk1
Definition: AHCalSD.cc:39
double birk3
Definition: AHCalSD.cc:39
Definition: weight.py:1
double birk2
Definition: AHCalSD.cc:39
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:438
bool useBirk
Definition: AHCalSD.cc:38
uint32_t AHCalSD::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 81 of file AHCalSD.cc.

References cuy::col, TauDecayModes::dec, egammaForCoreTracking_cff::depth, RemoveAddSevLevel::flag, HcalOther, DetId::rawId(), and unpackIndex().

81  {
82  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
83  const G4VTouchable* touch = preStepPoint->GetTouchable();
84 
85  int depth = (touch->GetReplicaNumber(1));
86  int incol = ((touch->GetReplicaNumber(0)) % 10);
87  int inrow = ((touch->GetReplicaNumber(0)) / 10) % 10;
88  int jncol = ((touch->GetReplicaNumber(0)) / 100) % 10;
89  int jnrow = ((touch->GetReplicaNumber(0)) / 1000) % 10;
90  int col = (jncol == 0) ? incol : -incol;
91  int row = (jnrow == 0) ? inrow : -inrow;
92  uint32_t index = AHCalDetId(row, col, depth).rawId();
93 #ifdef EDM_ML_DEBUG
94  edm::LogVerbatim("HcalSim")
95  << "AHCalSD: det = " << HcalOther << " depth = " << depth
96  << " row = " << row << " column = " << col << " packed index = 0x"
97  << std::hex << index << std::dec;
98  bool flag = unpackIndex(index, row, col, depth);
99  edm::LogVerbatim("HcalSim")
100  << "Results from unpacker for 0x" << std::hex << index << std::dec
101  << " Flag " << flag << " Row " << row << " Col " << col << " Depth "
102  << depth;
103 #endif
104  return index;
105 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
col
Definition: cuy.py:1010
bool unpackIndex(const uint32_t &idx, int &row, int &col, int &depth)
Definition: AHCalSD.cc:107
bool AHCalSD::unpackIndex ( const uint32_t &  idx,
int &  row,
int &  col,
int &  depth 
)

Definition at line 107 of file AHCalSD.cc.

References TauDecayModes::dec, AHCalDetId::depth(), DetId::det(), relval_steps::gen(), DetId::Hcal, HcalOther, AHCalDetId::icol(), AHCalDetId::irow(), and DetId::subdetId().

Referenced by setDetUnitId().

107  {
108  DetId gen(idx);
109  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
110  bool rcode = (gen.det() == DetId::Hcal && subdet != HcalOther);
111  row = col = depth = 0;
112  if (rcode) {
113  row = AHCalDetId(idx).irow();
114  col = AHCalDetId(idx).icol();
115  depth = AHCalDetId(idx).depth();
116  }
117 #ifdef EDM_ML_DEBUG
118  edm::LogVerbatim("HcalSim")
119  << "AHCalSD: packed index = 0x" << std::hex << idx << std::dec << " Row "
120  << row << " Column " << col << " Depth " << depth << " OK " << rcode;
121 #endif
122  return rcode;
123 }
int irow() const
get the row number
Definition: AHCalDetId.cc:34
int depth() const
Definition: AHCalDetId.cc:46
int icol() const
get the column number
Definition: AHCalDetId.cc:40
HcalSubdetector
Definition: HcalAssistant.h:31
def gen(fragment, howMuch)
Production test section ####.
Definition: DetId.h:18
col
Definition: cuy.py:1010

Member Data Documentation

double AHCalSD::betaThr
private

Definition at line 39 of file AHCalSD.cc.

double AHCalSD::birk1
private

Definition at line 39 of file AHCalSD.cc.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::birk2
private

Definition at line 39 of file AHCalSD.cc.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::birk3
private

Definition at line 39 of file AHCalSD.cc.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::eminHit
private

Definition at line 40 of file AHCalSD.cc.

Referenced by AHCalSD(), and filterHit().

bool AHCalSD::useBirk
private

Definition at line 38 of file AHCalSD.cc.

Referenced by AHCalSD(), and getEnergyDeposit().