File indexing completed on 2024-04-06 12:25:46
0001 #ifndef HCALHBHETIMESTATUSFROMDIGIS_H
0002 #define HCALHBHETIMESTATUSFROMDIGIS_H 1
0003
0004 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
0005 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0006 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0007
0008
0009
0010
0011
0012
0013
0014
0015 class HBHETimeProfileStatusBitSetter {
0016 public:
0017
0018 HBHETimeProfileStatusBitSetter();
0019 HBHETimeProfileStatusBitSetter(double R1Min,
0020 double R1Max,
0021 double R2Min,
0022 double R2Max,
0023 double FracLeaderMin,
0024 double FracLeaderMax,
0025 double SlopeMin,
0026 double SlopeMax,
0027 double OuterMin,
0028 double OuterMax,
0029 double EnergyThreshold);
0030
0031
0032 ~HBHETimeProfileStatusBitSetter();
0033
0034
0035 void hbheSetTimeFlagsFromDigi(HBHERecHitCollection*, const std::vector<HBHEDataFrame>&, const std::vector<int>&);
0036
0037
0038 void SetExpLimits(double R1Min, double R1Max, double R2Min, double R2Max) {
0039 R1Min_ = R1Min;
0040 R1Max_ = R1Max;
0041 R2Min_ = R2Max;
0042 R2Max_ = R2Max;
0043 }
0044 void SetFracLeaderLimits(double FracLeaderMin, double FracLeaderMax) {
0045 FracLeaderMin_ = FracLeaderMin;
0046 FracLeaderMax_ = FracLeaderMax;
0047 }
0048 void SetSlopeLimits(double SlopeMin, double SlopeMax) {
0049 SlopeMin_ = SlopeMin;
0050 SlopeMax_ = SlopeMax;
0051 }
0052 void SetOuterLimits(double OuterMin, double OuterMax) {
0053 OuterMin_ = OuterMin;
0054 OuterMax_ = OuterMax;
0055 }
0056 double EnergyThreshold() { return EnergyThreshold_; }
0057
0058 private:
0059
0060 double R1Min_, R1Max_, R2Min_, R2Max_;
0061 double FracLeaderMin_, FracLeaderMax_;
0062 double SlopeMin_, SlopeMax_;
0063 double OuterMin_, OuterMax_;
0064 double EnergyThreshold_;
0065
0066 double TotalEnergyInDataFrame(const HBHEDataFrame& x) {
0067 double Total = 0;
0068 for (int i = 0; i != x.size(); Total += x.sample(i++).nominal_fC())
0069 ;
0070 return Total;
0071 }
0072 };
0073
0074 #endif