Project
Loading...
Searching...
No Matches
o2::tpc::SectorEdgeFluctuations Class Reference

#include <SectorEdgeFluctuations.h>

Public Member Functions

bool loadFromCSVFile (const std::string &filename)
 
void dumpToFile (const char *file, const char *name="ccdb_object", const char *brName="SectorEdgeFluctuation")
 
void loadFromFile (const char *inpf, const char *name="ccdb_object", const int iEntry=0, const char *brName="SectorEdgeFluctuation")
 
void setFromTree (TTree &tree, const int iEntry=0, const char *brName="SectorEdgeFluctuation")
 set this object from input tree
 
std::vector< std::pair< int, float > > getSectorsAtTime (int run, Long64_t timestampMS) const
 
size_t size () const
 Total number of intervals across all runs.
 
size_t getNRuns () const
 number of total runs stored
 
bool empty () const
 
const auto & getIntervals () const
 get stored data
 

Static Public Member Functions

static int parseSectorId (const std::string &sectorStr)
 

Detailed Description

Parses and queries TPC sector edge fluctuation intervals from a CSV text file.

Expected line format (comma-separated, whitespace around tokens is ignored): runNumber, startMS, endMS, durationMS, label[, SectorID[=scale], ...]

The sector list is optional. If omitted (or all tokens fail to parse), the interval is applied to all 36 sectors (A0-A17 and C0-C17) with scale 1.0.

Examples: 560352,1732244770094,1732244771094,1000,edge distortions,A3 560352,1732244771344,1732244776344,5000,edge distortions,A3=1.2,C0,C1=0.6,C2,C3

If the same sector appears in multiple overlapping intervals at a queried timestamp, the scale from the interval with the latest end-time is used.

Definition at line 53 of file SectorEdgeFluctuations.h.

Member Function Documentation

◆ dumpToFile()

void o2::tpc::SectorEdgeFluctuations::dumpToFile ( const char file,
const char name = "ccdb_object",
const char brName = "SectorEdgeFluctuation" 
)

dump this object to a file

Parameters
fileoutput file
namename of the output object

Definition at line 214 of file SectorEdgeFluctuations.cxx.

◆ empty()

bool o2::tpc::SectorEdgeFluctuations::empty ( ) const
inline

Definition at line 94 of file SectorEdgeFluctuations.h.

◆ getIntervals()

const auto & o2::tpc::SectorEdgeFluctuations::getIntervals ( ) const
inline

get stored data

Definition at line 97 of file SectorEdgeFluctuations.h.

◆ getNRuns()

size_t o2::tpc::SectorEdgeFluctuations::getNRuns ( ) const
inline

number of total runs stored

Definition at line 93 of file SectorEdgeFluctuations.h.

◆ getSectorsAtTime()

std::vector< std::pair< int, float > > o2::tpc::SectorEdgeFluctuations::getSectorsAtTime ( int  run,
Long64_t  timestampMS 
) const

Returns all {o2SectorId, scalingFactor} pairs active for the given run at the given Unix timestamp (milliseconds). Returns empty if none are active or if the run is not known.

Definition at line 178 of file SectorEdgeFluctuations.cxx.

◆ loadFromCSVFile()

bool o2::tpc::SectorEdgeFluctuations::loadFromCSVFile ( const std::string &  filename)

Load intervals from file. Clears any previously loaded data. Throws std::runtime_error if the file cannot be opened.

Definition at line 56 of file SectorEdgeFluctuations.cxx.

◆ loadFromFile()

void o2::tpc::SectorEdgeFluctuations::loadFromFile ( const char inpf,
const char name = "ccdb_object",
const int  iEntry = 0,
const char brName = "SectorEdgeFluctuation" 
)

load from input file (which were written using the dumpToFile method)

Parameters
inpfinput file
namename of the object in the file

Definition at line 225 of file SectorEdgeFluctuations.cxx.

◆ parseSectorId()

int o2::tpc::SectorEdgeFluctuations::parseSectorId ( const std::string &  sectorStr)
static

Convert a sector string such as "A3" or "C14" to the O2 integer sector index (0-35). Returns -1 on parse error.

Definition at line 31 of file SectorEdgeFluctuations.cxx.

◆ setFromTree()

void o2::tpc::SectorEdgeFluctuations::setFromTree ( TTree &  tree,
const int  iEntry = 0,
const char brName = "SectorEdgeFluctuation" 
)

set this object from input tree

Definition at line 240 of file SectorEdgeFluctuations.cxx.

◆ size()

size_t o2::tpc::SectorEdgeFluctuations::size ( ) const
inline

Total number of intervals across all runs.

Definition at line 83 of file SectorEdgeFluctuations.h.


The documentation for this class was generated from the following files: