CMS 3D CMS Logo

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

#include <PltSD.h>

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

Public Member Functions

 PltSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *) override
 
 ~PltSD () 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 ()
 

Protected Member Functions

bool checkHit (const G4Step *, BscG4Hit *) override
 
- Protected Member Functions inherited from TimingSD
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 > &)
 

Private Attributes

double energyCut
 
double energyHistoryCut
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 

Detailed Description

Definition at line 11 of file PltSD.h.

Constructor & Destructor Documentation

◆ PltSD()

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

Definition at line 18 of file PltSD.cc.

23  : TimingSD(name, es, clg, p, manager) {
24  edm::ParameterSet m_TrackerSD = p.getParameter<edm::ParameterSet>("PltSD");
25  energyCut =
26  m_TrackerSD.getParameter<double>("EnergyThresholdForPersistencyInGeV") * CLHEP::GeV; //default must be 0.5
28  m_TrackerSD.getParameter<double>("EnergyThresholdForHistoryInGeV") * CLHEP::GeV; //default must be 0.05
29 
31 }

References energyCut, energyHistoryCut, edm::ParameterSet::getParameter(), GeV, AlCaHLTBitMon_ParallelJobs::p, and TimingSD::setCuts().

◆ ~PltSD()

PltSD::~PltSD ( )
override

Definition at line 33 of file PltSD.cc.

33 {}

Member Function Documentation

◆ checkHit()

bool PltSD::checkHit ( const G4Step *  ,
BscG4Hit hit 
)
overrideprotectedvirtual

Reimplemented from TimingSD.

Definition at line 121 of file PltSD.cc.

121  {
122  // 50 micron are allowed between the exit
123  // point of the current hit and the entry point of the new hit
124  static const float tolerance2 = (float)(0.0025 * CLHEP::mm * CLHEP::mm);
125  return ((hit->getExitLocalP() - getLocalEntryPoint()).mag2() < tolerance2);
126 }

References dqmMemoryStats::float, TimingSD::getLocalEntryPoint(), and mag2().

◆ setDetUnitId()

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

Implements SensitiveDetector.

Definition at line 35 of file PltSD.cc.

35  {
36  unsigned int detId = 0;
37 
38  LogDebug("PltSD") << " DetID = " << detId;
39 
40  //Find number of levels
41  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
42  int level = 0;
43  if (touch)
44  level = ((touch->GetHistoryDepth()) + 1);
45 
46  //Get name and copy numbers
47  if (level > 1) {
48  //some debugging with the names
49  G4String sensorName = touch->GetVolume(2)->GetName();
50  G4String telName = touch->GetVolume(3)->GetName();
51  G4String volumeName = touch->GetVolume(4)->GetName();
52  if (sensorName != "PLTSensorPlane")
53  std::cout << " PltSD::setDetUnitId -w- Sensor name not PLTSensorPlane " << std::endl;
54  if (telName != "Telescope")
55  std::cout << " PltSD::setDetUnitId -w- Telescope name not Telescope " << std::endl;
56  if (volumeName != "PLT")
57  std::cout << " PltSD::setDetUnitId -w- Volume name not PLT " << std::endl;
58 
59  //Get the information about which telescope, plane, row/column was hit
60  int columnNum = touch->GetReplicaNumber(0);
61  int rowNum = touch->GetReplicaNumber(1);
62  int sensorNum = touch->GetReplicaNumber(2);
63  int telNum = touch->GetReplicaNumber(3);
64  //temp stores the PLTBCM volume the hit occured in (i.e. was the hit on the + or -z side?)
65  int temp = touch->GetReplicaNumber(5);
66  //convert to the PLT hit id standard
67  int pltNum;
68  if (temp == 2)
69  pltNum = 0;
70  else
71  pltNum = 1;
72 
73  //correct the telescope numbers on the -z side to have the same naming convention in phi as the +z side
74  if (pltNum == 0) {
75  if (telNum == 0) {
76  telNum = 7;
77  } else if (telNum == 1) {
78  telNum = 6;
79  } else if (telNum == 2) {
80  telNum = 5;
81  } else if (telNum == 3) {
82  telNum = 4;
83  } else if (telNum == 4) {
84  telNum = 3;
85  } else if (telNum == 5) {
86  telNum = 2;
87  } else if (telNum == 6) {
88  telNum = 1;
89  } else if (telNum == 7) {
90  telNum = 0;
91  }
92  }
93  //the PLT is divided into sets of telescopes on the + and -x sides
94  int halfCarriageNum = -1;
95 
96  //If the telescope is on the -x side of the carriage, halfCarriageNum=0. If on the +x side, it is = 1.
97  if (telNum == 0 || telNum == 1 || telNum == 2 || telNum == 3)
98  halfCarriageNum = 0;
99  else
100  halfCarriageNum = 1;
101  //correct the telescope numbers of the +x half-carriage to range from 0 to 3
102  if (halfCarriageNum == 1) {
103  if (telNum == 4) {
104  telNum = 0;
105  } else if (telNum == 5) {
106  telNum = 1;
107  } else if (telNum == 6) {
108  telNum = 2;
109  } else if (telNum == 7) {
110  telNum = 3;
111  }
112  }
113  //Define unique detId for each pixel. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/PLTSimulationGuide for more information
114  detId =
115  10000000 * pltNum + 1000000 * halfCarriageNum + 100000 * telNum + 10000 * sensorNum + 100 * rowNum + columnNum;
116  //std::cout << "Hit Recorded at " << "plt:" << pltNum << " hc:" << halfCarriageNum << " tel:" << telNum << " plane:" << sensorNum << std::endl;
117  }
118  return detId;
119 }

References gather_cfg::cout, personalPlayback::level, LogDebug, and groupFilesInBlocks::temp.

Member Data Documentation

◆ energyCut

double PltSD::energyCut
private

Definition at line 26 of file PltSD.h.

Referenced by PltSD().

◆ energyHistoryCut

double PltSD::energyHistoryCut
private

Definition at line 27 of file PltSD.h.

Referenced by PltSD().

personalPlayback.level
level
Definition: personalPlayback.py:22
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TimingSD::TimingSD
TimingSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
Definition: TimingSD.cc:40
TimingSD::getLocalEntryPoint
const G4ThreeVector & getLocalEntryPoint() const
Definition: TimingSD.h:66
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
GeV
const double GeV
Definition: MathUtil.h:16
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic3DVectorLD.h:124
PltSD::energyHistoryCut
double energyHistoryCut
Definition: PltSD.h:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TimingSD::setCuts
void setCuts(double eCut, double historyCut)
Definition: TimingSD.cc:96
PltSD::energyCut
double energyCut
Definition: PltSD.h:26
hit
Definition: SiStripHitEffFromCalibTree.cc:88