Project
Loading...
Searching...
No Matches
CompressedAnalysisTask.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef O2_TOF_COMPRESSEDANALYSISTASK
18#define O2_TOF_COMPRESSEDANALYSISTASK
19
20#include "Framework/Task.h"
22
23#include "TROOT.h"
24#include "TSystem.h"
25#include "TGlobal.h"
26#include "TFunction.h"
27#include <string>
28#include <iostream>
29
30using namespace o2::framework;
31
32namespace o2
33{
34namespace tof
35{
36
38{
39 public:
41 ~CompressedAnalysisTask() override = default;
42 void init(InitContext& ic) final;
43 void run(ProcessingContext& pc) final;
44
45 private:
46 CompressedAnalysis* mAnalysis = nullptr;
47 bool mStatus = false;
48
49 template <typename T>
50 T GetFromMacro(const std::string& file, const std::string& funcname, const std::string& type, const std::string& unique)
51 {
52
54 auto func = funcname;
55 if (func.empty()) {
56 auto size = file.size();
57 auto firstindex = file.find_last_of("/") + 1;
58 auto lastindex = file.find_last_of(".");
59 func = file.substr(firstindex < size ? firstindex : 0,
60 lastindex < size ? lastindex - firstindex : size - firstindex) +
61 "()";
62 }
63 auto gfunc = func.substr(0, func.find_first_of('('));
64
66 if (!gROOT->GetGlobalFunction(gfunc.c_str())) {
67 if (gROOT->LoadMacro(file.c_str()) != 0) {
68 std::cout << "Cannot find " << file << std::endl;
69 return nullptr;
70 }
71 if (!gROOT->GetGlobalFunction(gfunc.c_str())) {
72 std::cout << "Global function '" << gfunc << "' not defined" << std::endl;
73 return nullptr;
74 }
75 }
76
78 if (strcmp(gROOT->GetGlobalFunction(gfunc.c_str())->GetReturnTypeName(), type.c_str())) {
79 std::cout << "Global function '" << gfunc << "' does not return a '" << type << "' type" << std::endl;
80 return nullptr;
81 }
82
84 gROOT->ProcessLine(Form("%s __%s__ = %s;", type.c_str(), unique.c_str(), func.c_str()));
85 auto ptr = (T*)gROOT->GetGlobal(Form("__%s__", unique.c_str()))->GetAddress();
86
88 return *ptr;
89 }
90};
91
92} // namespace tof
93} // namespace o2
94
95#endif /* O2_TOF_COMPRESSEDANALYSISTASK */
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
TBranch * ptr
void run(ProcessingContext &pc) final
~CompressedAnalysisTask() override=default
GLsizeiptr size
Definition glcorearb.h:659
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...