16#ifndef _CTP_SCALERS_H_
17#define _CTP_SCALERS_H_
113 void setClassMask(std::bitset<CTP_NCLASSES> classMask) { mClassMask = classMask; };
131 std::pair<double, double>
getRateGivenT(
double timestamp,
int classindex,
int type,
bool qc = 0)
const;
137 mScalerRecordO2[0].scalers[
i].classIndex,
138 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].lmBefore - mScalerRecordO2[0].scalers[
i].lmBefore,
139 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].lmAfter - mScalerRecordO2[0].scalers[
i].lmAfter,
140 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l0Before - mScalerRecordO2[0].scalers[
i].l0Before,
141 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l0After - mScalerRecordO2[0].scalers[
i].l0After,
142 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l1Before - mScalerRecordO2[0].scalers[
i].l1Before,
143 mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[
i].l1After - mScalerRecordO2[0].scalers[
i].l1After,
153 return std::make_pair((
unsigned long)mScalerRecordO2[0].epochTime * 1000, (
unsigned long)mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime * 1000);
158 return std::make_pair((
unsigned long)mScalerRecordRaw[0].epochTime * 1000, (
unsigned long)mScalerRecordRaw[mScalerRecordRaw.size() - 1].epochTime * 1000);
163 return std::make_pair((
unsigned long)mScalerRecordO2[0].intRecord.orbit, (
unsigned long)mScalerRecordO2[mScalerRecordO2.size() - 1].intRecord.orbit);
168 return std::make_pair((
unsigned long)mScalerRecordRaw[0].intRecord.orbit, (
unsigned long)mScalerRecordRaw[mScalerRecordRaw.size() - 1].intRecord.orbit);
174 typedef std::map<uint32_t, std::array<uint32_t, 6>> overflows_t;
178 std::bitset<CTP_NCLASSES> mClassMask;
180 std::vector<CTPScalerRecordRaw> mScalerRecordRaw;
181 std::vector<CTPScalerRecordO2> mScalerRecordO2;
182 int processScalerLine(
const std::string& line,
int&
level,
uint32_t& nclasses);
definition of CTPDigit, CTPInputDigit
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
static constexpr uint32_t NCOUNTERS
int printClassBRateAndIntegral(int iclsinscalers)
std::vector< uint32_t > getClassIndexes() const
int printClassBRateAndIntegralII(int icls)
uint64_t getLumiNoPuCorr(int classindex, int type) const
retrieves integral - same interface as getRate, no pileup correction
int readScalers(const std::string &rawscalers)
void setEpochTime(std::time_t tt, int index)
std::pair< unsigned long, unsigned long > getOrbitLimitFromRaw() const
retrieves orbit boundaries of this scaler object from Raw: should be same as from O2 and can be used ...
std::pair< unsigned long, unsigned long > getTimeLimitFromRaw() const
retrieves time boundaries of this scaler object from Raw: should be same as from O2 and can be used w...
void printClasses(std::ostream &stream) const
static constexpr uint32_t NCOUNTERSv2
void printLMBRateVsT() const
void setDetectorMask(o2::detectors::DetID::mask_t mask)
int printInputRateAndIntegral(int inp)
std::array< uint64_t, 7 > getIntegralForClass(int i) const
retrieves integral for class
static std::vector< std::string > scalerNames
std::pair< unsigned long, unsigned long > getTimeLimit() const
retrieves time boundaries of this scaler object from O2 scalers
std::pair< double, double > getRate(uint32_t orbit, int classindex, int type, bool qc=0) const
std::pair< double, double > getRateGivenT(double timestamp, int classindex, int type, bool qc=0) const
same with absolute timestamp (not orbit) as argument
void printO2(std::ostream &stream) const
int checkConsistency(const CTPScalerO2 &scal0, const CTPScalerO2 &scal1, errorCounters &eCnts) const
std::pair< unsigned long, unsigned long > getOrbitLimit() const
retrieves orbit boundaries of this scaler object from O2
void printStream(std::ostream &stream) const
void setRunNumber(uint32_t rnumber)
int addOrbitOffset(uint32_t offset)
int getScalerIndexForClass(uint32_t cls) const
std::vector< CTPScalerRecordRaw > & getScalerRecordRaw()
std::vector< CTPScalerRecordO2 > & getScalerRecordO2()
std::vector< std::pair< double_t, double_t > > getRatesForIndex(int classindex, int type) const
retrieves vector of counters - same interface as getRate, needed for
void addScalerRacordRaw(CTPScalerRecordRaw &scalerrecordraw)
void setClassMask(std::bitset< CTP_NCLASSES > classMask)
void printFromZero(std::ostream &stream) const
GLint GLint GLsizei GLint GLenum GLenum type
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Scalers produced from raw scalers corrected for overflow.
ClassDefNV(CTPScalerO2, 1)
void printFromZero(std::ostream &stream, CTPScalerO2 &scaler0) const
void createCTPScalerO2FromRaw(const CTPScalerRaw &raw, const std::array< uint32_t, 6 > &overfow)
void printStream(std::ostream &stream) const
ClassDefNV(CTPScalerRaw, 1)
void printStream(std::ostream &stream) const
o2::InteractionRecord intRecord
ClassDefNV(CTPScalerRecordO2, 4)
std::vector< uint64_t > scalersInps
std::vector< CTPScalerO2 > scalers
void printFromZero(std::ostream &stream, CTPScalerRecordO2 &record0) const
void printStream(std::ostream &stream) const
CTPScalerRecordO2()=default
CTPScalerRecordRaw()=default
std::vector< CTPScalerRaw > scalers
void printStream(std::ostream &stream) const
ClassDefNV(CTPScalerRecordRaw, 4)
o2::InteractionRecord intRecord
std::vector< uint32_t > scalersInps
void printStream(std::ostream &stream) const