CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetDiagTimingMonitor.h
Go to the documentation of this file.
1 #ifndef DQM_HCALMONITORTASKS_HCALDETDIAGTIMINGMONITOR_H
2 #define DQM_HCALMONITORTASKS_HCALDETDIAGTIMINGMONITOR_H
3 
4 // user include files
9 
13 
16 
17 
26 public:
29 
30  double GetTime(double *data,int n){
31  int MaxI=-100; double Time=0,SumT=0,MaxT=-10;
32  for(int j=0;j<n;++j) if(MaxT<data[j]){ MaxT=data[j]; MaxI=j; }
33  if(MaxI>=0){
34  Time=MaxI*data[MaxI];
35  SumT=data[MaxI];
36  if(MaxI>0){ Time+=(MaxI-1)*data[MaxI-1]; SumT+=data[MaxI-1]; }
37  if(MaxI<(n-1)){ Time+=(MaxI+1)*data[MaxI+1]; SumT+=data[MaxI+1]; }
38  Time=Time/SumT;
39  }
40  return Time;
41  }
42  bool isSignal(double *data,int n){
43  int Imax=-1; double max=-100;
44  for(int i=0;i<n;i++) if(data[i]>max){max=data[i]; Imax=i;}
45  if(Imax==0 && Imax==(n-1)) return false;
46  float sum=data[Imax-1]+data[Imax+1];
47  if(data[Imax]>5.5 && sum>(data[Imax]*0.25)) return true;
48  return false;
49  }
52  void set_hbhe(int eta,int phi,int depth,int cap,float val){
53  HBHE[eta+50][phi][depth][cap]+=val;
54  nHBHE[eta+50][phi][depth][cap]+=1.0;
55  }
56  void set_ho(int eta,int phi,int depth,int cap,float val){
57  HO[eta+50][phi][depth][cap]+=val;
58  nHO[eta+50][phi][depth][cap]+=1.0;
59  }
60  void set_hf(int eta,int phi,int depth,int cap,float val){
61  HF[eta+50][phi][depth][cap]+=val;
62  nHF[eta+50][phi][depth][cap]+=1.0;
63  }
64  double get_ped_hbhe(int eta,int phi,int depth,int cup){
65  if(nHBHE[eta+50][phi][depth][cup]<10) return 2.5;
66  if(nHBHE[eta+50][phi][depth][cup]!=0){
67  double ped=HBHE[eta+50][phi][depth][cup]/nHBHE[eta+50][phi][depth][cup];
68  if(ped>1.5 && ped<4.5) return ped;
69  }
70  return 9999;
71  }
72  double get_ped_ho(int eta,int phi,int depth,int cup){
73  if(nHO[eta+50][phi][depth][cup]<10) return 2.5;
74  if(nHO[eta+50][phi][depth][cup]!=0){
75  double ped=HO[eta+50][phi][depth][cup]/nHO[eta+50][phi][depth][cup];
76  if(ped>1.5 && ped<4.5) return ped;
77  }
78  return 9999;
79  }
80  double get_ped_hf(int eta,int phi,int depth,int cup){
81  if(nHF[eta+50][phi][depth][cup]<10) return 2.5;
82  if(nHF[eta+50][phi][depth][cup]!=0){
83  double ped=HF[eta+50][phi][depth][cup]/nHF[eta+50][phi][depth][cup];
84  if(ped>1.5 && ped<4.5) return ped;
85  }
86  return 9999;
87  }
88  double HBHE[100][73][5][4];
89  double nHBHE[100][73][5][4];
90  double HO[100][73][5][4];
91  double nHO[100][73][5][4];
92  double HF[100][73][5][4];
93  double nHF[100][73][5][4];
96 // noise/crazy channels masking
97  double occHBHE[100][73][5];
98  double occHO [100][73][5];
99  double occHF [100][73][5];
100  double occSum;
103  void setup();
104  void beginRun(const edm::Run& run, const edm::EventSetup& c);
105  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup);
106  void done();
107  void reset();
108  void cleanup();
109 
110 private:
114 
121 
137 
138  void CheckTiming();
139 };
140 
141 #endif
int i
Definition: DBlmapReader.cc:9
void set_hf(int eta, int phi, int depth, int cap, float val)
T eta() const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
int iEvent
Definition: GenABIO.cc:243
const T & max(const T &a, const T &b)
bool isSignal(double *data, int n)
double get_ped_ho(int eta, int phi, int depth, int cup)
int j
Definition: DBlmapReader.cc:9
void set_ho(int eta, int phi, int depth, int cap, float val)
HcalDetDiagTimingMonitor(const edm::ParameterSet &ps)
double get_ped_hbhe(int eta, int phi, int depth, int cup)
double get_ped_hf(int eta, int phi, int depth, int cup)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void beginRun(const edm::Run &run, const edm::EventSetup &c)
void set_hbhe(int eta, int phi, int depth, int cap, float val)
double GetTime(double *data, int n)
Definition: Run.h:33
Definition: DDAxes.h:10