Public Types | Public Member Functions | Private Attributes | List of all members
om::TriggerPlots Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/OnlineMonitoring/producer/TriggerPlots.h"

Inheritance diagram for om::TriggerPlots:
om::SummarySubscriber

Public Types

enum  _which { kEvent = 0x01, kDataBlock = 0x02, kMicroSlice = 0x04, kNanoSlice = 0x08 }
 Which summaries does a class want to subscribe to? More...
 

Public Member Functions

 TriggerPlots ()
 
 ~TriggerPlots ()
 
virtual void GetRawEventSummary (const RawEventSummary &r)
 Interface to the event summary. More...
 
virtual void GetDataBlockSummary (const RawEventSummary &res, const DataBlockSummary &dbs)
 Interface to the data block summary. More...
 
virtual void GetMicroSliceSummary (const RawEventSummary &res, const DataBlockSummary &dbs, const MicroSliceSummary &mss)
 Interface to the microslice summary. More...
 
virtual void GetNanoSliceSummary (const RawEventSummary &res, const DataBlockSummary &dbs, const MicroSliceSummary &mss, const NanoSliceSummary &nss)
 Interface to the nanoslice summary. More...
 

Private Attributes

TH1F * fDtNuMITrig
 
TH1F * fDtBNBTrig
 
TH1F * fDtCalibTrig
 
TH1F * fDtAccelTrig
 
TH1F * fDtAccelClkCoincidence
 
TH1F * fDeltaMasterTrigger
 
TH1F * fEventsTimeContinuous
 
TH1F * fIncompleteEvents
 
TH2F * fTriggerVsHour
 
TH2F * fTriggerVsHourGeneral
 
TH2F * fTriggerUsecResidualVsHour
 
TH1F * fEvtMinusPrevEvt
 
TH1F * fDeltaTSNEWSTrigger
 
unsigned long int fT0prevNuMI
 
unsigned long int fT0prevBNB
 
unsigned long int fT0prevCalib
 
unsigned long int fT0prevAccel
 
unsigned long int fRunPrev
 
unsigned long int fEventPrev
 
unsigned int fMasterTriggerPrev
 
RawEventListfTrigEvt
 

Detailed Description

Definition at line 11 of file TriggerPlots.h.

Member Enumeration Documentation

Which summaries does a class want to subscribe to?

Enumerator
kEvent 
kDataBlock 
kMicroSlice 
kNanoSlice 

Definition at line 20 of file SummarySubscriber.h.

Constructor & Destructor Documentation

TriggerPlots::TriggerPlots ( )

Definition at line 22 of file TriggerPlots.cxx.

References fDeltaMasterTrigger, fDeltaTSNEWSTrigger, fDtAccelClkCoincidence, fDtAccelTrig, fDtBNBTrig, fDtCalibTrig, fDtNuMITrig, fEventPrev, fEventsTimeContinuous, fEvtMinusPrevEvt, fIncompleteEvents, fMasterTriggerPrev, fRunPrev, fT0prevAccel, fT0prevBNB, fT0prevCalib, fT0prevNuMI, fTrigEvt, fTriggerUsecResidualVsHour, fTriggerVsHour, fTriggerVsHourGeneral, om::HistoSet::GetTH1F(), om::HistoSet::GetTH2F(), make_syst_table_plots::h, om::Settings::Instance(), om::HistoSet::Instance(), om::kFARDET, om::kNDOS, om::kNEARDET, om::kTESTBEAM, MI_SHIFT, TIME_OF_FLIGHT, and TRIG_DELAY.

