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 (G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
double getEnergyDeposit (G4Step *) override
 
uint32_t setDetUnitId (G4Step *step) override
 
bool unpackIndex (const uint32_t &idx, int &row, int &col, int &depth)
 
 ~AHCalSD () override
 
- Public Member Functions inherited from CaloSD
 CaloSD (G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
void clear () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PCaloHitContainer &, std::string n) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory) override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (const std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point)
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
Local3DPoint FinalStepPosition (G4Step *s, coordinates)
 
virtual std::vector< std::string > getNames ()
 
void Initialize (G4HCofThisEvent *eventHC) override
 
Local3DPoint InitialStepPosition (G4Step *s, coordinates)
 
std::string nameOfSD ()
 
void NaNTrap (G4Step *step)
 
void Register ()
 
 SensitiveDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
 ~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
 
- Protected Member Functions inherited from CaloSD
G4bool checkHit ()
 
void clearHits () override
 
CaloG4HitcreateNewHit ()
 
double getAttenuation (G4Step *aStep, double birk1, double birk2, double birk3)
 
virtual uint16_t getDepth (G4Step *)
 
int getNumberOfHits ()
 
double getResponseWt (G4Track *)
 
virtual G4bool getStepInfo (G4Step *aStep)
 
virtual int getTrackID (G4Track *)
 
G4bool hitExists ()
 
virtual void initRun ()
 
void resetForNewPrimary (const G4ThreeVector &, double)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *)
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *)
 
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 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

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Attributes inherited from CaloSD
int checkHits
 
double correctT
 
bool corrTOFBeam
 
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double eminHitD
 
G4int emPDG
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
G4int epPDG
 
bool forceSave
 
G4int gammaPDG
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
const SimTrackManagerm_trackManager
 
G4ThreeVector posGlobal
 
G4StepPoint * preStepPoint
 
CaloHitID previousID
 
int primIDSaved
 
bool runInit
 
bool suppressHeavy
 
G4Track * theTrack
 
double tmaxHit
 
bool useMap
 

Detailed Description

Definition at line 12 of file AHCalSD.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file AHCalSD.cc.

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

22  :
23  CaloSD(name, cpv, clg, p, manager,
24  (float)(p.getParameter<edm::ParameterSet>("AHCalSD").getParameter<double>("TimeSliceUnit")),
25  p.getParameter<edm::ParameterSet>("AHCalSD").getParameter<bool>("IgnoreTrackID")) {
26 
27  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("AHCalSD");
28  useBirk = m_HC.getParameter<bool>("UseBirkLaw");
29  birk1 = m_HC.getParameter<double>("BirkC1")*(CLHEP::g/(CLHEP::MeV*CLHEP::cm2));
30  birk2 = m_HC.getParameter<double>("BirkC2");
31  birk3 = m_HC.getParameter<double>("BirkC3");
32  eminHit = m_HC.getParameter<double>("EminHit")*CLHEP::MeV;
33 
34  edm::LogInfo("HcalSim") << "AHCalSD:: Use of Birks law is set to "
35  << useBirk << " with three constants kB = "
36  << birk1 << ", C1 = " << birk2 << ", C2 = " << birk3
37  << "\nAHCalSD:: Threshold for storing hits: "
38  << eminHit << std::endl;
39 }
T getParameter(std::string const &) const
double birk1
Definition: AHCalSD.h:30
double birk3
Definition: AHCalSD.h:30
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
CaloSD(G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:24
const double MeV
double birk2
Definition: AHCalSD.h:30
double eminHit
Definition: AHCalSD.h:31
bool useBirk
Definition: AHCalSD.h:29
AHCalSD::~AHCalSD ( )
override

Definition at line 41 of file AHCalSD.cc.

41 { }

Member Function Documentation

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

Reimplemented from CaloSD.

Definition at line 106 of file AHCalSD.cc.

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

106  {
107  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit));
108 }
double tmaxHit
Definition: CaloSD.h:123
double eminHit
Definition: AHCalSD.h:31
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
double AHCalSD::getEnergyDeposit ( G4Step *  aStep)
overridevirtual

Reimplemented from CaloSD.

Definition at line 43 of file AHCalSD.cc.

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

