Project
Loading...
Searching...
No Matches
ConfigurationManager.cxx
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
18#include <fairlogger/Logger.h>
19#include <TSystem.h>
20
21using namespace std;
22
23namespace o2
24{
25namespace event_visualisation
26{
27
29{
30 static ConfigurationManager instance;
31 return instance;
32}
33
35{
36 TString fileName;
37 if (not this->mOptionsFileName.empty() and settings.ReadFile(fileName = this->mOptionsFileName, kEnvUser) >= 0) {
38 return; // precise located options file name read succesfully
39 }
40 if (settings.ReadFile(fileName = ".o2eve_config", kEnvUser) < 0) {
41 LOGF(warn, "could not find .o2eve_config in working directory! Trying .o2eve_config in home directory");
42 if (settings.ReadFile(fileName = Form("%s/.o2eve_config", gSystem->Getenv("HOME")), kEnvUser) < 0) {
43 LOGF(warn, "could not find .o2eve_config in home directory! Trying o2eve_config in home directory");
44 if (settings.ReadFile(fileName = Form("%s/o2eve_config", gSystem->Getenv("HOME")), kEnvUser) < 0) {
45 LOGF(warn, "could not find o2eve_config in home directory! Trying o2eve_config in O2/EventVisualisation");
46 if (settings.ReadFile(fileName = Form("%s/EventVisualisation/o2eve_config",
47 gSystem->Getenv("ALICEO2_INSTALL_PATH")),
48 kEnvUser) < 0) {
49 LOGF(fatal, "could not find .o2eve_config or o2eve_config file!.");
50 exit(0);
51 }
52 }
53 }
54 }
55 LOGF(info, Form("using %s config settings", fileName.Data()));
56}
57
58const ConfigurationManager* ConfigurationManager::loadSettings()
59{
60 if (this->mSettingsLoadCounter <= 0) {
61 this->getConfig(mSettings);
62 this->mSettingsLoadCounter = mSettings.GetValue("settings.reload", 10000);
63 }
64 this->mSettingsLoadCounter--;
65 return this;
66}
67
69{
70 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("refresh.rate", 5);
71}
72
74{
75 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("outreach.frequency.refresh.rate", 1);
76}
77
78std::string ConfigurationManager::getScreenshotPath(const char* prefix)
79{
80 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".path").c_str(), "Screenshots");
81}
82
84{
85 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("outreach.files.max", 10);
86}
87
89{
90 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".width").c_str(), 3840);
91}
92
94{
95 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".height").c_str(), 2160);
96}
97
99{
100 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".pixel_object_scale.3d").c_str(), 0);
101}
102
104{
105 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".pixel_object_scale.rphi").c_str(), 0);
106}
107
109{
110 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue((std::string(prefix) + ".pixel_object_scale.zy").c_str(), 0);
111}
112
114{
115 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("screenshot.monthly", 0);
116}
117
119{
120 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("data.default", "NEWEST");
121}
122
124{
125 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("data.synthetic.run.dir",
126 "jsons/synthetic");
127}
128
130{
131 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("data.cosmics.run.dir",
132 "jsons/cosmics");
133}
134
136{
137 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("data.physics.run.dir",
138 "jsons/physics");
139}
140
142{
143 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("simple.geom.R3.path", "");
144}
145
147{
148 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("background.color", 1);
149}
150
152{
153 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("simple.geom.R3.path", "");
154}
155
157{
158 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("simple.geom.R3.path", "");
159}
160
162{
163 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("camera.3D.rotation.horizontal", -0.4);
164}
165
167{
168 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("camera.3D.rotation.vertical", 1.0);
169}
170
172{
173 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("camera.3D.zoom", 1.0);
174}
175
177{
178 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("camera.R-Phi.zoom", 1.0);
179}
180
182{
183 return ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("camera.Z-Y.zoom", 1.0);
184}
185
187{
188 static std::string str = ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue("screenshot.logo.o2",
189 "o2.png");
190 return str.c_str();
191}
192
194{
195 static std::string str = ConfigurationManager::getInstance().loadSettings()->mSettings.GetValue(
196 "screenshot.logo.alice", "alice-white.png");
197 return str.c_str();
198}
199
200} // namespace event_visualisation
201} // namespace o2
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs and
configStandalone Reconstruction settings
static std::string getScreenshotPath(const char *prefix)
static UInt_t getScreenshotHeight(const char *prefix)
static ConfigurationManager & getInstance()
Returns an instance of ConfigurationManager.
void getConfig(TEnv &settings) const
Returns current event display configuration.
static UInt_t getScreenshotPixelObjectScale3d(const char *prefix)
static UInt_t getScreenshotPixelObjectScaleZY(const char *prefix)
static UInt_t getScreenshotWidth(const char *prefix)
static UInt_t getScreenshotPixelObjectScaleRphi(const char *prefix)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
const std::string str