TQPlots.cxx
Go to the documentation of this file.
2 #include <iostream>
3 #include "TH1F.h"
4 #include "TH2F.h"
9 
12 
13 using namespace om;
14 class RawEventSummary;
15 class DataBlockSummary;
16 class MicroSliceSummary;
17 
18 //static const double kUSEC_PER_TDC = (1.0E6/64.0E6);
19 
22 {
23  for(unsigned int i = 0; i < TQDCM_size; ++i) {
24  for(unsigned int j = 0; j < TQDCM_size; ++j) {
25  fTQDCM[i][j] = 0;
26  fTQDCMnumi[i][j] = 0;
27  } // end for j
28  } // end for i
29 
30  // create the initial histos
32  fTPlotALL = h.GetTH1F("TPlotALL");
33  fTPlotZOOM = h.GetTH1F("TPlotZOOM");
34  fQPlotALL = h.GetTH1F("QPlotALL");
35  fTimingALLvsHour = h.GetTH2F("TimingALLvsHour");
36  fTimingZOOMvsHour = h.GetTH2F("TimingZOOMvsHour");
37 }
38 
39 //......................................................................
40 
42 
43 //......................................................................
44 
46  const DataBlockSummary& dbs,
47  const MicroSliceSummary& mss,
48  const NanoSliceSummary& nss)
49 {
51 
52  // NOTE: nss.fUsec and nss.fT0lo32Usec are both calcuated with only the
53  // lower 32 bits of the time (in NOvA time units.) This means that every
54  // now and then, nss.fT0lo32Usec will "roll over" back to zero before
55  // nss.fUsec does resulting in a difference between the two numbers of
56  // about 67 sec. Since this is rare and we are interested in
57  // the overall performance of a specific DCM, this exception is ignored
58  // in favor of not adding extra if statements.
59 
60  //
61  // fill TQDCM plots for all triggers
62  //
63  if(fTQDCM[mss.fDiblock][mss.fDCM] == 0) {
64  char histoname[64];
65  sprintf(histoname, "TQDCM_%.2u_%.2u", mss.fDiblock, mss.fDCM);
66  fTQDCM[mss.fDiblock][mss.fDCM] = h.GetTH2F(histoname);
67  }
68  fTQDCM[mss.fDiblock][mss.fDCM]->Fill(nss.fUsec-r.fT0lo32Usec, nss.fADC);
69 
70  fTPlotALL->Fill(nss.fUsec-r.fT0lo32Usec);
71 
72  // Only fill the Zoom plot if the trigger is NuMI.
73  if(r.fTrigger == 0) fTPlotZOOM->Fill(nss.fUsec-r.fT0lo32Usec);
74 
75  fQPlotALL->Fill(nss.fADC);
76 
77  //
78  // if detector is NearDet, fill TQDCM plots for just NuMI triggers
79  //
80  if(Settings::Instance().fDet == kNEARDET &&
81  fTQDCMnumi[mss.fDiblock][mss.fDCM] == 0 &&
82  r.fTrigger == 0) {
83  char histoname[64];
84  sprintf(histoname, "TQDCM_%.2u_%.2u_NuMI", mss.fDiblock, mss.fDCM);
85  fTQDCMnumi[mss.fDiblock][mss.fDCM] = h.GetTH2F(histoname);
86  }
87  if(Settings::Instance().fDet == kNEARDET &&
88  r.fTrigger == 0) {
89  fTQDCMnumi[mss.fDiblock][mss.fDCM]->Fill(nss.fUsec-r.fT0lo32Usec, nss.fADC);
90  }
91 
92  //
93  // Fill Timing vs Hour plots
94  //
95  fTimingALLvsHour->Fill(r.fHour, nss.fUsec-r.fT0lo32Usec);
96  if (r.fTrigger == 0) fTimingZOOMvsHour->Fill(r.fHour, nss.fUsec-r.fT0lo32Usec);
97  if (r.fHour >= 23.0) {
98  fTimingALLvsHour->Fill(r.fHour - 24.0, nss.fUsec-r.fT0lo32Usec);
99  if (r.fTrigger == 0) fTimingZOOMvsHour->Fill(r.fHour - 24.0, nss.fUsec-r.fT0lo32Usec);
100  }
101 
102 }
103 
104 ////////////////////////////////////////////////////////////////////////
unsigned int fDCM
DCM ID.
TH1F * fQPlotALL
Definition: TQPlots.h:31
unsigned int fDiblock
Diblock ID.
TH2F * fTimingZOOMvsHour
Definition: TQPlots.h:33
TH1F * GetTH1F(const char *nm)
Definition: HistoSet.cxx:68
All the interesting event-level data.
double fUsec
Time of hit relative to start of micro slice.
TH1F * fTPlotALL
Definition: TQPlots.h:29
TH2F * GetTH2F(const char *nm)
Definition: HistoSet.cxx:89
float fHour
A fractional hour of the day.
const double j
Definition: BetheBloch.cxx:29
virtual void GetNanoSliceSummary(const RawEventSummary &r, const DataBlockSummary &dbs, const MicroSliceSummary &mss, const NanoSliceSummary &nss)
Interface to the nanoslice summary.
Definition: TQPlots.cxx:45
A simple object that conatins all the global settings.
TH2F * fTQDCMnumi[TQDCM_size][TQDCM_size]
Definition: TQPlots.h:28
static const unsigned int TQDCM_size
Definition: TQPlots.h:8
TH2F * fTQDCM[TQDCM_size][TQDCM_size]
Definition: TQPlots.h:27
unsigned int fADC
Charge of hit in TDC units.
unsigned int fTrigger
Trigger type.
TH2F * fTimingALLvsHour
Definition: TQPlots.h:32
TRandom3 r(0)
double fT0lo32Usec
Just the lower 32 bits of T0 converted to Usec.
static HistoSet & Instance()
Definition: HistoSet.cxx:24
Hold the collection of histograms created by the producer.
All the interesting event-level data.
static Settings & Instance()
Definition: Settings.cxx:12
Online Monitoring package header.
All the interesting event-level data.
TH1F * fTPlotZOOM
Definition: TQPlots.h:30