MicroErrors.cxx
Go to the documentation of this file.
2 #include <iostream>
3 #include "TH2F.h"
4 #include "TH1F.h"
5 #include "DAQChannelMap/HardwareDisplay.h"
11 
12 using namespace om;
13 class RawEventSummary;
14 class DataBlockSummary;
15 
18  fHwMap(new daqchannelmap::HardwareDisplay)
19 {
21 
22  // initalize the arrays of histograms to zero
23  for(unsigned int i = 0; i < DCM_size_micro; ++i) {
24  for(unsigned int j = 0; j < DCM_size_micro; ++j) {
25  fBCperDCM[i][j] = 0;
26  } // end for j
27  } // end for i
28 
29  // create the initial Error Plots
31 
32  fDPEbyDCM = h.GetTH2F("DPEbyDCM");
33  fMCbyDCM = h.GetTH2F("MCbyDCM");
34  fBCbyDCM = h.GetTH2F("BCbyDCM");
35  fAEVsHour = h.GetTH2F("AEVsHour");
36  fAAVsHour = h.GetTH2F("AAVsHour");
37 
38 
39 }
40 
41 //......................................................................
42 
44  if(fHwMap) {delete fHwMap; fHwMap = 0;}
45 }
46 
47 //......................................................................
48 
50  const DataBlockSummary& dbs,
51  const MicroSliceSummary& mss)
52 {
54 
55  //
56  // Get the detector coordinates for this micro slice entry
57  //
58  unsigned int x1, x2, y1, y2;
59  fHwMap->DiblockXY(mss.fDiblock, &x1, &y1);
60  fHwMap->DCMXY(mss.fDCM, &x2, &y2);
61  unsigned int X = x1+x2, Y = y1+y2;
62 
63  float AlertFill = 0.0;
64 
65 
66 
67 
68 
69  //
70  // fill the Data Present histos
71  //
72  // NOTE: Unlike DataPresent reported at the nano level, this is NOT reported as an "error."
73  // It is reported as a "status" so if it is false, then the histo should be filled.
74  if(!mss.fDataPresent) {
75  fDPEbyDCM->Fill(X,Y);
76  fAEVsHour->Fill(r.fHour, 3);
77  if(r.fHour >= 23.0) fAEVsHour->Fill(r.fHour - 24.0, 3);
78  }
79 
80 
81 
82  //
83  // fill the Simulations Flag histos
84  // NOTE: This is an "alert" histo and should only be filled with a status
85  // indicating good (0) or bad (1).
86  // We fill the histo with the OR of the current and previous values
87  // so that once an alert gets set, the histo will continue to display
88  // the set status until the histo is reset.
89  //
90 
91  // record error in detailed all alerts histo
92  fAAVsHour->Fill(r.fHour, 0.0, mss.fMCflag);
93  if(r.fHour >= 23.0) fAAVsHour->Fill(r.fHour - 24.0, 0.0, mss.fMCflag);
94 
95  // fill DCM level histo of MC flag reported by DCM
96  //
97  // NOTE: We add 0.1 to distinguish bins that are empty from bins that have been filled
98  // with zero.
99  if(mss.fMCflag || fMCbyDCM->GetBinContent(fMCbyDCM->FindBin(X,Y)) > 1.0) AlertFill = 1.1;
100  else AlertFill = 0.1;
101  fMCbyDCM->SetBinContent(fMCbyDCM->FindBin(X,Y), AlertFill);
102 
103 
104 
105 
106 
107  //
108  // fill the Byte Count histos
109  //
110 
111  // fill the whole detector histo
112  fBCbyDCM->Fill(X,Y,mss.fByteCount);
113 
114  // fill the DCM specific histos
115  if(fBCperDCM[mss.fDiblock][mss.fDCM] == 0) {
116  // create and name the histogram by Diblock and DCM
117  char histoname[15];
118  sprintf(histoname, "BCperDCM_%.2u_%.2u", mss.fDiblock, mss.fDCM);
119  fBCperDCM[mss.fDiblock][mss.fDCM] = h.GetTH1F(histoname);
120  }
121 
122  fBCperDCM[mss.fDiblock][mss.fDCM]->Fill(mss.fByteCount);
123 
124 }
125 
126 ////////////////////////////////////////////////////////////////////////
unsigned int fDCM
DCM ID.
Float_t y1[n_points_granero]
Definition: compare.C:5
unsigned int fDiblock
Diblock ID.
TH1F * GetTH1F(const char *nm)
Definition: HistoSet.cxx:68
Float_t x1[n_points_granero]
Definition: compare.C:5
TH2F * fAEVsHour
Definition: MicroErrors.h:45
TH1F * fBCperDCM[DCM_size_micro][DCM_size_micro]
Definition: MicroErrors.h:43
virtual void GetMicroSliceSummary(const RawEventSummary &r, const DataBlockSummary &dbs, const MicroSliceSummary &mss)
Interface to the microslice summary.
Definition: MicroErrors.cxx:49
bool fMCflag
Monte Carlo flag.
TH2F * fDPEbyDCM
Definition: MicroErrors.h:38
void DiblockXY(unsigned int db, unsigned int *ix, unsigned int *iy)
Float_t Y
Definition: plot.C:38
unsigned int fByteCount
Number of bytes reported by DCM.
TH2F * GetTH2F(const char *nm)
Definition: HistoSet.cxx:89
static const unsigned int DCM_size_micro
Definition: MicroErrors.h:8
float fHour
A fractional hour of the day.
bool fDataPresent
Data Present flag by DCM.
const double j
Definition: BetheBloch.cxx:29
TH2F * fAAVsHour
Definition: MicroErrors.h:46
A simple object that conatins all the global settings.
daqchannelmap::HardwareDisplay * fHwMap
Definition: MicroErrors.h:26
void DCMXY(unsigned int dcm, unsigned int *ix, unsigned int *iy)
TRandom3 r(0)
static HistoSet & Instance()
Definition: HistoSet.cxx:24
Float_t X
Definition: plot.C:38
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.