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_
 
double thresholdToKeep_
 
const MTDTimeCalibtime_calib_
 

Detailed Description

Definition at line 6 of file MTDRecHitAlgo.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 9 of file MTDRecHitAlgo.cc.

10  : MTDRecHitAlgoBase(conf, sumes),
11  thresholdToKeep_(conf.getParameter<double>("thresholdToKeep")),
12  calibration_(conf.getParameter<double>("calibrationConstant")) {}
T getParameter(std::string const &) const
double thresholdToKeep_
double calibration_
MTDRecHitAlgoBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Constructor.
MTDRecHitAlgo::~MTDRecHitAlgo ( )
inlineoverride

Destructor.

Definition at line 15 of file MTDRecHitAlgo.cc.

15 {}

Member Function Documentation

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

get event and eventsetup information

Implements MTDRecHitAlgoBase.

Definition at line 18 of file MTDRecHitAlgo.cc.

References HLT_2018_cff::flags, getEventSetup(), and makeRecHit().

18 {}
void MTDRecHitAlgo::getEventSetup ( const edm::EventSetup es)
finalvirtual

Implements MTDRecHitAlgoBase.

Definition at line 29 of file MTDRecHitAlgo.cc.

References edm::EventSetup::get(), edm::ESHandle< T >::product(), and time_calib_.

Referenced by getEvent().

29  {
31  es.get<MTDTimeCalibRecord>().get("MTDTimeCalib", pTC);
32  time_calib_ = pTC.product();
33 }
T get() const
Definition: EventSetup.h:73
const MTDTimeCalib * time_calib_
T const * product() const
Definition: ESHandle.h:86
FTLRecHit MTDRecHitAlgo::makeRecHit ( const FTLUncalibratedRecHit uRecHit,
uint32_t &  flags 
) const
finalvirtual

make the rec hit

Implements MTDRecHitAlgoBase.

Definition at line 35 of file MTDRecHitAlgo.cc.

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

Referenced by getEvent().

35  {
36  unsigned char flagsWord = uRecHit.flags();
37  float timeError = uRecHit.timeError();
38 
39  float energy = 0.;
40  float time = 0.;
41 
42  switch (flagsWord) {
43  // BTL bar geometry with only the right SiPM information available
44  case 0x2: {
45  energy = uRecHit.amplitude().second;
46  time = uRecHit.time().second;
47 
48  break;
49  }
50  // BTL bar geometry with left and right SiPMs information available
51  case 0x3: {
52  energy = 0.5 * (uRecHit.amplitude().first + uRecHit.amplitude().second);
53  time = 0.5 * (uRecHit.time().first + uRecHit.time().second);
54 
55  break;
56  }
57  // ETL, BTL tile geometry, BTL bar geometry with only the left SiPM information available
58  default: {
59  energy = uRecHit.amplitude().first;
60  time = uRecHit.time().first;
61 
62  break;
63  }
64  }
65 
66  // --- Energy calibration: for the time being this is just a conversion pC --> MeV
67  energy *= calibration_;
68 
69  // --- Time calibration: for the time being just removes a time offset in BTL
70  time += time_calib_->getTimeCalib(uRecHit.id());
71 
72  FTLRecHit rh(uRecHit.id(), uRecHit.row(), uRecHit.column(), energy, time, timeError);
73 
74  // Now fill flags
75  // all rechits from the digitizer are "good" at present
76  if (energy > thresholdToKeep_) {
78  rh.setFlag(flags);
79  } else {
81  rh.setFlag(flags);
82  }
83 
84  return rh;
85 }
std::pair< float, float > time() const
std::pair< float, float > amplitude() const
double thresholdToKeep_
double calibration_
float getTimeCalib(const MTDDetId &id) const
Definition: MTDTimeCalib.cc:19
const MTDTimeCalib * time_calib_
unsigned char flags() const

Member Data Documentation

double MTDRecHitAlgo::calibration_
private

Definition at line 25 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

double MTDRecHitAlgo::thresholdToKeep_
private

Definition at line 25 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

const MTDTimeCalib* MTDRecHitAlgo::time_calib_
private

Definition at line 26 of file MTDRecHitAlgo.cc.

Referenced by getEventSetup(), and makeRecHit().