ATLAS Offline Software
LumiCalculator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // GoodRunsLists
11 
12 // ROOT
13 #include "TTree.h"
14 #include "TFile.h"
15 #include "TString.h"
16 #include "TObjString.h"
17 #include "TROOT.h"
18 
19 // stl includes
20 #include <iomanip>
21 #include <iostream>
22 #include <set>
23 #include <regex.h>
24 
26  : m_LumiTree (nullptr)
27  , m_recordTTree (false)
28  , m_State (true)
29 
30  , m_trigger ("COOLONL_TRIGGER/")
31  , m_lumioff ("COOLOFL_TRIGGER/")
32  , m_lumionl ("COOLONL_TRIGGER/")
33  , m_lumitag ("OflLumi-8TeV-002")// for offline: OflLumi_CosmicFake, OflLumi_TopMix
34  , m_lumimethod ("")// offline channels: ATLAS_PREFERRED, OflLumi_Fake0, OflLumi_Fake:, TopMixLumi
35  , m_laroff ("COOLOFL_LAR/")
36  , m_bsonl ("COOLONL_INDET/")
37  , m_bstag ("IndetBeamposOnl-HLT-UPD1-001-00")
38 
39  , m_parlvl1menufolder ("/TRIGGER/LVL1/Menu")
40  , m_parhltmenufolder ("/TRIGGER/HLT/Menu")// ChainCounter is here for COOLONL_TRIGGER/COMP20
41  , m_parhltprescalesfolder ("/TRIGGER/HLT/Prescales")// ChainCounter is here for COOLONL_TRIGGER/COMP20
42  , m_parlumilvl1folder ("/TRIGGER/LUMI/LVL1COUNTERS")
43  , m_parlumihltfolder ("/TRIGGER/LUMI/HLTCOUNTERS")
44  , m_parlvl1prescalesfolder ("/TRIGGER/LVL1/Prescales")
45  , m_parlvl1lblbfolder ("/TRIGGER/LUMI/LBLB")// for time information
46  , m_parlareventvetofolder ("/LAR/BadChannelsOfl/EventVeto") // For LAr event veto
47  , m_paronlbeamspotfolder ("/Indet/Onl/Beampos") // For invalid online beamspot
48 
49  , m_logger( "LumiCalculator" )
50  , m_lbcollname ("LumiBlocks")
51  , m_uselivetrigger (false)
52  , m_verbose (false)
53  , m_lbstarttime(0.)
54  , m_lbendtime(0.)
55 
56  , m_l1prescale(0.)
57  , m_l2prescale(0.)
58  , m_l3prescale(0.)
59  , m_afterprescale(0)
60  , m_livetime_beforeprescale(0)
61  , m_livetime_afterprescale(0)
62  , m_afterprescaleof(false)
63  , m_beforeprescale(0)
64  , m_beforeprescaleof(false)
65  , m_runnbr(0)
66  , m_lbstart(0)
67  , m_lbstop(0)
68  , m_lbstart_prev(0)
69  , m_lbstop_prev(0)
70  , m_runnbr_prev(0)
71  , m_totalgoodblock(0)
72  , m_totalbadblock(0)
73  , m_clumiblocknbr(0)
74  , m_clumiblocknbrend(0)
75  , m_triglevel(0)
76  , m_totalPrescaleWLiveTime(0.)
77  , m_t_totalPrescaleWLiveTime(0.)
78  , m_totalPrescale(0.)
79  , m_t_totalPrescale(0.)
80  , m_lumiWOPrescale(0.)
81  , m_t_lumiWOPrescale(0.)
82  , m_lumiLAr(0.)
83  , m_t_lumiLAr(0.)
84  , m_t_totalDelL(0.)
85  , m_t_totalL(0.)
86  , m_t_totalLRun(0.)
87  , m_t_totaltime(0.)
88  , m_t_deltaT(0.)
89  , m_t_l1acc(0)
90  , m_t_l2acc(0)
91  , m_t_l3acc(0)
92  , m_t_totalgoodblock(0)
93  , m_t_totalbadblock(0)
94  , m_t_totall1befpresc(0)
95  , m_lartime(0.)
96  , m_larfrac(0.)
97  , m_bsvalid(0.)
98 
99  , m_effxsec(1.)
100  , m_l1rate(0.)
101  , m_l2rate(0.)
102  , m_l3rate(0.)
103  , m_l1ratediveffxsec(0.)
104  , m_total_l1ratediveffxsec(0.)
105  , m_total_l1ratediveffxsecRun(0.)
106  , m_l1ratediveffxsec_recorded(0.)
107  , m_total_l1ratediveffxsec_recorded(0.)
108  , m_total_l1ratediveffxsecRun_recorded(0.)
109  , m_mintrigrate(5./120.)
110  , m_collsgrl(0)
111  , m_ntrigplb(0)
112  , m_trigrateplb(0)
113  , m_lumiplb(0)
114  , m_lumitrigrateplb(0)
115  , m_intlumi(0)
116  , m_intlumitrigrate(0)
117  , m_lumitrigrateplb_recorded(0)
118  , m_intlumitrigrate_recorded(0)
119  , m_intlumiruns(0)
120  , m_intlumitrigrateruns(0)
121  , m_intlumitrigrateruns_recorded(0)
122  , m_avgintperbx(0)
123  , m_makePlots(false)
124  , m_makecollList(false)
125  , m_Lumiid(0)
126  , m_L3id(0)
127  , m_L2id(0)
128  , m_L1id(0)
129  , m_LiveL1id(0)
130  , m_L1Valid(false)
131  , m_L2Valid(false)
132  , m_L3Valid(false)
133  , m_LiveValid(false)
134  , m_onlinelumi(false)
135  , m_uselar(false)
136  , m_usebs(false)
137  , m_minrun(0)
138  , m_maxrun(0)
139 {
140 
141  // by default we use the "offline data" database name
146 
147  m_lumichannel = 0;
148 
149 }
150 
151 
153 
154  // delete collisions grl
155  if (m_collsgrl!=0) { delete m_collsgrl; m_collsgrl=0; }
156 
158  for (itr=m_ntrigplbVec.begin(); itr!=m_ntrigplbVec.end(); ++itr) { delete *itr; }
159  for (itr=m_trigrateplbVec.begin(); itr!=m_trigrateplbVec.end(); ++itr) { delete *itr; }
160  for (itr=m_lumiplbVec.begin(); itr!=m_lumiplbVec.end(); ++itr) { delete *itr; }
161  for (itr=m_lumitrigrateplbVec.begin(); itr!=m_lumitrigrateplbVec.end(); ++itr) { delete *itr; }
162  for (itr=m_intlumiVec.begin(); itr!=m_intlumiVec.end(); ++itr) { delete *itr; }
163  for (itr=m_intlumitrigrateVec.begin(); itr!=m_intlumitrigrateVec.end(); ++itr) { delete *itr; }
164  for (itr=m_lumitrigrateplb_recordedVec.begin(); itr!=m_lumitrigrateplb_recordedVec.end(); ++itr) { delete *itr; }
165  for (itr=m_intlumitrigrate_recordedVec.begin(); itr!=m_intlumitrigrate_recordedVec.end(); ++itr) { delete *itr; }
166 
167  m_ntrigplbVec.clear();
168  m_trigrateplbVec.clear();
169  m_lumiplbVec.clear();
170  m_lumitrigrateplbVec.clear();
171  m_intlumiVec.clear();
172  m_intlumitrigrateVec.clear();
175 
176  if (m_intlumiruns!=0) { delete m_intlumiruns; m_intlumiruns=0; }
179  if (m_avgintperbx != 0) { delete m_avgintperbx; m_avgintperbx = 0; }
180 
181 }
182 
184  // Register branches
185  m_LumiTree = tree;
186  if(m_LumiTree != 0){
187 
188  m_LumiTree->Branch("LBStartTime/D", &m_lbstarttime);
189  m_LumiTree->Branch("LBEndTime/D", &m_lbendtime);
190  m_LumiTree->Branch("Trigger", &m_triggerchain);
191  m_LumiTree->Branch("LBCollection", &m_lbcollname);
192  m_LumiTree->Branch("RunNbr", &m_runnbr);
193  m_LumiTree->Branch("IOVRStart", &m_lbstart);
194  m_LumiTree->Branch("IOVREnd", &m_lbstop);
195  m_LumiTree->Branch("LBStart", &m_clumiblocknbr);
196  m_LumiTree->Branch("Inst_m_Lumi", &m_instLumi);
197  m_LumiTree->Branch("LiveTime", &m_livetime);
198  m_LumiTree->Branch("L1Presc", &m_l1prescale);
199  m_LumiTree->Branch("L2Presc", &m_l2prescale);
200  m_LumiTree->Branch("L3Presc", &m_l3prescale);
201  m_LumiTree->Branch("L1Count", &m_l1acc);
202  m_LumiTree->Branch("L1CountOverFlow", &m_l1accof);
203  m_LumiTree->Branch("L2Count", &m_l2acc);
204  m_LumiTree->Branch("L3Count", &m_l3acc);
205  m_LumiTree->Branch("L1AfterPrescale", &m_afterprescale);
206  m_LumiTree->Branch("L1AfterPrescaleOverFlow", &m_afterprescaleof);
207  m_LumiTree->Branch("L1BeforePrescale", &m_beforeprescale);
208  m_LumiTree->Branch("L1BeforePrescaleOverFlow", &m_beforeprescaleof);
209  m_LumiTree->Branch("Livefrac", &m_livefrac);
210  m_LumiTree->Branch("LArfrac", &m_larfrac);
211  m_LumiTree->Branch("DeltaT", &m_deltaT);
212  m_LumiTree->Branch("L1Rate", &m_l1rate);
213  m_LumiTree->Branch("IntLumi",&m_intLumi);
214  m_LumiTree->Branch("L1Ratediveffxsec",&m_l1ratediveffxsec);
215  m_LumiTree->Branch("TotalLumi",&m_totalL);
216  m_LumiTree->Branch("Total_L1Ratediveffxsec",&m_total_l1ratediveffxsec);
217  m_LumiTree->Branch("TotalLumiRun",&m_totalLRun);
218  m_LumiTree->Branch("Total_L1RatediveffxsecRun",&m_total_l1ratediveffxsecRun);
219  m_LumiTree->Branch("L1RatediveffxsecRecorded",&m_l1ratediveffxsec_recorded);
220  m_LumiTree->Branch("Total_L1RatediveffxsecRecorded",&m_total_l1ratediveffxsec_recorded);
221  m_LumiTree->Branch("Total_L1RatediveffxsecRunRecorded",&m_total_l1ratediveffxsecRun_recorded);
222  m_LumiTree->Branch("AvergeInteractionPerXing",&m_AvEvtsPerBX);
223  m_LumiTree->Branch("BSValid", &m_bsvalid);
224  }
225 
226 }
227 
228 
229 void LumiCalculator::SetCollName(const std::string& lbcollname){
230  m_lbcollname = lbcollname;
231 }
232 
233 
235  m_verbose = verbose;
236 }
237 
239 
240  // Print warning
241  if (mc)
242  m_logger << Root::kWARNING << "Monte Carlo mode no longer supported!" << Root::GEndl;
243 
244 }
245 
247 
249 
250 }
251 
252 void LumiCalculator::UseLumiTag(const std::string& tag){
253  m_lumitag = tag;
254 }
255 
256 void LumiCalculator::UseLumiMethod(const std::string& method){
258 }
259 
262  m_lumimethod = "";
263 }
264 
265 
266 void LumiCalculator::UseLiveTrigger(bool live, std::string& livetrigger){
267  m_uselivetrigger = live;
268  m_livetrigger = livetrigger;
269 }
270 
271 void LumiCalculator::UseLArNoiseDB(bool lar, const std::string& lartag) {
272  m_uselar = lar;
273  m_lartag = lartag;
274 }
275 
276 void LumiCalculator::UseBeamspot(bool bs, const std::string& bstag) {
277  m_usebs = bs;
278  m_bstag = bstag;
279 }
280 
282  if(m_LumiTree != 0)return m_LumiTree;
283  return 0;
284 }
285 
286 //______________________________________________________________________________
287 void LumiCalculator::IntegrateLumi ATLAS_NOT_THREAD_SAFE (const xAOD::LumiBlockRangeContainer * iovc, const std::string& triggerchain){
288 
289 
290  CoolQuery * cq_lumi = NULL;
291  CoolQuery * cq_trigger = NULL;
292  CoolQuery* cq_lar = NULL;
293  CoolQuery* cq_bs = NULL;
294 
295  // Peek at first run in iovc to check if we want Run1 or Run2 data
297  // const IOVRange * iovr = (*it);
298  const IOVRange* iovr = new IOVRange(IOVTime((*it)->startRunNumber(),(*it)->startLumiBlockNumber()),
299  IOVTime((*it)->stopRunNumber(),(*it)->stopLumiBlockNumber()));
300 
301  bool isrun2 = false;
302  std::string onlfolder;
303  std::string oflfolder;
304  if (iovr->start().run() > 222222) {
305  isrun2 = true;
306  m_data_db="CONDBR2";
307  onlfolder = "/TRIGGER/LUMI/OnlPrefLumi";
308  oflfolder = "/TRIGGER/OFLLUMI/OflPrefLumi";
309  } else {
310  isrun2 = false;
311  m_data_db="COMP200";
312  onlfolder = "/TRIGGER/LUMI/LBLESTONL";
313  oflfolder = "/TRIGGER/OFLLUMI/LBLESTOFL";
314  }
315 
316  // define all connection strings
317 
318  // check for online DB
319  if(m_onlinelumi){
320  m_lumi_database = m_lumionl + m_data_db;
321  m_parlumiestfolder = onlfolder;
322  } else {
323  m_lumi_database = m_lumioff + m_data_db;
324  m_parlumiestfolder = oflfolder;
325  }
326 
327  m_trig_database = m_trigger + m_data_db;
328  m_lar_database = m_laroff + m_data_db;
329  m_bs_database = m_bsonl + m_data_db;
330 
331 
332  m_logger << Root::kINFO << "Luminosity database: " << m_lumi_database << Root::GEndl;
333  m_logger << Root::kINFO << "Trigger database: " << m_trig_database << Root::GEndl;
334 
335  cq_lumi = new CoolQuery(m_lumi_database, triggerchain);
336  if (!cq_lumi->openDbConn()) {
337  delete cq_lumi;
338  return;
339  }
340 
341  cq_trigger = new CoolQuery(m_trig_database, triggerchain);
342  if (!cq_trigger->openDbConn()) {
343  delete cq_trigger;
344  return;
345  }
346 
347  if (m_uselar) {
348  m_logger << Root::kINFO << "LAr database: " << m_lar_database << Root::GEndl;
349 
350  cq_lar = new CoolQuery(m_lar_database, triggerchain);
351  if (!cq_lar->openDbConn()) {
352  delete cq_lar;
353  return;
354  }
355  }
356 
357  if (m_usebs) {
358  m_logger << Root::kINFO << "Onl beamspot database: " << m_bs_database << Root::GEndl;
359 
360  cq_bs = new CoolQuery(m_bs_database, triggerchain);
361  if (!cq_bs->openDbConn()) {
362  delete cq_bs;
363  return;
364  }
365  }
366 
367  // initialize
368  m_lbstarttime = 0.;
369  m_lbendtime = 0.;
370  m_totalDelL = 0.;
371  m_totalL = 0.;
372  m_totalLRun = 0.;
373  m_totaltime = 0.;
374  m_instLumi = 0.;
375  m_delLumi = 0.;
376  m_intLumi = 0.;
377  m_deltaT = 0.;
378  m_totalPrescaleWLiveTime = 0.;
379  m_totalPrescale = 0.;
380  m_lumiWOPrescale = 0.;
381  m_lumiLAr = 0.;
382  m_TotaldeltaT = 0.;
383  m_livefrac = 0.;
384  m_livetime = 0.;
385  m_lartime = 0.;
386  m_larfrac = 0.;
387  m_bsvalid = 0.;
388  m_livetime_l1acc = 0;
389  m_l1acc = 0;
390  m_l2acc = 0;
391  m_l3acc = 0;
392  m_totall1acc = 0;
393  m_livtrig_totall1acc = 0;
394  m_totall2acc = 0;
395  m_totall3acc = 0;
396  m_l1prescale = 1.;
397  m_l2prescale = 1.;
398  m_l3prescale = 1.;
399  m_livetime_beforeprescale = 0;
400  m_livetime_afterprescale = 0;
401  m_afterprescale = 0;
402  m_beforeprescale = 0;
403  m_totall1befpresc = 0;
404  m_runnbr = 0;
405  m_lbstart = 0;
406  m_lbstop = 0;
407  m_lbstart_prev = 0;
408  m_lbstop_prev = 0;
409  m_totalgoodblock = 0;
410  m_totalbadblock = 0;
411  m_clumiblocknbr = 0;
412  m_clumiblocknbrend =0;
413  m_triglevel = 0;
414  m_lbcollectionname = "LumiBlocks";
415  m_triggerchain = triggerchain;
416  m_l1rate = 0.;
417  m_l2rate = 0.;
418  m_l3rate = 0.;
419  m_l1ratediveffxsec = 0.;
420  m_total_l1ratediveffxsec = 0.;
421  m_total_l1ratediveffxsecRun = 0.;
422  m_l1ratediveffxsec_recorded = 0.;
423  m_total_l1ratediveffxsec_recorded = 0.;
424  m_total_l1ratediveffxsecRun_recorded = 0.;
425  m_runnbr_prev = 0;
426 
427  // Set to extreme values, to be updated below
428  m_minrun = 99999999;
429  m_maxrun = 0;
430 
431  bool firstL1Missing = true;
432  bool firstHLTMissing = true;
433 
434  std::set<cool::ValidityKey> lbrunset;
435  lbrunset.clear();
436 
437  // collisions xml file settings
438  if (m_collsgrl!=0) { delete m_collsgrl; m_collsgrl=0; }
439  if (m_makecollList) {
440  m_collsgrl = new Root::TGoodRunsList();
441  m_collsgrl->SetVersion("30"); // lumicalc signature
442  m_collsgrl->AddMetaData("Query","Generated by LumiCalculator");
443  }
444 
445  // Figure out trigger level
446  m_triglevel = cq_lumi->getTriggerLevel(triggerchain);
447  if (m_triglevel == 0){
448  // Check if on purpose, otherwise, give a warning
449  if (triggerchain == "None") {
450  m_logger << Root::kINFO << "No trigger specified!" << Root::GEndl;
451  } else {
452  m_logger << Root::kWARNING << "Invalid trigger: [" << triggerchain << "] - will proceed with no trigger defined!" << Root::GEndl;
453  }
454  }
455 
456  // Look for b-jet triggers
457  regex_t regex;
458  int reti = regcomp(&regex, "_[[:digit:]]?b[[:digit:]]+_", REG_EXTENDED);
459  if (reti) m_logger << Root::kWARNING << "Could not compile regex!" << Root::GEndl;
460 
461  reti = regexec(&regex, triggerchain.c_str(), 0, NULL, 0);
462  if ( !reti && !m_usebs) {
463  m_logger << Root::kWARNING << "Trigger: [" << triggerchain << "] appears to be a b-jet trigger, but online beamspot validity not included in livefraction!" << Root::GEndl;
464  m_logger << Root::kWARNING << "Probably need to specify --beamspot to get accurate luminosity!" << Root::GEndl;
465  }
466  regfree(&regex);
467 
468  // get lumi channel id (this never changes)
469  if (m_lumimethod != "") {
470  m_Lumiid = cq_lumi->getLumiChannelId(m_lumimethod, m_parlumiestfolder);
471  } else {
472  m_Lumiid = m_lumichannel;
473  }
474 
475 
476  // do main LumiBlock loop
477  //==============================
478 
479  IOVData<cool::Int32> L1preObj;
480  IOVData<cool::Int32> L1preOther;
481  IOVData<cool::Float> L2preObj;
482  IOVData<cool::Float> L3preObj;
483  IOVData<cool::UInt32> LArObj;
484  IOVData<cool::Int32> BSObj;
485 
486  std::map<cool::ValidityKey, CoolQuery::LumiFolderData> LumiDataMap;
487 
488  // UTC nanoseconds since 1970
489  std::map<cool::ValidityKey, cool::UInt63> L1starttime_map;
490  std::map<cool::ValidityKey, cool::UInt63> L1endtime_map;
491 
492  // Livetime maps
493  std::map<cool::ValidityKey, CoolQuery::L1CountFolderData> Livetime_map;
494  std::map<cool::ValidityKey, CoolQuery::L1CountFolderData> L1accept_map;
495 
496  for(xAOD::LumiBlockRangeContainer::const_iterator it = iovc->begin(); it != iovc->end(); ++it){
497  const IOVRange* iovr = new IOVRange(IOVTime((*it)->startRunNumber(),(*it)->startLumiBlockNumber()),
498  IOVTime((*it)->stopRunNumber(),(*it)->stopLumiBlockNumber()));
499 
500  // Bookkeeping temporary results
501  m_t_totalDelL = 0.;
502  m_t_totalL = 0.;
503  m_t_totalLRun = 0.;
504  m_t_totaltime = 0.;
505  m_t_deltaT = 0.;
506  m_t_l1acc = 0;
507  m_t_l2acc = 0;
508  m_t_l3acc = 0;
509  m_t_totalgoodblock = 0;
510  m_t_totalbadblock = 0;
511  m_t_totall1befpresc = 0;
512  m_t_totalPrescaleWLiveTime = 0.;
513  m_t_totalPrescale = 0.;
514  m_t_lumiWOPrescale = 0. ;
515  m_t_lumiLAr = 0.;
516 
517  m_runnbr = iovr->start().run();
518  m_lbstart = iovr->start().event();
519  m_lbstop = iovr->stop().event();
520 
521  // Look for duplicate run/LB
522  if(m_lbstart_prev == m_lbstart && m_lbstop_prev == m_lbstop && m_runnbr_prev == m_runnbr){
523  m_logger << Root::kWARNING << "Skipping multiply stored IOVRange: [" << m_lbstart << "-" << m_lbstop << "]" << Root::GEndl;
524  continue;
525  }
526 
527  // new run, reset its lumi and reload the trigger channels
528  if ( m_runnbr!=m_runnbr_prev ) {
529 
530  if (m_runnbr < m_minrun) m_minrun = m_runnbr;
531  if (m_runnbr > m_maxrun) m_maxrun = m_runnbr;
532 
533  m_totalLRun=0.;
534  m_total_l1ratediveffxsecRun=0.;
535  m_total_l1ratediveffxsecRun_recorded=0.;
536 
537  // Set IOV range for full run
538  cq_trigger->setIOVForRun (m_runnbr);
539  cq_lumi->setIOVForRun(m_runnbr);
540 
541  // get trigger channel ids
542  m_L1Valid = false;
543  m_L2Valid = false;
544  m_L3Valid = false;
545  m_LiveValid = false;
546  m_triggerlowerchains.clear();
547  // These are used to resolve L1 ORs like [L1_MU20,L1_MU21]
548  m_L1triggerchains.clear();
549  m_L1idList.clear();
550 
551  std::string lowerch = "";
552 
553  // This is really inefficient...
554  if(m_triglevel == 3){
555  m_L3id = cq_trigger->getHLTChannelId(triggerchain, m_parhltmenufolder);
556  m_L3Valid = cq_trigger->channelIdValid();
557 
558  lowerch = cq_trigger->getHLTLowerChainName(triggerchain, m_parhltmenufolder);
559  m_triggerlowerchains.push_back(lowerch);
560  //
561  m_L2id = cq_trigger->getHLTChannelId(lowerch, m_parhltmenufolder);
562  m_L2Valid = cq_trigger->channelIdValid();
563 
564  lowerch = cq_trigger->getHLTLowerChainName(lowerch, m_parhltmenufolder);
565  m_triggerlowerchains.push_back(lowerch);
566  //
567  m_L1id = cq_trigger->getL1ChannelId(lowerch, m_parlvl1menufolder );
568  m_L1Valid = cq_trigger->channelIdValid();
569 
570  }else if(m_triglevel == 2){ // Run2 or starting at L2 in Run1
571  lowerch = cq_trigger->getHLTLowerChainName(triggerchain, m_parhltmenufolder);
572  m_triggerlowerchains.push_back(lowerch);
573  m_L2id = cq_trigger->getHLTChannelId(triggerchain, m_parhltmenufolder);
574  m_L2Valid = cq_trigger->channelIdValid();
575 
576  ParseL1Trigger(lowerch, cq_trigger);
577 
578  }else if(m_triglevel == 1){
579 
580  ParseL1Trigger(triggerchain, cq_trigger);
581  }
582 
583  if (firstL1Missing && (!m_L1Valid && m_triglevel > 0)) {
584  firstL1Missing = false;
585  cq_trigger->printL1Triggers(m_parlvl1menufolder);
586  }
587 
588  if (firstHLTMissing && ((!m_L2Valid && m_triglevel > 1) || (!m_L3Valid && m_triglevel > 2)) ) {
589  firstHLTMissing = false;
590  cq_trigger->printHLTTriggers(m_parhltmenufolder);
591  }
592 
593  // Should we check here for btag trigger and onl beamspot?
594 
595  // Do we use dedicated livetime trigger?
596  if(m_uselivetrigger){
597  m_LiveL1id = cq_trigger->getL1ChannelId(m_livetrigger, m_parlvl1menufolder);
598  m_LiveValid = cq_trigger->channelIdValid();
599  }else{
600  // then fall back to the original trigger
601  m_LiveL1id = m_L1id;
602  m_LiveValid = m_L1Valid;
603  }
604 
605  if (!m_LiveValid) {
606  if (m_uselivetrigger)
607  m_logger << Root::kWARNING << "Runnumber: [" << m_runnbr << "] can't find livefraction trigger [" << m_livetrigger << "]! Livefraction won't be calculated!" << Root::GEndl;
608  else
609  m_logger << Root::kWARNING << "Runnumber: [" << m_runnbr << "] can't find trigger [" << triggerchain << "]! Livefraction won't be calculated!" << Root::GEndl;
610  }
611 
612  // Also load all deadtime counters here
613 
614  // Need to fix this for non-MC. HLT counters now available, but not used here...
615 
616  //-------------------------
617  // Load livetime information
618  Livetime_map.clear();
619  L1accept_map.clear();
620 
621  if (m_LiveValid)
622  Livetime_map = cq_trigger->getL1CountFolderData(m_parlumilvl1folder, m_LiveL1id);
623 
624 
625  if (m_L1Valid && m_triglevel >= 1)
626  L1accept_map = cq_trigger->getL1CountFolderData(m_parlumilvl1folder, m_L1id);
627 
628  // UTC nanoseconds since 1970
629  L1starttime_map.clear();
630  L1endtime_map.clear();
631  L1starttime_map = cq_trigger->getObjMapFromFolderAtChan<cool::UInt63>("StartTime", m_parlvl1lblbfolder, 0);
632  L1endtime_map = cq_trigger->getObjMapFromFolderAtChan<cool::UInt63>("EndTime", m_parlvl1lblbfolder, 0);
633 
634  //---------------------------
635  // Load LAr defects
636  LArObj.clear();
637 
638  if (m_uselar) {
639  cool::ValidityKey runstarttime = L1starttime_map.begin()->second;
640  cool::ValidityKey runendtime = L1endtime_map.rbegin()->second;
641 
642  cq_lar->setIOV(runstarttime, runendtime);
643  LArObj = cq_lar->getIOVData<cool::UInt32>("EventVeto", m_parlareventvetofolder, 0, m_lartag);
644  }
645 
646  //---------------------------
647  // Load Onl beamspot
648  BSObj.clear();
649 
650  if (m_usebs) {
651  cq_bs->setIOVForRun(m_runnbr);
652  BSObj = cq_bs->getIOVData<cool::Int32>("status", m_paronlbeamspotfolder, 0, m_bstag);
653  }
654 
655 
656  //-----------------------------
657  // Load luminosity for this run
658  LumiDataMap.clear();
659  LumiDataMap = cq_lumi->getLumiFolderData(m_parlumiestfolder, m_lumitag, m_Lumiid);
660 
661 
662  } // End of new run stuff
663 
664  m_lbstart_prev = m_lbstart;
665  m_lbstop_prev = m_lbstop;
666  m_runnbr_prev = m_runnbr;
667 
668  // Update DB for this specific IOV range
669  cq_trigger->setIOV(iovr->start().re_time(), iovr->stop().re_time());
670 
671  // Print this here (will be output for each contiguous LB range in XML file)
672  m_logger << Root::kINFO << std::left << "-----------------------------------" << Root::GEndl;
673  m_logger << Root::kINFO << "Beginning calculation for ";
674  if (m_triglevel > 0) {
675  m_logger << Root::kINFO << "Trigger " << m_triggerchain;
676  if(m_triggerlowerchains.size() > 0){
677  m_logger << Root::kINFO << "[";
678  for(std::vector<std::string>::iterator sit = m_triggerlowerchains.begin(); sit != m_triggerlowerchains.end(); ++sit){
679  m_logger << Root::kINFO << "==>" << *sit;
680  }
681  m_logger << Root::kINFO << "], ";
682  }
683  }
684  m_logger << Root::kINFO << "Run " << m_runnbr << " LB [" << m_lbstart << "-" << m_lbstop << "]" << Root::GEndl;
685  m_logger << Root::kINFO << std::left << "-----------------------------------" << Root::GEndl;
686 
687  //----------------------------
688  // Load prescales for this IOV
689  L1preObj.clear();
690  L2preObj.clear();
691  L3preObj.clear();
692  L1preOther.clear(); // Used for mutliple L1 triggers
693 
694  if(m_L1Valid) {
695  // Normal case
696  if (m_L1idList.size() <= 1) {
697  L1preObj = cq_trigger->getIOVData<cool::Int32>("Lvl1Prescale", m_parlvl1prescalesfolder, m_L1id);
698 
699  // Multiple L1 items defined
700  } else {
701 
702  m_logger << Root::kINFO << "Resolving multiple L1 prescales:" << Root::GEndl;
703 
704  // Load first one
705  L1preObj = cq_trigger->getIOVData<cool::Int32>("Lvl1Prescale", m_parlvl1prescalesfolder, m_L1idList[0]);
706 
707  // Dump prescales
708  std::list< std::pair<IOVRange, cool::Int32> >::iterator it;
709 
710  m_logger << Root::kINFO << std::setw(10) << std::left << m_L1triggerchains[0];
711  for(it = L1preObj.data.begin(); it != L1preObj.data.end(); ++it) {
712  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" ;
713 
714  if (it->second < 0)
715  m_logger << it->second << ", ";
716  else
717  m_logger << (0xFFFFFF / float(0x1000000 - it->second)) << ", ";
718  }
719  m_logger << Root::kINFO << Root::GEndl;
720 
721  // Now loop over the remaining and replace
722  for (unsigned int iid=1; iid < m_L1idList.size(); iid++) {
723  L1preOther = cq_trigger->getIOVData<cool::Int32>("Lvl1Prescale", m_parlvl1prescalesfolder, m_L1idList[iid]);
724 
725  // Dump prescales
726  m_logger << Root::kINFO << std::setw(10) << std::left << m_L1triggerchains[iid];
727  for(it = L1preOther.data.begin(); it != L1preOther.data.end(); ++it) {
728  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" ;
729 
730  if (it->second < 0)
731  m_logger << it->second << ", ";
732  else
733  m_logger << (0xFFFFFF / float(0x1000000 - it->second)) << ", ";
734  }
735  m_logger << Root::kINFO << Root::GEndl;
736 
737  // Iterate through both lists and keep lowest non-negative prescale
738  std::list< std::pair<IOVRange, cool::Int32> >::iterator it1;
739  std::list< std::pair<IOVRange, cool::Int32> >::iterator it2;
740  for(it1 = L1preObj.data.begin(), it2 = L1preOther.data.begin(); it1 != L1preObj.data.end(); ++it1, ++it2) {
741 
742  // -1 is disabled, otherwise this is the event count to prescale
743  if ((it2->second > 0) && (it1->second > it2->second)) {
744  // Check if they are both prescaled (this is bad)
745  if ((it1->second > 1) && (it2->second > 1)) {
746  m_logger << Root::kWARNING << "L1 Prescales combined with both triggers prescaled for Run " << m_runnbr << "!" << Root::GEndl;
747  }
748  it1->second = it2->second;// See if this works...
749  }
750  }
751  }
752 
753  // OK done, lets check the result
754  // Dump prescales
755  m_logger << Root::kINFO << std::setw(10) << std::left << "L1 Pre:";
756  for(it = L1preObj.data.begin(); it != L1preObj.data.end(); ++it) {
757  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" ;
758 
759  if (it->second < 0)
760  m_logger << it->second << ", ";
761  else
762  m_logger << (0xFFFFFF / float(0x1000000 - it->second)) << ", ";
763  }
764  m_logger << Root::kINFO << Root::GEndl;
765 
766  }
767 
768  }
769 
770  if(m_L2Valid) {
771  if (isrun2) {
772  L2preObj = cq_trigger->getIOVData<cool::Float>("Prescale", m_parhltprescalesfolder, 20000 + m_L2id);
773  }
774  else {
775  L2preObj = cq_trigger->getIOVData<cool::Float>("Prescale", m_parhltprescalesfolder, 2*m_L2id);
776  }
777  }
778 
779  if(m_L3Valid) {
780  L3preObj = cq_trigger->getIOVData<cool::Float>("Prescale", m_parhltprescalesfolder, 2*m_L3id+1);
781  }
782 
783  // Reload the time map to get the ATLAS range
784  L1starttime_map.clear();
785  L1endtime_map.clear();
786  L1starttime_map = cq_trigger->getObjMapFromFolderAtChan<cool::UInt63>("StartTime", m_parlvl1lblbfolder, 0);
787  L1endtime_map = cq_trigger->getObjMapFromFolderAtChan<cool::UInt63>("EndTime", m_parlvl1lblbfolder, 0);
788 
789  // Restrict lb range if necessary based on actual ATLAS run/lb values
790  if (L1starttime_map.begin()->first > iovr->start().re_time() || L1starttime_map.rbegin()->first < iovr->stop().re_time()) {
791  m_lbstart = (L1starttime_map.begin()->first & 0xFFFFFFFF);
792  m_lbstop = (L1starttime_map.rbegin()->first & 0xFFFFFFFF);
793  m_logger << Root::kINFO << "Restricting to valid ATLAS lumi block range [" << m_lbstart << "-" << m_lbstop << "]" << Root::GEndl;
794  }
795 
796 
797  //
798  // Dont assume that all lumi blocks in this range are present in the lumi DB.
799  // Loop over all lumi blocks specifically and flag any missing lumi entries as bad lumi blocks.
800  //
801 
802  // Counters to check for missing LB ranges
803  int firstMissing = -1;
804  int lastMissing = -1;
805 
806  for (cool::ValidityKey currentVK = L1starttime_map.begin()->first; currentVK <= L1starttime_map.rbegin()->first; currentVK++) {
807 
808  // Current IOVTime
809  IOVTime curIOV;
810  curIOV.setRETime(currentVK);
811 
812  m_clumiblocknbr = curIOV.event();
813  m_clumiblocknbrend = curIOV.event()+1;
814 
815  // Check here for duplicate lumi blocks by explicitly keeping track of every run/lb seen
816  if (lbrunset.count(curIOV.re_time()) != 0) {
817  m_logger << Root::kWARNING << "Skipping duplicate [run,lumiblock]: " << curIOV << " !" << Root::GEndl;
818  continue;
819  } else {
820  lbrunset.insert(curIOV.re_time());
821  }
822 
823  // Not really good, just all seen
824  m_totalgoodblock += 1;
825  m_t_totalgoodblock += 1;
826 
827  // Find luminosity record
828  std::map<cool::ValidityKey, CoolQuery::LumiFolderData>::iterator itOL = LumiDataMap.find(currentVK);
829 
830  // Check if we didn't find anything
831  if (itOL == LumiDataMap.end()) {
832 
833  m_t_totalbadblock++;
834  m_totalbadblock++;
835 
836  if (firstMissing < 0) {
837  // Is this the first missing one? If so, make a note of it and go on
838  firstMissing = curIOV.event();
839  lastMissing = firstMissing;
840  } else if (int(curIOV.event()) == (lastMissing+1)) {
841  // Is this a contiguous missing lumi block?
842  lastMissing = curIOV.event();
843  } else {
844  // Not contiguous, print previous
845  if (firstMissing == lastMissing) {
846  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB " << firstMissing << " !" << Root::GEndl;
847  } else {
848  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB [" << firstMissing << "-" << lastMissing << "] !" << Root::GEndl;
849  }
850  firstMissing = curIOV.event();
851  lastMissing = firstMissing;
852  }
853 
854  // If last time through loop, print this also
855  if (currentVK == L1starttime_map.rbegin()->first) {
856  if (firstMissing == lastMissing) {
857  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB " << firstMissing << " !" << Root::GEndl;
858  } else {
859  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB [" << firstMissing << "-" << lastMissing << "] !" << Root::GEndl;
860  }
861  firstMissing = -1;
862  lastMissing = -1;
863  }
864 
865  // Skip rest of this LB
866  continue;
867 
868  } else {
869 
870  // Check if we had previous missing block
871  if (firstMissing >= 0) {
872  if (firstMissing == lastMissing) {
873  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB " << firstMissing << " !" << Root::GEndl;
874  } else {
875  m_logger << Root::kWARNING << "Luminosity info not found for Run " << m_runnbr << " LB [" << firstMissing << "-" << lastMissing << "] !" << Root::GEndl;
876  }
877 
878  firstMissing = -1;
879  lastMissing = -1;
880  }
881 
882  }
883 
884 
885  // given in units of ub^{-1} = 10^{30} cm^{-2}
886  m_instLumi = (itOL->second).LBAvInstLumi;
887  m_AvEvtsPerBX = (itOL->second).LBAvEvtsPerBX;
888  m_Valid = (itOL->second).Valid;
889 
890 
891  // Clear values in case trigger isn't defined
892  m_l1acc = 0.;
893  m_beforeprescale = 0.;
894  m_afterprescale = 0.;
895  m_l2acc = 0.;
896  m_l3acc = 0.;
897 
898  // Store dummy prescale values at start
899  m_l1prescale = -1.;
900  m_l2prescale = -1.;
901  m_l3prescale = -1.;
902 
903  // Some trigger is defined. Get prescales and values here
904  if(m_L1Valid && m_triglevel > 0) {
905 
906  // Get L1 prescale
907  if (isrun2) {
908  if (L1preObj.getValue(curIOV) < 0)
909  m_l1prescale = L1preObj.getValue(curIOV);
910  else
911  m_l1prescale = 0xFFFFFF / float(0x1000000 - L1preObj.getValue(curIOV));
912  }
913  else {
914  m_l1prescale = L1preObj.getValue(curIOV);
915  }
916 
917  if (m_triglevel >=2) {
918  if(m_L2Valid) {
919 
920  // Get L2 prescale
921  m_l2prescale = L2preObj.getValue(curIOV);
922 
923  }
924  // Else, prescale stays at -1.
925 
926  } else {
927  // Force L2 'passthrough'
928  m_l2prescale = 1.;
929  }
930 
931  if(m_triglevel == 3){
932  if (m_L3Valid) {
933 
934  // Get L3 prescale
935  m_l3prescale = L3preObj.getValue(curIOV);
936 
937  }
938  // Else, L3 prescale stays at -1.
939  } else {
940  // Force L3 'passthrough'
941  m_l3prescale = 1.;
942  }
943  }
944 
945  //-------------------------------
946  // Calculate livetime from a dedicated not rare trigger if user requested
947  CoolQuery::L1CountFolderData l1count = Livetime_map.find(currentVK)->second;
948 
949  m_livetime_beforeprescale = l1count.BeforePrescale;
950  m_livetime_afterprescale = l1count.AfterPrescale;
951  m_livetime_l1acc = l1count.L1Accept;
952  if(m_livetime_afterprescale > 0.){
953  m_livefrac = m_livetime_l1acc/(float)m_livetime_afterprescale;
954  }else{
955  m_livefrac = 0.0;
956  }
957 
958  // Hack for bad SFO in particular run
959  if (m_runnbr == 286367) {
960  m_livefrac *= 5./6.;
961  }
962 
963  if (m_runnbr == 281385) {
964  if (m_clumiblocknbr <= 196) {
965  m_livefrac *= 4./6.;
966  } else if (m_clumiblocknbr <= 374) {
967  m_livefrac *= 5./6.;
968  }
969  }
970 
971  // Check for low statistics in afterprescale counts
972  if(m_livetime_beforeprescale > 0 && m_livetime_afterprescale <= 0 ){
973  std::string ttrig = "";
974  ttrig = triggerchain;
975  if(m_uselivetrigger)ttrig = m_livetrigger;
976  m_logger << Root::kWARNING << "L1 counts after prescale (before veto) are 0.0 for trigger " << ttrig << "! Livefraction set to zero!" << Root::GEndl;
977  m_logger << Root::kWARNING << "Try using a high rate L1 trigger for livetime calculation: --livetrigger=<high rate L1 trigger> " << Root::GEndl;
978  m_logger << Root::kINFO << m_runnbr << "[" << m_clumiblocknbr << "]: L1Acc: " << m_l1acc << ", AfterPrescale: " << m_afterprescale << ", L1Presc: " << m_l1prescale << Root::GEndl;
979  }
980 
981  //------------------------
982  // Calculate LAr veto time
983 
984  cool::ValidityKey lbstarttime = L1starttime_map.find(currentVK)->second;
985  cool::ValidityKey lbendtime = L1endtime_map.find(currentVK)->second;
986 
987  m_lartime = 0.; // Time to exclude in seconds
988  if (m_uselar) {
989 
990  IOVTime lbstart, lbend;
991  lbstart.setRETime(lbstarttime);
992  lbend.setRETime(lbendtime);
993  IOVRange range(lbstart, lbend);
994 
995  std::list<std::pair<IOVRange, cool::UInt32> > larlist;
996  larlist = LArObj.getOverlap(range);
997 
998  for (std::list<std::pair<IOVRange, cool::UInt32> >::iterator it = larlist.begin(); it != larlist.end(); ++it) {
999  if (it->second == 0) continue;
1000  float dtime = (it->first.stop().re_time() - it->first.start().re_time())/1.E9;
1001  m_lartime += dtime;
1002  if (m_verbose == true) {
1003  m_logger << Root::kINFO << "Found LAr veto from " << it->first.start().re_time() << " to " << it->first.stop().re_time() << " = " << dtime << " seconds" << Root::GEndl;
1004  }
1005  }
1006  }
1007 
1008  //------------------------
1009  // Check for online BS
1010  m_bsvalid = 1.;
1011  if (m_usebs) {
1012 
1013  // Read beamspot validity
1014  bool valid = true;
1015  int status = BSObj.getValue(curIOV);
1016  //m_logger << Root::kINFO << "Found online beamspot status = " << status << Root::GEndl;
1017 
1018  if (status != 7) valid = false;
1019 
1020  if (!valid) {
1021  m_bsvalid = 0.0;
1022  m_livefrac = 0.0;
1023  if(m_verbose == true){
1024  m_logger << Root::kINFO << m_runnbr << "[" << m_clumiblocknbr << "]: Online beamspot invalid with Lumi=" << m_instLumi << " 10^30 cm-2 s-1" << Root::GEndl;
1025  }
1026  }
1027  }
1028 
1029  //-------------------------------
1030 
1031  l1count = L1accept_map.find(currentVK)->second;
1032  m_beforeprescale = l1count.BeforePrescale;
1033  m_beforeprescaleof = false;
1034  m_afterprescale = l1count.AfterPrescale;
1035  m_afterprescaleof = false;
1036  m_l1acc = l1count.L1Accept;
1037  m_l1accof = false;
1038 
1039  m_deltaT = (lbendtime-lbstarttime)/1.E9;
1040  m_lbstarttime = lbstarttime/1.E9;
1041  m_lbendtime = lbendtime/1.E9;
1042 
1043  if (m_deltaT > 0.) m_larfrac = 1.-m_lartime/m_deltaT;
1044 
1045  // For online lumi database case one needs to make some changes:
1046  if(m_onlinelumi == true){
1047  // In Valid UInt32 type value some information is encoded:
1048  // see: https://twiki.cern.ch/twiki/bin/view/Atlas/CoolOnlineData#Folder_TRIGGER_LUMI_LBLESTONL
1049  cool::UInt32 tempValid = (m_Valid & 1023);
1050 
1051  if(tempValid == 10){
1052  // in this bits, Value 301 and 302 means MBTS and LUCID lumi for which some care is needed
1053  if((m_Valid >> 22) == 301
1054  || (m_Valid >> 22) == 302
1055  || (m_Valid >> 22) == 101
1056  || (m_Valid >> 22) == 102
1057  || (m_Valid >> 22) == 103
1058  || (m_Valid >> 22) == 104
1059  ){
1060  m_Valid = 0;
1061  }else{
1062  m_Valid = tempValid;
1063  }
1064  }else{
1065  m_Valid = tempValid;
1066  }
1067 
1068  } else {
1069 
1070  // For offline, we also need to strip out the preferred channel value from the validity word
1071  m_Valid &= 0xFFFF;
1072  }
1073 
1074  // Dump out debugging information
1075  if(m_verbose == true){
1076  m_logger << Root::kINFO << m_runnbr << "[" << m_clumiblocknbr << "]: L1Acc: " << m_l1acc;
1077  if(m_uselivetrigger) m_logger << ", Livetime trigger L1Acc: " << m_livetime_l1acc;
1078  m_logger << ", InstLumi: " << m_instLumi << ", deltaT: " << m_deltaT << ", AvEvtsPerBX: " << m_AvEvtsPerBX << ", BeforePrescale: " << m_beforeprescale << ", AfterPrescale: " << m_afterprescale;
1079  if (m_uselivetrigger) m_logger << ", Livetime trigger BeforePrescale: " << m_livetime_beforeprescale << " Livetime trigger AfterPrescale: " << m_livetime_afterprescale;
1080  if (isrun2) {
1081  m_logger << ", Livefrac: " << m_livefrac << ", L1Presc: " << m_l1prescale << ", HLTPresc: " << m_l2prescale << ", Valid: " << m_Valid;
1082  } else {
1083  m_logger << ", Livefrac: " << m_livefrac << ", L1Presc: " << m_l1prescale << ", L2Presc: " << m_l2prescale << ", L3Presc: " << m_l3prescale << ", Valid: " << m_Valid;
1084  }
1085  if (m_uselar) m_logger << ", LAr ready fraction: " << m_larfrac;
1086  m_logger << Root::GEndl;
1087  }
1088 
1089  // Check if we have valid luminosity
1090  // Just need to check lowest digit. 10 -> BCID blind, 100 -> mu not valid
1091  if(m_Valid%10 != 0){
1092 
1093  // Invalid luminosity entry, call it bad
1094  m_instLumi = 0.0;
1095  m_totalbadblock += 1;
1096  m_t_totalbadblock += 1;
1097  m_logger << Root::kWARNING << "Skipping lumiblock " << m_runnbr << "[" << m_clumiblocknbr << "] with invalid inst. lumi. (valid=" << m_Valid << ")!" << Root::GEndl;
1098 
1099  } else if ((m_triglevel > 0) && (m_l1prescale < 0. || m_l2prescale < 0. || m_l3prescale < 0.)) {
1100 
1101  // Disabled trigger, call bad but still record delivered luminosity
1102  m_totalbadblock += 1;
1103  m_t_totalbadblock += 1;
1104  m_logger << Root::kWARNING << "Lumiblock " << m_runnbr << "[" << m_clumiblocknbr << "] has a disabled or incorrectly specified trigger.! " << Root::GEndl;
1105 
1106  }
1107 
1108  //========================================================//
1109  // L U M I N O S I T Y C A L C U L A T I O N H E R E //
1110  //========================================================//
1111  // The actual calculation of integrated luminosity and
1112  // accumulation of some variables
1113  m_totalDelL += (m_deltaT*m_instLumi); // delivered lumi
1114  m_t_totalDelL += (m_deltaT*m_instLumi); // delivered lumi
1115  m_t_deltaT += m_deltaT;
1116 
1117  // Count up everything
1118  m_totall1acc += m_l1acc;
1119  m_livtrig_totall1acc += m_livetime_l1acc;
1120  m_t_l1acc += m_l1acc;
1121  m_totall1befpresc += m_beforeprescale;
1122  m_t_totall1befpresc += m_beforeprescale;
1123  m_totall2acc += m_l2acc;
1124  m_t_l2acc += m_l2acc;
1125  m_totall3acc += m_l3acc;
1126  m_t_l3acc += m_l3acc;
1127  m_livetime = m_livefrac*m_deltaT;
1128  m_totaltime += m_livetime;
1129  m_t_totaltime += m_livetime;
1130 
1131  double totalPrescale = m_l1prescale * m_l2prescale * m_l3prescale;
1132 
1133  // Check for disabled triggers
1134  if (m_l1prescale < 0. ) totalPrescale = 0.;
1135  if (m_l2prescale < 0. ) totalPrescale = 0.;
1136  if (m_l3prescale < 0. ) totalPrescale = 0.;
1137 
1138  // Check also for no trigger
1139  if (m_triglevel == 0) totalPrescale = 1.;
1140 
1141  m_intLumi = 0.;
1142 
1143  m_lumiWOPrescale += m_livetime*m_instLumi ;
1144  m_t_lumiWOPrescale += m_livetime*m_instLumi ;
1145 
1146  m_lumiLAr += m_livetime*m_larfrac*m_instLumi;
1147  m_t_lumiLAr += m_livetime*m_larfrac*m_instLumi;
1148 
1149  if (totalPrescale > 0.) {
1150  m_totalPrescaleWLiveTime += m_livetime/totalPrescale;
1151  m_t_totalPrescaleWLiveTime += m_livetime/totalPrescale;
1152  m_totalPrescale += 1./totalPrescale;
1153  m_t_totalPrescale += 1./totalPrescale;
1154  m_intLumi = m_larfrac * m_livetime * m_instLumi/totalPrescale; // <<<--- T H E F O R M U L A
1155  }
1156 
1157 
1158  m_totalL += m_intLumi;
1159  m_t_totalL += m_intLumi;
1160  m_totalLRun += m_intLumi;
1161 
1162 
1163  // MB: trigger rates, note that livefrac drops out of ratio
1164  m_l1rate = ( m_livetime>0 ? m_l1acc / m_livetime : 0. );
1165  m_l2rate = ( m_livetime>0 ? m_l2acc / m_livetime : 0. );
1166  m_l3rate = ( m_livetime>0 ? m_l3acc / m_livetime : 0. );
1167 
1168  // MB: delivered lumi
1169  m_l1ratediveffxsec = (float)m_afterprescale/( m_deltaT*m_effxsec );
1170  m_total_l1ratediveffxsec += (float)m_afterprescale / m_effxsec ;
1171  m_total_l1ratediveffxsecRun += (float)m_afterprescale / m_effxsec ;
1172 
1173  // MB: recorded lumi
1174  m_l1ratediveffxsec_recorded = (float)m_l1acc /( m_deltaT*m_effxsec );
1175  m_total_l1ratediveffxsec_recorded += (float)m_l1acc / m_effxsec ;
1176  m_total_l1ratediveffxsecRun_recorded += (float)m_l1acc / m_effxsec ;
1177 
1178  if (m_collsgrl!=0) {
1179  if ( m_l1rate>=m_mintrigrate )
1180  m_collsgrl->AddRunLumiBlock(m_runnbr,m_clumiblocknbr);
1181  }
1182 
1183  if (m_verbose) {
1184  if (m_effxsec!=1.0)
1185  m_logger << Root::kINFO << "L1rate a/ prescale: " << m_afterprescale << ", Delivered LumiFromL1rate (/ub): " << m_l1ratediveffxsec << ", Delivered TotalLumiFromL1rate (/ub): " << m_total_l1ratediveffxsec
1186  << Root::GEndl;
1187  }
1188 
1189  if(m_LumiTree != 0)m_LumiTree->Fill();
1190  } // End of loop over lumi blocks
1191 
1192  // Print IOV summary
1193  m_logger << Root::kINFO<< std::setw(10) << std::left << ">== Trigger : " << triggerchain << Root::GEndl;
1194  m_logger << Root::kINFO<< std::setw(10) << std::right << "Run" << std::setw(10) << std::right << "L1-Acc" << std::setw(10) << std::right << "L2-Acc" << std::setw(10) << std::right << "L3-Acc" << std::setw(10) << std::right << "LiveTime" << std::setw(18) << std::right << "IntL rec.(ub^-1)" << std::setw(18) << std::right << "IntL del.(ub^-1)" << Root::GEndl;
1195  m_logger << Root::kINFO<< std::setw(10) << std::right << m_runnbr << std::setw(10) << std::right << m_t_l1acc << std::setw(10) << std::right << m_t_l2acc << std::setw(10) << std::right << m_t_l3acc << std::setw(10) << std::right << m_t_totaltime << std::setw(18) << std::right << m_t_totalL << std::setw(18) << std::right << m_t_totalDelL << Root::GEndl;
1196  // m_logger << Root::kINFO << std::setw(10) << std::right << "BeforePrescale" << std::setw(10) << std::right << m_totall1befpresc << std::setw(10) << std::right << "" << std::setw(10) << std::right << "" << std::setw(10) << std::right << "" << std::setw(10) << std::right << "" << std::setw(10) << std::right << "" << std::setw(10) << m_TotaldeltaT << std::setw(14) << std::right << m_totalL << Root::GEndl;
1197 
1198  m_logger << Root::kINFO<< std::setw(10) << std::left << "L1/2/3 accept: " << std::setw(10) << std::left << m_t_l1acc << std::setw(10) << std::left << m_t_l2acc << std::setw(10) << std::left << m_t_l3acc << Root::GEndl;
1199  m_logger << Root::kINFO << std::setw(10) << std::left << "L1BeforePresc: " << std::setw(10) << std::left << m_t_totall1befpresc << Root::GEndl;
1200  m_logger << Root::kINFO << std::setw(10) << std::left << "Livetime : " << m_t_totaltime << Root::GEndl;
1201  m_logger << Root::kINFO << std::setw(10) << std::left << "Prescale Weighted Livetime: " << m_t_totalPrescaleWLiveTime << Root::GEndl;
1202  m_logger << Root::kINFO<< std::setw(10) << std::left << "Good LBs : " << m_t_totalgoodblock - m_t_totalbadblock << Root::GEndl;
1203  m_logger << Root::kINFO<< std::setw(10) << std::left << "Bad LBs : " << m_t_totalbadblock << Root::GEndl;
1204 
1205  if ( m_effxsec==1.0 ) {
1206  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL delivered (ub^-1) : " << m_t_totalDelL << Root::GEndl;
1207  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL after livefraction (ub^-1): " << m_t_lumiWOPrescale << Root::GEndl;
1208  if (m_uselar)
1209  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL after LAr fraction (ub^-1): " << m_t_lumiLAr << Root::GEndl;
1210  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL recorded after prescale (ub^-1) : " << m_t_totalL << Root::GEndl;
1211  } else {
1212  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL delived (ub^-1) : " << m_total_l1ratediveffxsec << Root::GEndl;
1213  m_logger << Root::kINFO << std::setw(10) << std::left << "IntL recorded (ub^-1) : " << m_total_l1ratediveffxsec_recorded << Root::GEndl;
1214  }
1215 
1216  // Print prescales as range of actual lumi blocks these apply to
1217  if(m_triglevel >= 1){
1218  // Print L1 Prescale values:
1219  m_logger << Root::kINFO << std::setw(10) << std::left << "L1 Prescales: ";
1220 
1221  std::list< std::pair<IOVRange, cool::Int32> >::iterator it;
1222  for(it = L1preObj.data.begin(); it != L1preObj.data.end(); ++it) {
1223  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" ;
1224  if (isrun2) {
1225  if (it->second < 0)
1226  m_logger << it->second << ", ";
1227  else
1228  m_logger << (0xFFFFFF / float(0x1000000 - it->second)) << ", ";
1229  } else {
1230  m_logger << it->second << ", ";
1231  }
1232  }
1233  m_logger << Root::kINFO << Root::GEndl;
1234  }
1235 
1236  if(m_triglevel >= 2){
1237  // Print L2 Prescale values:
1238  if (isrun2) {
1239  m_logger << Root::kINFO << std::setw(10) << std::left << "HLT Prescales: ";
1240  }
1241  else {
1242  m_logger << Root::kINFO << std::setw(10) << std::left << "L2 Prescales: ";
1243  }
1244 
1245  std::list< std::pair<IOVRange, cool::Float> >::iterator it;
1246  for(it = L2preObj.data.begin(); it != L2preObj.data.end(); ++it) {
1247  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" << it->second << ", ";
1248  }
1249  m_logger << Root::kINFO << Root::GEndl;
1250  }
1251 
1252  if(m_triglevel == 3){
1253  // Print L3 Prescale values:
1254  m_logger << Root::kINFO << std::setw(10) << std::left << "L3 Prescales: ";
1255 
1256  std::list< std::pair<IOVRange, cool::Float> >::iterator it;
1257  for(it = L3preObj.data.begin(); it != L3preObj.data.end(); ++it) {
1258  m_logger << Root::kINFO << std::setw(1) << std::left << "[" << it->first.start().event() << "," << it->first.stop().event()-1 << "]:" << it->second << ", ";
1259  }
1260  m_logger << Root::kINFO << Root::GEndl;
1261  }
1262 
1263  } // end lb collection loop
1264 
1265 
1266  // ------------------------------------------------------------------------------------------------
1267  // MB : Print total only at end of LB loop:
1268  m_logger << Root::kINFO << std::left << "-----------------------------------" << Root::GEndl;
1269  m_logger << Root::kINFO << std::left << " LumiCalculator summary" << Root::GEndl;
1270  m_logger << Root::kINFO << std::left << "-----------------------------------" << Root::GEndl;
1271  m_logger << Root::kINFO<< std::setw(10) << std::right << "Total" << std::setw(10) << std::right << "L1-Acc" << std::setw(10) << std::right << "L2-Acc" << std::setw(10) << std::right << "L3-Acc" <<
1272  std::setw(10) << std::right << "LiveTime" << std::setw(18) << std::right << "IntL rec.(ub^-1)" << std::setw(18) << std::right << "IntL del.(ub^-1)" << Root::GEndl;
1273  m_logger << Root::kINFO<< std::setw(10) << std::right << "" << std::setw(10) << std::right << m_totall1acc << std::setw(10) << std::right << m_totall2acc << std::setw(10) << std::right
1274  << m_totall3acc << std::setw(10) << std::right << m_totaltime << std::setw(18) << std::right << m_totalL << std::setw(18) << std::right << m_totalDelL << Root::GEndl;
1275  m_logger << Root::kINFO<< std::setw(10) << std::left << "Total L1/2/3 accept: " << std::setw(10) << std::left << m_totall1acc << std::setw(10) << std::left << m_totall2acc << std::setw(10)
1276  << std::left << m_totall3acc << Root::GEndl;
1277  if(m_uselivetrigger)m_logger << Root::kINFO<< std::setw(10) << std::left << "Total L1 livetime trigger accept: " << std::setw(10) << std::left << m_livtrig_totall1acc << Root::GEndl;
1278 
1279  m_logger << Root::kINFO << std::setw(10) << std::left << "First Run: " << std::setw(10) << std::left << m_minrun << Root::GEndl;
1280  m_logger << Root::kINFO << std::setw(10) << std::left << "Last Run: " << std::setw(10) << std::left << m_maxrun << Root::GEndl;
1281  m_logger << Root::kINFO << std::setw(10) << std::left << "Total L1BeforePresc: " << std::setw(10) << std::left << m_totall1befpresc << Root::GEndl;
1282  m_logger << Root::kINFO<< std::setw(10) << std::left << "Total Livetime : " << m_totaltime << Root::GEndl;
1283  m_logger << Root::kINFO << std::setw(10) << std::left << "Total prescale weighted Livetime: " << m_totalPrescaleWLiveTime << Root::GEndl;
1284  m_logger << Root::kINFO<< std::setw(10) << std::left << "Total Good LBs : " << m_totalgoodblock - m_totalbadblock << Root::GEndl;
1285  m_logger << Root::kINFO<< std::setw(10) << std::left << "Total Bad LBs : " << m_totalbadblock << Root::GEndl;
1286  m_logger << Root::kINFO << std::setw(10) << std::left << "Total IntL delivered (ub^-1) : " << m_totalDelL << Root::GEndl;
1287  m_logger << Root::kINFO << std::setw(10) << std::left << "Total IntL after livefraction (ub^-1): " << m_lumiWOPrescale << Root::GEndl;
1288  if (m_uselar)
1289  m_logger << Root::kINFO << std::setw(10) << std::left << "Total IntL after LAr fraction (ub^-1): " << m_lumiLAr << Root::GEndl;
1290  m_logger << Root::kINFO << std::setw(10) << std::left << "Total IntL recorded (ub^-1) : " << m_totalL << Root::GEndl;
1291 
1292  // ------------------------------------------------------------------------------------------------
1293 
1294  if(m_makecollList == true){
1295  // store collisions xml file on demand
1296  if (m_collsgrl!=0) {
1297  TString collisionsxml = "collisions_" + m_collsgrl->GetSuggestedName() + ".xml";
1299  writer.SetGoodRunsList( *m_collsgrl );
1300  writer.SetFilename( collisionsxml.Data() );
1301  writer.WriteXMLFile();
1302  // can now delete grl
1303  delete m_collsgrl; m_collsgrl=0;
1304  }
1305  }
1306 
1307 
1308  // Creating monitoring plots on demand
1309  if(m_makePlots == true) { this->MakePlots(triggerchain); }
1310 
1311  delete cq_trigger;
1312  delete cq_lumi;
1313  delete cq_lar;
1314  delete cq_bs;
1315 }
1316 
1317 // Deal with composite L1 trigger
1318 void
1319 LumiCalculator::ParseL1Trigger(const std::string& lowerch, CoolQuery * cq_trigger) {
1320 
1321  //
1322  // Check if we have multiple entries
1323  size_t last = 0;
1324  size_t next = 0;
1325  cool::ChannelId id;
1326  bool valid;
1327 
1328  m_L1id = 0;
1329  m_L1Valid = false;
1330 
1331  if (lowerch.find(',', last) == std::string::npos) {
1332  // Normal case
1333  m_L1id = cq_trigger->getL1ChannelId(lowerch, m_parlvl1menufolder);
1334  m_L1Valid = cq_trigger->channelIdValid();
1335 
1336  } else {
1337  m_logger << Root::kINFO << "L1 item is composite: " << lowerch << Root::GEndl;
1338  do {
1339  next = lowerch.find(',', last);
1340  // Check if these are valid before using them
1341  id = cq_trigger->getL1ChannelId(lowerch.substr(last, next-last), m_parlvl1menufolder);
1342  valid = cq_trigger->channelIdValid();
1343  if (valid) {
1344  m_L1triggerchains.push_back(lowerch.substr(last, next-last));
1345  m_L1idList.push_back(m_L1id);
1346  m_L1id = id;
1347  m_L1Valid = true;
1348  } else {
1349  m_logger << Root::kINFO << lowerch.substr(last, next-last) << " Invalid" << Root::GEndl;
1350  }
1351 
1352  last = next + 1;
1353  } while (next != std::string::npos);
1354 
1355 
1356  }
1357 }
1358 
1359 // ---------------------------------------------------------------------------------
1360 // Utility to print lumicalc summary results
1361 void
1363 
1364  os << std::left << "-----------------------------------" << std::endl;
1365  os << std::left << " LumiCalculator summary" << std::endl;
1366  os << std::left << "-----------------------------------" << std::endl;
1367  os << std::setw(10) << std::left << "Trigger: " << std::setw(10) << std::left << m_triggerchain << std::endl;
1368  os << std::setw(10) << std::left << "First Run: " << std::setw(10) << std::left << m_minrun << std::endl;
1369  os << std::setw(10) << std::left << "Last Run: " << std::setw(10) << std::left << m_maxrun << std::endl;
1370  os << std::setw(10) << std::left << "Total L1BeforePresc: " << std::setw(10) << std::left << m_totall1befpresc << std::endl;
1371  os << std::setw(10) << std::left << "Total Livetime : " << m_totaltime << std::endl;
1372  os << std::setw(10) << std::left << "Total prescale weighted Livetime: " << m_totalPrescaleWLiveTime << std::endl;
1373  os << std::setw(10) << std::left << "Total Good LBs : " << m_totalgoodblock - m_totalbadblock << std::endl;
1374  os << std::setw(10) << std::left << "Total Bad LBs : " << m_totalbadblock << std::endl;
1375  os << std::setw(10) << std::left << "Total IntL delivered (ub^-1) : " << m_totalDelL << std::endl;
1376  os << std::setw(10) << std::left << "Total IntL after livefraction (ub^-1): " << m_lumiWOPrescale << std::endl;
1377  if (m_uselar)
1378  os << std::setw(10) << std::left << "Total IntL after LAr fraction (ub^-1): " << m_lumiLAr << std::endl;
1379  os << std::setw(10) << std::left << "Total IntL recorded (ub^-1) : " << m_totalL << std::endl;
1380 
1381 }
1382 
1383 void
1384 LumiCalculator::DoHistogramAdmin(const uint32_t& runnbr, const TString& trigName, const float& effxsec)
1385 {
1386  // rebin the histograms once number of LBs is known
1387  int maxlb = 5000;
1388 
1389  m_ntrigplbVec.push_back( new TH1F(Form("run%d_ntrigplb",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1390  m_trigrateplbVec.push_back( new TH1F(Form("run%d_trigrateplb",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1391  m_lumiplbVec.push_back( new TH1F(Form("run%d_peaklumiplb",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1392  m_lumitrigrateplbVec.push_back( new TH1F(Form("run%d_peaklumitrigrateplb",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1393  m_intlumiVec.push_back( new TH1F(Form("run%d_intlumi",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1394  m_intlumitrigrateVec.push_back( new TH1F(Form("run%d_intlumitrigrate",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1395  m_lumitrigrateplb_recordedVec.push_back( new TH1F(Form("run%d_peakrecordedlumitrigrateplb",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1396  m_intlumitrigrate_recordedVec.push_back( new TH1F(Form("run%d_intrecordedlumitrigrate",runnbr), Form("Run %d",runnbr) , maxlb, 0., float(maxlb)) );
1397 
1398  m_ntrigplb = *(m_ntrigplbVec.rbegin());
1399  m_trigrateplb = *(m_trigrateplbVec.rbegin());
1400  m_lumiplb = *(m_lumiplbVec.rbegin());
1402  m_intlumi = *(m_intlumiVec.rbegin());
1406 
1407  this->SetHistogramStyle(m_ntrigplb, Form("Run = %d",runnbr), "Luminosity block number", Form("# %s triggers / LB",trigName.Data()));
1408  this->SetHistogramStyle(m_trigrateplb, Form("Run = %d",runnbr), "Luminosity block number", Form("%s trigger rate / LB",trigName.Data()));
1409  this->SetHistogramStyle(m_lumiplb, Form("Run = %d",runnbr), "Luminosity block number", "Delivered luminosity (#mub^{-1}/s)");
1410  this->SetHistogramStyle(m_lumitrigrateplb, Form("Efficiency * x-sec = %.1f #mub, Run = %d",effxsec,runnbr), "Luminosity block number", Form("%s luminosity (#mub^{-1}/s)",trigName.Data()));
1411  this->SetHistogramStyle(m_intlumi, Form("Run = %d",runnbr), "Luminosity block number", "Integrated delivered luminosity (#mub^{-1})");
1412  this->SetHistogramStyle(m_intlumitrigrate, Form("Efficiency * x-sec = %.1f #mub, Run = %d",effxsec,runnbr), "Luminosity block number", Form("%s Integrated luminosity (#mub^{-1})",trigName.Data()));
1413  this->SetHistogramStyle(m_lumitrigrateplb_recorded, Form("Efficiency * x-sec = %.1f #mub, Run = %d",effxsec,runnbr), "Luminosity block number", Form("%s Recorded luminosity (#mub^{-1}/s)",trigName.Data()));
1414  this->SetHistogramStyle(m_intlumitrigrate_recorded, Form("Efficiency * x-sec = %.1f #mub, Run = %d",effxsec,runnbr), "Luminosity block number", Form("%s Integrated recorded luminosity (#mub^{-1})",trigName.Data()));
1415 }
1416 
1417 
1418 void
1419 LumiCalculator::RebinHistograms(const int& nbins, const double& start, const double& end)
1420 {
1421  m_ntrigplb->SetBins(nbins,start,end);
1422  m_trigrateplb->SetBins(nbins,start,end);
1423  m_lumiplb->SetBins(nbins,start,end);
1424  m_lumitrigrateplb->SetBins(nbins,start,end);
1425  m_intlumi->SetBins(nbins,start,end);
1426  m_intlumitrigrate->SetBins(nbins,start,end);
1429 }
1430 
1431 
1432 void
1433 LumiCalculator::SetHistogramStyle(TH1F* hist, const char* title, const char* xaxis, const char* yaxis)
1434 {
1435  hist->SetFillColor(33); // light grey, blueish
1436  if (title!=0) hist->SetTitle(title);
1437  if (xaxis!=0) hist->GetXaxis()->SetTitle(xaxis);
1438  if (yaxis!=0) hist->GetYaxis()->SetTitle(yaxis);
1439 
1440  hist->GetXaxis()->SetLabelFont(52);
1441  hist->GetXaxis()->SetLabelSize(0.04);
1442  hist->GetXaxis()->SetTitleSize(0.05);
1443  hist->GetXaxis()->SetTitleOffset(1.28);
1444  hist->GetXaxis()->SetTitleFont(42);
1445 
1446  hist->GetYaxis()->SetLabelFont(52);
1447  hist->GetYaxis()->SetLabelSize(0.04);
1448  hist->GetYaxis()->SetTitleSize(0.05);
1449  hist->GetYaxis()->SetTitleOffset(1.25);
1450  hist->GetYaxis()->SetTitleFont(42);
1451 
1452  hist->SetStats(false);
1453 
1454  hist->SetLineWidth(2);
1455 }
1456 
1457 void
1458 LumiCalculator::MakePlots(const std::string& triggerchain)
1459 {
1460  if(m_LumiTree != 0){
1461  // rebin and fill histograms:
1462  m_LumiTree->SetBranchAddress("LBStart", &m_clumiblocknbr);
1463  m_LumiTree->SetBranchAddress("L1AfterPrescale", &m_afterprescale);
1464  m_LumiTree->SetBranchAddress("L1Rate", &m_l1rate);
1465  m_LumiTree->SetBranchAddress("IntLumi",&m_intLumi);
1466  m_LumiTree->SetBranchAddress("L1Ratediveffxsec",&m_l1ratediveffxsec);
1467  m_LumiTree->SetBranchAddress("TotalLumi",&m_totalL);
1468  m_LumiTree->SetBranchAddress("Total_L1Ratediveffxsec",&m_total_l1ratediveffxsec);
1469  m_LumiTree->SetBranchAddress("TotalLumiRun",&m_totalLRun);
1470  m_LumiTree->SetBranchAddress("Total_L1RatediveffxsecRun",&m_total_l1ratediveffxsecRun);
1471  m_LumiTree->SetBranchAddress("RunNbr", &m_runnbr);
1472  m_LumiTree->SetBranchAddress("L1RatediveffxsecRecorded",&m_l1ratediveffxsec_recorded);
1473  m_LumiTree->SetBranchAddress("Total_L1RatediveffxsecRecorded",&m_total_l1ratediveffxsec_recorded);
1474  m_LumiTree->SetBranchAddress("Total_L1RatediveffxsecRunRecorded",&m_total_l1ratediveffxsecRun_recorded);
1475  m_LumiTree->SetBranchAddress("AvergeInteractionPerXing",&m_AvEvtsPerBX);
1476 
1477  // get first and last run number
1478  m_LumiTree->GetEntry(0);
1479  int runnbrstart = m_runnbr;
1480  m_LumiTree->GetEntry(m_LumiTree->GetEntries()-1);
1481  int runnbrend = m_runnbr;
1482 
1483  // makeup of integrated lumi histograms
1484  m_intlumiruns = new TH1F("intlumiruns","Luminosity",1,0.,1.);
1485  m_intlumitrigrateruns = new TH1F("intlumitrigrateruns","Delivered luminosity",1,0.,1.);
1486  m_intlumitrigrateruns_recorded = new TH1F("intlumitrigrateruns_recorded","Recorded luminosity",1,0.,1.);
1487  m_intlumiruns->SetBins(runnbrend-runnbrstart+10,float(runnbrstart),float(runnbrend+10));
1488  m_intlumitrigrateruns->SetBins(runnbrend-runnbrstart+10,float(runnbrstart),float(runnbrend+10));
1489  m_intlumitrigrateruns_recorded->SetBins(runnbrend-runnbrstart+10,float(runnbrstart),float(runnbrend+10));
1490 
1491  // Lumi-weighted average interactions per crossing
1492  m_avgintperbx = new TH1F("avgintperbx", "Avg Int/BX", 1000, 0., 100.);
1493  m_avgintperbx->SetTitle("Lumi-weighted Interactions per BX");
1494  this->SetHistogramStyle(m_avgintperbx, "Lumi-weighted Average Interactions per BX", "Average Interactions per BX", "Recorded Luminosity (mb-1)");
1495 
1496  // loop over the lumi tree
1497  m_runnbr_prev = 0;
1498  int nlbs(0);
1499  float totalL(0.), total_l1ratediveffxsec(0.), total_l1ratediveffxsec_recorded(0.), totalLRun(0.), total_l1ratediveffxsecRun(0.), total_l1ratediveffxsecRun_recorded(0.);
1500  for(int i=0; i < m_LumiTree->GetEntries(); i++){
1501  m_LumiTree->GetEntry(i);
1502 
1503  // do histogram admin first
1504  if ( m_runnbr!=m_runnbr_prev ) {
1505  // first rebin prev histograms
1506  if (m_runnbr_prev>0) {
1507  m_intlumi->SetTitle(Form("Delivered luminosity = %.1f /#mu b, Run = %d",totalLRun,m_runnbr_prev));
1508  m_intlumitrigrate->SetTitle(Form("Delivered luminosity = %.1f /#mu b, Efficiency * x-sec = %.1f #mu b, Run = %d",total_l1ratediveffxsecRun,m_effxsec,m_runnbr_prev));
1509  m_intlumitrigrate_recorded->SetTitle(Form("Recorded luminosity = %.1f /#mu b, Efficiency * x-sec = %.1f #mu b, Run = %d",total_l1ratediveffxsecRun_recorded,m_effxsec,m_runnbr_prev));
1510  this->RebinHistograms(nlbs+10,0,double(nlbs+10));
1511  }
1512  // create new histograms
1513  this->DoHistogramAdmin(m_runnbr,triggerchain,m_effxsec);
1514  // fill cullumative luminosity
1515  if (m_runnbr_prev>0) {
1516  for (uint32_t j=m_runnbr_prev; j<m_runnbr; ++j) {
1517  m_intlumiruns->Fill(j,totalL);
1518  m_intlumitrigrateruns->Fill(j,total_l1ratediveffxsec);
1519  m_intlumitrigrateruns_recorded->Fill(j,total_l1ratediveffxsec_recorded);
1520  }
1521  }
1523  }
1524  totalL = m_totalL;
1525  totalLRun = m_totalLRun;
1526  total_l1ratediveffxsec = m_total_l1ratediveffxsec;
1527  total_l1ratediveffxsecRun = m_total_l1ratediveffxsecRun;
1528  total_l1ratediveffxsec_recorded = m_total_l1ratediveffxsec_recorded;
1529  total_l1ratediveffxsecRun_recorded = m_total_l1ratediveffxsecRun_recorded;
1530  nlbs = m_clumiblocknbr;
1531 
1540  m_avgintperbx->Fill(m_AvEvtsPerBX, m_intLumi); // Lumi-weighted mu
1541 
1542  } // end tree loop
1543  m_intlumiruns->Fill(runnbrend,totalL);
1544  m_intlumitrigrateruns->Fill(runnbrend,total_l1ratediveffxsec);
1545  m_intlumitrigrateruns_recorded->Fill(runnbrend,total_l1ratediveffxsec_recorded);
1546 
1547  // finish histograms make-up
1548  m_intlumiruns->SetMinimum(0.);
1549  m_intlumitrigrateruns->SetMinimum(0.);
1550  this->RebinHistograms(nlbs+10,0,double(nlbs+10));
1551  this->SetHistogramStyle(m_intlumiruns, Form("Delivered luminosity = %.1f /ub",totalL), "Run number", "Luminosity (#mu b^{-1})");
1552  this->SetHistogramStyle(m_intlumitrigrateruns, Form("Delivered luminosity = %.1f /#mu b, Recorded luminosity = %.1f /#mu b", //, Efficiency * x-sec = %.1f mb",
1553  total_l1ratediveffxsec,total_l1ratediveffxsec_recorded/*,m_effxsec*/), "Run number", Form("%s Luminosity (#mu b^{-1})",triggerchain.c_str()));
1554  this->SetHistogramStyle(m_intlumitrigrateruns_recorded, Form("Delivered luminosity = %.1f /#mub, Recorded luminosity = %.1f /#mub", //, Efficiency * x-sec = %.1f #mub",
1555  total_l1ratediveffxsec,total_l1ratediveffxsec_recorded/*,m_effxsec*/), "Run number", Form("%s Luminosity (#mu b^{-1})",triggerchain.c_str()));
1556 
1558 
1559  // and store the histograms
1560  TString histFileName = TString("ilumicalc_histograms_") + TString(triggerchain) + ( runnbrstart==runnbrend ? Form("_%d_",runnbrstart) : Form("_%d-%d_",runnbrstart,runnbrend)) + TString(m_lumitag) + TString(".root");
1561  TFile *ff = new TFile(histFileName.Data(),"recreate");
1562  m_avgintperbx->Write();
1563  if (m_effxsec==1.0) {
1564  m_intlumiruns->Write();
1565  for (itr=m_lumiplbVec.begin(); itr!=m_lumiplbVec.end(); ++itr) { (*itr)->Write(); }
1566  for (itr=m_intlumiVec.begin(); itr!=m_intlumiVec.end(); ++itr) { (*itr)->Write(); }
1567  }
1568  for (itr=m_ntrigplbVec.begin(); itr!=m_ntrigplbVec.end(); ++itr) { (*itr)->Write(); }
1569  for (itr=m_trigrateplbVec.begin(); itr!=m_trigrateplbVec.end(); ++itr) { (*itr)->Write(); }
1570  if (m_effxsec!=1.0) { // results only make sense when proper xsec is provided externally
1571  m_intlumitrigrateruns->Write();
1573  for (itr=m_lumitrigrateplbVec.begin(); itr!=m_lumitrigrateplbVec.end(); ++itr) { (*itr)->Write(); }
1574  for (itr=m_intlumitrigrateVec.begin(); itr!=m_intlumitrigrateVec.end(); ++itr) { (*itr)->Write(); }
1575  for (itr=m_lumitrigrateplb_recordedVec.begin(); itr!=m_lumitrigrateplb_recordedVec.end(); ++itr) { (*itr)->Write(); }
1576  for (itr=m_intlumitrigrate_recordedVec.begin(); itr!=m_intlumitrigrate_recordedVec.end(); ++itr) { (*itr)->Write(); }
1577  }
1578  m_LumiTree->Write();
1579 
1580  // And write out the lumi tag information
1581  TObjString lumiTag(m_lumitag.c_str());
1582  lumiTag.Write("lumiTag");
1583 
1584  TObjString larTag(m_lartag.c_str());
1585  larTag.Write("larTag");
1586 
1587 
1588  ff->Close();
1589  delete ff;
1590  m_logger << Root::kINFO << "Histograms stored as : " << histFileName << Root::GEndl;
1591 
1592  }else{
1593  m_logger << Root::kWARNING << "LumiTree pointer does not exist! : " << Root::GEndl;
1594  }
1595 
1596 
1597 }
1598 
1599 
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
LumiCalculator::m_deltaT
float m_deltaT
Definition: LumiCalculator.h:121
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LumiCalculator::m_afterprescaleof
bool m_afterprescaleof
Definition: LumiCalculator.h:141
LumiCalculator::m_l2acc
unsigned int m_l2acc
Definition: LumiCalculator.h:128
TGoodRunsList.h
LumiCalculator::m_lumiLAr
float m_lumiLAr
Definition: LumiCalculator.h:161
LumiCalculator::m_ntrigplbVec
std::vector< TH1F * > m_ntrigplbVec
Definition: LumiCalculator.h:213
LumiCalculator::m_livetrigger
std::string m_livetrigger
Definition: LumiCalculator.h:75
Root::kWARNING
@ kWARNING
Definition: TMsgLogger.h:51
LumiCalculator::m_totalbadblock
unsigned int m_totalbadblock
Definition: LumiCalculator.h:151
LumiCalculator::m_lumimethod
std::string m_lumimethod
Definition: LumiCalculator.h:80
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
LumiCalculator::UseLumiChannel
void UseLumiChannel(int chan)
Definition: LumiCalculator.cxx:260
LumiCalculator::m_totalgoodblock
unsigned int m_totalgoodblock
Definition: LumiCalculator.h:150
LumiCalculator::m_intlumi
TH1F * m_intlumi
Definition: LumiCalculator.h:202
LumiCalculator::m_lbstarttime
double m_lbstarttime
Definition: LumiCalculator.h:109
LumiCalculator::printSummary
void printSummary(std::ostream &os)
Definition: LumiCalculator.cxx:1362
IOVRange
Validity Range object. Holds two IOVTimes (start and stop)
Definition: IOVRange.h:30
python.output.AtlRunQueryRoot.MakePlots
def MakePlots(tree, datapath)
Definition: AtlRunQueryRoot.py:111
LumiCalculator::SetHistogramStyle
void SetHistogramStyle(TH1F *hist, const char *title=0, const char *xaxis=0, const char *yaxis=0)
Definition: LumiCalculator.cxx:1433
IOVTime::event
uint32_t event() const noexcept
Definition: IOVTime.h:106
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
IOVData
Definition: CoolQuery.h:54
LumiCalculator::m_usebs
bool m_usebs
Definition: LumiCalculator.h:238
LumiCalculator::m_intlumitrigrate
TH1F * m_intlumitrigrate
Definition: LumiCalculator.h:203
CoolQuery::getLumiFolderData
std::map< cool::ValidityKey, LumiFolderData > getLumiFolderData(const std::string &folder_name, const std::string &tag, const cool::ChannelId &id)
Definition: CoolQuery.cxx:290
LumiCalculator::RebinHistograms
void RebinHistograms(const int &nbins, const double &start, const double &end)
Definition: LumiCalculator.cxx:1419
LumiCalculator::m_lumichannel
int m_lumichannel
Definition: LumiCalculator.h:85
plotmaker.hist
hist
Definition: plotmaker.py:148
LumiCalculator::m_bsonl
std::string m_bsonl
Definition: LumiCalculator.h:83
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
tree
TChain * tree
Definition: tile_monitor.h:30
IOVRange::start
const IOVTime & start() const
Definition: IOVRange.h:38
CoolQuery::getHLTLowerChainName
std::string getHLTLowerChainName(const std::string &trigger, const std::string &folder_name)
Definition: CoolQuery.cxx:256
CoolQuery::setIOVForRun
void setIOVForRun(unsigned int runnum)
Definition: CoolQuery.cxx:101
skel.it
it
Definition: skel.GENtoEVGEN.py:396
IOVTime::re_time
uint64_t re_time() const noexcept
Definition: IOVTime.h:107
CoolQuery::L1CountFolderData::AfterPrescale
cool::UInt63 AfterPrescale
Definition: CoolQuery.h:312
LumiCalculator::m_afterprescale
ULong64_t m_afterprescale
Definition: LumiCalculator.h:138
LumiCalculator::m_lumitrigrateplbVec
std::vector< TH1F * > m_lumitrigrateplbVec
Definition: LumiCalculator.h:216
LumiCalculator::m_trigger
std::string m_trigger
Definition: LumiCalculator.h:74
CoolQuery::L1CountFolderData::BeforePrescale
cool::UInt63 BeforePrescale
Definition: CoolQuery.h:311
ATLAS_NOT_THREAD_SAFE
void LumiCalculator::IntegrateLumi ATLAS_NOT_THREAD_SAFE(const xAOD::LumiBlockRangeContainer *iovc, const std::string &triggerchain)
Definition: LumiCalculator.cxx:287
LumiCalculator::m_lumitrigrateplb
TH1F * m_lumitrigrateplb
Definition: LumiCalculator.h:201
LumiCalculator::m_lumiplbVec
std::vector< TH1F * > m_lumiplbVec
Definition: LumiCalculator.h:215
LumiCalculator::m_L1id
cool::ChannelId m_L1id
Definition: LumiCalculator.h:228
LumiCalculator::m_parlvl1menufolder
std::string m_parlvl1menufolder
Definition: LumiCalculator.h:90
LumiCalculator::m_avgintperbx
TH1F * m_avgintperbx
Definition: LumiCalculator.h:211
LumiCalculator.h
LumiCalculator::m_l3prescale
float m_l3prescale
Definition: LumiCalculator.h:137
LumiCalculator::SetCollName
void SetCollName(const std::string &lbcollname)
Definition: LumiCalculator.cxx:229
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
LumiCalculator::m_totalLRun
float m_totalLRun
Definition: LumiCalculator.h:114
LumiCalculator::UseLumiMethod
void UseLumiMethod(const std::string &method)
Definition: LumiCalculator.cxx:256
GEndl
#define GEndl
Definition: TMsgLogger.h:151
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
LumiCalculator::m_intlumiVec
std::vector< TH1F * > m_intlumiVec
Definition: LumiCalculator.h:217
LumiCalculator::m_trigrateplb
TH1F * m_trigrateplb
Definition: LumiCalculator.h:199
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
LumiCalculator::m_AvEvtsPerBX
float m_AvEvtsPerBX
Definition: LumiCalculator.h:117
CoolQuery::getL1CountFolderData
std::map< cool::ValidityKey, L1CountFolderData > getL1CountFolderData(const std::string &folder_name, const cool::ChannelId &id)
Definition: CoolQuery.cxx:324
IOVRange::stop
const IOVTime & stop() const
Definition: IOVRange.h:39
LumiCalculator::m_livefrac
float m_livefrac
Definition: LumiCalculator.h:123
LumiCalculator::m_bstag
std::string m_bstag
Definition: LumiCalculator.h:84
LumiCalculator::m_lumi_database
std::string m_lumi_database
Definition: LumiCalculator.h:69
LumiCalculator::m_lartag
std::string m_lartag
Definition: LumiCalculator.h:82
LumiCalculator::m_laroff
std::string m_laroff
Definition: LumiCalculator.h:81
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
calibdata.valid
list valid
Definition: calibdata.py:45
LumiCalculator::ParseL1Trigger
void ParseL1Trigger(const std::string &lowerch, CoolQuery *cq_trigger)
Definition: LumiCalculator.cxx:1319
TileSynchronizeBch.online
online
Definition: TileSynchronizeBch.py:88
mc
Definition: mc.PG_single_nu_valid.py:1
LumiCalculator::m_lbstop
uint32_t m_lbstop
Definition: LumiCalculator.h:146
CoolQuery::getLumiChannelId
cool::ChannelId getLumiChannelId(const std::string &lumimethod, const std::string &folder_name)
Definition: CoolQuery.cxx:170
LumiCalculator::m_data_db
std::string m_data_db
Definition: LumiCalculator.h:78
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
CoolQuery::L1CountFolderData::L1Accept
cool::UInt63 L1Accept
Definition: CoolQuery.h:313
CoolQuery
Definition: CoolQuery.h:217
lumiFormat.i
int i
Definition: lumiFormat.py:85
D3PDSizeSummary.ff
ff
Definition: D3PDSizeSummary.py:305
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LumiCalculator::m_clumiblocknbr
uint32_t m_clumiblocknbr
Definition: LumiCalculator.h:152
LumiCalculator::m_l1ratediveffxsec_recorded
float m_l1ratediveffxsec_recorded
Definition: LumiCalculator.h:191
DetDescrDictionaryDict::it1
std::vector< HWIdentifier >::iterator it1
Definition: DetDescrDictionaryDict.h:17
Root::kINFO
@ kINFO
Definition: TMsgLogger.h:50
LumiCalculator::m_lbstart
uint32_t m_lbstart
Definition: LumiCalculator.h:145
LumiCalculator::m_onlinelumi
bool m_onlinelumi
Definition: LumiCalculator.h:236
LumiCalculator::m_verbose
bool m_verbose
Definition: LumiCalculator.h:103
LumiCalculator::m_intlumitrigrateruns
TH1F * m_intlumitrigrateruns
Definition: LumiCalculator.h:208
IOVData::clear
void clear()
Definition: CoolQuery.h:65
LumiCalculator::m_totalL
float m_totalL
Definition: LumiCalculator.h:113
covarianceTool.title
title
Definition: covarianceTool.py:542
Root::TGoodRunsListWriter
Definition: TGoodRunsListWriter.h:38
LumiCalculator::m_maxrun
unsigned int m_maxrun
Definition: LumiCalculator.h:241
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LumiCalculator::m_collsgrl
Root::TGoodRunsList * m_collsgrl
Definition: LumiCalculator.h:196
LumiCalculator::m_l1ratediveffxsec
float m_l1ratediveffxsec
Definition: LumiCalculator.h:188
LumiCalculator::m_effxsec
float m_effxsec
Definition: LumiCalculator.h:184
beamspotman.bstag
string bstag
Definition: beamspotman.py:858
LumiCalculator::m_bs_database
std::string m_bs_database
Definition: LumiCalculator.h:72
CoolQuery::getObjMapFromFolderAtChan
std::map< cool::ValidityKey, T > getObjMapFromFolderAtChan(const std::string &obj_name, const std::string &folder_name, const cool::ChannelId &id)
Definition: CoolQuery.h:375
LumiCalculator::m_beforeprescaleof
bool m_beforeprescaleof
Definition: LumiCalculator.h:143
LumiCalculator::m_intlumitrigrate_recordedVec
std::vector< TH1F * > m_intlumitrigrate_recordedVec
Definition: LumiCalculator.h:220
IOVTime::setRETime
void setRETime(uint64_t time) noexcept
Definition: IOVTime.cxx:84
LumiCalculator::m_runnbr_prev
uint32_t m_runnbr_prev
Definition: LumiCalculator.h:149
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
LumiCalculator::m_lumiplb
TH1F * m_lumiplb
Definition: LumiCalculator.h:200
LumiCalculator::m_total_l1ratediveffxsecRun
float m_total_l1ratediveffxsecRun
Definition: LumiCalculator.h:190
CoolQuery::printHLTTriggers
void printHLTTriggers(const std::string &folder_name)
Definition: CoolQuery.cxx:235
CoolQuery::getIOVData
IOVData< T > getIOVData(const std::string &name, const std::string &folder_name, const cool::ChannelId &id, const std::string &tag="")
Definition: CoolQuery.h:421
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LumiCalculator::m_lumioff
std::string m_lumioff
Definition: LumiCalculator.h:76
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
LumiCalculator::m_logger
Root::TMsgLogger m_logger
Definition: LumiCalculator.h:100
CoolQuery::getHLTChannelId
cool::ChannelId getHLTChannelId(const std::string &trigger, const std::string &folder_name)
Definition: CoolQuery.cxx:191
LumiCalculator::m_totalDelL
float m_totalDelL
Definition: LumiCalculator.h:112
LumiCalculator::m_L1idList
std::vector< cool::ChannelId > m_L1idList
Definition: LumiCalculator.h:181
CoolQuery::channelIdValid
bool channelIdValid()
Definition: CoolQuery.cxx:250
LumiCalculator::UseLArNoiseDB
void UseLArNoiseDB(bool lar, const std::string &lardb)
Definition: LumiCalculator.cxx:271
LumiCalculator::m_livetime
float m_livetime
Definition: LumiCalculator.h:124
LumiCalculator::m_intlumitrigrateruns_recorded
TH1F * m_intlumitrigrateruns_recorded
Definition: LumiCalculator.h:209
LumiCalculator::m_ntrigplb
TH1F * m_ntrigplb
Definition: LumiCalculator.h:198
LumiCalculator::m_totall1befpresc
unsigned int m_totall1befpresc
Definition: LumiCalculator.h:132
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
CoolQuery::setIOV
void setIOV(const cool::ValidityKey start, const cool::ValidityKey stop)
Definition: CoolQuery.cxx:96
LumiCalculator::m_l1acc
unsigned int m_l1acc
Definition: LumiCalculator.h:125
LumiCalculator::m_lumitrigrateplb_recordedVec
std::vector< TH1F * > m_lumitrigrateplb_recordedVec
Definition: LumiCalculator.h:219
LumiCalculator::m_L1Valid
bool m_L1Valid
Definition: LumiCalculator.h:231
LumiCalculator::m_uselivetrigger
bool m_uselivetrigger
Definition: LumiCalculator.h:102
IOVTime::run
uint32_t run() const noexcept
Definition: IOVTime.h:105
Root::TGoodRunsList
Definition: TGoodRunsList.h:31
LumiCalculator::Verbose
void Verbose(bool verbose=true)
Definition: LumiCalculator.cxx:234
LumiCalculator::m_intLumi
float m_intLumi
Definition: LumiCalculator.h:120
LumiCalculator::m_L1triggerchains
std::vector< std::string > m_L1triggerchains
Definition: LumiCalculator.h:180
CoolQuery::printL1Triggers
void printL1Triggers(const std::string &folder_name)
Definition: CoolQuery.cxx:221
LumiCalculator::m_l1rate
float m_l1rate
Definition: LumiCalculator.h:185
LumiCalculator::m_total_l1ratediveffxsecRun_recorded
float m_total_l1ratediveffxsecRun_recorded
Definition: LumiCalculator.h:193
LumiCalculator::m_l3acc
unsigned int m_l3acc
Definition: LumiCalculator.h:129
LumiCalculator::UseOnlineLumi
void UseOnlineLumi(bool online)
Definition: LumiCalculator.cxx:246
LumiCalculator::m_lbcollname
std::string m_lbcollname
Definition: LumiCalculator.h:101
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
LumiCalculator::UseMC
void UseMC(bool mc=true)
Definition: LumiCalculator.cxx:238
python.DataFormatRates.lumiTag
lumiTag
Definition: DataFormatRates.py:56
IOVData::data
std::list< std::pair< IOVRange, T > > data
Definition: CoolQuery.h:81
LumiCalculator::m_intlumiruns
TH1F * m_intlumiruns
Definition: LumiCalculator.h:207
LumiCalculator::m_trigrateplbVec
std::vector< TH1F * > m_trigrateplbVec
Definition: LumiCalculator.h:214
CoolQuery::openDbConn
bool openDbConn()
Definition: CoolQuery.cxx:30
LumiCalculator::m_triggerchain
std::string m_triggerchain
Definition: LumiCalculator.h:178
LumiCalculator::m_intlumitrigrateVec
std::vector< TH1F * > m_intlumitrigrateVec
Definition: LumiCalculator.h:218
LumiCalculator::m_runnbr
uint32_t m_runnbr
Definition: LumiCalculator.h:144
LumiCalculator::m_l1prescale
float m_l1prescale
Definition: LumiCalculator.h:135
LumiCalculator::m_lumitag
std::string m_lumitag
Definition: LumiCalculator.h:79
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
LumiCalculator::m_totaltime
float m_totaltime
Definition: LumiCalculator.h:115
LumiCalculator::m_larfrac
float m_larfrac
Definition: LumiCalculator.h:175
LumiCalculator::m_LumiTree
TTree * m_LumiTree
Definition: LumiCalculator.h:62
TMsgLogger.h
LumiCalculator::m_l2prescale
float m_l2prescale
Definition: LumiCalculator.h:136
LumiCalculator::DoHistogramAdmin
void DoHistogramAdmin(const uint32_t &runnbr, const TString &trigName, const float &effxsec)
Definition: LumiCalculator.cxx:1384
IOVData::getValue
T getValue(IOVTime time)
Definition: CoolQuery.h:99
IOVData::getOverlap
std::list< std::pair< IOVRange, T > > getOverlap(const IOVRange &range)
Definition: CoolQuery.h:173
LumiCalculator::m_lumitrigrateplb_recorded
TH1F * m_lumitrigrateplb_recorded
Definition: LumiCalculator.h:204
LumiCalculator::m_total_l1ratediveffxsec
float m_total_l1ratediveffxsec
Definition: LumiCalculator.h:189
merge.status
status
Definition: merge.py:17
LumiCalculator::m_instLumi
float m_instLumi
Definition: LumiCalculator.h:116
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
CoolQuery::L1CountFolderData
Definition: CoolQuery.h:310
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
LumiCalculator::m_lar_database
std::string m_lar_database
Definition: LumiCalculator.h:71
LumiCalculator::UseLiveTrigger
void UseLiveTrigger(bool live, std::string &livetrigger)
Definition: LumiCalculator.cxx:266
LumiCalculator::m_bsvalid
float m_bsvalid
Definition: LumiCalculator.h:176
LumiCalculator::m_beforeprescale
ULong64_t m_beforeprescale
Definition: LumiCalculator.h:142
LumiCalculator::MakePlots
void MakePlots(bool plots)
Definition: LumiCalculator.h:40
LumiCalculator::m_total_l1ratediveffxsec_recorded
float m_total_l1ratediveffxsec_recorded
Definition: LumiCalculator.h:192
LumiCalculator::UseBeamspot
void UseBeamspot(bool bs, const std::string &bstag)
Definition: LumiCalculator.cxx:276
example.writer
writer
show summary of content
Definition: example.py:36
LumiCalculator::m_lumiWOPrescale
float m_lumiWOPrescale
Definition: LumiCalculator.h:159
LumiCalculator::m_lbendtime
double m_lbendtime
Definition: LumiCalculator.h:110
LumiCalculator::m_intlumitrigrate_recorded
TH1F * m_intlumitrigrate_recorded
Definition: LumiCalculator.h:205
LumiCalculator::m_uselar
bool m_uselar
Definition: LumiCalculator.h:237
LumiCalculator::m_totalPrescaleWLiveTime
float m_totalPrescaleWLiveTime
Definition: LumiCalculator.h:155
readCCLHist.float
float
Definition: readCCLHist.py:83
TGoodRunsListWriter.h
LumiCalculator::m_trig_database
std::string m_trig_database
Definition: LumiCalculator.h:70
LumiCalculator::m_l1accof
bool m_l1accof
Definition: LumiCalculator.h:127
LumiCalculator::LumiCalculator
LumiCalculator()
Definition: LumiCalculator.cxx:25
LumiCalculator::~LumiCalculator
~LumiCalculator()
Definition: LumiCalculator.cxx:152
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CoolQuery::getTriggerLevel
unsigned int getTriggerLevel(const std::string &triggername)
Definition: CoolQuery.cxx:79
LumiCalculator::m_minrun
unsigned int m_minrun
Definition: LumiCalculator.h:240
LumiCalculator::getTree
TTree * getTree()
Definition: LumiCalculator.cxx:281
LumiCalculator::UseLumiTag
void UseLumiTag(const std::string &tag)
Definition: LumiCalculator.cxx:252
LumiCalculator::setTree
void setTree(TTree *tree=0)
Definition: LumiCalculator.cxx:183
CoolQuery::getL1ChannelId
cool::ChannelId getL1ChannelId(const std::string &trigger, const std::string &folder_name)
Definition: CoolQuery.cxx:139