HitCounts.cxx
Go to the documentation of this file.
2 #include <iostream>
3 #include "TH1F.h"
4 #include "TH2F.h"
7 using namespace om;
8 
9 //......................................................................
10 
13 {
15 
16  fNhitVsHour = h.GetTH2F("NhitVsHour");
17  fNfebsVsHour = h.GetTH2F("NfebsVsHour");
18  fNdcmsVsHour = h.GetTH2F("NdcmsVsHour");
19  fAveNmicroSlVsHour = h.GetTH2F("AveNmicroSlVsHour");
20  fTotNmicroSlVsHour = h.GetTH2F("TotNmicroSlVsHour");
21 }
22 
23 //......................................................................
24 
26 {
27 
28  fNdcmsVsHour->Fill(r.fHour, r.fDCMs.size());
29  fNfebsVsHour->Fill(r.fHour, r.fFEBs.size());
30  fNhitVsHour-> Fill(r.fHour, r.fNhit);
31  if(r.fDCMs.size() != 0) {
32  unsigned int num = r.fNmicroSl;
33  unsigned int den = r.fDCMs.size();
34  double ratio = (double)num/(double)den;
35  fAveNmicroSlVsHour->Fill(r.fHour, ratio);
36  }
37  else
38  fAveNmicroSlVsHour->Fill(r.fHour, 0);
40 
41  // This filling is done so that when the histogram is displayed, if the
42  // current time is between 0 and 1, one can still see the information from
43  // between 23 and 24 on the "previous day."
44  if(r.fHour >= 23.0) {
45  fNdcmsVsHour->Fill(r.fHour - 24.0, r.fDCMs.size());
46  fNfebsVsHour->Fill(r.fHour - 24.0, r.fFEBs.size());
47  fNhitVsHour-> Fill(r.fHour - 24.0, r.fNhit);
48  if(r.fDCMs.size() != 0) {
49  unsigned int num = r.fNmicroSl;
50  unsigned int den = r.fDCMs.size();
51  double ratio = (double)num/(double)den;
52  fAveNmicroSlVsHour->Fill(r.fHour - 24.0, ratio);
53  }
54  else
55  fAveNmicroSlVsHour->Fill(r.fHour - 24.0, 0);
56  fTotNmicroSlVsHour->Fill(r.fHour - 24.0, r.fNmicroSl);
57  }
58 }
59 
60 ////////////////////////////////////////////////////////////////////////
Float_t den
Definition: plot.C:36
TH1 * ratio(TH1 *h1, TH1 *h2)
std::set< unsigned int > fFEBs
The list of FEBs contributing to the event.
TH2F * fTotNmicroSlVsHour
Definition: HitCounts.h:17
TH2F * fNfebsVsHour
Definition: HitCounts.h:14
unsigned int fNmicroSl
Total number of micro slices.
std::set< unsigned int > fDCMs
The list of DCMs contributing to the event.
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
TH2F * GetTH2F(const char *nm)
Definition: HistoSet.cxx:89
float fHour
A fractional hour of the day.
virtual void GetRawEventSummary(const RawEventSummary &res)
Interface to the event summary.
Definition: HitCounts.cxx:25
TH2F * fNdcmsVsHour
Definition: HitCounts.h:15
TH2F * fNhitVsHour
Definition: HitCounts.h:13
int num
Definition: f2_nu.C:119
TRandom3 r(0)
TH2F * fAveNmicroSlVsHour
Definition: HitCounts.h:16
static HistoSet & Instance()
Definition: HistoSet.cxx:24
unsigned int fNhit
Total number of nanoslices (hits)
Hold the collection of histograms created by the producer.
Online Monitoring package header.
All the interesting event-level data.