test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HBHETimeProfileStatusBitSetter.h
Go to the documentation of this file.
1 #ifndef HCALHBHETIMESTATUSFROMDIGIS_H
2 #define HCALHBHETIMESTATUSFROMDIGIS_H 1
3 
7 
16 public:
19  HBHETimeProfileStatusBitSetter(double R1Min, double R1Max,
20  double R2Min, double R2Max,
21  double FracLeaderMin, double FracLeaderMax,
22  double SlopeMin, double SlopeMax,
23  double OuterMin, double OuterMax, double EnergyThreshold);
24 
25  // Destructor
27 
28  // Methods for setting the status flag values
29  void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector<HBHEDataFrame>&, const std::vector<int>&);
30 
31 
32 
33 
34  // setter functions
35  void SetExpLimits(double R1Min, double R1Max, double R2Min, double R2Max)
36  { R1Min_ = R1Min; R1Max_ = R1Max; R2Min_ = R2Max; R2Max_ = R2Max; }
37  void SetFracLeaderLimits(double FracLeaderMin, double FracLeaderMax)
38  { FracLeaderMin_ = FracLeaderMin; FracLeaderMax_ = FracLeaderMax;}
39  void SetSlopeLimits(double SlopeMin, double SlopeMax)
40  { SlopeMin_ = SlopeMin; SlopeMax_ = SlopeMax;}
41  void SetOuterLimits(double OuterMin, double OuterMax)
42  { OuterMin_ = OuterMin; OuterMax_ = OuterMax;}
44 
45 private:
46  // variables for cfg files
52  struct compare_digi_energy : public std::binary_function<HBHEDataFrame, HBHEDataFrame, bool> {
53  bool operator()(const HBHEDataFrame& x, const HBHEDataFrame& y) {
54  double TotalX=0, TotalY=0;
55  for(int i=0; i!=x.size(); TotalX += x.sample(i++).nominal_fC());
56  for(int i=0; i!=y.size(); TotalY += y.sample(i++).nominal_fC());
57 
58  return (TotalX>TotalY) ;
59 
60  }
61  };
62 
64  double Total=0;
65  for(int i=0; i!=x.size(); Total += x.sample(i++).nominal_fC());
66  return Total;
67  }
68 
69 
70 };
71 
72 #endif
int i
Definition: DBlmapReader.cc:9
void SetExpLimits(double R1Min, double R1Max, double R2Min, double R2Max)
void SetOuterLimits(double OuterMin, double OuterMax)
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
double TotalEnergyInDataFrame(const HBHEDataFrame &x)
void SetFracLeaderLimits(double FracLeaderMin, double FracLeaderMax)
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector< HBHEDataFrame > &, const std::vector< int > &)
const HcalQIESample & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:39
double nominal_fC() const
get the nominal FC (no calibrations applied)
void SetSlopeLimits(double SlopeMin, double SlopeMax)
Definition: DDAxes.h:10
bool operator()(const HBHEDataFrame &x, const HBHEDataFrame &y)