43  {
44 
45  double destep = aStep->GetTotalEnergyDeposit();
46  double wt2 = aStep->GetTrack()->GetWeight();
47  double weight = (wt2 > 0.0) ? wt2 : 1.0;
48 #ifdef EDM_ML_DEBUG
49  double weight0 = weight;
50 #endif
51  if (useBirk) weight *= getAttenuation(aStep, birk1, birk2, birk3);
52 #ifdef EDM_ML_DEBUG
53  edm::LogInfo("HcalSim") << "AHCalSD: weight " << weight0 << " " << weight
54  << std::endl;
55 #endif
56  double edep = weight*destep;
57  return edep;
58 }
double birk1
Definition: AHCalSD.h:30
double birk3
Definition: AHCalSD.h:30
Definition: weight.py:1
double birk2
Definition: AHCalSD.h:30
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:465
bool useBirk
Definition: AHCalSD.h:29
uint32_t AHCalSD::setDetUnitId ( G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 60 of file AHCalSD.cc.

References cuy::col, TauDecayModes::dec, particleFlowClusterECALTimeSelected_cfi::depth, RemoveAddSevLevel::flag, HcalOther, diffTreeTool::index, CaloSD::preStepPoint, DetId::rawId(), and unpackIndex().

60  {
61 
62  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
63  const G4VTouchable* touch = preStepPoint->GetTouchable();
64 
65  int depth = (touch->GetReplicaNumber(1));
66  int incol = ((touch->GetReplicaNumber(0))%10);
67  int inrow = ((touch->GetReplicaNumber(0))/10)%10;
68  int jncol = ((touch->GetReplicaNumber(0))/100)%10;
69  int jnrow = ((touch->GetReplicaNumber(0))/1000)%10;
70  int col = (jncol == 0) ? incol : -incol;
71  int row = (jnrow == 0) ? inrow : -inrow;
72  uint32_t index = AHCalDetId(row,col,depth).rawId();
73 #ifdef EDM_ML_DEBUG
74  edm::LogInfo("HcalSim") << "AHCalSD: det = " << HcalOther
75  << " depth = " << depth << " row = " << row
76  << " column = " << col << " packed index = 0x"
77  << std::hex << index << std::dec << std::endl;
78  bool flag = unpackIndex(index, row, col, depth);
79  edm::LogInfo("HcalSim") << "Results from unpacker for 0x" << std::hex
80  << index << std::dec << " Flag " << flag << " Row "
81  << row << " Col " << col << " Depth " << depth
82  << std::endl;
83 #endif
84  return index;
85 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
col
Definition: cuy.py:1008
bool unpackIndex(const uint32_t &idx, int &row, int &col, int &depth)
Definition: AHCalSD.cc:87
bool AHCalSD::unpackIndex ( const uint32_t &  idx,
int &  row,
int &  col,
int &  depth 
)

Definition at line 87 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().

87  {
88 
89  DetId gen(idx);
90  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
91  bool rcode = (gen.det()==DetId::Hcal && subdet!=HcalOther);
92  row = col = depth = 0;
93  if (rcode) {
94  row = AHCalDetId(idx).irow();
95  col = AHCalDetId(idx).icol();
97  }
98 #ifdef EDM_ML_DEBUG
99  edm::LogInfo("HcalSim") << "AHCalSD: packed index = 0x" << std::hex << idx
100  << std::dec << " Row " << row << " Column " << col
101  << " Depth " << depth << " OK " << rcode << std::endl;
102 #endif
103  return rcode;
104 }
int irow() const
get the row number
Definition: AHCalDetId.cc:33
int depth() const
Definition: AHCalDetId.cc:45
int icol() const
get the column number
Definition: AHCalDetId.cc:39
HcalSubdetector
Definition: HcalAssistant.h:31
def gen(fragment, howMuch)
Production test section ####.
Definition: DetId.h:18
col
Definition: cuy.py:1008

Member Data Documentation

double AHCalSD::betaThr
private

Definition at line 30 of file AHCalSD.h.

double AHCalSD::birk1
private

Definition at line 30 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::birk2
private

Definition at line 30 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::birk3
private

Definition at line 30 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().

double AHCalSD::eminHit
private

Definition at line 31 of file AHCalSD.h.

Referenced by AHCalSD(), and filterHit().

bool AHCalSD::useBirk
private

Definition at line 29 of file AHCalSD.h.

Referenced by AHCalSD(), and getEnergyDeposit().