|
| 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 | +/// \author Alexander Tiekoetter <alexander.tiekoetter@cern.ch>, Muenster |
| 13 | +/// \brief Header file for definition of constants in the DQ framework |
| 14 | +/// \file DQConstants.h |
| 15 | + |
| 16 | +#ifndef PWGDQ_CORE_DQCONSTANTS_H_ |
| 17 | +#define PWGDQ_CORE_DQCONSTANTS_H_ |
| 18 | + |
| 19 | +#include <array> |
| 20 | + |
| 21 | +namespace o2::dqconstants |
| 22 | +{ |
| 23 | +// Numerical conventions |
| 24 | +inline constexpr float InvalidValueF = -9999.f; |
| 25 | +inline constexpr int InvalidValueI = -9999; |
| 26 | +inline constexpr int InvalidIndex = -1; |
| 27 | + |
| 28 | +inline constexpr float EmptyVariable = 0.0f; |
| 29 | + |
| 30 | +inline constexpr double MillisecondsPerMinute = 60000.0; |
| 31 | + |
| 32 | +inline constexpr int TwoProng = 2; |
| 33 | +inline constexpr int ThreeProng = 3; |
| 34 | +inline constexpr int FourProng = 4; |
| 35 | + |
| 36 | +inline constexpr int TPCCalibTypeStart = 0; |
| 37 | +inline constexpr int TPCCalibTypeEnd = 2; |
| 38 | + |
| 39 | +inline constexpr float InvalidDCA = 998.0f; |
| 40 | +inline constexpr float InvalidStdDev = -1.0; |
| 41 | + |
| 42 | +// Checks |
| 43 | +inline constexpr auto IsCoordinateValid = [](float value) constexpr -> bool { |
| 44 | + return value < 0.f; |
| 45 | +}; |
| 46 | + |
| 47 | +inline constexpr auto IsDCAInvalid = [](float value) constexpr -> bool { |
| 48 | + return value > InvalidDCA; |
| 49 | +}; |
| 50 | + |
| 51 | +inline constexpr auto IsStdDevValid = [](float value) constexpr -> bool { |
| 52 | + return value < 0.f; |
| 53 | +}; |
| 54 | + |
| 55 | +inline constexpr auto IsProcCodeInvalid = [](int procCode) constexpr -> bool { |
| 56 | + return procCode == 0; |
| 57 | +}; |
| 58 | + |
| 59 | +inline constexpr auto CheckCalibrationTypeInvalid = [](int type) constexpr -> bool { |
| 60 | + return type < TPCCalibTypeStart || type > TPCCalibTypeEnd; |
| 61 | +}; |
| 62 | + |
| 63 | +inline constexpr auto GetNumDegreesOfFreedom = [](int Ntrk) constexpr -> int { |
| 64 | + return 2 * Ntrk - 3; |
| 65 | +}; |
| 66 | + |
| 67 | +// Shared histogram class names |
| 68 | +namespace histograms |
| 69 | +{ |
| 70 | +// Event histograms names |
| 71 | +inline constexpr char EventBeforeCuts[] = "Event_BeforeCuts"; |
| 72 | +inline constexpr char EventAfterCuts[] = "Event_AfterCuts"; |
| 73 | +inline constexpr char EventMCTruth[] = "Event_MCTruth"; |
| 74 | + |
| 75 | +// Track histogram names |
| 76 | +inline constexpr char TrackBarrelBeforeCuts[] = "TrackBarrel_BeforeCuts"; |
| 77 | +inline constexpr char TrackBarrelAfterCuts[] = "TrackBarrel_"; |
| 78 | + |
| 79 | +inline constexpr char PairsBarrelSEPM[] = "PairsBarrelSEPM"; |
| 80 | +inline constexpr char PairsBarrelSEPP[] = "PairsBarrelSEPP"; |
| 81 | +inline constexpr char PairsBarrelSEMM[] = "PairsBarrelSEMM"; |
| 82 | + |
| 83 | +inline constexpr char PairsBarrelMEPM[] = "PairsBarrelMEPM"; |
| 84 | +inline constexpr char PairsBarrelMEPP[] = "PairsBarrelMEPP"; |
| 85 | +inline constexpr char PairsBarrelMEMM[] = "PairsBarrelMEMM"; |
| 86 | + |
| 87 | +// Muon histogram names |
| 88 | +inline constexpr char MuonBeforeCuts[] = "Muons_BeforeCuts"; |
| 89 | +inline constexpr char TrackMuonBeforeCuts[] = "TrackMuon_BeforeCuts"; |
| 90 | +inline constexpr char TrackMuonAfterCuts[] = "TrackMuon_"; |
| 91 | + |
| 92 | +inline constexpr char PairsMuonSEPM[] = "PairsMuonSEPM"; |
| 93 | +inline constexpr char PairsMuonSEPP[] = "PairsMuonSEPP"; |
| 94 | +inline constexpr char PairsMuonSEMM[] = "PairsMuonSEMM"; |
| 95 | + |
| 96 | +inline constexpr char PairsMuonMEPM[] = "PairsMuonMEPM"; |
| 97 | +inline constexpr char PairsMuonMEPP[] = "PairsMuonMEPP"; |
| 98 | +inline constexpr char PairsMuonMEMM[] = "PairsMuonMEMM"; |
| 99 | +} // namespace histograms |
| 100 | + |
| 101 | +namespace devices |
| 102 | +{ |
| 103 | +inline constexpr char EventSelection[] = "analysis-event-selection"; |
| 104 | +inline constexpr char TrackSelection[] = "analysis-track-selection"; |
| 105 | +inline constexpr char MuonSelection[] = "analysis-muon-selection"; |
| 106 | +inline constexpr char PrefilterSelection[] = "analysis-prefilter-selection"; |
| 107 | +inline constexpr char SameEventPairing[] = "analysis-same-event-pairing"; |
| 108 | +inline constexpr char AsymmetricPairing[] = "analysis-asymmetric-pairing"; |
| 109 | +inline constexpr char DileptonTrack[] = "analysis-dilepton-track"; |
| 110 | +inline constexpr char DileptonTrackTrack[] = "analysis-dilepton-track-track"; |
| 111 | +} // namespace devices |
| 112 | + |
| 113 | +// Defaults |
| 114 | +namespace defaults |
| 115 | +{ |
| 116 | +// Event selection defaults |
| 117 | +inline constexpr int EventTagStartBit = 56; |
| 118 | +inline constexpr float MaxAbsVertexZCm = 10.f; |
| 119 | +inline constexpr char DefaultRCTLabel[] = "CBT"; |
| 120 | + |
| 121 | +inline constexpr int NumDalitzSelections = 8; |
| 122 | + |
| 123 | +inline constexpr int NumTPCPostCalibrationTypes = 4; |
| 124 | + |
| 125 | +// Track defaults |
| 126 | +inline constexpr int NumDCAPars = 2; |
| 127 | +inline constexpr int IndexDCAxy = 0; |
| 128 | +inline constexpr int IndexDCAz = 1; |
| 129 | +inline constexpr double InitialDCA = 1e10; |
| 130 | + |
| 131 | +inline constexpr int RotationType1 = 1; |
| 132 | +inline constexpr int RotationType2 = 2; |
| 133 | +inline constexpr int RotationType3 = 3; |
| 134 | + |
| 135 | +inline constexpr int BdtSingleClassOutput = 1; |
| 136 | +inline constexpr int BdtMultiClassOutput = 3; |
| 137 | + |
| 138 | +// Bimodality defaults |
| 139 | +inline constexpr int BimodalMinDataSize = 3; |
| 140 | +inline constexpr float BimodalityInvalidBinWidth = -1.0; |
| 141 | +inline constexpr float BimodalityBinWidth = 0.005; |
| 142 | + |
| 143 | +// DCA thresholds in cm: 100 µm, 200 µm, 500 µm, 1 mm, 2 mm, 5 mm, 10 mm |
| 144 | +inline constexpr std::array<float, 7> BimodalityDCAThresholdsCm{ |
| 145 | + 0.01f, 0.02f, 0.05f, 0.1f, |
| 146 | + 0.2f, 0.5f, 1.0f}; |
| 147 | + |
| 148 | +// KFParticle defaults |
| 149 | +inline constexpr int KFParticleMassConstrainedConstruction = 2; |
| 150 | +inline constexpr int KFParticleLegacyConstructionMethod = 3; |
| 151 | + |
| 152 | +inline constexpr int TrkCovEntries = 21; |
| 153 | +inline constexpr int NumTrkCovPars = 6; |
| 154 | + |
| 155 | +inline constexpr int TrkCovEntriesNoX = 15; |
| 156 | +inline constexpr int NumTrkCovParsNoX = 5; |
| 157 | + |
| 158 | +inline constexpr int NumTrkComponents = 3; |
| 159 | + |
| 160 | +// Vertexing defaults |
| 161 | +inline constexpr float InvalidVertexingError = 1.e8f; |
| 162 | +inline constexpr float VertexingLxyzTolerance = 1.0e-8f; |
| 163 | +inline constexpr float InitialShift = 0.0f; |
| 164 | + |
| 165 | +inline constexpr float GJMinMagnitude = 1.e-6f; |
| 166 | + |
| 167 | +// Detector defaults |
| 168 | +inline constexpr int PostCalibElectron = 0; |
| 169 | +inline constexpr int PostCalibPion = 1; |
| 170 | +inline constexpr int PostCalibKaon = 2; |
| 171 | +inline constexpr int PostCalibProton = 3; |
| 172 | + |
| 173 | +inline constexpr int TPCPIDCalibrationMeanSigma = 1; |
| 174 | +inline constexpr int TPCPIDCalibrationMeanSigmaStatus = 2; |
| 175 | + |
| 176 | +inline constexpr int NumITSLayers = 7; |
| 177 | + |
| 178 | +inline constexpr int NumMFTLayers = 10; |
| 179 | +inline constexpr float MuonAbsorberExitZ = -505.; // cm |
| 180 | + |
| 181 | +inline constexpr double InvalidZnEnergy = -1.e12; |
| 182 | +inline constexpr int ZDCNeutronNTowers = 4; |
| 183 | + |
| 184 | +inline constexpr float CurvatureNormalizationFactor = 2.466; |
| 185 | + |
| 186 | +// Hadron defaults |
| 187 | +inline constexpr float InitialHadronMass = 0.0f; |
| 188 | + |
| 189 | +// Lifetimes |
| 190 | +inline constexpr float LifetimeBPlus = 1.638e-12f; // s |
| 191 | +inline constexpr float LifetimeB0 = 1.517e-12f; // s |
| 192 | + |
| 193 | +} // namespace defaults |
| 194 | + |
| 195 | +} // namespace o2::dqconstants |
| 196 | + |
| 197 | +#endif // PWGDQ_CORE_DQCONSTANTS_H_ |
0 commit comments