23#if defined(_LIBCPP_VERSION)
25#include <TStreamerElement.h>
26#include <TStreamerInfo.h>
34void* extractFromTFile(TFile&
file, TClass
const* cl,
const char* what)
39#if defined(_LIBCPP_VERSION)
40 DataRefUtils::registerLibstdcxxStdArray(
file, cl);
42 auto object =
file.GetObjectChecked(what, cl);
46 std::string objectName(cl->GetName());
47 objectName.erase(std::find_if(objectName.rbegin(), objectName.rend(), [](
unsigned char ch) {
48 return !std::isspace(ch);
51 objectName.erase(objectName.begin(), std::find_if(objectName.begin(), objectName.end(), [](
unsigned char ch) {
52 return !std::isspace(ch);
55 object =
file.GetObjectChecked(objectName.c_str(), cl);
56 LOG(warn) <<
"Did not find object under expected name " << what;
60 LOG(warn) <<
"Found object under deprecated name " << cl->GetName();
65 if (cl->IsTObject()) {
70 tree->LoadBaskets(0x1L << 32);
71 tree->SetDirectory(
nullptr);
74 auto h =
dynamic_cast<TH1*
>((
TObject*)
object);
76 h->SetDirectory(
nullptr);
85#if defined(_LIBCPP_VERSION)
96UInt_t stdArrayCheckSum(TClass
const* cl, TStreamerElement
const* el,
char const*
name)
99 auto add = [&
id](
char const*
s) {
for (; *
s; ++
s) {
id =
id * 3 + *
s; } };
102 add(el->GetTypeName());
103 for (
int i = 0;
i < el->GetArrayDim(); ++
i) {
104 id =
id * 3 + el->GetMaxIndex(
i);
110void DataRefUtils::registerLibstdcxxStdArray(TFile&
file, TClass
const* )
112 auto* infos =
file.GetStreamerInfoCache();
116 for (
auto* obj : *infos) {
117 auto* onfile =
dynamic_cast<TStreamerInfo*
>(obj);
118 if (!onfile || std::strncmp(onfile->GetName(),
"array<", 6) != 0 || onfile->GetNelement() != 1) {
121 auto* cl = TClass::GetClass(onfile->GetName());
126 auto* current =
static_cast<TStreamerInfo*
>(cl->GetStreamerInfo());
127 if (!current || current->GetNelement() != 1) {
132 auto checksum = std::strcmp(onfile->GetElement(0)->GetName(),
"_M_elems") == 0 ? onfile->GetCheckSum() : stdArrayCheckSum(cl, current->GetElement(0),
"_M_elems");
133 auto*
info =
static_cast<TStreamerInfo*
>(cl->FindStreamerInfo(checksum));
135 info =
static_cast<TStreamerInfo*
>((std::strcmp(onfile->GetElement(0)->GetName(),
"_M_elems") == 0 ? onfile : current)->Clone());
136 info->GetElement(0)->SetName(
"_M_elems");
137 info->SetCheckSum(checksum);
139 info =
static_cast<TStreamerInfo*
>(cl->FindStreamerInfo(checksum));
145 if (std::strcmp(
info->GetElement(0)->GetName(), current->GetElement(0)->GetName()) != 0) {
146 info->GetElement(0)->SetName(current->GetElement(0)->GetName());
147 info->Clear(
"build");
160 Int_t previousErrorLevel = gErrorIgnoreLevel;
161 gErrorIgnoreLevel = kFatal;
162 auto* dh = o2::header::get<o2::header::DataHeader*>(
ref.header);
163 const char* buff =
const_cast<char*
>(
ref.payload);
164 size_t flSize = dh->payloadSize;
166 constexpr char FlatHeaderAnnot[] =
"$HEADER$";
167 constexpr int Offset =
sizeof(int) +
sizeof(FlatHeaderAnnot);
169 LOGP(
debug,
"DHPayloadSize={}>{} Ref:{}/{} Cmp {}:{}", dh->payloadSize, Offset, dh->dataOrigin.as<std::string>(), dh->dataDescription.as<std::string>(), std::string{buff + dh->payloadSize - sizeof(FlatHeaderAnnot)}, std::string{FlatHeaderAnnot});
171 if (dh->payloadSize >= Offset &&
172 !std::strncmp(buff + dh->payloadSize -
sizeof(FlatHeaderAnnot), FlatHeaderAnnot,
sizeof(FlatHeaderAnnot))) {
173 headerSize = *
reinterpret_cast<const int*
>(buff + dh->payloadSize - Offset);
175 if (headerSize < 0) {
176 LOGP(fatal,
"Anomalous flattened header size {} extracted for CCDB object {}/{}", headerSize, dh->dataOrigin.as<std::string>(), dh->dataDescription.as<std::string>());
178 TMemFile memFile(
"name",
const_cast<char*
>(
ref.payload), dh->payloadSize - headerSize,
"READ");
179 gErrorIgnoreLevel = previousErrorLevel;
180 if (memFile.IsZombie()) {
184 TClass* tcl = TClass::GetClass(tinfo);
185 result = extractFromTFile(memFile, tcl,
"ccdb_object");
187 throw runtime_error_f(
"Couldn't retrieve object corresponding to %s from TFile", tcl->GetName());
195 auto* dh = o2::header::get<o2::header::DataHeader*>(
ref.header);
196 const char* buff =
const_cast<char*
>(
ref.payload);
198 constexpr char FlatHeaderAnnot[] =
"$HEADER$";
199 constexpr int Offset =
sizeof(int) +
sizeof(FlatHeaderAnnot);
200 int headerSize = 0, ss0 = 0;
201 std::map<std::string, std::string>
res;
202 if (dh->payloadSize >= Offset && !std::strncmp(buff + dh->payloadSize -
sizeof(FlatHeaderAnnot), FlatHeaderAnnot,
sizeof(FlatHeaderAnnot))) {
203 headerSize = *
reinterpret_cast<const int*
>(buff + dh->payloadSize - Offset);
205 LOGP(warn,
"CCDB headers were not added to condition object blob, returning dummy header map");
209 if (headerSize < 0) {
210 LOGP(fatal,
"Anomalous flattened header size {} extracted for CCDB object {}/{}", headerSize, dh->dataOrigin.as<std::string>(), dh->dataDescription.as<std::string>());
213 buff += dh->payloadSize - headerSize;
214 headerSize -= Offset;
215 const char* str0 = &buff[ss0++];
216 while (ss0 < headerSize) {
217 if (buff[ss0++] == 0) {
221 res.emplace(std::string(str0), std::string(&buff[ss0]));
222 LOGP(
debug,
"Header{} {}:{}",
res.size(), std::string(str0), std::string(&buff[ss0]));
232 auto* dh = o2::header::get<o2::header::DataHeader*>(
ref.header);
233 const char* buff =
ref.payload;
234 size_t payloadSize = dh->payloadSize;
235 constexpr char FlatHeaderAnnot[] =
"$HEADER$";
236 constexpr size_t Offset =
sizeof(int) +
sizeof(FlatHeaderAnnot);
238 if (payloadSize >= Offset &&
239 !std::strncmp(buff + payloadSize -
sizeof(FlatHeaderAnnot), FlatHeaderAnnot,
sizeof(FlatHeaderAnnot))) {
240 headerSize = *
reinterpret_cast<const int*
>(buff + payloadSize - Offset);
242 return {buff, payloadSize - headerSize};
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
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 s
Class for time synchronization of RawReader instances.
GLuint const GLchar * name
Defining ITS Vertex explicitly as messageable.
RuntimeErrorRef runtime_error_f(const char *,...)
static std::map< std::string, std::string > extractCCDBHeaders(DataRef const &ref)
static void * decodeCCDB(DataRef const &ref, std::type_info const &info)
static std::span< const char > getCCDBPayloadBlob(DataRef const &ref)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))