CMS 3D CMS Logo

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

#include <MtdSD.h>

Inheritance diagram for MtdSD:
TimingSD SensitiveTkDetector Observer< const BeginOfEvent * > SensitiveDetector

Public Member Functions

 MtdSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *) override
 
 ~MtdSD () override
 
- Public Member Functions inherited from TimingSD
void clearHits () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
 TimingSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
 
 ~TimingSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (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 BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 

Private Member Functions

void getBaseNumber (const G4Step *)
 
void setNumberingScheme (MTDNumberingScheme *)
 

Private Attributes

bool isBTL
 
bool isETL
 
MTDNumberingSchemenumberingScheme
 
MTDBaseNumber theBaseNumber
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from TimingSD
virtual bool checkHit (const G4Step *, BscG4Hit *)
 
const G4ThreeVector & getGlobalEntryPoint () const
 
const G4ThreeVector & getLocalEntryPoint () const
 
void setCuts (double eCut, double historyCut)
 
void setTimeFactor (double)
 
void setToLocal (const G4StepPoint *stepPoint, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint)
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
- 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 > &)
 

Detailed Description

Definition at line 17 of file MtdSD.h.

Constructor & Destructor Documentation

◆ MtdSD()

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

Definition at line 21 of file MtdSD.cc.

26  : TimingSD(name, es, clg, p, manager), numberingScheme(nullptr) {
27  //Parameters
28  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("MtdSD");
29  int verbn = m_p.getUntrackedParameter<int>("Verbosity");
30 
31  SetVerboseLevel(verbn);
32 
33  MTDNumberingScheme* scheme = nullptr;
34  if (name == "FastTimerHitsBarrel") {
35  scheme = dynamic_cast<MTDNumberingScheme*>(new BTLNumberingScheme());
36  isBTL = true;
37  } else if (name == "FastTimerHitsEndcap") {
38  scheme = dynamic_cast<MTDNumberingScheme*>(new ETLNumberingScheme());
39  isETL = true;
40  } else {
41  scheme = nullptr;
42  edm::LogWarning("MtdSim") << "MtdSD: ReadoutName not supported";
43  }
44  if (scheme)
46 
47  double newTimeFactor = 1. / m_p.getParameter<double>("TimeSliceUnit");
48  edm::LogInfo("MtdSim") << "New time factor = " << newTimeFactor;
49  setTimeFactor(newTimeFactor);
50 
51  edm::LogVerbatim("MtdSim") << "MtdSD: Instantiation completed for " << name;
52 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), isBTL, isETL, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, generator_cfi::scheme, setNumberingScheme(), and TimingSD::setTimeFactor().

◆ ~MtdSD()

MtdSD::~MtdSD ( )
override

Definition at line 54 of file MtdSD.cc.

54 {}

Member Function Documentation

◆ getBaseNumber()

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

Definition at line 77 of file MtdSD.cc.

77  {
79  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
80  int theSize = touch->GetHistoryDepth() + 1;
81  if (theBaseNumber.getCapacity() < theSize)
82  theBaseNumber.setSize(theSize);
83  //Get name and copy numbers
84  if (theSize > 1) {
85 #ifdef EDM_ML_DEBUG
86  edm::LogInfo("MtdSim") << "Building MTD basenumber:";
87 #endif
88  for (int ii = 0; ii < theSize; ii++) {
89  theBaseNumber.addLevel(touch->GetVolume(ii)->GetName(), touch->GetReplicaNumber(ii));
90 #ifdef EDM_ML_DEBUG
91  edm::LogVerbatim("MtdSim") << "MtdSD::getBaseNumber(): Adding level " << ii << ": "
92  << touch->GetVolume(ii)->GetName() << "[" << touch->GetReplicaNumber(ii) << "]";
93 #endif
94  }
95  }
96 }

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

Referenced by setDetUnitId().

◆ setDetUnitId()

uint32_t MtdSD::setDetUnitId ( const G4Step *  aStep)
overridevirtual

Implements SensitiveDetector.

Definition at line 56 of file MtdSD.cc.

56  {
57  if (numberingScheme == nullptr) {
58  return MTDDetId();
59  } else {
60  getBaseNumber(aStep);
61 #ifdef EDM_ML_DEBUG
62  edm::LogInfo("MtdSim") << "DetId = " << numberingScheme->getUnitID(theBaseNumber);
63 #endif
65  }
66 }

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

◆ setNumberingScheme()

void MtdSD::setNumberingScheme ( MTDNumberingScheme scheme)
private

Definition at line 68 of file MtdSD.cc.

68  {
69  if (scheme != nullptr) {
70  edm::LogInfo("MtdSim") << "MtdSD: updates numbering scheme for " << GetName();
71  if (numberingScheme)
72  delete numberingScheme;
74  }
75 }

References numberingScheme, and generator_cfi::scheme.

Referenced by MtdSD().

Member Data Documentation

◆ isBTL

bool MtdSD::isBTL
private

Definition at line 35 of file MtdSD.h.

Referenced by MtdSD().

◆ isETL

bool MtdSD::isETL
private

Definition at line 36 of file MtdSD.h.

Referenced by MtdSD().

◆ numberingScheme

MTDNumberingScheme* MtdSD::numberingScheme
private

Definition at line 33 of file MtdSD.h.

Referenced by setDetUnitId(), and setNumberingScheme().

◆ theBaseNumber

MTDBaseNumber MtdSD::theBaseNumber
private

Definition at line 34 of file MtdSD.h.

Referenced by getBaseNumber(), and setDetUnitId().

MTDNumberingScheme::getUnitID
virtual uint32_t getUnitID(const MTDBaseNumber &baseNumber) const =0
MTDNumberingScheme
Definition: MTDNumberingScheme.h:8
TimingSD::setTimeFactor
void setTimeFactor(double)
Definition: TimingSD.cc:86
MTDBaseNumber::getCapacity
int getCapacity()
Definition: MTDBaseNumber.cc:45
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TimingSD::TimingSD
TimingSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
Definition: TimingSD.cc:40
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MtdSD::isBTL
bool isBTL
Definition: MtdSD.h:35
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MTDBaseNumber::addLevel
void addLevel(const std::string &name, const int &copyNumber)
Definition: MTDBaseNumber.cc:21
MtdSD::numberingScheme
MTDNumberingScheme * numberingScheme
Definition: MtdSD.h:33
MTDBaseNumber::setSize
void setSize(const int &size)
Definition: MTDBaseNumber.cc:10
edm::ParameterSet
Definition: ParameterSet.h:47
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
ETLNumberingScheme
Definition: ETLNumberingScheme.h:6
MtdSD::theBaseNumber
MTDBaseNumber theBaseNumber
Definition: MtdSD.h:34
MtdSD::setNumberingScheme
void setNumberingScheme(MTDNumberingScheme *)
Definition: MtdSD.cc:68
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
MTDBaseNumber::reset
void reset()
Definition: MTDBaseNumber.cc:47
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MtdSD::getBaseNumber
void getBaseNumber(const G4Step *)
Definition: MtdSD.cc:77
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MtdSD::isETL
bool isETL
Definition: MtdSD.h:36
cuy.ii
ii
Definition: cuy.py:590
BTLNumberingScheme
Definition: BTLNumberingScheme.h:6