CMS 3D CMS Logo

EcalRecHitSimpleAlgo.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_EcalRecAlgos_EcalRecHitSimpleAlgo_HH
2 #define RecoLocalCalo_EcalRecAlgos_EcalRecHitSimpleAlgo_HH
3 
12 #include "TMath.h"
13 #include <iostream>
14 
16 public:
17  // default ctor
19  adcToGeVConstant_ = -1;
20  adcToGeVConstantIsSet_ = false;
21  }
22 
23  void setADCToGeVConstant(const float& value) override {
26  }
27 
28  // destructor
29  ~EcalRecHitSimpleAlgo() override{};
30 
33  const float& intercalibConstant,
34  const float& timeIntercalib = 0,
35  const uint32_t& flags = 0) const override {
37  std::cout << "EcalRecHitSimpleAlgo::makeRecHit: adcToGeVConstant_ not set before calling this method!"
38  << " will use -1 and produce bogus rechits!" << std::endl;
39  }
40 
41  float clockToNsConstant = 25;
42  float energy = uncalibRH.amplitude() * adcToGeVConstant_ * intercalibConstant;
43  float time = uncalibRH.jitter() * clockToNsConstant + timeIntercalib;
44 
45  EcalRecHit rh(uncalibRH.id(), energy, time);
46  rh.setChi2(uncalibRH.chi2());
47  rh.setEnergyError(uncalibRH.amplitudeError() * adcToGeVConstant_ * intercalibConstant);
48  /* rh.setOutOfTimeEnergy( uncalibRH.outOfTimeEnergy() * adcToGeVConstant_ * intercalibConstant ); */
49  /* rh.setOutOfTimeChi2( uncalibRH.outOfTimeChi2() ); */
50  rh.setTimeError(uncalibRH.jitterErrorBits());
51 
52  // Now fill flags
53 
54  bool good = true;
55 
58  good = false;
59  }
61  // leading edge recovery failed - still keep the information
62  // about the saturation and do not flag as dead
63  rh.setFlag(EcalRecHit::kSaturated);
64  good = false;
65  }
66  if (uncalibRH.isSaturated()) {
67  rh.setFlag(EcalRecHit::kSaturated);
68  good = false;
69  }
71  rh.setFlag(EcalRecHit::kOutOfTime);
72  good = false;
73  }
75  rh.setFlag(EcalRecHit::kPoorReco);
76  good = false;
77  }
80  }
83  }
84 
85  if (good)
86  rh.setFlag(EcalRecHit::kGood);
87  return rh;
88  }
89 
90 private:
93 };
94 #endif
bool checkFlag(Flags flag) const
Definition: value.py:1
void setADCToGeVConstant(const float &value) override
make rechits from dataframes
EcalRecHit makeRecHit(const EcalUncalibratedRecHit &uncalibRH, const float &intercalibConstant, const float &timeIntercalib=0, const uint32_t &flags=0) const override
Compute parameters.
void setChi2(float chi2)
Definition: EcalRecHit.h:126