ATLAS Offline Software
Loading...
Searching...
No Matches
LumiCalculator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LUMICALC_LUMICALCULATOR_H
6#define LUMICALC_LUMICALCULATOR_H
7
9#include "GoodRunsLists/TMsgLogger.h" //Root TMsgLogger
10#include "CoolKernel/types.h" //Cool::Uint32 typedef
11#include "CoolKernel/ChannelId.h" //Cool::ChannelId typedef
13#include <string>
14#include <vector>
15#include <cstdint>
16
17namespace Root {
18 class TGoodRunsList;
19}
20
21class CoolQuery;
22class TH1F;
23class TTree;
24class TString;
25
27
28 public:
31
32 void UseMC(bool mc = true); // No longer supported
33 void UseLArNoiseDB(bool lar, const std::string& lardb); // Calculate LAr defect fraction
34 void UseBeamspot(bool bs, const std::string& bstag); // Calculate online beamspot validity fraction
35 void UseOnlineLumi(bool online);
36 void Verbose(bool verbose = true);
37 void UseLumiTag(const std::string& tag);// i.e. COOL Folder tag
38 void UseLumiMethod(const std::string& method);// i.e. COOL Folder channel
39 void UseLumiChannel(int chan);
40 void UseLiveTrigger(bool live, std::string& livetrigger);
41 void IntegrateLumi ATLAS_NOT_THREAD_SAFE (const xAOD::LumiBlockRangeContainer * iovc, const std::string& triggerchain);
42 void SetCollName(const std::string& lbcollname);
43 void setTree(TTree * tree = 0);
44
45 TTree *getTree();
46
47 inline void MakePlots(bool plots) { m_makePlots = plots; }
48 inline void MakeCollList(bool collList) { m_makecollList = collList; }
49 inline void ScaleL1TrigRate( const float& rate ) { m_effxsec=1./rate; }
50 inline void SetMinL1TrigRate( const float& mintrigrate ) { m_mintrigrate=mintrigrate; }
51
52 // Print terse summary of results
53 void printSummary(std::ostream& os);
54
55 private:
56
57 void DoHistogramAdmin(const uint32_t& runnbr, const TString& trigName, const float& effxsec);
58 void SetHistogramStyle(TH1F* hist, const char* title=0, const char* xaxis=0, const char* yaxis=0);
59 void RebinHistograms(const int& nbins, const double& start, const double& end);
60 void MakePlots(const std::string& triggerchain);
61
63
64 void ParseL1Trigger(const std::string& lowerch, CoolQuery* cq_trigger);
65
66 //TCanvas* GetNiceCanvas(const char* name="tcan", const char* title="tcan");
67
68 // A TTree to bookkeep the calculation
69 TTree * m_LumiTree{};
71
72 // State of LumiCalculator: True - OK, False - something went bad..
73 bool m_State{};
74
75
76 std::string m_lumi_database{};
77 std::string m_trig_database{};
78 std::string m_lar_database{};
79 std::string m_bs_database{};
80
81 std::string m_trigger{};
82 std::string m_livetrigger{};
83 std::string m_lumioff{};
84 std::string m_lumionl{};
85 std::string m_data_db{};
86 std::string m_lumitag{};
87 std::string m_lumimethod{};
88 std::string m_laroff{};
89 std::string m_lartag{};
90 std::string m_bsonl{};
91 std::string m_bstag{};
93
94 std::string m_parofflumiestfolder{};
95 std::string m_paronllumiestfolder{};
96 std::string m_parlumiestfolder{};
97 std::string m_parlvl1menufolder{};
98 std::string m_parhltmenufolder{};
100 std::string m_parlumilvl1folder{};
101 std::string m_parlumihltfolder{};
103 std::string m_parlvl1lblbfolder{};
106
108 std::string m_lbcollname{};
110 bool m_verbose{};
111
112
113
114 // Internal variables
115
116 double m_lbstarttime{}; // In seconds since start of epoch
117 double m_lbendtime{};
118
119 float m_totalDelL{};
120 float m_totalL{};
121 float m_totalLRun{};
122 float m_totaltime{};
123 float m_instLumi{};
125 cool::UInt32 m_Valid{};
126 float m_delLumi{};
127 float m_intLumi{};
128 float m_deltaT{};
130 float m_livefrac{};
131 float m_livetime{};
132 unsigned int m_l1acc{};
133 unsigned int m_livetime_l1acc{};
134 bool m_l1accof{};
135 unsigned int m_l2acc{};
136 unsigned int m_l3acc{};
137 unsigned int m_totall1acc{};
138 unsigned int m_livtrig_totall1acc{};
139 unsigned int m_totall1befpresc{};
140 unsigned int m_totall2acc{};
141 unsigned int m_totall3acc{};
145 ULong64_t m_afterprescale{};
149 ULong64_t m_beforeprescale{};
151 uint32_t m_runnbr{};
152 uint32_t m_lbstart{};
153 uint32_t m_lbstop{};
154 uint32_t m_lbstart_prev{};
155 uint32_t m_lbstop_prev{};
156 uint32_t m_runnbr_prev{};
157 unsigned int m_totalgoodblock{};
158 unsigned int m_totalbadblock{};
159 uint32_t m_clumiblocknbr{};
161 unsigned int m_triglevel{};
168 float m_lumiLAr{};
169 float m_t_lumiLAr{};
171 float m_t_totalL{};
174 float m_t_deltaT{};
175 unsigned int m_t_l1acc{};
176 unsigned int m_t_l2acc{};
177 unsigned int m_t_l3acc{};
178 unsigned int m_t_totalgoodblock{};
179 unsigned int m_t_totalbadblock{};
180 unsigned int m_t_totall1befpresc{};
181 float m_lartime{};
182 float m_larfrac{};
183 float m_bsvalid{};
184
185 std::string m_triggerchain{};
186 std::vector<std::string> m_triggerlowerchains{};
187 std::vector<std::string> m_L1triggerchains{}; // Used for evaluating [L1_MU20,L1_MU21]
188 std::vector<cool::ChannelId> m_L1idList{};
189 std::string m_lbcollectionname{};
190
191 float m_effxsec{};
192 float m_l1rate{};
193 float m_l2rate{};
194 float m_l3rate{};
202
204
205 TH1F* m_ntrigplb{};
207 TH1F* m_lumiplb{};
209 TH1F* m_intlumi{};
213
217
219
220 std::vector<TH1F*> m_ntrigplbVec;
221 std::vector<TH1F*> m_trigrateplbVec;
222 std::vector<TH1F*> m_lumiplbVec;
223 std::vector<TH1F*> m_lumitrigrateplbVec;
224 std::vector<TH1F*> m_intlumiVec;
225 std::vector<TH1F*> m_intlumitrigrateVec;
228
231
232 cool::ChannelId m_Lumiid{};
233 cool::ChannelId m_L3id{};
234 cool::ChannelId m_L2id{};
235 cool::ChannelId m_L1id{};
236 cool::ChannelId m_LiveL1id{};
237
238 bool m_L1Valid{};
239 bool m_L2Valid{};
240 bool m_L3Valid{};
242
244 bool m_uselar{};
245 bool m_usebs{};
246
247 unsigned int m_minrun{};
248 unsigned int m_maxrun{};
249};
250
251
252#endif //> LUMICALC_LUMICALCULATOR_H
Define macros for attributes used to control the static checker.
unsigned int m_t_totalbadblock
std::vector< TH1F * > m_intlumitrigrate_recordedVec
cool::ChannelId m_L3id
unsigned int m_t_l3acc
std::string m_bs_database
void LoadChannelIds()
unsigned int m_l2acc
std::string m_parlumiestfolder
cool::ChannelId m_Lumiid
unsigned int m_t_l1acc
Root::TMsgLogger m_logger
std::string m_bsonl
std::string m_lumionl
std::vector< std::string > m_triggerlowerchains
std::string m_parlumilvl1folder
float m_total_l1ratediveffxsecRun_recorded
unsigned int m_livtrig_totall1acc
std::string m_parlvl1menufolder
void UseOnlineLumi(bool online)
std::vector< TH1F * > m_intlumiVec
float m_l1ratediveffxsec_recorded
std::string m_lartag
unsigned int m_l1acc
void UseLumiChannel(int chan)
void UseLumiMethod(const std::string &method)
void SetHistogramStyle(TH1F *hist, const char *title=0, const char *xaxis=0, const char *yaxis=0)
ULong64_t m_livetime_afterprescale
cool::ChannelId m_L1id
std::vector< std::string > m_L1triggerchains
void SetMinL1TrigRate(const float &mintrigrate)
void RebinHistograms(const int &nbins, const double &start, const double &end)
std::string m_livetrigger
std::string m_lumimethod
void setTree(TTree *tree=0)
float m_total_l1ratediveffxsec
unsigned int m_t_totalgoodblock
float m_total_l1ratediveffxsecRun
std::string m_lbcollname
std::string m_lbcollectionname
float m_total_l1ratediveffxsec_recorded
void UseLArNoiseDB(bool lar, const std::string &lardb)
std::string m_trigger
unsigned int m_t_totall1befpresc
void ScaleL1TrigRate(const float &rate)
std::string m_parlvl1prescalesfolder
float m_t_totalPrescaleWLiveTime
std::vector< TH1F * > m_trigrateplbVec
uint32_t m_lbstop_prev
void IntegrateLumi ATLAS_NOT_THREAD_SAFE(const xAOD::LumiBlockRangeContainer *iovc, const std::string &triggerchain)
unsigned int m_totalbadblock
std::string m_parlareventvetofolder
ULong64_t m_afterprescale
unsigned int m_l3acc
std::string m_lar_database
uint32_t m_lbstart_prev
unsigned int m_livetime_l1acc
std::vector< TH1F * > m_lumitrigrateplbVec
std::string m_parlvl1lblbfolder
unsigned int m_totall1befpresc
void UseMC(bool mc=true)
void SetCollName(const std::string &lbcollname)
std::string m_parhltmenufolder
std::vector< cool::ChannelId > m_L1idList
void UseLiveTrigger(bool live, std::string &livetrigger)
Root::TGoodRunsList * m_collsgrl
void DoHistogramAdmin(const uint32_t &runnbr, const TString &trigName, const float &effxsec)
unsigned int m_totall1acc
std::string m_trig_database
TH1F * m_intlumitrigrateruns
unsigned int m_totall3acc
unsigned int m_t_l2acc
uint32_t m_runnbr_prev
std::string m_lumi_database
void printSummary(std::ostream &os)
void ParseL1Trigger(const std::string &lowerch, CoolQuery *cq_trigger)
std::string m_parlumihltfolder
std::string m_bstag
std::vector< TH1F * > m_intlumitrigrateVec
std::vector< TH1F * > m_ntrigplbVec
std::string m_lumioff
ULong64_t m_livetime_beforeprescale
uint32_t m_clumiblocknbrend
void Verbose(bool verbose=true)
void UseBeamspot(bool bs, const std::string &bstag)
cool::ChannelId m_LiveL1id
TH1F * m_intlumitrigrateruns_recorded
std::string m_lumitag
ULong64_t m_beforeprescale
std::vector< TH1F * > m_lumiplbVec
std::string m_parhltprescalesfolder
void MakePlots(bool plots)
unsigned int m_totall2acc
std::string m_paronlbeamspotfolder
std::string m_paronllumiestfolder
std::vector< TH1F * > m_lumitrigrateplb_recordedVec
unsigned int m_maxrun
std::string m_data_db
TH1F * m_intlumitrigrate_recorded
unsigned int m_triglevel
void MakeCollList(bool collList)
unsigned int m_totalgoodblock
float m_totalPrescaleWLiveTime
std::string m_laroff
TH1F * m_lumitrigrateplb_recorded
std::string m_parofflumiestfolder
void UseLumiTag(const std::string &tag)
cool::UInt32 m_Valid
std::string m_triggerchain
cool::ChannelId m_L2id
uint32_t m_clumiblocknbr
unsigned int m_minrun
bool verbose
Definition hcg.cxx:73
static std::vector< std::string > triggerchain
Definition iLumiCalc.h:34
static std::string livetrigger
Definition iLumiCalc.h:35
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
LumiBlockRangeContainer_v1 LumiBlockRangeContainer
Declare the latest version of the container.
TChain * tree