CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MTDRecHitAlgo Class Reference
Inheritance diagram for MTDRecHitAlgo:
MTDRecHitAlgoBase

Public Member Functions

void getEvent (const edm::Event &) final
 get event and eventsetup information More...
 
void getEventSetup (const edm::EventSetup &) final
 
FTLRecHit makeRecHit (const FTLUncalibratedRecHit &uRecHit, uint32_t &flags) const final
 make the rec hit More...
 
 MTDRecHitAlgo (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 Constructor. More...
 
 ~MTDRecHitAlgo () override
 Destructor. More...
 
- Public Member Functions inherited from MTDRecHitAlgoBase
 MTDRecHitAlgoBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 Constructor. More...
 
const std::string & name () const
 
virtual ~MTDRecHitAlgoBase ()
 Destructor. More...
 

Private Attributes

double calibration_
 
edm::ESGetToken< MTDTimeCalib, MTDTimeCalibRecordtcToken_
 
double thresholdToKeep_
 
const MTDTimeCalibtime_calib_
 

Detailed Description

Definition at line 6 of file MTDRecHitAlgo.cc.

Constructor & Destructor Documentation

◆ MTDRecHitAlgo()

MTDRecHitAlgo::MTDRecHitAlgo ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)

Constructor.

Definition at line 27 of file MTDRecHitAlgo.cc.

28  : MTDRecHitAlgoBase(conf, sumes),
29  thresholdToKeep_(conf.getParameter<double>("thresholdToKeep")),
30  calibration_(conf.getParameter<double>("calibrationConstant")) {
31  tcToken_ = sumes.esConsumes<MTDTimeCalib, MTDTimeCalibRecord>(edm::ESInputTag("", "MTDTimeCalib"));
32 }

References edm::ConsumesCollector::esConsumes(), and tcToken_.

◆ ~MTDRecHitAlgo()

MTDRecHitAlgo::~MTDRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 12 of file MTDRecHitAlgo.cc.

12 {}

Member Function Documentation

◆ getEvent()

void MTDRecHitAlgo::getEvent ( const edm::Event )
inlinefinalvirtual

get event and eventsetup information

Implements MTDRecHitAlgoBase.

Definition at line 15 of file MTDRecHitAlgo.cc.

15 {}

◆ getEventSetup()

void MTDRecHitAlgo::getEventSetup ( const edm::EventSetup es)
finalvirtual

Implements MTDRecHitAlgoBase.

Definition at line 34 of file MTDRecHitAlgo.cc.

34  {
35  auto pTC = es.getHandle(tcToken_);
36  time_calib_ = pTC.product();
37 }

References edm::EventSetup::getHandle(), tcToken_, and time_calib_.

◆ makeRecHit()

FTLRecHit MTDRecHitAlgo::makeRecHit ( const FTLUncalibratedRecHit uRecHit,
uint32_t &  flags 
) const
finalvirtual

make the rec hit

position and positionError in unit cm

Implements MTDRecHitAlgoBase.

Definition at line 39 of file MTDRecHitAlgo.cc.

39  {
40  unsigned char flagsWord = uRecHit.flags();
41  float timeError = uRecHit.timeError();
42 
43  float energy = 0.;
44  float time = 0.;
45 
47  float position = -1.f;
48  float positionError = -1.f;
49 
50  switch (flagsWord) {
51  // BTL bar geometry with only the right SiPM information available
52  case 0x2: {
53  energy = uRecHit.amplitude().second;
54  time = uRecHit.time().second;
55 
56  break;
57  }
58  // BTL bar geometry with left and right SiPMs information available
59  case 0x3: {
60  energy = 0.5 * (uRecHit.amplitude().first + uRecHit.amplitude().second);
61  time = 0.5 * (uRecHit.time().first + uRecHit.time().second);
62 
63  position = uRecHit.position();
64  positionError = uRecHit.positionError();
65 
66  break;
67  }
68  // ETL, BTL tile geometry, BTL bar geometry with only the left SiPM information available
69  default: {
70  energy = uRecHit.amplitude().first;
71  time = uRecHit.time().first;
72 
73  break;
74  }
75  }
76 
77  // --- Energy calibration: for the time being this is just a conversion pC --> MeV
79 
80  // --- Time calibration: for the time being just removes a time offset in BTL
81  time += time_calib_->getTimeCalib(uRecHit.id());
82 
83  FTLRecHit rh(uRecHit.id(), uRecHit.row(), uRecHit.column(), energy, time, timeError, position, positionError);
84 
85  // Now fill flags
86  // all rechits from the digitizer are "good" at present
87  if (energy > thresholdToKeep_) {
89  rh.setFlag(flags);
90  } else {
92  rh.setFlag(flags);
93  }
94 
95  return rh;
96 }

