Project
Loading...
Searching...
No Matches
CalibTreeDump.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
12#ifndef ALICEO2_TPC_CALIBTREEDUMP_H_
13#define ALICEO2_TPC_CALIBTREEDUMP_H_
14
15#include <vector>
16#include <string>
17#include <unordered_map>
18
19#include <boost/variant.hpp>
20
23
24// forward declarations
25class TTree;
26
27namespace o2
28{
29namespace tpc
30{
31
32// forward declarations
33template <class T>
34class CalDet;
35
36template <class T>
37class CalArray;
38
47
49{
50 public:
51 using DataTypes = CalDet<float>; // boost::variant<CalDet<int>, CalDet<float>, CalDet<double>, CalDet<bool>, CalDet<unsigned int>>;
52 using CalPadMapType = std::unordered_map<std::string, DataTypes>;
53
54 CalibTreeDump() = default;
55 ~CalibTreeDump() = default;
56
58 template <typename T>
59 void add(CalDet<T>* calDet)
60 {
61 mCalDetObjects.emplace_back(calDet);
62 }
63 // void add(const CalDet<DataTypes>& calDet) { mCalDetObjects.push_back(calDet); }
64
66 template <typename T>
67 void add(CalArray<T>* calArray)
68 {
69 mCalArrayObjects.emplace_back(calArray);
70 }
74 void add(CalPadMapType& calibs);
75
77 void setAddFEEInfo(bool add = true) { mAddFEEInfo = add; }
78
80 void addCalPads(const std::string_view file, const std::string_view calPadNames);
81
83 void dumpToFile(const std::string filename = "CalibTree.root");
84
86 void addInfo(const std::string_view name, float value) { mAddInfo[name.data()] = value; }
87
88 private:
89 std::unordered_map<std::string, float> mAddInfo{};
90 std::vector<DataTypes*> mCalDetObjects{};
91 std::vector<DataTypes*> mCalArrayObjects{};
92 bool mAddFEEInfo{false};
93 std::vector<float> mTraceLengthIROC;
94 std::vector<float> mTraceLengthOROC;
95
97 void addDefaultMapping(TTree* tree);
98
100 void addFEEMapping(TTree* tree);
101
104 void addCalDetObjects(TTree* tree);
105
107 void setDefaultAliases(TTree* tree);
108
110 template <class Result, class Func>
111 struct forwarding_visitor : boost::static_visitor<Result> {
112 Func func;
113 forwarding_visitor(const Func& f) : func(f) {}
114 forwarding_visitor(Func&& f) : func(std::move(f)) {}
115 template <class Arg>
116 Result operator()(Arg&& arg) const
117 {
118 return func(std::forward<Arg>(arg));
119 }
120 };
121
123 template <class Result, class Func>
124 forwarding_visitor<Result, std::decay_t<Func>> make_forwarding_visitor(Func&& func)
125 {
126 return {std::forward<Func>(func)};
127 }
128};
129} // namespace tpc
130
131} // namespace o2
132#endif
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
class to dump calibration data to a ttree for simple visualisation
void addCalPads(const std::string_view file, const std::string_view calPadNames)
Add CalPad objects from a file.
void setAddFEEInfo(bool add=true)
Set adding of FEE mapping to the tree.
std::unordered_map< std::string, DataTypes > CalPadMapType
void dumpToFile(const std::string filename="CalibTree.root")
Dump the registered calibration data to file.
void add(CalDet< T > *calDet)
Add CalDet object.
void add(CalArray< T > *calArray)
Add CalArray objects.
void addInfo(const std::string_view name, float value)
Add complementary information.
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble f
Definition glcorearb.h:310
GLsizei const GLfloat * value
Definition glcorearb.h:819
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))