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  :
11  MTDRecHitAlgoBase( conf, sumes ),
12  thresholdToKeep_( conf.getParameter<double>("thresholdToKeep") ),
13  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 16 of file MTDRecHitAlgo.cc.

16 { }

Member Function Documentation

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

get event and eventsetup information

Implements MTDRecHitAlgoBase.

Definition at line 19 of file MTDRecHitAlgo.cc.

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

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

Implements MTDRecHitAlgoBase.

Definition at line 30 of file MTDRecHitAlgo.cc.

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

Referenced by getEvent().

31 {
33  es.get<MTDTimeCalibRecord>().get("MTDTimeCalib",pTC);
34  time_calib_ = pTC.product();
35 }
T get() const
Definition: EventSetup.h:71
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 38 of file MTDRecHitAlgo.cc.

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

Referenced by getEvent().

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

Member Data Documentation

double MTDRecHitAlgo::calibration_
private

Definition at line 26 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

double MTDRecHitAlgo::thresholdToKeep_
private

Definition at line 26 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

const MTDTimeCalib* MTDRecHitAlgo::time_calib_
private

Definition at line 27 of file MTDRecHitAlgo.cc.

Referenced by getEventSetup(), and makeRecHit().