22  :
24 {
26 
27  if(Settings::Instance().fDet == kNDOS) {
28  fDtBNBTrig = h.GetTH1F("DtBNBTrig");
29  fDtNuMITrig = h.GetTH1F("DtNuMITrig");
30  fDtCalibTrig = h.GetTH1F("DtCalibTrig");
31  fDtAccelTrig = h.GetTH1F("DtAccelTrig");
32  fDtAccelClkCoincidence = h.GetTH1F("DtAccelClkCoincidence");
33  fTriggerVsHour = h.GetTH2F("TriggerVsHour");
34  fTriggerVsHourGeneral = h.GetTH2F("TriggerVsHourGeneral");
35  fTriggerUsecResidualVsHour = h.GetTH2F("TriggerUsecResidualVsHour");
36  TRIG_DELAY = 0;
37  }
38  if(Settings::Instance().fDet == kNEARDET) {
39  fDtBNBTrig = h.GetTH1F("DtBNBTrig");
40  fDtNuMITrig = h.GetTH1F("DtNuMITrig");
41  fDtCalibTrig = h.GetTH1F("DtCalibTrig");
42  fDtAccelTrig = h.GetTH1F("DtAccelTrig");
43  fDtAccelClkCoincidence = h.GetTH1F("DtAccelClkCoincidence");
44  fTriggerVsHour = h.GetTH2F("TriggerVsHour");
45  fTriggerVsHourGeneral = h.GetTH2F("TriggerVsHourGeneral");
46  fTriggerUsecResidualVsHour = h.GetTH2F("TriggerUsecResidualVsHour");
47  TRIG_DELAY = 0;
48  }
49  if(Settings::Instance().fDet == kFARDET) {
50  fDtNuMITrig = h.GetTH1F("DtNuMITrig");
51  fDtCalibTrig = h.GetTH1F("DtCalibTrig");
52  fDtAccelTrig = h.GetTH1F("DtAccelTrig");
53  fDtAccelClkCoincidence = h.GetTH1F("DtAccelClkCoincidence");
54  fTriggerVsHour = h.GetTH2F("TriggerVsHour");
55  fTriggerVsHourGeneral = h.GetTH2F("TriggerVsHourGeneral");
56  fTriggerUsecResidualVsHour = h.GetTH2F("TriggerUsecResidualVsHour");
58  }
59  if(Settings::Instance().fDet == kTESTBEAM) {
60  fDtBNBTrig = h.GetTH1F("DtBNBTrig");
61  fDtCalibTrig = h.GetTH1F("DtCalibTrig");
62  fDtAccelTrig = h.GetTH1F("DtAccelTrig");
63  fDtAccelClkCoincidence = h.GetTH1F("DtAccelClkCoincidence");
64  fTriggerVsHour = h.GetTH2F("TriggerVsHour");
65  fTriggerVsHourGeneral = h.GetTH2F("TriggerVsHourGeneral");
66  fTriggerUsecResidualVsHour = h.GetTH2F("TriggerUsecResidualVsHour");
67  TRIG_DELAY = 0;
68  }
69 
70  fDeltaMasterTrigger = h.GetTH1F("DeltaMasterTrigger");
71  fEventsTimeContinuous = h.GetTH1F("EventsTimeContinuous");
72  fEvtMinusPrevEvt = h.GetTH1F("EvtMinusPrevEvt");
73  fIncompleteEvents = h.GetTH1F("IncompleteEvents");
74  fDeltaTSNEWSTrigger = h.GetTH1F("DeltaTSNEWSTrigger");
75 
76  fT0prevNuMI = 0;
77  fT0prevBNB = 0;
78  fT0prevCalib = 0;
79  fT0prevAccel = 0;
80 
81  fRunPrev = 0;
82  fEventPrev = 0;
84 
85  fTrigEvt = new RawEventList();
86 }
static const double MI_SHIFT
unsigned int fMasterTriggerPrev
Definition: TriggerPlots.h:38
TH1F * fEventsTimeContinuous
Definition: TriggerPlots.h:23
TH1F * fDeltaTSNEWSTrigger
Definition: TriggerPlots.h:29
TH1F * fIncompleteEvents
Definition: TriggerPlots.h:24
TH1F * GetTH1F(const char *nm)
Definition: HistoSet.cxx:68
double TRIG_DELAY
unsigned long int fEventPrev
Definition: TriggerPlots.h:37
unsigned long int fT0prevBNB
Definition: TriggerPlots.h:32
unsigned long int fT0prevAccel
Definition: TriggerPlots.h:34
TH2F * fTriggerUsecResidualVsHour
Definition: TriggerPlots.h:27
unsigned long int fT0prevNuMI
Definition: TriggerPlots.h:31
TH2F * fTriggerVsHour
Definition: TriggerPlots.h:25
TH2F * GetTH2F(const char *nm)
Definition: HistoSet.cxx:89
TH1F * fEvtMinusPrevEvt
Definition: TriggerPlots.h:28
static const double TIME_OF_FLIGHT
RawEventList * fTrigEvt
Definition: TriggerPlots.h:40
TH2F * fTriggerVsHourGeneral
Definition: TriggerPlots.h:26
unsigned long int fRunPrev
Definition: TriggerPlots.h:36
unsigned long int fT0prevCalib
Definition: TriggerPlots.h:33
TH1F * fDtAccelClkCoincidence
Definition: TriggerPlots.h:21
static HistoSet & Instance()
Definition: HistoSet.cxx:24
static Settings & Instance()
Definition: Settings.cxx:12
TH1F * fDeltaMasterTrigger
Definition: TriggerPlots.h:22
TriggerPlots::~TriggerPlots ( )

