CMS 3D CMS Logo

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

#include <EcalTBH4BeamSD.h>

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

Public Member Functions

 EcalTBH4BeamSD (const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
double getEnergyDeposit (G4Step *) override
 
uint32_t setDetUnitId (const G4Step *step) override
 
void setNumberingScheme (EcalNumberingScheme *scheme)
 
 ~EcalTBH4BeamSD () override
 
- 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
 
bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory) override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) 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
 
 SensitiveDetector (const 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 ()
 

Private Member Functions

void getBaseNumber (const G4Step *aStep)
 

Private Attributes

double birk1
 
double birk2
 
double birk3
 
EcalNumberingSchemenumberingScheme
 
EcalBaseNumber theBaseNumber
 
bool useBirk
 
bool useWeight
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from CaloSD
G4bool checkHit ()
 
CaloG4HitcreateNewHit ()
 
virtual bool filterHit (CaloG4Hit *, double)
 
double getAttenuation (const G4Step *aStep, double birk1, double birk2, double birk3)
 
virtual uint16_t getDepth (const G4Step *)
 
int getNumberOfHits ()
 
double getResponseWt (const G4Track *)
 
virtual G4bool getStepInfo (G4Step *aStep)
 
virtual int getTrackID (const 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 SensitiveDetector
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...
 
- 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 20 of file EcalTBH4BeamSD.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file EcalTBH4BeamSD.cc.

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

25  :
26  CaloSD(name, cpv, clg, p, manager), numberingScheme(nullptr) {
27 
28  edm::ParameterSet m_EcalTBH4BeamSD = p.getParameter<edm::ParameterSet>("EcalTBH4BeamSD");
29  useBirk= m_EcalTBH4BeamSD.getParameter<bool>("UseBirkLaw");
30  birk1 = m_EcalTBH4BeamSD.getParameter<double>("BirkC1")*(g/(MeV*cm2));
31  birk2 = m_EcalTBH4BeamSD.getParameter<double>("BirkC2");
32  birk3 = m_EcalTBH4BeamSD.getParameter<double>("BirkC3");
33 
34  EcalNumberingScheme* scheme=nullptr;
35  if (name == "EcalTBH4BeamHits") {
36  scheme = dynamic_cast<EcalNumberingScheme*>(new EcalHodoscopeNumberingScheme());
37  }
38  else {edm::LogWarning("EcalTBSim") << "EcalTBH4BeamSD: ReadoutName not supported\n";}
39 
40  if (scheme) setNumberingScheme(scheme);
41  edm::LogInfo("EcalTBSim") << "Constructing a EcalTBH4BeamSD with name "
42  << GetName();
43  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD:: Use of Birks law is set to "
44  << useBirk << " with three constants kB = "
45  << birk1 << ", C1 = " << birk2 << ", C2 = "
46  << birk3;
47 }
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
const double MeV
void setNumberingScheme(EcalNumberingScheme *scheme)
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:24
EcalNumberingScheme * numberingScheme
EcalTBH4BeamSD::~EcalTBH4BeamSD ( )
override

Definition at line 49 of file EcalTBH4BeamSD.cc.

References numberingScheme.

49  {
50  if (numberingScheme) delete numberingScheme;
51 }
EcalNumberingScheme * numberingScheme

Member Function Documentation

void EcalTBH4BeamSD::getBaseNumber ( const G4Step *  aStep)
private

Definition at line 87 of file EcalTBH4BeamSD.cc.

References EcalBaseNumber::addLevel(), EcalBaseNumber::getCapacity(), cuy::ii, LogDebug, EcalBaseNumber::reset(), EcalBaseNumber::setSize(), and theBaseNumber.

Referenced by setDetUnitId().

87  {
88 
90  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
91  int theSize = touch->GetHistoryDepth()+1;
92  if ( theBaseNumber.getCapacity() < theSize ) theBaseNumber.setSize(theSize);
93  //Get name and copy numbers
94  if ( theSize > 1 ) {
95  for (int ii = 0; ii < theSize ; ii++) {
96  theBaseNumber.addLevel(touch->GetVolume(ii)->GetName(),touch->GetReplicaNumber(ii));
97  LogDebug("EcalTBSim") << "EcalTBH4BeamSD::getBaseNumber(): Adding level " << ii
98  << ": " << touch->GetVolume(ii)->GetName() << "["
99  << touch->GetReplicaNumber(ii) << "]";
100  }
101  }
102 }
#define LogDebug(id)
void addLevel(const std::string &name, const int &copyNumber)
ii
Definition: cuy.py:588
EcalBaseNumber theBaseNumber
void setSize(const int &size)
double EcalTBH4BeamSD::getEnergyDeposit ( G4Step *  aStep)
overridevirtual

Reimplemented from CaloSD.

Definition at line 53 of file EcalTBH4BeamSD.cc.

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

53  {
54 
55  if (aStep == nullptr) {
56  return 0;
57  } else {
58  preStepPoint = aStep->GetPreStepPoint();
59  G4String nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
60 
61  // take into account light collection curve for crystals
62  double weight = 1.;
63  if (useBirk) weight *= getAttenuation(aStep, birk1, birk2, birk3);
64  double edep = aStep->GetTotalEnergyDeposit() * weight;
65  LogDebug("EcalTBSim") << "EcalTBH4BeamSD:: " << nameVolume
66  <<" Light Collection Efficiency " << weight
67  << " Weighted Energy Deposit " << edep/MeV << " MeV";
68  return edep;
69  }
70 }
#define LogDebug(id)
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:439
Definition: weight.py:1
const double MeV
G4StepPoint * preStepPoint
Definition: CaloSD.h:121
uint32_t EcalTBH4BeamSD::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 72 of file EcalTBH4BeamSD.cc.

References getBaseNumber(), EcalNumberingScheme::getUnitID(), numberingScheme, and theBaseNumber.

72  {
73  getBaseNumber(aStep);
74  return (numberingScheme == nullptr ? 0 : numberingScheme->getUnitID(theBaseNumber));
75 }
EcalNumberingScheme * numberingScheme
EcalBaseNumber theBaseNumber
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const =0
void getBaseNumber(const G4Step *aStep)
void EcalTBH4BeamSD::setNumberingScheme ( EcalNumberingScheme scheme)

Definition at line 77 of file EcalTBH4BeamSD.cc.

References numberingScheme.

Referenced by EcalTBH4BeamSD().

77  {
78  if (scheme != nullptr) {
79  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD: updates numbering scheme for "
80  << GetName() << "\n";
81  if (numberingScheme) delete numberingScheme;
82  numberingScheme = scheme;
83  }
84 }
EcalNumberingScheme * numberingScheme

Member Data Documentation

double EcalTBH4BeamSD::birk1
private

Definition at line 37 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

double EcalTBH4BeamSD::birk2
private

Definition at line 37 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

double EcalTBH4BeamSD::birk3
private

Definition at line 37 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

EcalNumberingScheme* EcalTBH4BeamSD::numberingScheme
private

Definition at line 34 of file EcalTBH4BeamSD.h.

Referenced by setDetUnitId(), setNumberingScheme(), and ~EcalTBH4BeamSD().

EcalBaseNumber EcalTBH4BeamSD::theBaseNumber
private

Definition at line 38 of file EcalTBH4BeamSD.h.

Referenced by getBaseNumber(), and setDetUnitId().

bool EcalTBH4BeamSD::useBirk
private

Definition at line 36 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

bool EcalTBH4BeamSD::useWeight
private

Definition at line 35 of file EcalTBH4BeamSD.h.