#include <Trend.h>
Public Member Functions | |
float | operator() (int run1, int run2) const |
Sums luminosity for [run1, run2[ and returns it in /fb. More... | |
float | operator() (int run) const |
Sums luminosity for [firstRun, run[. More... | |
float | operator() () const |
Sums luminosity for [firstRun, lastRun[. More... | |
TGraph * | operator() (TGraph *gIn) const |
TH1 * | operator() (TH1 *hIn) const |
Run2Lumi (boost::filesystem::path file, int first, int last, float convertUnit) | |
Public Attributes | |
const float | convertUnit |
const int | firstRun |
first run, starting at lumi = 0 on the x-axis of the trend More... | |
const int | lastRun |
last run (excluded!), starting at the max lumi on the x-axis of the trend More... | |
Private Attributes | |
std::map< int, float > | runs |
couples of run and corresponding luminosity More... | |
Functor to obtain delivered luminosity corresponding to a given range.
The constructor extracts the luminosity from an 2-column file (see constructor), and the operator() returns the accumulated luminosity for any subrange.
Another overload of the operator() allows the conversion of a TGraphErrors
as a function of the run number to another TGraphErrors
as a function of the luminosity.
Run2Lumi::Run2Lumi | ( | boost::filesystem::path | file, |
int | first, | ||
int | last, | ||
float | convertUnit | ||
) |
Constructor, takes as input a 2-column file that will populate the map runs
as well as the global range.
(Note: in principle, the global range could be extracted from the 2-column file, but the choice here is to have one standard lumi file, leaving as only freedom to the user the possibility to change the global range depending on the analysis.)
file | path to a 2-column file with 6-digit run number and lumi in /pb |
first | 6-digit run number (included) |
last | 6-digit run number (excluded) |
convertUnit | default is from pb to fb |
Definition at line 23 of file Trend.cc.
References cms::cuda::assert(), f, geometryDiff::file, dqmdumpme::first, dqmdumpme::last, writedatasetfile::run, and runs.
float Run2Lumi::operator() | ( | int | run1, |
int | run2 | ||
) | const |
Sums luminosity for [run1, run2[ and returns it in /fb.
Definition at line 36 of file Trend.cc.
References convertUnit, writedatasetfile::run, ntuplemaker::run1, compare_using_db::run2, and runs.
float Run2Lumi::operator() | ( | int | run | ) | const |
Sums luminosity for [firstRun, run[.
Definition at line 50 of file Trend.cc.
References firstRun, operator()(), and writedatasetfile::run.
Referenced by operator()().
float Run2Lumi::operator() | ( | ) | const |
Sums luminosity for [firstRun, lastRun[.
Definition at line 52 of file Trend.cc.
References firstRun, and lastRun.
Referenced by operator()().
TGraph * Run2Lumi::operator() | ( | TGraph * | gIn | ) | const |
Converts a TGraph
given as a function of the run number to another TGraph
as a function of the luminosity in the global subrange.
Definition at line 69 of file Trend.cc.
References cms::cuda::assert(), CopyStyle(), relativeConstraints::error, firstRun, mps_fire::i, lastRun, N, create_idmaps::n, operator()(), point, x, and y.
TH1 * Run2Lumi::operator() | ( | TH1 * | hIn | ) | const |
Converts a TH1
given as a function of the run number to another TH1
as a function of the luminosity in the global subrange.
Note: the run is expected to be on the low edge of each bin
Definition at line 100 of file Trend.cc.
References Skims_PA_cff::content, relmon_rootfiles_spy::contents, CopyStyle(), SelectiveReadoutTask_cfi::edges, relativeConstraints::error, nano_mu_digi_cff::errors, firstRun, mps_fire::i, lastRun, N, and mergeVDriftHistosByStation::name.
const float Run2Lumi::convertUnit |
Definition at line 25 of file Trend.h.
Referenced by operator()().
const int Run2Lumi::firstRun |
first run, starting at lumi = 0 on the x-axis of the trend
Definition at line 23 of file Trend.h.
Referenced by operator()().
const int Run2Lumi::lastRun |
last run (excluded!), starting at the max lumi on the x-axis of the trend
Definition at line 23 of file Trend.h.
Referenced by operator()().
|
private |
couples of run and corresponding luminosity
Definition at line 28 of file Trend.h.
Referenced by operator()(), and Run2Lumi().