CMS 3D CMS Logo

MTDRecHitAlgo.cc
Go to the documentation of this file.
2 
4  public:
7  edm::ConsumesCollector& sumes ) :
8  MTDRecHitAlgoBase( conf, sumes ),
9  thresholdToKeep_( conf.getParameter<double>("thresholdToKeep") ),
10  calibration_( conf.getParameter<double>("calibrationConstant") ) { }
11 
13  ~MTDRecHitAlgo() override { }
14 
16  void getEvent(const edm::Event&) final {}
17  void getEventSetup(const edm::EventSetup&) final {}
18 
20  FTLRecHit makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32_t& flags ) const final;
21 
22  private:
24 };
25 
26 
27 FTLRecHit
28 MTDRecHitAlgo::makeRecHit(const FTLUncalibratedRecHit& uRecHit, uint32_t& flags) const {
29 
30  float energy = uRecHit.amplitude() * calibration_;
31  float time = uRecHit.time();
32  float timeError = uRecHit.timeError();
33 
34  FTLRecHit rh( uRecHit.id(), energy, time, timeError );
35 
36  // Now fill flags
37  // all rechits from the digitizer are "good" at present
38  if( energy > thresholdToKeep_ ) {
39  flags = FTLRecHit::kGood;
40  rh.setFlag(flags);
41  } else {
42  flags = FTLRecHit::kKilled;
43  rh.setFlag(flags);
44  }
45 
46  return rh;
47 }
48 
49 
void getEvent(const edm::Event &) final
get event and eventsetup information
~MTDRecHitAlgo() override
Destructor.
FTLRecHit makeRecHit(const FTLUncalibratedRecHit &uRecHit, uint32_t &flags) const final
make the rec hit
double thresholdToKeep_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void getEventSetup(const edm::EventSetup &) final
double calibration_
MTDRecHitAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Constructor.
Definition: MTDRecHitAlgo.cc:6
#define DEFINE_EDM_PLUGIN(factory, type, name)