CMS 3D CMS Logo

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

#include <TotemT2ScintSD.h>

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

Public Member Functions

uint32_t setDetUnitId (const G4Step *step) override
 
void setNumberingScheme (TotemT2ScintNumberingScheme *scheme)
 
 TotemT2ScintSD (const std::string &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
 ~TotemT2ScintSD () 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
 
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 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

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)
 
unsigned int findBoundaryCrossingParent (const G4Track *track, bool markParentAsSaveable=true)
 
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 *)
 
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)
 
std::string shortreprID (const CaloHitID &ID)
 
std::string shortreprID (const CaloG4Hit *hit)
 
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 Member Functions

uint32_t setDetUnitId (const int &zside, const int &lay, const int &phi)
 

Private Attributes

double birk1_
 
double birk2_
 
double birk3_
 
std::unique_ptr< TotemT2ScintNumberingSchemenumberingScheme
 
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 9 of file TotemT2ScintSD.h.

Constructor & Destructor Documentation

◆ TotemT2ScintSD()

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

Definition at line 20 of file TotemT2ScintSD.cc.

References birk1_, birk2_, birk3_, g, edm::ParameterSet::getParameter(), Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, setNumberingScheme(), and useBirk_.

24  : CaloSD(name,
25  clg,
26  p,
27  manager,
28  (float)(p.getParameter<edm::ParameterSet>("TotemT2ScintSD").getParameter<double>("TimeSliceUnit")),
29  p.getParameter<edm::ParameterSet>("TotemT2ScintSD").getParameter<bool>("IgnoreTrackID")) {
30  edm::ParameterSet m_T2SD = p.getParameter<edm::ParameterSet>("TotemT2ScintSD");
31  useBirk_ = m_T2SD.getParameter<bool>("UseBirkLaw");
32  birk1_ = m_T2SD.getParameter<double>("BirkC1") * (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
33  birk2_ = m_T2SD.getParameter<double>("BirkC2");
34  birk3_ = m_T2SD.getParameter<double>("BirkC3");
36 
37  edm::LogVerbatim("ForwardSim") << "***************************************************\n"
38  << "* *\n"
39  << "* Constructing a TotemT2ScintSD with name " << name << " *\n"
40  << "* *\n"
41  << "***************************************************";
42 
43  edm::LogVerbatim("ForwardSim") << "\nUse of Birks law is set to " << useBirk_
44  << " with three constants kB = " << birk1_ << ", C1 = " << birk2_
45  << ", C2 = " << birk3_;
46 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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
void setNumberingScheme(TotemT2ScintNumberingScheme *scheme)
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:33

◆ ~TotemT2ScintSD()

TotemT2ScintSD::~TotemT2ScintSD ( )
overridedefault

Member Function Documentation

◆ getEnergyDeposit()

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

Reimplemented from CaloSD.

Definition at line 66 of file TotemT2ScintSD.cc.

References birk1_, birk2_, birk3_, CaloSD::getAttenuation(), and useBirk_.

66  {
67  double destep = aStep->GetTotalEnergyDeposit();
68  double weight = ((useBirk_) ? getAttenuation(aStep, birk1_, birk2_, birk3_) : 1.0);
69  double edep = weight * destep;
70 #ifdef EDM_ML_DEBUG
71  edm::LogVerbatim("ForwardSim") << "TotemT2ScintSD: edep= " << destep << ":" << weight << ":" << edep;
72 #endif
73  return edep;
74 }
Log< level::Info, true > LogVerbatim
Definition: weight.py:1
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:665

◆ setDetUnitId() [1/2]

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

Implements CaloSD.

Definition at line 48 of file TotemT2ScintSD.cc.

References LEDCalibrationChannels::iphi, and ecaldqm::zside().

48  {
49  auto const prePoint = aStep->GetPreStepPoint();
50  auto const touch = prePoint->GetTouchable();
51 
52  int iphi = (touch->GetReplicaNumber(0)) % 10;
53  int lay = (touch->GetReplicaNumber(0) / 10) % 10 + 1;
54  int zside = (((touch->GetReplicaNumber(1)) == 1) ? 1 : -1);
55 
56  return setDetUnitId(zside, lay, iphi);
57 }
uint32_t setDetUnitId(const G4Step *step) override
int zside(DetId const &)

◆ setDetUnitId() [2/2]

uint32_t TotemT2ScintSD::setDetUnitId ( const int &  zside,
const int &  lay,
const int &  phi 
)
private

Definition at line 76 of file TotemT2ScintSD.cc.

References TauDecayModes::dec, l1ctLayer2EG_cff::id, LEDCalibrationChannels::iphi, numberingScheme, and ecaldqm::zside().

76  {
77  uint32_t id = ((numberingScheme.get()) ? numberingScheme->packID(zside, lay, iphi) : 0);
78 #ifdef EDM_ML_DEBUG
79  edm::LogVerbatim("ForwardSim") << "TotemT2ScintSD: zside " << zside << " layer " << lay << " phi " << iphi << " ID "
80  << std::hex << id << std::dec;
81 #endif
82  return id;
83 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
std::unique_ptr< TotemT2ScintNumberingScheme > numberingScheme

◆ setNumberingScheme()

void TotemT2ScintSD::setNumberingScheme ( TotemT2ScintNumberingScheme scheme)

Definition at line 59 of file TotemT2ScintSD.cc.

References numberingScheme, and generator_cfi::scheme.

Referenced by TotemT2ScintSD().

59  {
60  if (scheme != nullptr) {
61  edm::LogVerbatim("ForwardSim") << "TotemT2ScintSD: updates numbering scheme for " << GetName();
62  numberingScheme.reset(scheme);
63  }
64 }
Log< level::Info, true > LogVerbatim
std::unique_ptr< TotemT2ScintNumberingScheme > numberingScheme

Member Data Documentation

◆ birk1_

double TotemT2ScintSD::birk1_
private

Definition at line 26 of file TotemT2ScintSD.h.

Referenced by getEnergyDeposit(), and TotemT2ScintSD().

◆ birk2_

double TotemT2ScintSD::birk2_
private

Definition at line 26 of file TotemT2ScintSD.h.

Referenced by getEnergyDeposit(), and TotemT2ScintSD().

◆ birk3_

double TotemT2ScintSD::birk3_
private

Definition at line 26 of file TotemT2ScintSD.h.

Referenced by getEnergyDeposit(), and TotemT2ScintSD().

◆ numberingScheme

std::unique_ptr<TotemT2ScintNumberingScheme> TotemT2ScintSD::numberingScheme
private

Definition at line 28 of file TotemT2ScintSD.h.

Referenced by setDetUnitId(), and setNumberingScheme().

◆ useBirk_

bool TotemT2ScintSD::useBirk_
private

Definition at line 25 of file TotemT2ScintSD.h.

Referenced by getEnergyDeposit(), and TotemT2ScintSD().