Definition at line 90 of file TriggerPlots.cxx.

90 { }

Member Function Documentation

virtual void om::SummarySubscriber::GetDataBlockSummary ( const RawEventSummary res,
const DataBlockSummary dbs 
)
inlinevirtualinherited

Interface to the data block summary.

Reimplemented in om::DataBlockErrors.

Definition at line 35 of file SummarySubscriber.h.

36  { abort(); }
virtual void om::SummarySubscriber::GetMicroSliceSummary ( const RawEventSummary res,
const DataBlockSummary dbs,
const MicroSliceSummary mss 
)
inlinevirtualinherited

Interface to the microslice summary.

Reimplemented in om::MicroErrors.

Definition at line 39 of file SummarySubscriber.h.

41  { abort(); }
virtual void om::SummarySubscriber::GetNanoSliceSummary ( const RawEventSummary res,
const DataBlockSummary dbs,
const MicroSliceSummary mss,
const NanoSliceSummary nss 
)
inlinevirtualinherited

Interface to the nanoslice summary.

Reimplemented in om::FEBRatesByDiblock, om::HitMaps, om::NanoErrors, om::TQPlots, and om::WLPlots.

Definition at line 44 of file SummarySubscriber.h.

47  { abort(); }
void TriggerPlots::GetRawEventSummary ( const RawEventSummary res)
virtual

Interface to the event summary.

Reimplemented from om::SummarySubscriber.

Definition at line 94 of file TriggerPlots.cxx.

References om::RawEventList::AddEventToRawEventList(), fDeltaMasterTrigger, fDeltaTSNEWSTrigger, om::Settings::fDet, fDtAccelClkCoincidence, fDtAccelTrig, fDtBNBTrig, fDtCalibTrig, fDtNuMITrig, om::RawEventSummary::fEvent, om::RawEventSummary::fEventIncomplete, fEventPrev, fEventsTimeContinuous, fEvtMinusPrevEvt, om::RawEventSummary::fHour, fIncompleteEvents, om::RawEventSummary::fMasterTrigger, fMasterTriggerPrev, om::RawEventSummary::fRun, fRunPrev, om::RawEventSummary::fT0, fT0prevAccel, fT0prevBNB, fT0prevCalib, fT0prevNuMI, fTrigEvt, om::RawEventSummary::fTrigger, fTriggerUsecResidualVsHour, fTriggerVsHour, fTriggerVsHourGeneral, om::Settings::Instance(), om::RawEventList::IsEventContinuousInTime(), om::kFARDET, kSEC_PER_TDC, TICKS_PER_SEC, TICKS_PER_USEC, om::RawEventList::TimeDiffBetweenEvents(), and TRIG_DELAY.

