CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLXMonitor.cc
Go to the documentation of this file.
1 /*
2  Author: Adam Hunt
3  email: ahunt@princeton.edu
4 */
7 
8 // STL Headers
9 
10 #include <math.h>
11 #include <iomanip>
12 #include <TSystem.h>
13 
14 using std::cout;
15 using std::endl;
16 
18 {
19 
20  NUM_HLX = iConfig.getUntrackedParameter< unsigned int >("numHlx", 36);
21  NUM_BUNCHES = iConfig.getUntrackedParameter< unsigned int >("numBunches", 3564);
22  MAX_LS = iConfig.getUntrackedParameter< unsigned int >("maximumNumLS", 480);
23  listenPort = iConfig.getUntrackedParameter< unsigned int >("SourcePort", 51001);
24  OutputFilePrefix = iConfig.getUntrackedParameter< std::string >("outputFile", "lumi");
25  OutputDir = iConfig.getUntrackedParameter< std::string >("outputDir"," data");
26  SavePeriod = iConfig.getUntrackedParameter< unsigned int >("SavePeriod", 10);
27  NBINS = iConfig.getUntrackedParameter< unsigned int >("NBINS", 297); // 12 BX per bin
28  XMIN = iConfig.getUntrackedParameter< double >("XMIN", 0);
29  XMAX = iConfig.getUntrackedParameter< double >("XMAX", 3564);
30  Style = iConfig.getUntrackedParameter< std::string >("Style", "BX");
31  AquireMode = iConfig.getUntrackedParameter< unsigned int >("AquireMode", 0);
32  Accumulate = iConfig.getUntrackedParameter< bool >("Accumulate", true); // all
33  TriggerBX = iConfig.getUntrackedParameter< unsigned int >("TriggerBX", 50);
34  MinLSBeforeSave = iConfig.getUntrackedParameter< unsigned int >("MinLSBeforeSave", 1);
35  reconnTime = iConfig.getUntrackedParameter< unsigned int >("ReconnectionTime",5);
36  DistribIP1 = iConfig.getUntrackedParameter< std::string >("PrimaryHLXDAQIP", "vmepcs2f17-18");
37  DistribIP2 = iConfig.getUntrackedParameter< std::string >("SecondaryHLXDAQIP", "vmepcs2f17-19");
38  ResetAtNewRun = iConfig.getUntrackedParameter< bool >("NewRun_Reset",true);
39  SaveAtEndJob = iConfig.getUntrackedParameter< bool >("SaveAtEndJob",true);
40 
41  eventInfoFolderHLX_ = iConfig.getUntrackedParameter<std::string>("eventInfoFolderHLX", "EventInfoHLX") ;
42  eventInfoFolder_ = iConfig.getUntrackedParameter<std::string >("eventInfoFolder", "EventInfo") ;
43  subSystemName_ = iConfig.getUntrackedParameter<std::string >("subSystemName", "HLX") ;
44 
45  // Set the lumi section counter
46  lsBinOld = 0;
47  previousSection = 0;
48  lumiSectionCount = 0;
56 
57 
58  // HLX Config info
59  set1BelowIndex = 0;
60  set1BetweenIndex = 1;
61  set1AboveIndex = 2;
62  set2BelowIndex = 3;
63  set2BetweenIndex = 4;
64  set2AboveIndex = 5;
65 
66  runNumLength = 9;
67  secNumLength = 8;
68 
69  if(NUM_HLX > 36)
70  NUM_HLX = 36;
71 
72  if(NUM_BUNCHES > 3564)
73  NUM_BUNCHES = 3564;
74 
75  if(XMAX <= XMIN){
76  XMIN = 0;
77  if(XMAX <= 0) XMAX = 3564;
78  }
79 
80  if((Style.compare("History")==0) || (NBINS == 0)){
81  NBINS = (unsigned int)(XMAX-XMIN);
82  }
83 
85 
86  if ( dbe_ ) {
87  dbe_->setVerbose(1);
88  }
89 
90  monitorName_ = iConfig.getUntrackedParameter<std::string>("monitorName","HLX");
91  //cout << "Monitor name = " << monitorName_ << endl;
92  prescaleEvt_ = iConfig.getUntrackedParameter<int>("prescaleEvt", -1);
93  //cout << "===>DQM event prescale = " << prescaleEvt_ << " events "<< endl;
94 
95  unsigned int HLXHFMapTemp[] = {31,32,33,34,35,18, // s2f07 hf-
96  13,14,15,16,17,0, // s2f07 hf+
97  25,26,27,28,29,30, // s2f05 hf-
98  7, 8, 9, 10,11,12, // s2f05 hf+
99  19,20,21,22,23,24, // s2f02 hf-
100  1, 2, 3, 4, 5, 6}; // s2f02 hf+
101 
102  currentRunEnded_ = true;
103  runNumber_ = 0;
104  expectedNibbles_ = 0;
105 
106  for( int iHLX = 0; iHLX < 36; ++iHLX ){
107  HLXHFMap[iHLX] = HLXHFMapTemp[iHLX];
108  //std::cout << "At " << iHLX << " Wedge " << HLXHFMap[iHLX] << std::endl;
109  totalNibbles_[iHLX] = 0;
110  }
111 
112  num4NibblePerLS_ = 16.0;
113 
114  SetupHists();
115  SetupEventInfo();
116 }
117 
119 {
120  HLXTCP.Disconnect();
121 }
122 
123 // ------------ Setup the monitoring elements ---------------
124 void
126 {
127 
128  dbe_->setCurrentFolder(monitorName_+"/HFPlus");
129 
130  for( unsigned int iWedge = 0; iWedge < 18 && iWedge < NUM_HLX; ++iWedge )
131  {
132  std::ostringstream tempStreamer;
133  tempStreamer << std::dec << std::setw(2) << std::setfill('0') << (iWedge+1);
134 
135  std::ostringstream wedgeNum;
136  wedgeNum << std::dec << (iWedge % 18) + 1;
137 
138  dbe_->setCurrentFolder(monitorName_+"/HFPlus/Wedge"+tempStreamer.str());
139 
140  Set1Below[iWedge] = dbe_->book1D("Set1_Below",
141  "HF+ Wedge "+wedgeNum.str()+": Below Threshold 1 - Set 1",
142  NBINS, XMIN, XMAX);
143  Set1Between[iWedge] = dbe_->book1D("Set1_Between",
144  "HF+ Wedge "+wedgeNum.str()+": Between Threshold 1 & 2 - Set 1",
145  NBINS, XMIN, XMAX);
146  Set1Above[iWedge] = dbe_->book1D("Set1_Above",
147  "HF+ Wedge "+wedgeNum.str()+": Above Threshold 2 - Set 1",
148  NBINS, XMIN, XMAX);
149  Set2Below[iWedge] = dbe_->book1D("Set2_Below",
150  "HF+ Wedge "+wedgeNum.str()+": Below Threshold 1 - Set 2",
151  NBINS, XMIN, XMAX);
152  Set2Between[iWedge] = dbe_->book1D("Set2_Between",
153  "HF+ Wedge "+wedgeNum.str()+": Between Threshold 1 & 2 - Set 2",
154  NBINS, XMIN, XMAX);
155  Set2Above[iWedge] = dbe_->book1D("Set2_Above",
156  "HF+ Wedge "+wedgeNum.str()+": Above Threshold 2 - Set 2",
157  NBINS, XMIN, XMAX);
158  ETSum[iWedge] = dbe_->book1D("ETSum",
159  "HF+ Wedge "+wedgeNum.str()+": Transverse Energy",
160  NBINS, XMIN, XMAX);
161 
162  dbe_->tagContents(monitorName_+"/HFPlus/Wedge"+tempStreamer.str(), iWedge+1);
163  }
164 
165  if(NUM_HLX > 17)
166  {
167  dbe_->setCurrentFolder(monitorName_+"/HFMinus");
168 
169  for( unsigned int iWedge=18; iWedge < NUM_HLX; ++iWedge )
170  {
171  std::ostringstream tempStreamer;
172  tempStreamer << std::dec << std::setw(2) << std::setfill('0') << (iWedge+1);
173 
174  std::ostringstream wedgeNum;
175  wedgeNum << std::dec << (iWedge % 18) + 1;
176 
177  dbe_->setCurrentFolder(monitorName_+"/HFMinus/Wedge"+tempStreamer.str());
178  Set1Below[iWedge] = dbe_->book1D("Set1_Below",
179  "HF- Wedge "+wedgeNum.str()+": Below Threshold 1 - Set 1",
180  NBINS, XMIN, XMAX);
181  Set1Between[iWedge] = dbe_->book1D("Set1_Between",
182  "HF- Wedge "+wedgeNum.str()+": Between Threshold 1 & 2 - Set 1",
183  NBINS, XMIN, XMAX);
184  Set1Above[iWedge] = dbe_->book1D("Set1_Above",
185  "HF- Wedge "+wedgeNum.str()+": Above Threshold 2 - Set 1",
186  NBINS, XMIN, XMAX);
187  Set2Below[iWedge] = dbe_->book1D("Set2_Below",
188  "HF- Wedge "+wedgeNum.str()+": Below Threshold 1 - Set 2",
189  NBINS, XMIN, XMAX);
190  Set2Between[iWedge] = dbe_->book1D("Set2_Between",
191  "HF- Wedge "+wedgeNum.str()+": Between Threshold 1 & 2 - Set 2",
192  NBINS, XMIN, XMAX);
193  Set2Above[iWedge] = dbe_->book1D("Set2_Above",
194  "HF- Wedge "+wedgeNum.str()+": Above Threshold 2 - Set 2",
195  NBINS, XMIN, XMAX);
196  ETSum[iWedge] = dbe_->book1D("ETSum",
197  "HF- Wedge "+wedgeNum.str()+": Transverse Energy",
198  NBINS, XMIN, XMAX);
199 
200  dbe_->tagContents(monitorName_+"/HFMinus/Wedge"+tempStreamer.str(), iWedge+1);
201  }
202  }
203 
204  if(!Accumulate){
205  for( unsigned int iWedge = 0; iWedge < NUM_HLX; ++iWedge ){
206  Set1Below[iWedge]-> setResetMe(true);
207  Set1Between[iWedge]->setResetMe(true);
208  Set1Above[iWedge]-> setResetMe(true);
209  Set2Below[iWedge]-> setResetMe(true);
210  Set2Between[iWedge]->setResetMe(true);
211  Set2Above[iWedge]-> setResetMe(true);
212  ETSum[iWedge]-> setResetMe(true);
213  }
214  }
215 
216  if(Style.compare("BX") == 0){
217  OccXAxisTitle = "Bunch Crossing";
218  OccYAxisTitle = "Tower Occupancy";
219  EtXAxisTitle = "Bunch Crossing";
220  EtYAxisTitle = "E_{T} Sum";
221  }else if(Style.compare("Distribution")==0){
222  OccXAxisTitle = "Tower Occupancy";
223  OccYAxisTitle = "Count";
224  EtXAxisTitle = "E_{T} Sum";
225  EtYAxisTitle = "Count";
226  }
227 
228  for( unsigned int iWedge=0; iWedge < NUM_HLX; ++iWedge )
229  {
230  Set1Below[iWedge]-> setAxisTitle(OccXAxisTitle, 1);
231  Set1Below[iWedge]-> setAxisTitle(OccYAxisTitle, 2);
234  Set1Above[iWedge]-> setAxisTitle(OccXAxisTitle, 1);
235  Set1Above[iWedge]-> setAxisTitle(OccYAxisTitle, 2);
236  Set2Below[iWedge]-> setAxisTitle(OccXAxisTitle, 1);
237  Set2Below[iWedge]-> setAxisTitle(OccYAxisTitle, 2);
240  Set2Above[iWedge]-> setAxisTitle(OccXAxisTitle, 1);
241  Set2Above[iWedge]-> setAxisTitle(OccYAxisTitle, 2);
242  ETSum[iWedge]-> setAxisTitle(EtXAxisTitle, 1);
243  ETSum[iWedge]-> setAxisTitle(EtYAxisTitle, 2);
244  }
245 
246  // Comparison Histograms
247 
248  dbe_->setCurrentFolder(monitorName_+"/HFCompare");
249 
250  std::string CompXTitle = "HF Wedge";
251  std::string CompEtSumYTitle = "E_{T} Sum per active tower";
252  std::string CompOccYTitle = "Occupancy per active tower";
253 
254  HFCompareEtSum = dbe_->book1D("HFCompareEtSum","E_{T} Sum",NUM_HLX, 0, NUM_HLX );
255  HFCompareEtSum->setAxisTitle( CompXTitle, 1 );
256  HFCompareEtSum->setAxisTitle( CompEtSumYTitle, 2 );
257 
258  HFCompareOccBelowSet1 = dbe_->book1D("HFCompareOccBelowSet1",
259  "Occupancy Below Threshold 1 - Set 1",
260  NUM_HLX, 0, NUM_HLX );
261  HFCompareOccBelowSet1->setAxisTitle( CompXTitle, 1 );
262  HFCompareOccBelowSet1->setAxisTitle( CompOccYTitle, 2 );
263 
264  HFCompareOccBetweenSet1 = dbe_->book1D("HFCompareOccBetweenSet1",
265  "Occupancy Between Threshold 1 & 2 - Set 1",
266  NUM_HLX, 0, NUM_HLX );
267  HFCompareOccBetweenSet1->setAxisTitle( CompXTitle, 1 );
268  HFCompareOccBetweenSet1->setAxisTitle( CompOccYTitle, 2 );
269 
270  HFCompareOccAboveSet1 = dbe_->book1D("HFCompareOccAboveSet1",
271  "Occupancy Above Threshold 2 - Set 1",
272  NUM_HLX, 0, NUM_HLX );
273  HFCompareOccAboveSet1->setAxisTitle( CompXTitle, 1 );
274  HFCompareOccAboveSet1->setAxisTitle( CompOccYTitle, 2 );
275 
276  HFCompareOccBelowSet2 = dbe_->book1D("HFCompareOccBelowSet2",
277  "Occupancy Below Threshold 1 - Set 2",
278  NUM_HLX, 0, NUM_HLX);
279  HFCompareOccBelowSet2->setAxisTitle(CompXTitle,1);
280  HFCompareOccBelowSet2->setAxisTitle(CompOccYTitle,2);
281 
282  HFCompareOccBetweenSet2 = dbe_->book1D("HFCompareOccBetweenSet2",
283  "Occupancy Between Threshold 1 & 2 - Set 2",
284  NUM_HLX, 0, NUM_HLX);
285  HFCompareOccBetweenSet2->setAxisTitle(CompXTitle,1);
286  HFCompareOccBetweenSet2->setAxisTitle(CompOccYTitle,2);
287 
288  HFCompareOccAboveSet2 = dbe_->book1D( "HFCompareOccAboveSet2",
289  "Occupancy Above Threshold 2 - Set 2",
290  NUM_HLX, 0, NUM_HLX);
291  HFCompareOccAboveSet2->setAxisTitle(CompXTitle,1);
292  HFCompareOccAboveSet2->setAxisTitle(CompOccYTitle,2);
293 
294  // Average Histograms
295 
296  dbe_->setCurrentFolder(monitorName_+"/Average");
297 
298  int OccBins = 10000; // This does absolutely nothing.
299  double OccMin = 0;
300  double OccMax = 0; // If min and max are zero, no bounds on the data are set.
301 
302  int EtSumBins = 10000; // This does absolutely nothing. The Variable is not used in the function.
303  double EtSumMin = 0;
304  double EtSumMax = 0; // If min and max are zero, no bounds on the data are set.
305 
306  std::string errorOpt = "i";
307 
308  std::string AvgXTitle = "HF Wedge";
309  std::string AvgEtSumYTitle = "Average E_{T} Sum";
310  std::string AvgOccYTitle = "Average Tower Occupancy";
311 
312  AvgEtSum = dbe_->bookProfile( "AvgEtSum",
313  "Average E_{T} Sum",
314  NUM_HLX, 0, NUM_HLX, EtSumBins, EtSumMin, EtSumMax);
315  AvgEtSum->setAxisTitle( AvgXTitle, 1 );
316  AvgEtSum->setAxisTitle( AvgEtSumYTitle, 2 );
317 
318  AvgOccBelowSet1 = dbe_->bookProfile( "AvgOccBelowSet1",
319  "Average Occupancy Below Threshold 1 - Set1",
320  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
321  AvgOccBelowSet1->setAxisTitle( AvgXTitle, 1 );
322  AvgOccBelowSet1->setAxisTitle( AvgOccYTitle, 2 );
323 
324  AvgOccBetweenSet1 = dbe_->bookProfile( "AvgOccBetweenSet1",
325  "Average Occupancy Between Threhold 1 & 2 - Set1",
326  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
327  AvgOccBetweenSet1->setAxisTitle( AvgXTitle, 1 );
328  AvgOccBetweenSet1->setAxisTitle( AvgOccYTitle, 2 );
329 
330  AvgOccAboveSet1 = dbe_->bookProfile( "AvgOccAboveSet1",
331  "Average Occupancy Above Threshold 2 - Set1",
332  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
333  AvgOccAboveSet1->setAxisTitle( AvgXTitle, 1 );
334  AvgOccAboveSet1->setAxisTitle( AvgOccYTitle, 2 );
335 
336  AvgOccBelowSet2 = dbe_->bookProfile("AvgOccBelowSet2",
337  "Average Occupancy Below Threshold 1 - Set2",
338  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
339  AvgOccBelowSet2->setAxisTitle( AvgXTitle, 1 );
340  AvgOccBelowSet2->setAxisTitle( AvgOccYTitle, 2 );
341 
342  AvgOccBetweenSet2 = dbe_->bookProfile("AvgOccBetweenSet2",
343  "Average Occupancy Between Threshold 1 & 2 - Set2",
344  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
345  AvgOccBetweenSet2->setAxisTitle( AvgXTitle, 1 );
346  AvgOccBetweenSet2->setAxisTitle( AvgOccYTitle, 2 );
347 
348  AvgOccAboveSet2 = dbe_->bookProfile("AvgOccAboveSet2",
349  "Average Occupancy Above Threshold 2 - Set2",
350  NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
351  AvgOccAboveSet2->setAxisTitle( AvgXTitle, 1 );
352  AvgOccAboveSet2->setAxisTitle( AvgOccYTitle, 2 );
353 
354  // Luminosity Histograms
355  dbe_->setCurrentFolder(monitorName_+"/Luminosity");
356 
357  std::string LumiXTitle = "Bunch Crossing";
358  std::string LumiEtSumYTitle = "Luminosity: E_{T} Sum";
359  std::string LumiOccYTitle = "Luminosity: Occupancy";
360 
361  LumiAvgEtSum = dbe_->bookProfile("LumiAvgEtSum","Average Luminosity ",int(XMAX-XMIN), XMIN, XMAX, EtSumBins, EtSumMin, EtSumMax );
362  LumiAvgEtSum->setAxisTitle( LumiXTitle, 1 );
363  LumiAvgEtSum->setAxisTitle( LumiEtSumYTitle, 2 );
364 
365  LumiAvgOccSet1 = dbe_->bookProfile("LumiAvgOccSet1","Average Luminosity - Set 1", int(XMAX-XMIN), XMIN, XMAX, OccBins, OccMax, OccMin );
366  LumiAvgOccSet1->setAxisTitle( LumiXTitle, 1 );
367  LumiAvgOccSet1->setAxisTitle( LumiOccYTitle, 2 );
368 
369  LumiAvgOccSet2 = dbe_->bookProfile("LumiAvgOccSet2","Average Luminosity - Set 2", int(XMAX-XMIN), XMIN, XMAX, OccBins, OccMax, OccMin );
370  LumiAvgOccSet2->setAxisTitle( LumiXTitle, 1 );
371  LumiAvgOccSet2->setAxisTitle( LumiOccYTitle, 2 );
372 
373  LumiInstantEtSum = dbe_->book1D("LumiInstantEtSum","Instantaneous Luminosity ",int(XMAX-XMIN), XMIN, XMAX );
374  LumiInstantEtSum->setAxisTitle( LumiXTitle, 1 );
375  LumiInstantEtSum->setAxisTitle( LumiEtSumYTitle, 2 );
376 
377  LumiInstantOccSet1 = dbe_->book1D("LumiInstantOccSet1","Instantaneous Luminosity - Set 1", int(XMAX-XMIN), XMIN, XMAX );
378  LumiInstantOccSet1->setAxisTitle( LumiXTitle, 1 );
379  LumiInstantOccSet1->setAxisTitle( LumiOccYTitle, 2 );
380 
381  LumiInstantOccSet2 = dbe_->book1D("LumiInstantOccSet2","Instantaneous Luminosity - Set 2", int(XMAX-XMIN), XMIN, XMAX );
382  LumiInstantOccSet2->setAxisTitle( LumiXTitle, 1 );
383  LumiInstantOccSet2->setAxisTitle( LumiOccYTitle, 2 );
384 
385  LumiIntegratedEtSum = dbe_->book1D("LumiIntegratedEtSum","Integrated Luminosity ",int(XMAX-XMIN), XMIN, XMAX );
386  LumiIntegratedEtSum->setAxisTitle( LumiXTitle, 1 );
387  LumiIntegratedEtSum->setAxisTitle( LumiEtSumYTitle, 2 );
388 
389  LumiIntegratedOccSet1 = dbe_->book1D("LumiIntegratedOccSet1","Integrated Luminosity - Set 1", int(XMAX-XMIN), XMIN, XMAX );
390  LumiIntegratedOccSet1->setAxisTitle( LumiXTitle, 1 );
391  LumiIntegratedOccSet1->setAxisTitle( LumiOccYTitle, 2 );
392 
393  LumiIntegratedOccSet2 = dbe_->book1D("LumiIntegratedOccSet2","Integrated Luminosity - Set 2", int(XMAX-XMIN), XMIN, XMAX );
394  LumiIntegratedOccSet2->setAxisTitle( LumiXTitle, 1 );
395  LumiIntegratedOccSet2->setAxisTitle( LumiOccYTitle, 2 );
396 
397 
398  // Sanity check sum histograms
399  dbe_->setCurrentFolder(monitorName_+"/CheckSums");
400 
401  std::string sumXTitle = "HF Wedge";
402  std::string sumYTitle = "Occupancy Sum (Below+Above+Between)";
403 
404  SumAllOccSet1 = dbe_->bookProfile("SumAllOccSet1","Occupancy Check - Set 1",NUM_HLX, 0, NUM_HLX, OccBins, OccMax, OccMin );
405  SumAllOccSet1->setAxisTitle( sumXTitle, 1 );
406  SumAllOccSet1->setAxisTitle( sumYTitle, 2 );
407 
408  SumAllOccSet2 = dbe_->bookProfile("SumAllOccSet2","Occupancy Check - Set 2",NUM_HLX, 0, NUM_HLX, OccBins, OccMax, OccMin );
409  SumAllOccSet2->setAxisTitle( sumXTitle, 1 );
410  SumAllOccSet2->setAxisTitle( sumYTitle, 2 );
411 
412  MissingDQMDataCheck = dbe_->book1D( "MissingDQMDataCheck", "Missing Data Count",1, 0, 1);
414  MissingDQMDataCheck->setAxisTitle( "Number Missing Nibbles", 2 );
415 
416  // Signal & Background monitoring histograms
417  dbe_->setCurrentFolder(monitorName_+"/SigBkgLevels");
418 
419  MaxInstLumiBX1 = dbe_->book1D("MaxInstLumiBX1","Max Instantaneous Luminosity BX: 1st",10000,-1e-5,0.01);
420  MaxInstLumiBX1->setAxisTitle("Max Inst. L (10^{30}cm^{-2}s^{-1})",1);
421  MaxInstLumiBX1->setAxisTitle("Entries",2);
422  MaxInstLumiBX2 = dbe_->book1D("MaxInstLumiBX2","Max Instantaneous Luminosity BX: 2nd",10000,-1e-5,0.01);
423  MaxInstLumiBX2->setAxisTitle("Max Inst. L (10^{30}cm^{-2}s^{-1})",1);
424  MaxInstLumiBX2->setAxisTitle("Entries",2);
425  MaxInstLumiBX3 = dbe_->book1D("MaxInstLumiBX3","Max Instantaneous Luminosity BX: 3rd",10000,-1e-5,0.01);
426  MaxInstLumiBX3->setAxisTitle("Max Inst. L (10^{30}cm^{-2}s^{-1})",1);
427  MaxInstLumiBX3->setAxisTitle("Entries",2);
428  MaxInstLumiBX4 = dbe_->book1D("MaxInstLumiBX4","Max Instantaneous Luminosity BX: 4th",10000,-1e-5,0.01);
429  MaxInstLumiBX4->setAxisTitle("Max Inst. L (10^{30}cm^{-2}s^{-1})",1);
430  MaxInstLumiBX4->setAxisTitle("Entries",2);
431 
432  MaxInstLumiBXNum1 = dbe_->book1D("MaxInstLumiBXNum1","BX Number of Max: 1st",3564,0,3564);
434  MaxInstLumiBXNum1->setAxisTitle("Num Time Max",2);
435  MaxInstLumiBXNum2 = dbe_->book1D("MaxInstLumiBXNum2","BX Number of Max: 2nd",3564,0,3564);
437  MaxInstLumiBXNum2->setAxisTitle("Num Time Max",2);
438  MaxInstLumiBXNum3 = dbe_->book1D("MaxInstLumiBXNum3","BX Number of Max: 3rd",3564,0,3564);
440  MaxInstLumiBXNum3->setAxisTitle("Num Time Max",2);
441  MaxInstLumiBXNum4 = dbe_->book1D("MaxInstLumiBXNum4","BX Number of Max: 4th",3564,0,3564);
443  MaxInstLumiBXNum4->setAxisTitle("Num Time Max",2);
444 
445  // History histograms
446  dbe_->setCurrentFolder(monitorName_+"/HistoryRaw");
447 
448  std::string HistXTitle = "Time (LS)";
449  std::string RecentHistXTitle = "Time (LS/16)";
450  std::string HistEtSumYTitle = "Average E_{T} Sum";
451  std::string HistOccYTitle = "Average Occupancy";
452  std::string HistLumiYTitle = "Luminosity";
453  std::string HistLumiErrorYTitle = "Luminosity Error (%)";
454  std::string BXvsTimeXTitle = "Time (LS)";
455  std::string BXvsTimeYTitle = "BX";
456 
457  // Et Sum histories
458  HistAvgEtSumHFP = dbe_->bookProfile( "HistAvgEtSumHFP", "Average Et Sum: HF+",
459  MAX_LS, 0.5, (double)MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
460  HistAvgEtSumHFP->setAxisTitle( HistXTitle, 1 );
461  HistAvgEtSumHFP->setAxisTitle( HistEtSumYTitle, 2 );
462 
463  HistAvgEtSumHFM = dbe_->bookProfile( "HistAvgEtSumHFM", "Average Et Sum: HF-",
464  MAX_LS, 0.5, (double)MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
465  HistAvgEtSumHFM->setAxisTitle( HistXTitle, 1 );
466  HistAvgEtSumHFM->setAxisTitle( HistEtSumYTitle, 2 );
467 
468  // Tower Occupancy Histories
469  HistAvgOccBelowSet1HFP = dbe_->bookProfile( "HistAvgOccBelowSet1HFP", "Average Occ Set1Below: HF+",
470  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
471  HistAvgOccBelowSet1HFP->setAxisTitle( HistXTitle, 1 );
472  HistAvgOccBelowSet1HFP->setAxisTitle( HistOccYTitle, 2 );
473 
474  HistAvgOccBelowSet1HFM = dbe_->bookProfile( "HistAvgOccBelowSet1HFM", "Average Occ Set1Below: HF-",
475  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
476  HistAvgOccBelowSet1HFM->setAxisTitle( HistXTitle, 1 );
477  HistAvgOccBelowSet1HFM->setAxisTitle( HistOccYTitle, 2 );
478 
479  HistAvgOccBetweenSet1HFP = dbe_->bookProfile( "HistAvgOccBetweenSet1HFP", "Average Occ Set1Between: HF+",
480  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
481  HistAvgOccBetweenSet1HFP->setAxisTitle( HistXTitle, 1 );
482  HistAvgOccBetweenSet1HFP->setAxisTitle( HistOccYTitle, 2 );
483 
484  HistAvgOccBetweenSet1HFM = dbe_->bookProfile( "HistAvgOccBetweenSet1HFM", "Average Occ Set1Between: HF-",
485  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
486  HistAvgOccBetweenSet1HFM->setAxisTitle( HistXTitle, 1 );
487  HistAvgOccBetweenSet1HFM->setAxisTitle( HistOccYTitle, 2 );
488 
489  HistAvgOccAboveSet1HFP = dbe_->bookProfile( "HistAvgOccAboveSet1HFP", "Average Occ Set1Above: HF+",
490  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
491  HistAvgOccAboveSet1HFP->setAxisTitle( HistXTitle, 1 );
492  HistAvgOccAboveSet1HFP->setAxisTitle( HistOccYTitle, 2 );
493 
494  HistAvgOccAboveSet1HFM = dbe_->bookProfile( "HistAvgOccAboveSet1HFM", "Average Occ Set1Above: HF-",
495  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
496  HistAvgOccAboveSet1HFM->setAxisTitle( HistXTitle, 1 );
497  HistAvgOccAboveSet1HFM->setAxisTitle( HistOccYTitle, 2 );
498 
499  HistAvgOccBelowSet2HFP = dbe_->bookProfile( "HistAvgOccBelowSet2HFP", "Average Occ Set2Below: HF+",
500  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
501  HistAvgOccBelowSet2HFP->setAxisTitle( HistXTitle, 1 );
502  HistAvgOccBelowSet2HFP->setAxisTitle( HistOccYTitle, 2 );
503 
504  HistAvgOccBelowSet2HFM = dbe_->bookProfile( "HistAvgOccBelowSet2HFM", "Average Occ Set2Below: HF-",
505  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
506  HistAvgOccBelowSet2HFM->setAxisTitle( HistXTitle, 1 );
507  HistAvgOccBelowSet2HFM->setAxisTitle( HistOccYTitle, 2 );
508 
509  HistAvgOccBetweenSet2HFP = dbe_->bookProfile( "HistAvgOccBetweenSet2HFP", "Average Occ Set2Between: HF+",
510  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
511  HistAvgOccBetweenSet2HFP->setAxisTitle( HistXTitle, 1 );
512  HistAvgOccBetweenSet2HFP->setAxisTitle( HistOccYTitle, 2 );
513 
514  HistAvgOccBetweenSet2HFM = dbe_->bookProfile( "HistAvgOccBetweenSet2HFM", "Average Occ Set2Between: HF-",
515  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
516  HistAvgOccBetweenSet2HFM->setAxisTitle( HistXTitle, 1 );
517  HistAvgOccBetweenSet2HFM->setAxisTitle( HistOccYTitle, 2 );
518 
519  HistAvgOccAboveSet2HFP = dbe_->bookProfile( "HistAvgOccAboveSet2HFP", "Average Occ Set2Above: HF+",
520  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
521  HistAvgOccAboveSet2HFP->setAxisTitle( HistXTitle, 1 );
522  HistAvgOccAboveSet2HFP->setAxisTitle( HistOccYTitle, 2 );
523 
524  HistAvgOccAboveSet2HFM = dbe_->bookProfile( "HistAvgOccAboveSet2HFM", "Average Occ Set2Above: HF-",
525  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax );
526  HistAvgOccAboveSet2HFM->setAxisTitle( HistXTitle, 1 );
527  HistAvgOccAboveSet2HFM->setAxisTitle( HistOccYTitle, 2 );
528 
529  // Et Sum histories
530  BXvsTimeAvgEtSumHFP = dbe_->book2D( "BXvsTimeAvgEtSumHFP", "Average Et Sum: HF+",
531  MAX_LS, 0.5, (double)MAX_LS+0.5, NBINS, (double)XMIN, (double)XMAX);
532  BXvsTimeAvgEtSumHFP->setAxisTitle( BXvsTimeXTitle, 1 );
533  BXvsTimeAvgEtSumHFP->setAxisTitle( BXvsTimeYTitle, 2 );
534 
535  BXvsTimeAvgEtSumHFM = dbe_->book2D( "BXvsTimeAvgEtSumHFM", "Average Et Sum: HF-",
536  MAX_LS, 0.5, (double)MAX_LS+0.5, NBINS, (double)XMIN, (double)XMAX);
537  BXvsTimeAvgEtSumHFM->setAxisTitle( BXvsTimeXTitle, 1 );
538  BXvsTimeAvgEtSumHFM->setAxisTitle( BXvsTimeYTitle, 2 );
539 
540  dbe_->setCurrentFolder(monitorName_+"/HistoryLumi");
541 
542  // Lumi Histories
543  HistAvgLumiEtSum = dbe_->bookProfile( "HistAvgLumiEtSum", "Average Instant Luminosity: Et Sum",
544  MAX_LS, 0.5, (double)MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
545  HistAvgLumiEtSum->setAxisTitle( HistXTitle, 1 );
546  HistAvgLumiEtSum->setAxisTitle( HistLumiYTitle, 2 );
547 
548  HistAvgLumiOccSet1 = dbe_->bookProfile( "HistAvgLumiOccSet1", "Average Instant Luminosity: Occ Set1",
549  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax);
550  HistAvgLumiOccSet1->setAxisTitle( HistXTitle, 1 );
551  HistAvgLumiOccSet1->setAxisTitle( HistLumiYTitle, 2 );
552 
553  HistAvgLumiOccSet2 = dbe_->bookProfile( "HistAvgLumiOccSet2", "Average Instant Luminosity: Occ Set2",
554  MAX_LS, 0.5, (double)MAX_LS+0.5, OccBins, OccMin, OccMax);
555  HistAvgLumiOccSet2->setAxisTitle( HistXTitle, 1 );
556  HistAvgLumiOccSet2->setAxisTitle( HistLumiYTitle, 2 );
557 
558  HistInstantLumiEtSum = dbe_->book1D( "HistInstantLumiEtSum", "Instant Luminosity: Et Sum",
559  MAX_LS, 0.5, (double)MAX_LS+0.5);
560  HistInstantLumiEtSum->setAxisTitle( HistXTitle, 1 );
561  HistInstantLumiEtSum->setAxisTitle( HistLumiYTitle, 2 );
562 
563  HistInstantLumiOccSet1 = dbe_->book1D( "HistInstantLumiOccSet1", "Instant Luminosity: Occ Set1",
564  MAX_LS, 0.5, (double)MAX_LS+0.5);
565  HistInstantLumiOccSet1->setAxisTitle( HistXTitle, 1 );
566  HistInstantLumiOccSet1->setAxisTitle( HistLumiYTitle, 2 );
567 
568  HistInstantLumiOccSet2 = dbe_->book1D( "HistInstantLumiOccSet2", "Instant Luminosity: Occ Set2",
569  MAX_LS, 0.5, (double)MAX_LS+0.5);
570  HistInstantLumiOccSet2->setAxisTitle( HistXTitle, 1 );
571  HistInstantLumiOccSet2->setAxisTitle( HistLumiYTitle, 2 );
572 
573  HistInstantLumiEtSumError = dbe_->book1D( "HistInstantLumiEtSumError", "Luminosity Error: Et Sum",
574  MAX_LS, 0.5, (double)MAX_LS+0.5);
575  HistInstantLumiEtSumError->setAxisTitle( HistXTitle, 1 );
576  HistInstantLumiEtSumError->setAxisTitle( HistLumiErrorYTitle, 2 );
577 
578  HistInstantLumiOccSet1Error = dbe_->book1D( "HistInstantLumiOccSet1Error", "Luminosity Error: Occ Set1",
579  MAX_LS, 0.5, (double)MAX_LS+0.5);
580  HistInstantLumiOccSet1Error->setAxisTitle( HistXTitle, 1 );
581  HistInstantLumiOccSet1Error->setAxisTitle( HistLumiErrorYTitle, 2 );
582 
583  HistInstantLumiOccSet2Error = dbe_->book1D( "HistInstantLumiOccSet2Error", "Luminosity Error: Occ Set2",
584  MAX_LS, 0.5, (double)MAX_LS+0.5);
585  HistInstantLumiOccSet2Error->setAxisTitle( HistXTitle, 1 );
586  HistInstantLumiOccSet2Error->setAxisTitle( HistLumiErrorYTitle, 2 );
587 
588 
589  HistIntegratedLumiEtSum = dbe_->book1D( "HistIntegratedLumiEtSum", "Integrated Luminosity: Et Sum",
590  MAX_LS, 0.5, (double)MAX_LS+0.5);
591  HistIntegratedLumiEtSum->setAxisTitle( HistXTitle, 1 );
592  HistIntegratedLumiEtSum->setAxisTitle( HistLumiYTitle, 2 );
593 
594  HistIntegratedLumiOccSet1 = dbe_->book1D( "HistIntegratedLumiOccSet1", "Integrated Luminosity: Occ Set1",
595  MAX_LS, 0.5, (double)MAX_LS+0.5);
596  HistIntegratedLumiOccSet1->setAxisTitle( HistXTitle, 1 );
597  HistIntegratedLumiOccSet1->setAxisTitle( HistLumiYTitle, 2 );
598 
599  HistIntegratedLumiOccSet2 = dbe_->book1D( "HistIntegratedLumiOccSet2", "Integrated Luminosity: Occ Set2",
600  MAX_LS, 0.5, (double)MAX_LS+0.5);
601  HistIntegratedLumiOccSet2->setAxisTitle( HistXTitle, 1 );
602  HistIntegratedLumiOccSet2->setAxisTitle( HistLumiYTitle, 2 );
603 
604  dbe_->setCurrentFolder(monitorName_+"/RecentHistoryLumi");
605 
606  // Lumi Recent Histories (past 128 short sections)
607  RecentInstantLumiEtSum = dbe_->book1D( "RecentInstantLumiEtSum", "Instant Luminosity: Et Sum",
608  128, 0.5, (double)128+0.5);
609  RecentInstantLumiEtSum->setAxisTitle( RecentHistXTitle, 1 );
610  RecentInstantLumiEtSum->setAxisTitle( HistLumiYTitle, 2 );
611 
612  RecentInstantLumiOccSet1 = dbe_->book1D( "RecentInstantLumiOccSet1", "Instant Luminosity: Occ Set1",
613  128, 0.5, (double)128+0.5);
614  RecentInstantLumiOccSet1->setAxisTitle( RecentHistXTitle, 1 );
615  RecentInstantLumiOccSet1->setAxisTitle( HistLumiYTitle, 2 );
616 
617  RecentInstantLumiOccSet2 = dbe_->book1D( "RecentInstantLumiOccSet2", "Instant Luminosity: Occ Set2",
618  128, 0.5, (double)128+0.5);
619  RecentInstantLumiOccSet2->setAxisTitle( RecentHistXTitle, 1 );
620  RecentInstantLumiOccSet2->setAxisTitle( HistLumiYTitle, 2 );
621 
622  RecentIntegratedLumiEtSum = dbe_->book1D( "RecentIntegratedLumiEtSum", "Integrated Luminosity: Et Sum",
623  128, 0.5, (double)128+0.5);
624  RecentIntegratedLumiEtSum->setAxisTitle( RecentHistXTitle, 1 );
625  RecentIntegratedLumiEtSum->setAxisTitle( HistLumiYTitle, 2 );
626 
627  RecentIntegratedLumiOccSet1 = dbe_->book1D( "RecentIntegratedLumiOccSet1", "Integrated Luminosity: Occ Set1",
628  128, 0.5, (double)128+0.5);
629  RecentIntegratedLumiOccSet1->setAxisTitle( RecentHistXTitle, 1 );
630  RecentIntegratedLumiOccSet1->setAxisTitle( HistLumiYTitle, 2 );
631 
632  RecentIntegratedLumiOccSet2 = dbe_->book1D( "RecentIntegratedLumiOccSet2", "Integrated Luminosity: Occ Set2",
633  128, 0.5, (double)128+0.5);
634  RecentIntegratedLumiOccSet2->setAxisTitle( RecentHistXTitle, 1 );
635  RecentIntegratedLumiOccSet2->setAxisTitle( HistLumiYTitle, 2 );
636 
637  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
638  for( size_t i=0, e = systems.size(); i<e; ++i ){
639  std::cout << "Systems " << systems[i] << std::endl;
640  }
641 
643 }
644 
645 
647 {
648 
649  using std::string;
650 
651  string currentfolder = subSystemName_ + "/" + eventInfoFolderHLX_;
652  //cout << "currentfolder " << currentfolder << endl;
653 
654  dbe_->setCurrentFolder(currentfolder) ;
655 
656  pEvent_ = 0;
657  evtRateCount_ = 0;
658  gettimeofday(&currentTime_,NULL);
660  evtRateWindow_ = 0.5;
661 
662  //Event specific contents
663  runId_ = dbe_->bookInt("iRun");
664  lumisecId_ = dbe_->bookInt("iLumiSection");
665 
666  eventId_ = dbe_->bookInt("iEvent");
667  eventId_->Fill(-1);
668  eventTimeStamp_ = dbe_->bookFloat("eventTimeStamp");
669 
670  dbe_->setCurrentFolder(currentfolder) ;
671  //Process specific contents
672  processTimeStamp_ = dbe_->bookFloat("processTimeStamp");
674  processLatency_ = dbe_->bookFloat("processLatency");
675  processTimeStamp_->Fill(-1);
676  processEvents_ = dbe_->bookInt("processedEvents");
678  processEventRate_ = dbe_->bookFloat("processEventRate");
679  processEventRate_->Fill(-1);
680  nUpdates_= dbe_->bookInt("processUpdates");
681  nUpdates_->Fill(-1);
682 
683  //Static Contents
684  processId_= dbe_->bookInt("processID");
685  processId_->Fill(gSystem->GetPid());
686  processStartTimeStamp_ = dbe_->bookFloat("processStartTimeStamp");
688  runStartTimeStamp_ = dbe_->bookFloat("runStartTimeStamp");
689  hostName_= dbe_->bookString("hostName",gSystem->HostName());
690  processName_= dbe_->bookString("processName",subSystemName_);
691  workingDir_= dbe_->bookString("workingDir",gSystem->pwd());
692  cmsswVer_= dbe_->bookString("CMSSW_Version",edm::getReleaseVersion());
693  // dqmPatch_= dbe_->bookString("DQM_Patch",dbe_->getDQMPatchVersion());
694 
695  // Go to the standard EventInfo folder (in the case online case where this
696  // is different).
697  currentfolder = subSystemName_ + "/" + eventInfoFolder_;
698  dbe_->setCurrentFolder(currentfolder) ;
699 
700  reportSummary_ = dbe_->bookFloat("reportSummary");
701  reportSummaryMap_ = dbe_->book2D("reportSummaryMap", "reportSummaryMap", 18, 0., 18., 2, -1.5, 1.5);
702 
703  currentfolder = subSystemName_ + "/" + eventInfoFolderHLX_;
704  dbe_->setCurrentFolder(currentfolder) ;
705 
706  TH2F *summaryHist = reportSummaryMap_->getTH2F();
707  summaryHist->GetYaxis()->SetBinLabel(1,"HF-");
708  summaryHist->GetYaxis()->SetBinLabel(2,"HF+");
709  summaryHist->GetXaxis()->SetTitle("Wedge #");
710 
711  // Fill the report summary objects with default values, since these will only
712  // be filled at the change of run.
713  reportSummary_->Fill(1.0);
714 
715  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX ){
716  unsigned int iWedge = HLXHFMap[iHLX] + 1;
717  unsigned int iEta = 2;
718  if( iWedge >= 19 ){ iEta = 1; iWedge -= 18; }
719  reportSummaryMap_->setBinContent(iWedge,iEta,1.0);
720  }
721 }
722 
723 
724 // ------------ method called to for each event ------------
725 void
727 {
728  using namespace edm;
729 
730  while( HLXTCP.IsConnected() == false )
731  {
733  if( HLXTCP.Connect() != 1 )
734  {
735  std::cout << "Failed to connect to " << DistribIP1 << "." << std::endl;
736  sleep( 1 );
737  std::cout << "Trying " << DistribIP2 << std::endl;
739  if( HLXTCP.Connect() == 1) break;
740  std::cout << "Failed to connect to " << DistribIP2 << "." << std::endl;
741  std::cout << " Reconnect in " << reconnTime << " seconds." << std::endl;
742  sleep(reconnTime);
743  }
744  }
745  if( HLXTCP.IsConnected() == true )
746  {
747  std::cout << "Successfully connected." << std::endl;
748  }
749 
751  {
752  // If this is the first time through, set the runNumber ...
754  if( !currentRunEnded_ && runNumber_ != 0 ) EndRun();
756  currentRunEnded_ = false;
757  //std::cout << "Run number is: " << runNumber_ << std::endl;
758  timeval startruntime;
759  gettimeofday(&startruntime,NULL);
760  runStartTimeStamp_->Fill(getUTCtime(&startruntime));
761  }
762 
763  // Fill the monitoring histograms
766  FillEventInfo(lumiSection,iEvent);
768 
769  cout << "Run: " << lumiSection.hdr.runNumber
770  << " Section: " << lumiSection.hdr.sectionNumber
771  << " Orbit: " << lumiSection.hdr.startOrbit << endl;
772  cout << "Et Lumi: " << lumiSection.lumiSummary.InstantETLumi << endl;
773  cout << "Occ Lumi 1: " << lumiSection.lumiSummary.InstantOccLumi[0] << endl;
774  cout << "Occ Lumi 2: " << lumiSection.lumiSummary.InstantOccLumi[1] << endl;
775  }
776  else
777  {
778  HLXTCP.Disconnect();
779  EndRun();
780  }
781 
782 // do
783 // {
784 // errorCode = HLXTCP.ReceiveLumiSection(lumiSection);
785 
786 // while(errorCode !=1)
787 // {
788 // HLXTCP.Disconnect();
789 // //cout << "Connecting to TCPDistributor" << endl;
790 // errorCode = HLXTCP.Connect();
791 // if(errorCode != 1)
792 // {
793 // if( (attemptCounter%10)==0 ){
794 // cout << "*** Connection Failed: " << errorCode
795 // << " Will attempt to reconnect in " << reconnTime << " seconds." << endl;
796 // cout << "This message will be printed once every 10 attempts." << endl;
797 // }
798 // ++attemptCounter;
799 // sleep(reconnTime);
800 // }
801 // }
802 // } while( errorCode != 1 );
803 
804 }
805 
806 
808 
809  std::ostringstream tempStreamer;
810  tempStreamer << OutputDir << "/" << OutputFilePrefix << "_" << subSystemName_
811  << "_R" << std::setfill('0') << std::setw(runNumLength)
812  << runNumber_ << "_T00000001.root";
813 
814  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
815  char rewrite[64]; sprintf(rewrite, "\\1Run %d/\\2/Run summary", runNumber_);
816  int saveReference_ = DQMStore::SaveWithoutReference;
817  int saveReferenceQMin_ = dqm::qstatus::STATUS_OK;
818 
819  for( size_t i = 0, e = systems.size(); i != e; ++i )
820  if (systems[i] != "Reference")
821  dbe_->save( tempStreamer.str(), systems[i], "^(Reference/)?([^/]+)", rewrite,
822  (DQMStore::SaveReferenceTag)saveReference_, saveReferenceQMin_);
823 
824  //dbe_->save(tempStreamer.str());
825 }
826 
827 // ------------ method called once each job just before starting event loop ------------
829 {
831  int errorCode = HLXTCP.SetPort(listenPort);
832  cout << "SetPort: " << listenPort << " Success: " << errorCode << endl;
833  errorCode = HLXTCP.SetMode(AquireMode);
834  cout << "AquireMode: " << AquireMode << " Success: " << errorCode << endl;
835 
836  while( HLXTCP.IsConnected() == false )
837  {
839  if( HLXTCP.Connect() != 1 )
840  {
841  std::cout << "Failed to connect to " << DistribIP1 << "." << std::endl;
842  sleep( 1 );
843  std::cout << "Trying " << DistribIP2 << std::endl;
845  if( HLXTCP.Connect() == 1) break;
846  std::cout << "Failed to connect to " << DistribIP2 << "." << std::endl;
847  std::cout << " Reconnect in " << reconnTime << " seconds." << std::endl;
848  sleep(reconnTime);
849  }
850  }
851  if( HLXTCP.IsConnected() == true )
852  {
853  std::cout << "Successfully connected." << std::endl;
854  }
855 
856 }
857 
858 // ------------ method called once each job just after ending the event loop ------------
860 {
861  // Fill the report summaries at end job
862  // Loop over the HLX's and fill the map,
863  // also calculate the overall quality.
864  HLXTCP.Disconnect();
865  EndRun( SaveAtEndJob );
866 }
867 
868 void HLXMonitor::EndRun( bool saveFile )
869 {
871 
872  // Do some things that should be done at the end of the run ...
873  if( saveFile && runNumber_ != 0 ){
875  else std::cout << "Num LS's (" << int(lumiSectionCount/num4NibblePerLS_) << ") "
876  << "is less than required minumum (" << MinLSBeforeSave
877  << "). File will not be saved!" << std::endl;
878  }
879  expectedNibbles_ = 0;
880  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX ) totalNibbles_[iHLX] = 0;
881 
882  std::cout << "** Here in end run **" << std::endl;
883  if(ResetAtNewRun) ResetAll();
884  runNumber_ = 0;
885  currentRunEnded_ = true;
892  sectionInstantNorm = 0;
893  lsBinOld = 0;
894  lumiSectionCount = 0;
895  previousSection = 0;
896 }
897 
898 
900 {
901  // Check for missing data
902  if( previousSection != (section.hdr.sectionNumber-1) ){
903  double weight = (double)(section.hdr.sectionNumber-previousSection-1);
904  //std::cout << "Filling missing data! " << weight << std::endl;
905  MissingDQMDataCheck->Fill(0.5,weight);
906  }
908 
909  int lsBin = int(lumiSectionCount/num4NibblePerLS_);
910  int lsBinBX = int(lumiSectionCount/num4NibblePerLS_);
914  //std::cout << "Lumi section count " << lumiSectionCount << " lsBin " << lsBin
915  // << " lsBinOld " << lsBinOld << " True section: " << section.hdr.sectionNumber << std::endl;
916 
917  //std::cout << "Instant Et sum: " << section.lumiSummary.InstantETLumi
918  // << " +/- " << section.lumiSummary.InstantETLumiErr << std::endl;
919  //std::cout << "Section sum so far: " << sectionInstantSumEt << " +/- "
920  // << sqrt(sectionInstantErrSumEt) << std::endl;
921 
922  int fillBin = lumiSectionCount+1;
923  if( fillBin > 128 )
924  {
925  // If we are already more than 2 LS's in, move everything back by one bin
926  // and fill the last bin with the new value.
927  for( int iBin = 1; iBin<128; ++iBin )
928  {
935  }
936  fillBin = 128;
937  }
938 
945 
946  double recentOldBinContent = RecentIntegratedLumiEtSum->getBinContent(fillBin-1);
947  if( fillBin == 1 ) recentOldBinContent = 0;
948  double recentNewBinContent = recentOldBinContent + section.lumiSummary.InstantETLumi;
949  RecentIntegratedLumiEtSum->setBinContent(fillBin,recentNewBinContent);
950  recentOldBinContent = RecentIntegratedLumiOccSet1->getBinContent(fillBin-1);
951  if( fillBin == 1 ) recentOldBinContent = 0;
952  recentNewBinContent = recentOldBinContent + section.lumiSummary.InstantOccLumi[0];
953  RecentIntegratedLumiOccSet1->setBinContent(fillBin,recentNewBinContent);
954  recentOldBinContent = RecentIntegratedLumiOccSet2->getBinContent(fillBin-1);
955  if( fillBin == 1 ) recentOldBinContent = 0;
956  recentNewBinContent = recentOldBinContent + section.lumiSummary.InstantOccLumi[0];
957  RecentIntegratedLumiOccSet2->setBinContent(fillBin,recentNewBinContent);
958 
959  double recentOldBinError = RecentIntegratedLumiEtSum->getBinError(fillBin-1);
960  if( fillBin == 1 ) recentOldBinError = 0;
961  double recentNewBinError = sqrt(recentOldBinError*recentOldBinError + section.lumiSummary.InstantETLumiErr*section.lumiSummary.InstantETLumiErr);
962  RecentIntegratedLumiEtSum->setBinError(fillBin,recentNewBinError);
963  recentOldBinError = RecentIntegratedLumiOccSet1->getBinError(fillBin-1);
964  if( fillBin == 1 ) recentOldBinError = 0;
965  recentNewBinError = sqrt(recentOldBinError*recentOldBinError + section.lumiSummary.InstantOccLumiErr[0]*section.lumiSummary.InstantOccLumiErr[0]);
966  RecentIntegratedLumiOccSet1->setBinError(fillBin,recentNewBinError);
967  recentOldBinError = RecentIntegratedLumiOccSet2->getBinError(fillBin-1);
968  if( fillBin == 1 ) recentOldBinError = 0;
969  recentNewBinError = sqrt(recentOldBinError*recentOldBinError + section.lumiSummary.InstantOccLumiErr[1]*section.lumiSummary.InstantOccLumiErr[1]);
970  RecentIntegratedLumiOccSet2->setBinError(fillBin,recentNewBinError);
971 
972 // std::cout << "New total " << RecentIntegratedLumiEtSum->getBinContent(fillBin)
973 // << " +/- " << RecentIntegratedLumiEtSum->getBinError(fillBin) << std::endl;
974 
975  if( lsBinOld != lsBin )
976  {
983 
984  double etDenom = fabs(sectionInstantSumEt);
985  if( etDenom < 1e-10 ) etDenom = 1e-10;
986  double occ1Denom = fabs(sectionInstantSumOcc1);
987  if( occ1Denom < 1e-10 ) occ1Denom = 1e-10;
988  double occ2Denom = fabs(sectionInstantSumOcc2);
989  if( occ2Denom < 1e-10 ) occ2Denom = 1e-10;
990  double etError = 100.0*sqrt(sectionInstantErrSumEt)/etDenom;
991  double occ1Error = 100.0*sqrt(sectionInstantErrSumOcc1)/occ1Denom;
992  double occ2Error = 100.0*sqrt(sectionInstantErrSumOcc2)/occ2Denom;
996 
997  double histOldBinContent = HistIntegratedLumiEtSum->getBinContent(lsBinOld);
998  if( lsBinOld == 0 ) histOldBinContent = 0;
999  double histNewBinContent = histOldBinContent + sectionInstantSumEt;
1000  HistIntegratedLumiEtSum->setBinContent(lsBin,histNewBinContent);
1001  histOldBinContent = HistIntegratedLumiOccSet1->getBinContent(lsBinOld);
1002  if( lsBinOld == 0 ) histOldBinContent = 0;
1003  histNewBinContent = histOldBinContent + sectionInstantSumOcc1;
1004  HistIntegratedLumiOccSet1->setBinContent(lsBin,histNewBinContent);
1005  histOldBinContent = HistIntegratedLumiOccSet2->getBinContent(lsBinOld);
1006  if( lsBinOld == 0 ) histOldBinContent = 0;
1007  histNewBinContent = histOldBinContent + sectionInstantSumOcc2;
1008  HistIntegratedLumiOccSet2->setBinContent(lsBin,histNewBinContent);
1009 
1010  double histOldBinError = HistIntegratedLumiEtSum->getBinError(lsBinOld);
1011  if( lsBinOld == 0 ) histOldBinError = 0;
1012  double histNewBinError = sqrt(histOldBinError*histOldBinError + sectionInstantErrSumEt);
1013  HistIntegratedLumiEtSum->setBinError(lsBin,histNewBinError);
1014  histOldBinError = HistIntegratedLumiOccSet1->getBinError(lsBinOld);
1015  if( lsBinOld == 0 ) histOldBinError = 0;
1016  histNewBinError = sqrt(histOldBinError*histOldBinError + sectionInstantErrSumOcc1);
1017  HistIntegratedLumiOccSet1->setBinError(lsBin,histNewBinError);
1018  histOldBinError = HistIntegratedLumiOccSet2->getBinError(lsBinOld);
1019  if( lsBinOld == 0 ) histOldBinError = 0;
1020  histNewBinError = sqrt(histOldBinError*histOldBinError + sectionInstantErrSumOcc2);
1021  HistIntegratedLumiOccSet2->setBinError(lsBin,histNewBinError);
1022 
1023  sectionInstantSumEt = 0;
1025  sectionInstantSumOcc1 = 0;
1027  sectionInstantSumOcc2 = 0;
1029  sectionInstantNorm = 0;
1030  lsBinOld = lsBin;
1031  }
1032 
1040 
1044 
1045  for( int iHLX = 0; iHLX < (int)NUM_HLX; ++iHLX ){
1046  unsigned int utotal1= 0;
1047  unsigned int utotal2 = 0;
1048  unsigned int iWedge = HLXHFMap[iHLX];
1049  if(section.occupancy[iHLX].hdr.numNibbles != 0){
1050 
1051  // Don't include the last one hundred BX in the average.
1052  for( unsigned int iBX = 0; iBX < NUM_BUNCHES; ++iBX ){
1053 
1054  // Normalize to number of towers
1055  unsigned int norm[2] = {0,0};
1056  norm[0] += section.occupancy[iHLX].data[set1BelowIndex ][iBX];
1057  norm[0] += section.occupancy[iHLX].data[set1BetweenIndex ][iBX];
1058  norm[0] += section.occupancy[iHLX].data[set1AboveIndex ][iBX];
1059  if( norm[0] == 0 ) norm[0]=1;
1060  norm[1] += section.occupancy[iHLX].data[set2BelowIndex ][iBX];
1061  norm[1] += section.occupancy[iHLX].data[set2BetweenIndex ][iBX];
1062  norm[1] += section.occupancy[iHLX].data[set2AboveIndex ][iBX];
1063  if( norm[1] == 0 ) norm[1]=1;
1064 
1065  double normEt = section.etSum[iHLX].data[iBX]/(double)(norm[0]+norm[1]);
1066  double normOccSet1Below = (double)section.occupancy[iHLX].data[set1BelowIndex][iBX]/(double)norm[0];
1067  double normOccSet1Between = (double)section.occupancy[iHLX].data[set1BetweenIndex][iBX]/(double)norm[0];
1068  double normOccSet1Above = (double)section.occupancy[iHLX].data[set1AboveIndex][iBX]/(double)norm[0];
1069  double normOccSet2Below = (double)section.occupancy[iHLX].data[set2BelowIndex][iBX]/(double)norm[1];
1070  double normOccSet2Between = (double)section.occupancy[iHLX].data[set2BetweenIndex][iBX]/(double)norm[1];
1071  double normOccSet2Above = (double)section.occupancy[iHLX].data[set2AboveIndex][iBX]/(double)norm[1];
1072 
1073  // Averages & check sum
1074  if( iBX < NUM_BUNCHES-100 )
1075  {
1076  AvgEtSum->Fill( iWedge,normEt);
1077 
1078  AvgOccBelowSet1-> Fill( iWedge, normOccSet1Below );
1079  AvgOccBetweenSet1->Fill( iWedge, normOccSet1Between );
1080  AvgOccAboveSet1-> Fill( iWedge, normOccSet1Above );
1081 
1082  AvgOccBelowSet2-> Fill( iWedge, normOccSet2Below );
1083  AvgOccBetweenSet2->Fill( iWedge, normOccSet2Between );
1084  AvgOccAboveSet2-> Fill( iWedge, normOccSet2Above );
1085 
1086  if( iWedge < 18 )
1087  {
1088  HistAvgEtSumHFP->Fill( lsBin,normEt);
1089  HistAvgOccBelowSet1HFP->Fill( lsBin, normOccSet1Below );
1090  HistAvgOccBetweenSet1HFP->Fill( lsBin, normOccSet1Between );
1091  HistAvgOccAboveSet1HFP->Fill( lsBin, normOccSet1Above );
1092  HistAvgOccBelowSet2HFP->Fill( lsBin, normOccSet2Below );
1093  HistAvgOccBetweenSet2HFP->Fill( lsBin, normOccSet2Between );
1094  HistAvgOccAboveSet2HFP->Fill( lsBin, normOccSet2Above );
1095 
1096  if( iBX >= (XMIN-1) && iBX <= (XMAX-1) ) BXvsTimeAvgEtSumHFP->Fill(lsBinBX,iBX,normEt/(num4NibblePerLS_*18.0*12.0));
1097  }
1098  else
1099  {
1100  HistAvgEtSumHFM->Fill( lsBin,normEt);
1101  HistAvgOccBelowSet1HFM->Fill( lsBin, normOccSet1Below );
1102  HistAvgOccBetweenSet1HFM->Fill( lsBin, normOccSet1Between );
1103  HistAvgOccAboveSet1HFM->Fill( lsBin, normOccSet1Above );
1104  HistAvgOccBelowSet2HFM->Fill( lsBin, normOccSet2Below );
1105  HistAvgOccBetweenSet2HFM->Fill( lsBin, normOccSet2Between );
1106  HistAvgOccAboveSet2HFM->Fill( lsBin, normOccSet2Above );
1107 
1108  if( iBX >= (XMIN-1) && iBX <= (XMAX-1) ) BXvsTimeAvgEtSumHFM->Fill(lsBinBX,iBX,normEt/(num4NibblePerLS_*18.0*12.0));
1109  }
1110 
1111  utotal1 += section.occupancy[iHLX].data[set1BelowIndex ][iBX];
1112  utotal1 += section.occupancy[iHLX].data[set1BetweenIndex][iBX];
1113  utotal1 += section.occupancy[iHLX].data[set1AboveIndex ][iBX];
1114 
1115  utotal2 += section.occupancy[iHLX].data[set2BelowIndex ][iBX];
1116  utotal2 += section.occupancy[iHLX].data[set2BetweenIndex][iBX];
1117  utotal2 += section.occupancy[iHLX].data[set2AboveIndex ][iBX];
1118 
1119  }
1120 
1121  if(Style.compare("BX") == 0)
1122  {
1123  // Get the correct bin ...
1124  TH1F *Set1BelowHist = Set1Below[iWedge]->getTH1F();
1125  int iBin = Set1BelowHist->FindBin((float)iBX);
1126 
1127  // Adjust the old bin content to make the new, unnormalize and renormalize
1128  if( lumiSectionCount > 0 ){
1129  double oldNormOccSet1Below = (Set1Below[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1130  normOccSet1Below += oldNormOccSet1Below;
1131  normOccSet1Below /= (double)(lumiSectionCount+1);
1132  double oldNormOccSet2Below = (Set2Below[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1133  normOccSet2Below += oldNormOccSet2Below;
1134  normOccSet2Below /= (double)(lumiSectionCount+1);
1135 
1136  double oldNormOccSet1Between = (Set1Between[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1137  normOccSet1Between += oldNormOccSet1Between;
1138  normOccSet1Between /= (double)(lumiSectionCount+1);
1139  double oldNormOccSet2Between = (Set2Between[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1140  normOccSet2Between += oldNormOccSet2Between;
1141  normOccSet2Between /= (double)(lumiSectionCount+1);
1142 
1143  double oldNormOccSet1Above = (Set1Above[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1144  normOccSet1Above += oldNormOccSet1Above;
1145  normOccSet1Above /= (double)(lumiSectionCount+1);
1146  double oldNormOccSet2Above = (Set2Above[iWedge]->getBinContent(iBin))*(double)(lumiSectionCount);
1147  normOccSet2Above += oldNormOccSet2Above;
1148  normOccSet2Above /= (double)(lumiSectionCount+1);
1149 
1150  double oldNormEt = ETSum[iWedge]->getBinContent(iBin)*(double)(lumiSectionCount);
1151  normEt += oldNormEt;
1152  normEt /= (double)(lumiSectionCount+1);
1153  }
1154 
1155  Set1Below[iWedge]-> setBinContent(iBin, normOccSet1Below );
1156  Set1Between[iWedge]->setBinContent(iBin, normOccSet1Between );
1157  Set1Above[iWedge]-> setBinContent(iBin, normOccSet1Above );
1158  Set2Below[iWedge]-> setBinContent(iBin, normOccSet2Below );
1159  Set2Between[iWedge]->setBinContent(iBin, normOccSet2Between );
1160  Set2Above[iWedge]-> setBinContent(iBin, normOccSet2Above );
1161  ETSum[iWedge]-> setBinContent(iBin, normEt);
1162 
1163 // Set1Below[iWedge]-> Fill(iBX, normOccSet1Below );
1164 // Set1Between[iWedge]->Fill(iBX, normOccSet1Between );
1165 // Set1Above[iWedge]-> Fill(iBX, normOccSet1Above );
1166 // Set2Below[iWedge]-> Fill(iBX, normOccSet2Below );
1167 // Set2Between[iWedge]->Fill(iBX, normOccSet2Between );
1168 // Set2Above[iWedge]-> Fill(iBX, normOccSet2Above );
1169 // ETSum[iWedge]-> Fill(iBX, normEt);
1170  }
1171  else if(Style.compare("Dist")==0)
1172  {
1173  Set1Below[iWedge]-> Fill( normOccSet1Below );
1174  Set1Between[iWedge]->Fill( normOccSet1Between );
1175  Set1Above[iWedge]-> Fill( normOccSet1Above );
1176  Set2Below[iWedge]-> Fill( normOccSet2Below );
1177  Set2Between[iWedge]->Fill( normOccSet2Between );
1178  Set2Above[iWedge]-> Fill( normOccSet2Above );
1179  ETSum[iWedge]-> Fill( normEt );
1180  }
1181  }
1182 
1183  // Get the number of towers per wedge per BX (assuming non-zero numbers)
1184  double total1 = 0;
1185  double total2 = 0;
1186  if( (NUM_BUNCHES-100)>0 )
1187  {
1188  total1 = (double)utotal1/(double)(NUM_BUNCHES-100);
1189  total2 = (double)utotal2/(double)(NUM_BUNCHES-100);
1190  }
1191  if( section.hdr.numOrbits > 0 )
1192  {
1193  total1 = total1/(double)section.hdr.numOrbits;
1194  total2 = total2/(double)section.hdr.numOrbits;
1195  }
1196 
1197  SumAllOccSet1-> Fill( iWedge, total1 );
1198  SumAllOccSet2-> Fill( iWedge, total2 );
1199  }
1200  }
1201 
1202  double max[4] = {-1000.0,-1000.0,-1000.0,-1000.0};
1203  int bxmax[4] = {-1,-1,-1,-1};
1204  for( unsigned int iBX = 0; iBX < NUM_BUNCHES; ++iBX ){
1205 
1206  LumiAvgEtSum->Fill(iBX, section.lumiDetail.ETLumi[iBX]);
1207  LumiAvgOccSet1->Fill(iBX, section.lumiDetail.OccLumi[0][iBX]);
1208  LumiAvgOccSet2->Fill(iBX, section.lumiDetail.OccLumi[1][iBX]);
1209 
1210  if( section.lumiDetail.OccLumi[0][iBX] > max[0] ){
1211  max[3] = max[2];
1212  bxmax[3] = bxmax[2];
1213  max[2] = max[1];
1214  bxmax[2] = bxmax[1];
1215  max[1] = max[0];
1216  bxmax[1] = bxmax[0];
1217  max[0] = section.lumiDetail.OccLumi[0][iBX];
1218  bxmax[0] = iBX;
1219  } else if( section.lumiDetail.OccLumi[0][iBX] > max[1] ){
1220  max[3] = max[2];
1221  bxmax[3] = bxmax[2];
1222  max[2] = max[1];
1223  bxmax[2] = bxmax[1];
1224  max[1] = section.lumiDetail.OccLumi[0][iBX];
1225  bxmax[1] = iBX;
1226  } else if( section.lumiDetail.OccLumi[0][iBX] > max[2] ){
1227  max[3] = max[2];
1228  bxmax[3] = bxmax[2];
1229  max[2] = section.lumiDetail.OccLumi[0][iBX];
1230  bxmax[2] = iBX;
1231  } else if( section.lumiDetail.OccLumi[0][iBX] > max[3] ){
1232  max[3] = section.lumiDetail.OccLumi[0][iBX];
1233  bxmax[3] = iBX;
1234  }
1235 
1236  int iBin = iBX - (int)XMIN + 1;
1237  if( iBin <= int(XMAX-XMIN) && iBin >= 1 ){
1238 
1239  //cout << "Et sum " << section.lumiDetail.ETLumi[iBX] << " +/- "
1240  // << section.lumiDetail.ETLumiErr[iBX] << std::endl;
1241  //cout << "Occ1 " << section.lumiDetail.OccLumi[0][iBX] << " +/- "
1242  // << section.lumiDetail.OccLumiErr[0][iBX] << std::endl;
1243  //cout << "Occ2 " << section.lumiDetail.OccLumi[1][iBX] << " +/- "
1244  // << section.lumiDetail.OccLumiErr[1][iBX] << std::endl;
1245  LumiInstantEtSum->setBinContent(iBin, section.lumiDetail.ETLumi[iBX]);
1246  LumiInstantOccSet1->setBinContent(iBin, section.lumiDetail.OccLumi[0][iBX]);
1247  LumiInstantOccSet2->setBinContent(iBin, section.lumiDetail.OccLumi[1][iBX]);
1248  LumiInstantEtSum->setBinError(iBin, section.lumiDetail.ETLumiErr[iBX]);
1249  LumiInstantOccSet1->setBinError(iBin, section.lumiDetail.OccLumiErr[0][iBX]);
1250  LumiInstantOccSet2->setBinError(iBin, section.lumiDetail.OccLumiErr[1][iBX]);
1251 
1252  double oldBinContent = LumiIntegratedEtSum->getBinContent(iBin);
1253  if( lumiSectionCount == 0 ) oldBinContent = 0;
1254  double newBinContent = oldBinContent + section.lumiDetail.ETLumi[iBX];
1255  LumiIntegratedEtSum->setBinContent(iBin, newBinContent);
1256  oldBinContent = LumiIntegratedOccSet1->getBinContent(iBin);
1257  if( lumiSectionCount == 0 ) oldBinContent = 0;
1258  newBinContent = oldBinContent + section.lumiDetail.OccLumi[0][iBX];
1259  LumiIntegratedOccSet1->setBinContent(iBin, newBinContent);
1260  oldBinContent = LumiIntegratedOccSet2->getBinContent(iBin);
1261  if( lumiSectionCount == 0 ) oldBinContent = 0;
1262  newBinContent = oldBinContent + section.lumiDetail.OccLumi[1][iBX];
1263  LumiIntegratedOccSet2->setBinContent(iBin, newBinContent);
1264 
1265  double oldBinError = LumiIntegratedEtSum->getBinError(iBin);
1266  if( lumiSectionCount == 0 ) oldBinError = 0;
1267  double newBinError = sqrt(oldBinError*oldBinError + section.lumiDetail.ETLumiErr[iBX]*section.lumiDetail.ETLumiErr[iBX]);
1268  LumiIntegratedEtSum->setBinError(iBin, newBinError);
1269  oldBinError = LumiIntegratedOccSet1->getBinError(iBin);
1270  if( lumiSectionCount == 0 ) oldBinError = 0;
1271  newBinError = sqrt(oldBinError*oldBinError + section.lumiDetail.OccLumiErr[0][iBX]*section.lumiDetail.OccLumiErr[0][iBX]);
1272  LumiIntegratedOccSet1->setBinError(iBin, newBinError);
1273  oldBinError = LumiIntegratedOccSet1->getBinError(iBin);
1274  if( lumiSectionCount == 0 ) oldBinError = 0;
1275  newBinError = sqrt(oldBinError*oldBinError + section.lumiDetail.OccLumiErr[1][iBX]*section.lumiDetail.OccLumiErr[1][iBX]);
1276  LumiIntegratedOccSet2->setBinError(iBin, newBinError);
1277  }
1278  }
1279 
1280  // Now fill the maximum hists, but ordered by BX, so that
1281  // collision BX's or satellite BX's will always appear in the
1282  // same histogram.
1283  int flag=1;
1284  for( int iM = 0; (iM<4)&&flag; ++iM ){
1285  flag = 0;
1286  for( int iN = 0; iN < 3; ++iN ){
1287  if( bxmax[iN+1] < bxmax[iN] ){
1288  int tmp = bxmax[iN];
1289  bxmax[iN] = bxmax[iN+1];
1290  bxmax[iN+1] = tmp;
1291 
1292  double tmp2 = max[iN];
1293  max[iN] = max[iN+1];
1294  max[iN+1] = tmp2;
1295  flag=1;
1296  }
1297  }
1298  }
1299 
1300  // 0.9e1 = Conversion constant for occ1 at 900GeV COM.
1301  MaxInstLumiBX1->Fill(max[0]*0.9e1);
1302  MaxInstLumiBXNum1->Fill(bxmax[0]);
1303  MaxInstLumiBX2->Fill(max[1]*0.9e1);
1304  MaxInstLumiBXNum2->Fill(bxmax[1]);
1305  MaxInstLumiBX3->Fill(max[2]*0.9e1);
1306  MaxInstLumiBXNum3->Fill(bxmax[2]);
1307  MaxInstLumiBX4->Fill(max[3]*0.9e1);
1308  MaxInstLumiBXNum4->Fill(bxmax[3]);
1309 
1310  TH1F* tmpHist = MaxInstLumiBX1->getTH1F();
1311  double minX = tmpHist->GetBinLowEdge(1);
1312  double maxX = tmpHist->GetBinLowEdge(tmpHist->GetNbinsX()+1);
1313 
1314  int inum4NibblePerLS = (int)num4NibblePerLS_;
1315  if( lumiSectionCount%inum4NibblePerLS == 0 ){
1316  double mean1 = MaxInstLumiBX1->getMean();
1317  double rms1 = MaxInstLumiBX1->getRMS();
1318  if( rms1 > 0 && mean1-5*rms1 > minX && mean1+5*rms1<maxX ) MaxInstLumiBX1->setAxisRange(mean1-5*rms1,mean1+5*rms1);
1319 
1320  double mean2 = MaxInstLumiBX2->getMean();
1321  double rms2 = MaxInstLumiBX2->getRMS();
1322  if( rms2 > 0 && mean2-5*rms2 > minX && mean2+5*rms2<maxX ) MaxInstLumiBX2->setAxisRange(mean2-5*rms2,mean2+5*rms2);
1323 
1324  double mean3 = MaxInstLumiBX3->getMean();
1325  double rms3 = MaxInstLumiBX3->getRMS();
1326  if( rms3 > 0 && mean3-5*rms3 > minX && mean3+5*rms3<maxX ) MaxInstLumiBX3->setAxisRange(mean3-5*rms3,mean3+5*rms3);
1327 
1328  double mean4 = MaxInstLumiBX4->getMean();
1329  double rms4 = MaxInstLumiBX4->getRMS();
1330  if( rms4 > 0 && mean4-5*rms4 > minX && mean4+5*rms4<maxX ) MaxInstLumiBX4->setAxisRange(mean4-5*rms4,mean4+5*rms4);
1331  }
1332 
1333 
1334  // Add one to the section count (usually short sections)
1335  ++lumiSectionCount;
1336 }
1337 
1338 
1340 {
1341 
1342  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX ){
1343 
1344  unsigned int iWedge = HLXHFMap[iHLX];
1345 
1346  if(section.occupancy[iHLX].hdr.numNibbles != 0){
1347  float nActvTwrsSet1 = section.occupancy[iHLX].data[set1AboveIndex][TriggerBX]
1348  + section.occupancy[iHLX].data[set1BetweenIndex][TriggerBX]
1349  + section.occupancy[iHLX].data[set1BelowIndex][TriggerBX];
1350 
1351  float nActvTwrsSet2 = section.occupancy[iHLX].data[set2AboveIndex][TriggerBX]
1352  + section.occupancy[iHLX].data[set2BetweenIndex][TriggerBX]
1353  + section.occupancy[iHLX].data[set2BelowIndex][TriggerBX];
1354 
1355  float total = nActvTwrsSet1 + nActvTwrsSet2;
1356 
1357  if( total > 0){
1358  float tempData = section.etSum[iHLX].data[TriggerBX]/total;
1359  //cout << "Filling HFCompare Et sum " << tempData << endl;
1360  HFCompareEtSum->Fill( iWedge, tempData );
1361  }
1362 
1363  if(nActvTwrsSet1 > 0){
1364  float tempData = (float)section.occupancy[iHLX].data[set1BelowIndex][TriggerBX]/nActvTwrsSet1;
1365  HFCompareOccBelowSet1->Fill( iWedge, tempData);
1366 
1367  tempData = (float)section.occupancy[iHLX].data[set1BetweenIndex][TriggerBX]/nActvTwrsSet1;
1368  HFCompareOccBetweenSet1->Fill( iWedge, tempData);
1369 
1370  tempData = (float)section.occupancy[iHLX].data[set1AboveIndex][TriggerBX]/nActvTwrsSet1;
1371  HFCompareOccAboveSet1->Fill( iWedge, tempData);
1372  }
1373 
1374  if( nActvTwrsSet2 > 0){
1375  float tempData = (float)section.occupancy[iHLX].data[set2BelowIndex][TriggerBX]/nActvTwrsSet2;
1376  HFCompareOccBelowSet2->Fill( iWedge, tempData);
1377 
1378  tempData = (float)section.occupancy[iHLX].data[set2BetweenIndex][TriggerBX]/nActvTwrsSet2;
1379  HFCompareOccBetweenSet2->Fill( iWedge, tempData);
1380 
1381  tempData = (float)section.occupancy[iHLX].data[set2AboveIndex][TriggerBX]/nActvTwrsSet2;
1382  HFCompareOccAboveSet2->Fill( iWedge, tempData);
1383  }
1384  }
1385  }
1386 }
1387 
1389 {
1390  // New run .. set the run number and fill run summaries ...
1391  //std::cout << "Run number " << runNumber_ << " Section hdr run number "
1392 // << section.hdr.runNumber << std::endl;
1393 
1394  runId_->Fill( section.hdr.runNumber );
1395  lumisecId_->Fill( (int)(section.hdr.sectionNumber/num4NibblePerLS_) + 1 );
1396 
1397  // Update the total nibbles & the expected number
1398  expectedNibbles_ += section.hdr.numOrbits/4096;
1399  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX ){
1400  unsigned int iWedge = HLXHFMap[iHLX] + 1;
1401  totalNibbles_[iWedge-1] += section.occupancy[iHLX].hdr.numNibbles;
1402  }
1403 
1404  eventId_->Fill(e.id().event());
1405  eventTimeStamp_->Fill(e.time().value()/(double)0xffffffff);
1406 
1407  pEvent_++;
1408  evtRateCount_++;
1410 
1412  gettimeofday(&currentTime_,NULL);
1415 
1417  if(time>=(evtRateWindow_*60.0)){
1418  processEventRate_->Fill((float)evtRateCount_/time);
1419  evtRateCount_ = 0;
1421  }
1422 
1423 }
1424 
1426  // Run summary - Loop over the HLX's and fill the map,
1427  // also calculate the overall quality.
1428  float overall = 0.0;
1429  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX ){
1430  unsigned int iWedge = HLXHFMap[iHLX] + 1;
1431  unsigned int iEta = 2;
1432  float frac = 0.0;
1433  if( expectedNibbles_ > 0 ) frac = (float)totalNibbles_[iWedge-1]/(float)expectedNibbles_;
1434  if( iWedge >= 19 ){ iEta = 1; iWedge -= 18; }
1435  reportSummaryMap_->setBinContent(iWedge,iEta,frac);
1436  overall += frac;
1437  }
1438 
1439  overall /= (float)NUM_HLX;
1440  if( overall > 1.0 ) overall = 0.0;
1441  //std::cout << "Filling report summary! Main. " << overall << std::endl;
1442  reportSummary_->Fill(overall);
1443 }
1444 
1446 {
1447  for( unsigned int iHLX = 0; iHLX < NUM_HLX; ++iHLX )
1448  {
1449  dbe_->softReset( Set1Below[iHLX] );
1450  dbe_->softReset( Set1Between[iHLX] );
1451  dbe_->softReset( Set1Above[iHLX] );
1452  dbe_->softReset( Set2Below[iHLX] );
1453  dbe_->softReset( Set2Between[iHLX] );
1454  dbe_->softReset( Set2Above[iHLX] );
1455 
1456  dbe_->softReset( ETSum[iHLX] );
1457 
1458  }
1459 
1467 
1475 
1476  // Luminosity Monitoring
1486 
1487  // Sanity Check for Occupancy
1491 
1496 
1501 
1502 
1503  // History
1504  lumiSectionCount = 0;
1505  previousSection = 0;
1508 
1515 
1522 
1535 
1542 
1545 }
1546 
1547 double HLXMonitor::getUTCtime(timeval* a, timeval* b){
1548  double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0;
1549  if(b!=NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT;
1550  return deltaT/1000.0;
1551 }
1552 
1553 
1554 //define this as a plug-in
double sectionInstantSumEt
Definition: HLXMonitor.h:281
MonitorElement * HistAvgOccBetweenSet1HFP
Definition: HLXMonitor.h:146
MonitorElement * HFCompareOccAboveSet1
Definition: HLXMonitor.h:101
EventNumber_t event() const
Definition: EventID.h:44
MonitorElement * Set2Between[36]
Definition: HLXMonitor.h:94
MonitorElement * processLatency_
The UTC time of the last event.
Definition: HLXMonitor.h:198
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * HistInstantLumiOccSet1
Definition: HLXMonitor.h:163
std::string OutputDir
Definition: HLXMonitor.h:230
MonitorElement * HFCompareOccAboveSet2
Definition: HLXMonitor.h:104
MonitorElement * RecentIntegratedLumiOccSet2
Definition: HLXMonitor.h:177
MonitorElement * MaxInstLumiBX4
Definition: HLXMonitor.h:134
int i
Definition: DBlmapReader.cc:9
unsigned int totalNibbles_[36]
Definition: HLXMonitor.h:274
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: HLXMonitor.h:197
void FillReportSummary()
Definition: HLXMonitor.cc:1425
void setBinContent(int binx, double content)
set content of bin (1-D)
unsigned int HLXHFMap[36]
Definition: HLXMonitor.h:276
long int flag
Definition: mlp_lapack.h:47
int SetPort(unsigned short int)
Definition: TCPReceiver.cc:182
MonitorElement * HistAvgLumiOccSet2
Definition: HLXMonitor.h:161
ET_SUM_SECTION etSum[HCAL_HLX_MAX_HLXS]
unsigned int secNumLength
Definition: HLXMonitor.h:262
MonitorElement * HistAvgOccBelowSet2HFM
Definition: HLXMonitor.h:151
MonitorElement * RecentIntegratedLumiEtSum
Definition: HLXMonitor.h:175
double XMAX
Definition: HLXMonitor.h:226
virtual void beginJob()
Definition: HLXMonitor.cc:828
MonitorElement * LumiIntegratedEtSum
Definition: HLXMonitor.h:121
void SetupHists()
Definition: HLXMonitor.cc:125
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1419
MonitorElement * SumAllOccSet1
Definition: HLXMonitor.h:126
MonitorElement * LumiInstantOccSet2
Definition: HLXMonitor.h:120
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * AvgOccBetweenSet2
Definition: HLXMonitor.h:111
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
int prescaleEvt_
Definition: HLXMonitor.h:241
MonitorElement * AvgOccBelowSet1
Definition: HLXMonitor.h:107
MonitorElement * HistAvgEtSumHFM
Definition: HLXMonitor.h:143
MonitorElement * AvgOccAboveSet2
Definition: HLXMonitor.h:112
MonitorElement * HistAvgEtSumHFP
Definition: HLXMonitor.h:142
MonitorElement * HistAvgOccAboveSet1HFP
Definition: HLXMonitor.h:148
float data[HCAL_HLX_MAX_BUNCHES]
MonitorElement * LumiInstantEtSum
Definition: HLXMonitor.h:118
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: HLXMonitor.cc:726
std::string OccYAxisTitle
Definition: HLXMonitor.h:265
MonitorElement * LumiAvgOccSet2
Definition: HLXMonitor.h:117
MonitorElement * cmsswVer_
Current working directory of the job.
Definition: HLXMonitor.h:204
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
uint32_t data[6][HCAL_HLX_MAX_BUNCHES]
MonitorElement * HistInstantLumiOccSet2Error
Definition: HLXMonitor.h:167
unsigned int NUM_HLX
Definition: HLXMonitor.h:233
MonitorElement * processEventRate_
Time elapsed since the last event.
Definition: HLXMonitor.h:199
unsigned int runNumber_
Definition: HLXMonitor.h:272
int lsBinOld
Definition: HLXMonitor.h:280
MonitorElement * MissingDQMDataCheck
Definition: HLXMonitor.h:128
#define NULL
Definition: scimark2.h:8
MonitorElement * HistInstantLumiOccSet2
Definition: HLXMonitor.h:164
MonitorElement * LumiInstantOccSet1
Definition: HLXMonitor.h:119
MonitorElement * HistAvgOccAboveSet1HFM
Definition: HLXMonitor.h:149
float OccLumi[2][HCAL_HLX_MAX_BUNCHES]
float evtRateWindow_
Definition: HLXMonitor.h:292
std::string OutputFilePrefix
Definition: HLXMonitor.h:229
MonitorElement * LumiIntegratedOccSet1
Definition: HLXMonitor.h:122
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double sectionInstantErrSumEt
Definition: HLXMonitor.h:282
double sectionInstantErrSumOcc2
Definition: HLXMonitor.h:286
void sleep(Duration_t)
Definition: Utils.h:163
unsigned int set2AboveIndex
Definition: HLXMonitor.h:252
MonitorElement * Set1Below[36]
Definition: HLXMonitor.h:90
void SetIP(std::string IP)
Definition: TCPReceiver.cc:222
int evtRateCount_
Definition: HLXMonitor.h:293
double XMIN
Definition: HLXMonitor.h:226
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
SaveReferenceTag
Definition: DQMStore.h:70
void Fill(long long x)
std::string EtYAxisTitle
Definition: HLXMonitor.h:267
std::string eventInfoFolderHLX_
Definition: HLXMonitor.h:257
MonitorElement * HistInstantLumiEtSumError
Definition: HLXMonitor.h:165
std::string DistribIP2
Definition: HLXMonitor.h:245
virtual void endJob()
Definition: HLXMonitor.cc:859
MonitorElement * eventId_
UTC time of the run start.
Definition: HLXMonitor.h:187
int listenPort
Definition: HLXMonitor.h:225
MonitorElement * processId_
Number of collector updates (TBD)
Definition: HLXMonitor.h:195
MonitorElement * MaxInstLumiBX1
Definition: HLXMonitor.h:131
MonitorElement * reportSummaryMap_
Definition: HLXMonitor.h:212
unsigned int MAX_LS
Definition: HLXMonitor.h:235
int iEvent
Definition: GenABIO.cc:243
MonitorElement * HistAvgOccBelowSet1HFP
Definition: HLXMonitor.h:144
MonitorElement * HFCompareEtSum
Definition: HLXMonitor.h:98
MonitorElement * runStartTimeStamp_
Definition: HLXMonitor.h:186
const T & max(const T &a, const T &b)
MonitorElement * Set1Between[36]
Definition: HLXMonitor.h:91
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
unsigned int set2BetweenIndex
Definition: HLXMonitor.h:251
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double sectionInstantSumOcc1
Definition: HLXMonitor.h:283
timeval lastUpdateTime_
Definition: HLXMonitor.h:290
unsigned int set2BelowIndex
Definition: HLXMonitor.h:250
T sqrt(T t)
Definition: SSEVec.h:46
double sectionInstantSumOcc2
Definition: HLXMonitor.h:285
DQMStore * dbe_
Definition: HLXMonitor.h:215
MonitorElement * HistIntegratedLumiOccSet1
Definition: HLXMonitor.h:169
MonitorElement * RecentInstantLumiOccSet1
Definition: HLXMonitor.h:173
MonitorElement * HistIntegratedLumiOccSet2
Definition: HLXMonitor.h:170
MonitorElement * BXvsTimeAvgEtSumHFM
Definition: HLXMonitor.h:157
MonitorElement * HistAvgOccBetweenSet2HFM
Definition: HLXMonitor.h:153
MonitorElement * AvgOccAboveSet1
Definition: HLXMonitor.h:109
MonitorElement * HistInstantLumiOccSet1Error
Definition: HLXMonitor.h:166
HCAL_HLX::LUMI_SECTION lumiSection
Definition: HLXMonitor.h:269
MonitorElement * hostName_
of event processed so far
Definition: HLXMonitor.h:201
MonitorElement * HFCompareOccBelowSet1
Definition: HLXMonitor.h:99
bool SaveAtEndJob
Definition: HLXMonitor.h:255
unsigned int NBINS
Definition: HLXMonitor.h:227
MonitorElement * ETSum[36]
Definition: HLXMonitor.h:96
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
bool ResetAtNewRun
Definition: HLXMonitor.h:254
MonitorElement * Set2Below[36]
Definition: HLXMonitor.h:93
float ETLumi[HCAL_HLX_MAX_BUNCHES]
void softReset(MonitorElement *me)
Definition: DQMStore.cc:2734
MonitorElement * MaxInstLumiBXNum2
Definition: HLXMonitor.h:137
MonitorElement * MaxInstLumiBX2
Definition: HLXMonitor.h:132
void SetupEventInfo()
Definition: HLXMonitor.cc:646
MonitorElement * SumAllOccSet2
Definition: HLXMonitor.h:127
std::string monitorName_
Definition: HLXMonitor.h:240
MonitorElement * AvgEtSum
Definition: HLXMonitor.h:106
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
Definition: HLXMonitor.h:194
MonitorElement * HistAvgOccAboveSet2HFM
Definition: HLXMonitor.h:155
bool Accumulate
Definition: HLXMonitor.h:228
MonitorElement * LumiAvgEtSum
Definition: HLXMonitor.h:115
MonitorElement * eventTimeStamp_
Definition: HLXMonitor.h:189
MonitorElement * BXvsTimeAvgEtSumHFP
Definition: HLXMonitor.h:156
MonitorElement * HistAvgOccBetweenSet1HFM
Definition: HLXMonitor.h:147
OCCUPANCY_SECTION occupancy[HCAL_HLX_MAX_HLXS]
MonitorElement * RecentIntegratedLumiOccSet1
Definition: HLXMonitor.h:176
unsigned int TriggerBX
Definition: HLXMonitor.h:237
MonitorElement * MaxInstLumiBXNum4
Definition: HLXMonitor.h:139
std::string getReleaseVersion()
unsigned int NUM_BUNCHES
Definition: HLXMonitor.h:234
MonitorElement * HistAvgLumiOccSet1
Definition: HLXMonitor.h:160
MonitorElement * HistAvgOccAboveSet2HFP
Definition: HLXMonitor.h:154
TimeValue_t value() const
Definition: Timestamp.cc:72
unsigned int MinLSBeforeSave
Definition: HLXMonitor.h:238
MonitorElement * HistAvgOccBelowSet1HFM
Definition: HLXMonitor.h:145
MonitorElement * RecentInstantLumiOccSet2
Definition: HLXMonitor.h:174
MonitorElement * Set2Above[36]
Definition: HLXMonitor.h:95
MonitorElement * HistAvgLumiEtSum
Definition: HLXMonitor.h:159
MonitorElement * HistIntegratedLumiEtSum
Definition: HLXMonitor.h:168
float ETLumiErr[HCAL_HLX_MAX_BUNCHES]
TCPReceiver HLXTCP
Definition: HLXMonitor.h:88
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
MonitorElement * HistAvgOccBelowSet2HFP
Definition: HLXMonitor.h:150
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
Definition: HLXMonitor.h:200
double sectionInstantNorm
Definition: HLXMonitor.h:287
MonitorElement * MaxInstLumiBXNum3
Definition: HLXMonitor.h:138
MonitorElement * MaxInstLumiBX3
Definition: HLXMonitor.h:133
TH1F * getTH1F(void) const
void setResetMe(bool)
double sectionInstantErrSumOcc1
Definition: HLXMonitor.h:284
unsigned int previousSection
Definition: HLXMonitor.h:278
std::string subSystemName_
Definition: HLXMonitor.h:259
bool currentRunEnded_
Definition: HLXMonitor.h:271
double b
Definition: hdecay.h:120
MonitorElement * processName_
Hostname of the local machine.
Definition: HLXMonitor.h:202
void FillEventInfo(const LUMI_SECTION &, const edm::Event &e)
Definition: HLXMonitor.cc:1388
double getUTCtime(timeval *a, timeval *b=NULL)
Definition: HLXMonitor.cc:1547
unsigned int runNumLength
Definition: HLXMonitor.h:261
timeval lastAvgTime_
Definition: HLXMonitor.h:290
int ReceiveLumiSection(HCAL_HLX::LUMI_SECTION &localSection)
Definition: TCPReceiver.cc:88
MonitorElement * Set1Above[36]
Definition: HLXMonitor.h:92
int SavePeriod
Definition: HLXMonitor.h:232
MonitorElement * processStartTimeStamp_
The PID associated with this job.
Definition: HLXMonitor.h:196
void EndRun(bool saveFile=true)
Definition: HLXMonitor.cc:868
unsigned int expectedNibbles_
Definition: HLXMonitor.h:273
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int SetMode(unsigned char)
Definition: TCPReceiver.cc:202
MonitorElement * MaxInstLumiBXNum1
Definition: HLXMonitor.h:136
MonitorElement * AvgOccBelowSet2
Definition: HLXMonitor.h:110
double getBinContent(int binx) const
get content of bin (1-D)
edm::EventID id() const
Definition: EventBase.h:56
HLXMonitor(const edm::ParameterSet &)
Definition: HLXMonitor.cc:17
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
Definition: DQMStore.cc:1385
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double num4NibblePerLS_
Definition: HLXMonitor.h:297
double a
Definition: hdecay.h:121
std::string OccXAxisTitle
Definition: HLXMonitor.h:264
MonitorElement * HistInstantLumiEtSum
Definition: HLXMonitor.h:162
MonitorElement * runId_
Definition: HLXMonitor.h:185
unsigned int AquireMode
Definition: HLXMonitor.h:236
MonitorElement * HFCompareOccBetweenSet2
Definition: HLXMonitor.h:103
unsigned int set1BelowIndex
Definition: HLXMonitor.h:247
static const int STATUS_OK
unsigned int lumiSectionCount
Definition: HLXMonitor.h:279
std::string eventInfoFolder_
Definition: HLXMonitor.h:258
MonitorElement * LumiIntegratedOccSet2
Definition: HLXMonitor.h:123
MonitorElement * HFCompareOccBelowSet2
Definition: HLXMonitor.h:102
tuple cout
Definition: gather_cfg.py:121
MonitorElement * HFCompareOccBetweenSet1
Definition: HLXMonitor.h:100
void FillHistograms(const LUMI_SECTION &)
Definition: HLXMonitor.cc:899
void ResetAll()
Definition: HLXMonitor.cc:1445
void SaveDQMFile()
Definition: HLXMonitor.cc:807
timeval currentTime_
Definition: HLXMonitor.h:290
void showDirStructure(void) const
Definition: DQMStore.cc:2761
MonitorElement * LumiAvgOccSet1
Definition: HLXMonitor.h:116
std::string DistribIP1
Definition: HLXMonitor.h:244
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
MonitorElement * workingDir_
DQM &quot;name&quot; of the job (eg, Hcal or DT)
Definition: HLXMonitor.h:203
MonitorElement * AvgOccBetweenSet1
Definition: HLXMonitor.h:108
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * RecentInstantLumiEtSum
Definition: HLXMonitor.h:172
edm::Timestamp time() const
Definition: EventBase.h:57
MonitorElement * reportSummary_
Definition: HLXMonitor.h:211
MonitorElement * HistAvgOccBetweenSet2HFP
Definition: HLXMonitor.h:152
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
unsigned int set1AboveIndex
Definition: HLXMonitor.h:249
Definition: NicePlot.h:7
std::string EtXAxisTitle
Definition: HLXMonitor.h:266
MonitorElement * lumisecId_
Definition: HLXMonitor.h:188
unsigned int reconnTime
Definition: HLXMonitor.h:243
unsigned int set1BetweenIndex
Definition: HLXMonitor.h:248
void FillHistoHFCompare(const LUMI_SECTION &)
Definition: HLXMonitor.cc:1339
float OccLumiErr[2][HCAL_HLX_MAX_BUNCHES]