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_
 

Detailed Description

Definition at line 3 of file MTDRecHitAlgo.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 6 of file MTDRecHitAlgo.cc.

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

13 { }

Member Function Documentation

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

get event and eventsetup information

Implements MTDRecHitAlgoBase.

Definition at line 16 of file MTDRecHitAlgo.cc.

16 {}
void MTDRecHitAlgo::getEventSetup ( const edm::EventSetup )
inlinefinalvirtual

Implements MTDRecHitAlgoBase.

Definition at line 17 of file MTDRecHitAlgo.cc.

References flags, and makeRecHit().

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

make the rec hit

Implements MTDRecHitAlgoBase.

Definition at line 28 of file MTDRecHitAlgo.cc.

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

Referenced by getEventSetup().

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

Member Data Documentation

double MTDRecHitAlgo::calibration_
private

Definition at line 23 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().

double MTDRecHitAlgo::thresholdToKeep_
private

Definition at line 23 of file MTDRecHitAlgo.cc.

Referenced by makeRecHit().