16#ifndef ALICEO2_TPC_DEBUGSTREAMER_H_
17#define ALICEO2_TPC_DEBUGSTREAMER_H_
20#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
22#include <boost/property_tree/ptree.hpp>
23#if defined(DEBUG_STREAMER)
25#include <tbb/concurrent_unordered_map.h>
56#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
60 return static_cast<StreamFlags>(
static_cast<int>(
a) |
static_cast<int>(
b));
81#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && defined(DEBUG_STREAMER)
96 void setStreamer(
const char* outFile,
const char* option,
const size_t id = getCPUID());
100 bool isStreamerSet(
const size_t id = getCPUID())
const {
return getStreamerPtr(
id); }
104 void flush(
const size_t id);
127 static std::pair<SamplingTypes, float> getSamplingTypeFrequency(
const StreamFlags streamFlag);
130 static float getSamplingFrequency(
const StreamFlags streamFlag) {
return getSamplingTypeFrequency(streamFlag).second; }
133 static size_t getCPUID();
137 int getNTrees(
const size_t id = getCPUID())
const;
142 std::string getUniqueTreeName(
const char*
tree,
const size_t id = getCPUID())
const;
145 static void setStreamFlags(
const StreamFlags streamFlags) { o2::conf::ConfigurableParam::setValue<int>(
"DebugStreamerParam",
"streamLevel",
static_cast<int>(streamFlags)); }
148 static void enableStream(
const StreamFlags streamFlag);
151 static void disableStream(
const StreamFlags streamFlag);
162 static void mergeTrees(
const char* inpFile,
const char* outFile,
const char* option =
"fast");
168 static float getRandom(
float min = 0,
float max = 1);
171 using StreamersPerFlag = tbb::concurrent_unordered_map<size_t, std::unique_ptr<o2::utils::TreeStreamRedirector>>;
172 StreamersPerFlag mTreeStreamer;
178 template <
typename... Args>
191 template <
typename Type>
192 GPUd() StreamerDummy& operator<<(Type)
198 GPUd() StreamerDummy getStreamer(const
int id = 0)
const {
return StreamerDummy{}; };
201 template <
typename... Args>
202 GPUd() StreamerDummy getStreamer(Args... args)
const
204 return StreamerDummy{};
207 template <
typename Type>
208 GPUd() StreamerDummy getUniqueTreeName(Type, const
int id = 0)
const
210 return StreamerDummy{};
static const ParameterDebugStreamer & Instance()
class to enable streaming debug information to root files
GPUd() StreamerDummy getStreamer(Args... args) const
empty for GPU
GPUd() StreamerDummy getUniqueTreeName(Type
GPUd() static bool checkStream(const StreamFlags
always false for GPU
GPUd() void setStreamer(Args... args)
empty for GPU
GPUd() StreamerDummy getStreamer(const int id=0) const
GLuint GLuint GLfloat weight
GLboolean GLboolean GLboolean b
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
StreamFlags operator|(StreamFlags a, StreamFlags b)
@ sampleIDGlobal
in case different streamers have access to the same IDs use this gloabl ID
@ sampleTsallis
perform sampling on tsallis pdf
@ sampleAll
use all data (default)
@ sampleID
sample every n IDs (per example track)
@ sampleWeights
perform sampling on weights, defined where the streamer is called
@ sampleRandom
sample randomly every n points
StreamFlags operator~(StreamFlags a)
StreamFlags
struct defining the flags which can be used to check if a certain debug streamer is used
@ streamdEdx
stream corrections and cluster properties used for the dE/dx
@ streamDigits
stream digit information
@ streamFastTransform
stream tpc fast transform
@ streamMergeBorderTracksBest
stream MergeBorderTracks best track
@ streamFlagsCount
total number of streamers
@ streamRejectCluster
stream cluster rejection informations
@ streamMergeBorderTracksAll
stream MergeBorderTracks all tracks
@ streamITCorr
stream ion tail correction information
@ streamDigitFolding
stream ion tail and saturatio information
@ streamDistortionsSC
stream distortions applied in the TPC space-charge class (used for example in the tpc digitizer)
@ streamUpdateTrack
stream update track informations
StreamFlags operator&(StreamFlags a, StreamFlags b)
struct for setting and storing the streamer level
int sampleIDGlobal[StreamFlags::streamFlagsCount]
storage of reference streamer used for sampleIDFromOtherStreamer
float samplingFrequency[StreamFlags::streamFlagsCount]
frequency which is used for the sampling (0.1 -> 10% is written if sampling is used)
O2ParamDef(ParameterDebugStreamer, "DebugStreamerParam")
SamplingTypes samplingType[StreamFlags::streamFlagsCount]
flag to store what will be streamed
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))