Project
Loading...
Searching...
No Matches
CTPRateFetcher.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef COMMON_CCDB_CTPRATEFETCHER_H_
13#define COMMON_CCDB_CTPRATEFETCHER_H_
14
15#include <string>
16
20
21namespace o2::ccdb
22{
23class BasicCCDBManager;
24}
25
26namespace o2::ctp
27{
28
30{
31 public:
32 CTPRateFetcher() = default;
33 double fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, const std::string sourceName);
34 double fetchNoPuCorr(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, const std::string sourceName);
35 void setupRun(int runNumber, o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, bool initScalers);
36 void updateScalers(ctp::CTPRunScalers& scalers);
37 int getRates(std::array<double, 3>& rates, o2::ccdb::BasicCCDBManager* ccdb, int runNumber, const std::string sourceName); // rates at start,stop and middle of the run
38 double getLumi(o2::ccdb::BasicCCDBManager* ccdb, int runNumber, const std::string sourceName, int puCorr = 0); // total lumi for a run
39 double getLumiNoPuCorr(const std::string& classname, int type = 1);
40 double getLumiWPuCorr(const std::string& classname, int type = 1);
41 void setOrbit(bool orb) { mOrbit = orb; } // use orbit instead of time
42 void setOutsideLimits(bool qc) { mOutsideLimits = qc; } // return first/last rate of time outside of run
43
44 private:
45 double fetchCTPratesInputs(uint64_t timeStamp, int input);
46 double fetchCTPratesClasses(uint64_t timeStamp, const std::string& className, int inputType = 1);
47 double fetchCTPratesInputsNoPuCorr(uint64_t timeStamp, int input);
48 double fetchCTPratesClassesNoPuCorr(uint64_t timeStamp, const std::string& className, int inputType = 1);
49 double getLumi(const std::string& classname, int type = 1, int puCorr = 0);
50 double pileUpCorrection(double rate);
51 int mRunNumber = -1;
52 bool mOutsideLimits = 0;
53 bool mOrbit = 0;
55 o2::ctp::CTPRunScalers mScalers{};
57 ClassDefNV(CTPRateFetcher, 1);
58};
59} // namespace o2::ctp
60
61
62#endif // COMMON_CCDB_CTPRATEFETCHER_H_
definition of CTPConfiguration and related CTP structures
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
container for the LHC InterFace data
std::string className
Definition Objects.cxx:33
definition of CTPScalerRaw, CTPScalerO2
int getRates(std::array< double, 3 > &rates, o2::ccdb::BasicCCDBManager *ccdb, int runNumber, const std::string sourceName)
double getLumiWPuCorr(const std::string &classname, int type=1)
double getLumi(o2::ccdb::BasicCCDBManager *ccdb, int runNumber, const std::string sourceName, int puCorr=0)
void setOutsideLimits(bool qc)
void setupRun(int runNumber, o2::ccdb::BasicCCDBManager *ccdb, uint64_t timeStamp, bool initScalers)
double fetchNoPuCorr(o2::ccdb::BasicCCDBManager *ccdb, uint64_t timeStamp, int runNumber, const std::string sourceName)
double getLumiNoPuCorr(const std::string &classname, int type=1)
void updateScalers(ctp::CTPRunScalers &scalers)
double fetch(o2::ccdb::BasicCCDBManager *ccdb, uint64_t timeStamp, int runNumber, const std::string sourceName)
GLuint GLenum * rate
Definition glcorearb.h:5735
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLuint GLsizei const GLenum * rates
Definition glcorearb.h:5738
information complementary to a CCDB object (path, metadata, startTimeValidity, endTimeValidity etc)