16#ifndef O2_TPC_RESIDUALAGGREGATOR_H
17#define O2_TPC_RESIDUALAGGREGATOR_H
48 void init(
const TrackResiduals* residualsEngine, std::string outputDir,
bool wFile,
bool wBinnedResid,
bool wUnbinnedResid,
bool wTrackData,
bool wTrackDataMC,
int autosave,
int compression,
long orbitResetTime);
52 void fill(
const o2::dataformats::TFIDInfo& ti,
const gsl::span<const UnbinnedResid> resid,
const gsl::span<const DetInfoResid> detInfoRes,
const gsl::span<const o2::tpc::TrackDataCompact> trkRefsIn,
const gsl::span<const o2::tpc::TrackData>* trkDataIn,
const gsl::span<const o2::tpc::TrackDataMC>* trkDataMCIn,
const o2::ctp::LumiInfo* lumiInput);
58 std::array<std::vector<TrackResiduals::LocalResid>, SECTORSPERSIDE * SIDES>
residuals{};
59 std::array<std::vector<TrackResiduals::LocalResid>*, SECTORSPERSIDE * SIDES>
residualsPtr{};
60 std::array<std::vector<TrackResiduals::VoxStats>, SECTORSPERSIDE * SIDES>
stats{};
61 std::array<std::vector<TrackResiduals::VoxStats>*, SECTORSPERSIDE * SIDES>
statsPtr{};
120 mMetaOutputDir = dir;
121 mStoreMetaData =
true;
138 TrackResiduals mTrackResiduals;
139 std::string mOutputDir{
"./"};
140 std::string mMetaOutputDir{
"none"};
141 std::string mLHCPeriod{
""};
142 bool mStoreMetaData{
false};
143 bool mWriteOutput{
false};
144 bool mWriteBinnedResiduals{
false};
145 bool mWriteUnbinnedResiduals{
false};
146 bool mWriteTrackData{
false};
147 bool mWriteTrackDataMC{
false};
148 int mAutosaveInterval{0};
149 int mCompressionSetting{101};
151 long mOrbitResetTime;
152 float mTPCVDriftRef = -1.;
153 float mTPCDriftTimeOffsetRef = 0.;
155 ClassDefOverride(ResidualAggregator, 4);
Definition of the TrackResiduals class.
Slot & emplaceNewSlot(bool front, TFType tStart, TFType tEnd) final
bool hasEnoughData(const Slot &slot) const final
void setWriteTrackDataMC(bool f)
void setAutosaveInterval(int n)
void setOutputDir(std::string dir)
void setLHCPeriod(std::string period)
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void finalizeSlot(Slot &slot) final
~ResidualAggregator() final
void setOrbitResetTime(long t)
void setWriteTrackData(bool f)
ResidualAggregator(size_t nMin=1000)
void setDataTakingContext(o2::framework::DataTakingContext &dtc)
void setCompression(int c)
void setWriteBinnedResiduals(bool f)
void setMetaFileOutputDir(std::string dir)
void setWriteUnbinnedResiduals(bool f)
void init(bool doBinning=true)
constexpr TFType INFINITE_TF
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< TTree > treeOutResidualsUnbinned
std::vector< TrackDataCompact > * trackInfoPtr
allows to obtain track type for each unbinned residual downstream
long orbitReset
current orbit reset time in ms
std::array< std::vector< TrackResiduals::VoxStats > *, SECTORSPERSIDE *SIDES > statsPtr
std::vector< TrackData > * trkDataPtr
track data and cluster ranges
std::unique_ptr< TTree > treeOutRecords
ResidualsContainer()=default
float TPCVDriftRef
TPC nominal drift speed in cm/microseconds.
void fillStatisticsBranches()
std::vector< TrackDataMC > * trkDataMCPtr
MC truth for the track data (MC only)
std::vector< uint32_t > sumBinnedResid
TFType lastSeenTF
the last TF which was added to this container
uint64_t timeMS
for each processed TF we store its absolute time in ms in the tree of unbinned residuals
bool writeTrackDataMC
flag, whether the MC truth of the seeding tracks should be written out
uint64_t getNEntries() const
std::vector< DetInfoResid > * detInfoUnbResPtr
detector info associated to unbinned residuals which are sent to the aggregator
o2::calibration::TFType TFType
void fill(const o2::dataformats::TFIDInfo &ti, const gsl::span< const UnbinnedResid > resid, const gsl::span< const DetInfoResid > detInfoRes, const gsl::span< const o2::tpc::TrackDataCompact > trkRefsIn, const gsl::span< const o2::tpc::TrackData > *trkDataIn, const gsl::span< const o2::tpc::TrackDataMC > *trkDataMCIn, const o2::ctp::LumiInfo *lumiInput)
std::vector< UnbinnedResid > * unbinnedResPtr
unbinned residuals which are sent to the aggregator
std::vector< uint32_t > tfOrbits
ResidualsContainer & operator=(const ResidualsContainer &src)=delete
std::vector< uint32_t > * sumBinnedResidPtr
sum of binned residuals for each TF
std::vector< TrackDataMC > trkDataMC
uint32_t firstTForbit
stored for the first seen TF to allow conversion to time stamp
std::vector< o2::ctp::LumiInfo > * lumiPtr
luminosity information from CTP per TF
void init(const TrackResiduals *residualsEngine, std::string outputDir, bool wFile, bool wBinnedResid, bool wUnbinnedResid, bool wTrackData, bool wTrackDataMC, int autosave, int compression, long orbitResetTime)
std::array< std::vector< TrackResiduals::LocalResid > *, SECTORSPERSIDE *SIDES > residualsPtr
bool writeBinnedResid
flag, whether binned residuals should be written out
std::vector< o2::ctp::LumiInfo > lumi
bool writeTrackData
flag, whether full seeding track information should be written out
std::vector< TrackDataCompact > trackInfo
std::vector< uint32_t > * tfOrbitsPtr
first TF orbit
bool writeUnbinnedResiduals
flag, whether unbinned residuals should be written out
void writeToFile(bool closeFileAfterwards)
o2::ctp::LumiInfo lumiTF
for each processed TF we store the lumi information in the tree of unbinned residuals
std::array< std::vector< TrackResiduals::LocalResid >, SECTORSPERSIDE *SIDES > residuals
local (binned) residuals per sector
void merge(ResidualsContainer *prev)
std::vector< UnbinnedResid > unbinnedRes
float TPCDriftTimeOffsetRef
TPC nominal (e.g. at the start of run) drift time bias in cm/mus.
std::unique_ptr< TFile > fileOut
std::vector< uint32_t > sumUnbinnedResid
std::array< std::vector< TrackResiduals::VoxStats >, SECTORSPERSIDE *SIDES > stats
voxel statistics per sector
std::unique_ptr< TTree > treeOutStats
const TrackResiduals * trackResiduals
TFType firstSeenTF
the first TF which was added to this container
uint64_t nResidualsTotal
the total number of residuals for this container
std::vector< uint32_t > * sumUnbinnedResidPtr
sum of unbinned residuals for each TF
std::unique_ptr< TTree > treeOutResiduals
ClassDefNV(ResidualsContainer, 6)
int autosaveInterval
if > 0, then the output written to file for every n-th TF
std::vector< DetInfoResid > detInfoUnbRes
std::unique_ptr< TTree > treeOutTrackData
std::vector< TrackData > trkData
bool writeToRootFile
set to false to avoid that any output file is produced