95 {
96  // NOTE: Since the fT0prev* variables are initialized to zero, the very
97  // first dt will be huge. BUT, this will only happen the very first time
98  // and that dt will go into the overflow bin of the histogram so I felt
99  // it wasn't worth it to add an extra "if(fT0prev* != 0)" statement that
100  // would only be necessary the very first time a trigger appears.
101  if(r.fTrigger == 0) {
102  double dt = (r.fT0 - fT0prevNuMI)*kSEC_PER_TDC;
103  fDtNuMITrig->Fill(dt);
104  fT0prevNuMI = r.fT0;
105  }
106  if(r.fTrigger == 1 && Settings::Instance().fDet != kFARDET) {
107  double dt = (r.fT0 - fT0prevBNB)*kSEC_PER_TDC;
108  fDtBNBTrig->Fill(dt);
109  fT0prevBNB = r.fT0;
110  }
111  if(r.fTrigger == 2) {
112  double dt = (r.fT0 - fT0prevCalib)*kSEC_PER_TDC;
113  fDtCalibTrig->Fill(dt);
114  fT0prevCalib = r.fT0;
115  }
116  if(r.fTrigger == 5) {
117  double dt = (r.fT0 - fT0prevAccel)*kSEC_PER_TDC;
118  fDtAccelTrig->Fill(dt);
119  fT0prevAccel = r.fT0;
120 
121  double residual_usec = (r.fT0%TICKS_PER_SEC);
122  if ( residual_usec > TICKS_PER_SEC/2 ) residual_usec -= TICKS_PER_SEC;
123  residual_usec *= (1.0/TICKS_PER_USEC);
124  residual_usec -= TRIG_DELAY;
125  double RESID_OVERFLOW = fDtAccelClkCoincidence->GetXaxis()->GetXmax();
126  if ( residual_usec > RESID_OVERFLOW ) residual_usec = RESID_OVERFLOW-1;
127  if ( residual_usec < -RESID_OVERFLOW ) residual_usec = -RESID_OVERFLOW+1;
128  fDtAccelClkCoincidence->Fill(residual_usec);
129 
130  fTriggerUsecResidualVsHour->Fill(r.fHour, residual_usec);
131  }
132 
133  // NOTE: Bad trigger numbers will just go into the under/over-flow bins.
134  fTriggerVsHour->Fill(r.fHour, r.fTrigger);
135  fTriggerVsHourGeneral->Fill(r.fHour, r.fTrigger);
136  if(r.fHour >= 23.0) {
137  fTriggerVsHour->Fill(r.fHour - 24.0, r.fTrigger);
138  fTriggerVsHourGeneral->Fill(r.fHour - 24.0, r.fTrigger);
139  }
140 
141  if (r.fRun==fRunPrev) {
142  fEvtMinusPrevEvt->Fill(r.fEvent - fEventPrev);
143  }
144 
145  double deltaMT = -1;
146 
147  if (r.fTrigger == 25){
148  if (fMasterTriggerPrev != 0) {
149  deltaMT = r.fMasterTrigger - fMasterTriggerPrev;
150  fDeltaMasterTrigger->Fill(deltaMT);
151  } else {
152  fDeltaMasterTrigger->Fill(0);
153  }
154 
156 
157  if (deltaMT == 0) {
159  }
160  else {
161  fTrigEvt = new RawEventList();
163  }
164 
166 
167  fMasterTriggerPrev = r.fMasterTrigger;
168  }
169 
170  fIncompleteEvents->Fill(r.fEventIncomplete);
171  fIncompleteEvents->GetXaxis()->SetBinLabel(1, "Complete");
172  fIncompleteEvents->GetXaxis()->SetBinLabel(2, "Incomplete");
173  fIncompleteEvents->SetMinimum(0.1);
174 
175  fEventsTimeContinuous->GetXaxis()->SetBinLabel(1, "False");
176  fEventsTimeContinuous->GetXaxis()->SetBinLabel(2, "True");
177 
178  fRunPrev = r.fRun;
179  fEventPrev = r.fEvent;
180 }
unsigned int fMasterTriggerPrev
Definition: TriggerPlots.h:38
TH1F * fEventsTimeContinuous
Definition: TriggerPlots.h:23
TH1F * fDeltaTSNEWSTrigger
Definition: TriggerPlots.h:29
long int TimeDiffBetweenEvents(const RawEventSummary &evtFirst, const RawEventSummary &evtSecond)
TH1F * fIncompleteEvents
Definition: TriggerPlots.h:24
static const double kSEC_PER_TDC
double TRIG_DELAY
unsigned long int fEventPrev
Definition: TriggerPlots.h:37
unsigned long int fT0prevBNB
Definition: TriggerPlots.h:32
unsigned long int fT0prevAccel
Definition: TriggerPlots.h:34
TH2F * fTriggerUsecResidualVsHour
Definition: TriggerPlots.h:27
unsigned long int fT0prevNuMI
Definition: TriggerPlots.h:31
bool IsEventContinuousInTime(const RawEventSummary &evtFirst, const RawEventSummary &evtSecond)
TH2F * fTriggerVsHour
Definition: TriggerPlots.h:25
Definition: Cand.cxx:23
Detector_t fDet
Definition: Settings.h:18
TH1F * fEvtMinusPrevEvt
Definition: TriggerPlots.h:28
RawEventList * fTrigEvt
Definition: TriggerPlots.h:40
static const double TICKS_PER_USEC
TH2F * fTriggerVsHourGeneral
Definition: TriggerPlots.h:26
unsigned long int fRunPrev
Definition: TriggerPlots.h:36
TRandom3 r(0)
static const unsigned long long TICKS_PER_SEC
unsigned long int fT0prevCalib
Definition: TriggerPlots.h:33
TH1F * fDtAccelClkCoincidence
Definition: TriggerPlots.h:21
static Settings & Instance()
Definition: Settings.cxx:12
TH1F * fDeltaMasterTrigger
Definition: TriggerPlots.h:22
void AddEventToRawEventList(const RawEventSummary &evtsum)

