CMS 3D CMS Logo

EcalUncalibRecHitMaxSampleAlgo.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitMaxSampleAlgo_HH
2 #define RecoLocalCalo_EcalRecAlgos_EcalUncalibRecHitMaxSampleAlgo_HH
3 
13 
14 template <class C>
16 public:
18  EcalUncalibratedRecHit makeRecHit(const C& dataFrame,
19  const double* pedestals,
20  const double* gainRatios,
22  const EcalWeightSet::EcalChi2WeightMatrix** chi2Matrix) override;
23 
24 private:
26  double chi2_;
27 };
28 
30 template <class C>
32  const C& dataFrame,
33  const double* pedestals,
34  const double* gainRatios,
36  const EcalWeightSet::EcalChi2WeightMatrix** chi2Matrix) {
37  amplitude_ = std::numeric_limits<int16_t>::min();
38  pedestal_ = 4095;
39  jitter_ = -1;
40  chi2_ = -1;
41  //bool isSaturated = 0;
42  uint32_t flags = 0;
43  for (int16_t iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
44  gainId_ = dataFrame.sample(iSample).gainId();
45 
46  if (gainId_ == 0) {
48  }
49 
50  // ampli gain 12
51  if (gainId_ == 1) {
52  sampleAdc_ = dataFrame.sample(iSample).adc();
53  }
54 
55  else {
56  if (gainId_ == 2) { // ampli gain 6
57  sampleAdc_ = 200 + (dataFrame.sample(iSample).adc() - 200) * 2;
58  } else { // accounts for gainId_==3 or 0 - ampli gain 1 and gain0
59  sampleAdc_ = 200 + (dataFrame.sample(iSample).adc() - 200) * 12;
60  }
61  }
62 
63  if (sampleAdc_ > amplitude_) {
64  amplitude_ = sampleAdc_;
65  jitter_ = iSample;
66  } // if statement
67 
68  if (sampleAdc_ < pedestal_)
69  pedestal_ = sampleAdc_;
70 
71  } // loop on samples
72 
73  return EcalUncalibratedRecHit(dataFrame.id(),
74  static_cast<double>(amplitude_ - pedestal_),
75  static_cast<double>(pedestal_),
76  static_cast<double>(jitter_ - 5),
77  chi2_,
78  flags);
79 }
80 
81 #endif
MessageLogger.h
EcalUncalibRecHitMaxSampleAlgo::jitter_
int16_t jitter_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:25
min
T min(T a, T b)
Definition: MathUtil.h:58
EcalUncalibRecHitMaxSampleAlgo::amplitude_
int16_t amplitude_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:25
EcalWeightSet::EcalWeightMatrix
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition: EcalWeightSet.h:19
EcalUncalibRecHitRecAbsAlgo
Definition: EcalUncalibRecHitRecAbsAlgo.h:18
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99166
EcalWeightSet::EcalChi2WeightMatrix
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
Definition: EcalWeightSet.h:20
EcalUncalibRecHitRecAbsAlgo.h
EcalUncalibRecHitMaxSampleAlgo::gainId_
int16_t gainId_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibratedRecHit
Definition: EcalUncalibratedRecHit.h:8
EcalUncalibRecHitMaxSampleAlgo::chi2_
double chi2_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:26
EcalUncalibRecHitMaxSampleAlgo::makeRecHit
EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix) override
compute rechits
Definition: EcalUncalibRecHitMaxSampleAlgo.h:31
gen::C
C
Definition: PomwigHadronizer.cc:78
EcalUncalibratedRecHit::kSaturated
Definition: EcalUncalibratedRecHit.h:15
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13150
EcalUncalibRecHitMaxSampleAlgo::pedestal_
int16_t pedestal_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibRecHitMaxSampleAlgo::sampleAdc_
int16_t sampleAdc_
Definition: EcalUncalibRecHitMaxSampleAlgo.h:25
EcalUncalibRecHitMaxSampleAlgo
Definition: EcalUncalibRecHitMaxSampleAlgo.h:15