CMS 3D CMS Logo

List of all members | Public Member Functions | Protected 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 edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
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 edm::EventSetup &es, 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 edm::EventSetup &es, 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 edm::EventSetup &es, 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

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 *)
 
virtual bool filterHit (CaloG4Hit *, double)
 
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 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 }
 
- 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 20 of file EcalTBH4BeamSD.h.

Constructor & Destructor Documentation

◆ EcalTBH4BeamSD()

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

Definition at line 22 of file EcalTBH4BeamSD.cc.

27  : CaloSD(name, es, clg, p, manager), numberingScheme(nullptr) {
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  } else {
38  edm::LogWarning("EcalTBSim") << "EcalTBH4BeamSD: ReadoutName not supported\n";
39  }
40 
41  if (scheme)
43  edm::LogInfo("EcalTBSim") << "Constructing a EcalTBH4BeamSD with name " << GetName();
44  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD:: Use of Birks law is set to " << useBirk
45  << " with three constants kB = " << birk1 << ", C1 = " << birk2
46  << ", C2 = " << birk3;
47 }

References birk1, birk2, birk3, g, edm::ParameterSet::getParameter(), MeV, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, generator_cfi::scheme, setNumberingScheme(), and useBirk.

◆ ~EcalTBH4BeamSD()

EcalTBH4BeamSD::~EcalTBH4BeamSD ( )
override

Definition at line 49 of file EcalTBH4BeamSD.cc.

49  {
50  if (numberingScheme)
51  delete numberingScheme;
52 }

References numberingScheme.

Member Function Documentation

◆ getBaseNumber()

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

Definition at line 80 of file EcalTBH4BeamSD.cc.

80  {
82  const G4VTouchable *touch = aStep->GetPreStepPoint()->GetTouchable();
83  int theSize = touch->GetHistoryDepth() + 1;
84  if (theBaseNumber.getCapacity() < theSize)
85  theBaseNumber.setSize(theSize);
86  // Get name and copy numbers
87  if (theSize > 1) {
88  for (int ii = 0; ii < theSize; ii++) {
89  theBaseNumber.addLevel(touch->GetVolume(ii)->GetName(), touch->GetReplicaNumber(ii));
90  LogDebug("EcalTBSim") << "EcalTBH4BeamSD::getBaseNumber(): Adding level " << ii << ": "
91  << touch->GetVolume(ii)->GetName() << "[" << touch->GetReplicaNumber(ii) << "]";
92  }
93  }
94 }

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

Referenced by setDetUnitId().

◆ getEnergyDeposit()

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

Reimplemented from CaloSD.

Definition at line 54 of file EcalTBH4BeamSD.cc.

54  {
55  // take into account light collection curve for crystals
56  double weight = 1.;
57  if (useBirk)
58  weight *= getAttenuation(aStep, birk1, birk2, birk3);
59  double edep = aStep->GetTotalEnergyDeposit() * weight;
60  LogDebug("EcalTBSim") << "EcalTBH4BeamSD:: " << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()
61  << " Light Collection Efficiency " << weight << " Weighted Energy Deposit " << edep / MeV
62  << " MeV";
63  return edep;
64 }

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

◆ setDetUnitId()

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

Implements CaloSD.

Definition at line 66 of file EcalTBH4BeamSD.cc.

66  {
67  getBaseNumber(aStep);
68  return (numberingScheme == nullptr ? 0 : numberingScheme->getUnitID(theBaseNumber));
69 }

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

◆ setNumberingScheme()

void EcalTBH4BeamSD::setNumberingScheme ( EcalNumberingScheme scheme)

Definition at line 71 of file EcalTBH4BeamSD.cc.

71  {
72  if (scheme != nullptr) {
73  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD: updates numbering scheme for " << GetName() << "\n";
74  if (numberingScheme)
75  delete numberingScheme;
77  }
78 }

References numberingScheme, and generator_cfi::scheme.

Referenced by EcalTBH4BeamSD().

Member Data Documentation

◆ birk1

double EcalTBH4BeamSD::birk1
private

Definition at line 39 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

◆ birk2

double EcalTBH4BeamSD::birk2
private

Definition at line 39 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

◆ birk3

double EcalTBH4BeamSD::birk3
private

Definition at line 39 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

◆ numberingScheme

EcalNumberingScheme* EcalTBH4BeamSD::numberingScheme
private

Definition at line 36 of file EcalTBH4BeamSD.h.

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

◆ theBaseNumber

EcalBaseNumber EcalTBH4BeamSD::theBaseNumber
private

Definition at line 40 of file EcalTBH4BeamSD.h.

Referenced by getBaseNumber(), and setDetUnitId().

◆ useBirk

bool EcalTBH4BeamSD::useBirk
private

Definition at line 38 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

◆ useWeight

bool EcalTBH4BeamSD::useWeight
private

Definition at line 37 of file EcalTBH4BeamSD.h.

EcalTBH4BeamSD::birk3
double birk3
Definition: EcalTBH4BeamSD.h:39
EcalTBH4BeamSD::birk1
double birk1
Definition: EcalTBH4BeamSD.h:39
mps_merge.weight
weight
Definition: mps_merge.py:88
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalBaseNumber::getCapacity
int getCapacity()
Definition: EcalBaseNumber.cc:37
EcalBaseNumber::addLevel
void addLevel(const std::string &name, const int &copyNumber)
Definition: EcalBaseNumber.cc:16
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:685
MeV
const double MeV
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalTBH4BeamSD::setNumberingScheme
void setNumberingScheme(EcalNumberingScheme *scheme)
Definition: EcalTBH4BeamSD.cc:71
EcalTBH4BeamSD::birk2
double birk2
Definition: EcalTBH4BeamSD.h:39
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalNumberingScheme
Definition: EcalNumberingScheme.h:14
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
EcalBaseNumber::reset
void reset()
Definition: EcalBaseNumber.cc:39
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:35
EcalTBH4BeamSD::useBirk
bool useBirk
Definition: EcalTBH4BeamSD.h:38
EcalTBH4BeamSD::getBaseNumber
void getBaseNumber(const G4Step *aStep)
Definition: EcalTBH4BeamSD.cc:80
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
EcalTBH4BeamSD::theBaseNumber
EcalBaseNumber theBaseNumber
Definition: EcalTBH4BeamSD.h:40
EcalNumberingScheme::getUnitID
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const =0
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalHodoscopeNumberingScheme
Definition: EcalHodoscopeNumberingScheme.h:10
EcalTBH4BeamSD::numberingScheme
EcalNumberingScheme * numberingScheme
Definition: EcalTBH4BeamSD.h:36
EcalBaseNumber::setSize
void setSize(const int &size)
Definition: EcalBaseNumber.cc:11
cuy.ii
ii
Definition: cuy.py:590
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