Member Data Documentation

TH1F* om::TriggerPlots::fDeltaMasterTrigger
private

Definition at line 22 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDeltaTSNEWSTrigger
private

Definition at line 29 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDtAccelClkCoincidence
private

Definition at line 21 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDtAccelTrig
private

Definition at line 20 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDtBNBTrig
private

Definition at line 18 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDtCalibTrig
private

Definition at line 19 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fDtNuMITrig
private

Definition at line 17 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fEventPrev
private

Definition at line 37 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fEventsTimeContinuous
private

Definition at line 23 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fEvtMinusPrevEvt
private

Definition at line 28 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH1F* om::TriggerPlots::fIncompleteEvents
private

Definition at line 24 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned int om::TriggerPlots::fMasterTriggerPrev
private

Definition at line 38 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fRunPrev
private

Definition at line 36 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fT0prevAccel
private

Definition at line 34 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fT0prevBNB
private

Definition at line 32 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fT0prevCalib
private

Definition at line 33 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

unsigned long int om::TriggerPlots::fT0prevNuMI
private

Definition at line 31 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

RawEventList* om::TriggerPlots::fTrigEvt
private

Definition at line 40 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH2F* om::TriggerPlots::fTriggerUsecResidualVsHour
private

Definition at line 27 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH2F* om::TriggerPlots::fTriggerVsHour
private

Definition at line 25 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().

TH2F* om::TriggerPlots::fTriggerVsHourGeneral
private

Definition at line 26 of file TriggerPlots.h.

Referenced by GetRawEventSummary(), and TriggerPlots().


The documentation for this class was generated from the following files: