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 
18 public:
21  HBHETimeProfileStatusBitSetter(double R1Min, double R1Max,
22  double R2Min, double R2Max,
23  double FracLeaderMin, double FracLeaderMax,
24  double SlopeMin, double SlopeMax,
25  double OuterMin, double OuterMax, double EnergyThreshold);
26 
27  // Destructor
29 
30  // Methods for setting the status flag values
31  void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, std::vector<HBHEDataFrame>, std::vector<int>);
32 
33 
34 
35 
36  // setter functions
37  void SetExpLimits(double R1Min, double R1Max, double R2Min, double R2Max)
38  { R1Min_ = R1Min; R1Max_ = R1Max; R2Min_ = R2Max; R2Max_ = R2Max; }
39  void SetFracLeaderLimits(double FracLeaderMin, double FracLeaderMax)
40  { FracLeaderMin_ = FracLeaderMin; FracLeaderMax_ = FracLeaderMax;}
41  void SetSlopeLimits(double SlopeMin, double SlopeMax)
42  { SlopeMin_ = SlopeMin; SlopeMax_ = SlopeMax;}
43  void SetOuterLimits(double OuterMin, double OuterMax)
44  { OuterMin_ = OuterMin; OuterMax_ = OuterMax;}
46 
47 private:
48  // variables for cfg files
54  struct compare_digi_energy : public std::binary_function<HBHEDataFrame, HBHEDataFrame, bool> {
55  bool operator()(const HBHEDataFrame& x, const HBHEDataFrame& y) {
56  double TotalX=0, TotalY=0;
57  for(int i=0; i!=x.size(); TotalX += x.sample(i++).nominal_fC());
58  for(int i=0; i!=y.size(); TotalY += y.sample(i++).nominal_fC());
59 
60  return (TotalX>TotalY) ;
61 
62  }
63  };
64 
66  double Total=0;
67  for(int i=0; i!=x.size(); Total += x.sample(i++).nominal_fC());
68  return Total;
69  }
70 
71 
72 };
73 
74 #endif
int i
Definition: DBlmapReader.cc:9
void SetExpLimits(double R1Min, double R1Max, double R2Min, double R2Max)
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, std::vector< HBHEDataFrame >, std::vector< int >)
void SetOuterLimits(double OuterMin, double OuterMax)
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
void SetFracLeaderLimits(double FracLeaderMin, double FracLeaderMax)
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)