ATLAS Offline Software
Loading...
Searching...
No Matches
LumiCalculator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
34
35 void UseMC(bool mc = true); // No longer supported
36 void UseLArNoiseDB(bool lar, const std::string& lardb); // Calculate LAr defect fraction
37 void UseBeamspot(bool bs, const std::string& bstag); // Calculate online beamspot validity fraction
38 void UseOnlineLumi(bool online);
39 void Verbose(bool verbose = true);
40 void UseLumiTag(const std::string& tag);// i.e. COOL Folder tag
41 void UseLumiMethod(const std::string& method);// i.e. COOL Folder channel
42 void UseLumiChannel(int chan);
43 void UseLiveTrigger(bool live, std::string& livetrigger);
44 void IntegrateLumi ATLAS_NOT_THREAD_SAFE (const xAOD::LumiBlockRangeContainer * iovc, const std::string& triggerchain);
45 void SetCollName(const std::string& lbcollname);
46 void setTree(TTree * tree = 0);
47
48 TTree *getTree();
49
50 inline void MakePlots(bool plots) { m_makePlots = plots; }
51 inline void MakeCollList(bool collList) { m_makecollList = collList; }
52 inline void ScaleL1TrigRate( const float& rate ) { m_effxsec=1./rate; }
53 inline void SetMinL1TrigRate( const float& mintrigrate ) { m_mintrigrate=mintrigrate; }
54
55 // Print terse summary of results
56 void printSummary(std::ostream& os);
57
58 private:
59
60 void DoHistogramAdmin(const uint32_t& runnbr, const TString& trigName, const float& effxsec);
61 void SetHistogramStyle(TH1F* hist, const char* title=0, const char* xaxis=0, const char* yaxis=0);
62 void RebinHistograms(const int& nbins, const double& start, const double& end);
63 void MakePlots(const std::string& triggerchain);
64
66
67 void ParseL1Trigger(const std::string& lowerch, CoolQuery* cq_trigger);
68
69 //TCanvas* GetNiceCanvas(const char* name="tcan", const char* title="tcan");
70
71 // A TTree to bookkeep the calculation
72 TTree * m_LumiTree{};
74
75 // State of LumiCalculator: True - OK, False - something went bad..
76 bool m_State{};
77
78
79 std::string m_lumi_database{};
80 std::string m_trig_database{};
81 std::string m_lar_database{};
82 std::string m_bs_database{};
83
84 std::string m_trigger{};
85 std::string m_livetrigger{};
86 std::string m_lumioff{};
87 std::string m_lumionl{};
88 std::string m_data_db{};
89 std::string m_lumitag{};
90 std::string m_lumimethod{};
91 std::string m_laroff{};
92 std::string m_lartag{};
93 std::string m_bsonl{};
94 std::string m_bstag{};
96
97 std::string m_parofflumiestfolder{};
98 std::string m_paronllumiestfolder{};
99 std::string m_parlumiestfolder{};
100 std::string m_parlvl1menufolder{};
101 std::string m_parhltmenufolder{};
103 std::string m_parlumilvl1folder{};
104 std::string m_parlumihltfolder{};
106 std::string m_parlvl1lblbfolder{};
109
111 std::string m_lbcollname{};
113 bool m_verbose{};
114
115
116
117 // Internal variables
118
119 double m_lbstarttime{}; // In seconds since start of epoch
120 double m_lbendtime{};
121
122 float m_totalDelL{};
123 float m_totalL{};
124 float m_totalLRun{};
125 float m_totaltime{};
126 float m_instLumi{};
128 cool::UInt32 m_Valid{};
129 float m_delLumi{};
130 float m_intLumi{};
131 float m_deltaT{};
133 float m_livefrac{};
134 float m_livetime{};
135 unsigned int m_l1acc{};
136 unsigned int m_livetime_l1acc{};
137 bool m_l1accof{};
138 unsigned int m_l2acc{};
139 unsigned int m_l3acc{};
140 unsigned int m_totall1acc{};
141 unsigned int m_livtrig_totall1acc{};
142 unsigned int m_totall1befpresc{};
143 unsigned int m_totall2acc{};
144 unsigned int m_totall3acc{};
148 ULong64_t m_afterprescale{};
152 ULong64_t m_beforeprescale{};
154 uint32_t m_runnbr{};
155 uint32_t m_lbstart{};
156 uint32_t m_lbstop{};
157 uint32_t m_lbstart_prev{};
158 uint32_t m_lbstop_prev{};
159 uint32_t m_runnbr_prev{};
160 unsigned int m_totalgoodblock{};
161 unsigned int m_totalbadblock{};
162 uint32_t m_clumiblocknbr{};
164 unsigned int m_triglevel{};
171 float m_lumiLAr{};
172 float m_t_lumiLAr{};
174 float m_t_totalL{};
177 float m_t_deltaT{};
178 unsigned int m_t_l1acc{};
179 unsigned int m_t_l2acc{};
180 unsigned int m_t_l3acc{};
181 unsigned int m_t_totalgoodblock{};
182 unsigned int m_t_totalbadblock{};
183 unsigned int m_t_totall1befpresc{};
184 float m_lartime{};
185 float m_larfrac{};
186 float m_bsvalid{};
187
188 std::string m_triggerchain{};
189 std::vector<std::string> m_triggerlowerchains{};
190 std::vector<std::string> m_L1triggerchains{}; // Used for evaluating [L1_MU20,L1_MU21]
191 std::vector<cool::ChannelId> m_L1idList{};
192 std::string m_lbcollectionname{};
193
194 float m_effxsec{};
195 float m_l1rate{};
196 float m_l2rate{};
197 float m_l3rate{};
205
207
208 TH1F* m_ntrigplb{};
210 TH1F* m_lumiplb{};
212 TH1F* m_intlumi{};
216
220
222
223 std::vector<TH1F*> m_ntrigplbVec;
224 std::vector<TH1F*> m_trigrateplbVec;
225 std::vector<TH1F*> m_lumiplbVec;
226 std::vector<TH1F*> m_lumitrigrateplbVec;
227 std::vector<TH1F*> m_intlumiVec;
228 std::vector<TH1F*> m_intlumitrigrateVec;
231
234
235 cool::ChannelId m_Lumiid{};
236 cool::ChannelId m_L3id{};
237 cool::ChannelId m_L2id{};
238 cool::ChannelId m_L1id{};
239 cool::ChannelId m_LiveL1id{};
240
241 bool m_L1Valid{};
242 bool m_L2Valid{};
243 bool m_L3Valid{};
245
247 bool m_uselar{};
248 bool m_usebs{};
249
250 unsigned int m_minrun{};
251 unsigned int m_maxrun{};
252};
253
254
255#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
LumiCalculator & operator=(const LumiCalculator &)=delete
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
LumiCalculator(const LumiCalculator &)=delete
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