References FTLUncalibratedRecHit::amplitude(), calibration_, FTLUncalibratedRecHit::column(), HCALHighEnergyHPDFilter_cfi::energy, FTLUncalibratedRecHit::flags(), HLT_FULL_cff::flags, MTDTimeCalib::getTimeCalib(), FTLUncalibratedRecHit::id(), FTLRecHit::kGood, FTLRecHit::kKilled, FTLUncalibratedRecHit::position(), position, FTLUncalibratedRecHit::positionError(), FTLUncalibratedRecHit::row(), thresholdToKeep_, protons_cff::time, FTLUncalibratedRecHit::time(), time_calib_, and FTLUncalibratedRecHit::timeError().

Member Data Documentation

◆ calibration_

double MTDRecHitAlgo::calibration_
private

Definition at line 22 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

◆ tcToken_

edm::ESGetToken<MTDTimeCalib, MTDTimeCalibRecord> MTDRecHitAlgo::tcToken_
private

Definition at line 24 of file MTDRecHitAlgo.cc.

Referenced by getEventSetup(), and MTDRecHitAlgo().

◆ thresholdToKeep_

double MTDRecHitAlgo::thresholdToKeep_
private

Definition at line 22 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

◆ time_calib_

const MTDTimeCalib* MTDRecHitAlgo::time_calib_
private

Definition at line 23 of file MTDRecHitAlgo.cc.

Referenced by getEventSetup(), and makeRecHit().

edm::ESInputTag
Definition: ESInputTag.h:87
FTLRecHit
Definition: FTLRecHit.h:15
FTLUncalibratedRecHit::row
int row() const
Definition: FTLUncalibratedRecHit.h:47
protons_cff.time
time
Definition: protons_cff.py:35
MTDTimeCalibRecord
Definition: MTDTimeCalibRecord.h:11
MTDTimeCalib
Definition: MTDTimeCalib.h:11
MTDRecHitAlgo::time_calib_
const MTDTimeCalib * time_calib_
Definition: MTDRecHitAlgo.cc:23
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
MTDRecHitAlgo::calibration_
double calibration_
Definition: MTDRecHitAlgo.cc:22
MTDRecHitAlgo::tcToken_
edm::ESGetToken< MTDTimeCalib, MTDTimeCalibRecord > tcToken_
Definition: MTDRecHitAlgo.cc:24
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
FTLUncalibratedRecHit::position
float position() const
Definition: FTLUncalibratedRecHit.h:39
MTDTimeCalib::getTimeCalib
float getTimeCalib(const MTDDetId &id) const
Definition: MTDTimeCalib.cc:19
FTLUncalibratedRecHit::positionError
float positionError() const
Definition: FTLUncalibratedRecHit.h:42
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
MTDRecHitAlgo::thresholdToKeep_
double thresholdToKeep_
Definition: MTDRecHitAlgo.cc:22
FTLUncalibratedRecHit::id
DetId id() const
Definition: FTLUncalibratedRecHit.h:46
MTDRecHitAlgoBase::MTDRecHitAlgoBase
MTDRecHitAlgoBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Constructor.
Definition: MTDRecHitAlgoBase.h:24
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
FTLUncalibratedRecHit::column
int column() const
Definition: FTLUncalibratedRecHit.h:48
FTLRecHit::kGood
Definition: FTLRecHit.h:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
FTLUncalibratedRecHit::flags
unsigned char flags() const
Definition: FTLUncalibratedRecHit.h:44
FTLUncalibratedRecHit::amplitude
std::pair< float, float > amplitude() const
Definition: FTLUncalibratedRecHit.h:37
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13168
FTLRecHit::kKilled
Definition: FTLRecHit.h:22
FTLUncalibratedRecHit::timeError
float timeError() const
Definition: FTLUncalibratedRecHit.h:41
FTLUncalibratedRecHit::time
std::pair< float, float > time() const
Definition: FTLUncalibratedRecHit.h:38