|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | +// |
| 11 | +// Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no |
| 12 | +// |
| 13 | +#include "Analysis/AnalysisCut.h" |
| 14 | +#include "Analysis/AnalysisCompositeCut.h" |
| 15 | +#include "Analysis/VarManager.h" |
| 16 | + |
| 17 | +namespace o2::aod |
| 18 | +{ |
| 19 | +namespace dqcuts |
| 20 | +{ |
| 21 | +AnalysisCompositeCut* GetCompositeCut(const char* cutName); |
| 22 | +AnalysisCut* GetAnalysisCut(const char* cutName); |
| 23 | +} // namespace dqcuts |
| 24 | +} // namespace o2::aod |
| 25 | + |
| 26 | +AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) |
| 27 | +{ |
| 28 | + // |
| 29 | + // define composie cuts, typically combinations of all the ingredients needed for a full cut |
| 30 | + // |
| 31 | + // TODO: Agree on some conventions for the naming |
| 32 | + // Possibly think of possible customization of the predefined cuts |
| 33 | + |
| 34 | + AnalysisCompositeCut* cut = new AnalysisCompositeCut(cutName, cutName); |
| 35 | + std::string nameStr = cutName; |
| 36 | + |
| 37 | + if (!nameStr.compare("jpsiKineAndQuality")) { |
| 38 | + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); |
| 39 | + cut->AddCut(GetAnalysisCut("electronStandardQuality")); |
| 40 | + cut->AddCut(GetAnalysisCut("standardPrimaryTrack")); |
| 41 | + return cut; |
| 42 | + } |
| 43 | + |
| 44 | + if (!nameStr.compare("jpsiPID1")) { |
| 45 | + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); |
| 46 | + cut->AddCut(GetAnalysisCut("electronStandardQuality")); |
| 47 | + cut->AddCut(GetAnalysisCut("standardPrimaryTrack")); |
| 48 | + cut->AddCut(GetAnalysisCut("electronPID1")); |
| 49 | + return cut; |
| 50 | + } |
| 51 | + |
| 52 | + if (!nameStr.compare("jpsiPID2")) { |
| 53 | + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); |
| 54 | + cut->AddCut(GetAnalysisCut("electronStandardQuality")); |
| 55 | + cut->AddCut(GetAnalysisCut("standardPrimaryTrack")); |
| 56 | + cut->AddCut(GetAnalysisCut("electronPID2")); |
| 57 | + return cut; |
| 58 | + } |
| 59 | + |
| 60 | + if (!nameStr.compare("pairNoCut")) { |
| 61 | + cut->AddCut(GetAnalysisCut("pairNoCut")); |
| 62 | + return cut; |
| 63 | + } |
| 64 | + |
| 65 | + if (!nameStr.compare("pairMassLow")) { |
| 66 | + cut->AddCut(GetAnalysisCut("pairMassLow")); |
| 67 | + return cut; |
| 68 | + } |
| 69 | + |
| 70 | + if (!nameStr.compare("pairJpsi")) { |
| 71 | + cut->AddCut(GetAnalysisCut("pairJpsi")); |
| 72 | + return cut; |
| 73 | + } |
| 74 | + |
| 75 | + if (!nameStr.compare("pairPsi2S")) { |
| 76 | + cut->AddCut(GetAnalysisCut("pairPsi2S")); |
| 77 | + return cut; |
| 78 | + } |
| 79 | + |
| 80 | + if (!nameStr.compare("pairUpsilon")) { |
| 81 | + cut->AddCut(GetAnalysisCut("pairUpsilon")); |
| 82 | + return cut; |
| 83 | + } |
| 84 | + |
| 85 | + if (!nameStr.compare("pairJpsiLowPt1")) { |
| 86 | + cut->AddCut(GetAnalysisCut("pairJpsi")); |
| 87 | + cut->AddCut(GetAnalysisCut("pairPtLow1")); |
| 88 | + return cut; |
| 89 | + } |
| 90 | + |
| 91 | + if (!nameStr.compare("pairJpsiLowPt2")) { |
| 92 | + cut->AddCut(GetAnalysisCut("pairJpsi")); |
| 93 | + cut->AddCut(GetAnalysisCut("pairPtLow2")); |
| 94 | + return cut; |
| 95 | + } |
| 96 | + |
| 97 | + delete cut; |
| 98 | + return nullptr; |
| 99 | +} |
| 100 | + |
| 101 | +AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) |
| 102 | +{ |
| 103 | + // |
| 104 | + // define here cuts which are likely to be used often |
| 105 | + // |
| 106 | + AnalysisCut* cut = new AnalysisCut(cutName, cutName); |
| 107 | + std::string nameStr = cutName; |
| 108 | + |
| 109 | + if (!nameStr.compare("eventStandard")) { |
| 110 | + cut->AddCut(VarManager::kVtxZ, -10.0, 10.0); |
| 111 | + cut->AddCut(VarManager::kIsINT7, 0.5, 1.5); |
| 112 | + return cut; |
| 113 | + } |
| 114 | + |
| 115 | + if (!nameStr.compare("int7vtxZ5")) { |
| 116 | + cut->AddCut(VarManager::kVtxZ, -5.0, 5.0); |
| 117 | + cut->AddCut(VarManager::kIsINT7, 0.5, 1.5); |
| 118 | + return cut; |
| 119 | + } |
| 120 | + |
| 121 | + if (!nameStr.compare("jpsiStandardKine")) { |
| 122 | + cut->AddCut(VarManager::kPt, 1.0, 1000.0); |
| 123 | + cut->AddCut(VarManager::kEta, -0.9, 0.9); |
| 124 | + return cut; |
| 125 | + } |
| 126 | + |
| 127 | + if (!nameStr.compare("electronStandardQuality")) { |
| 128 | + cut->AddCut(VarManager::kIsSPDany, 0.5, 1.5); |
| 129 | + cut->AddCut(VarManager::kIsITSrefit, 0.5, 1.5); |
| 130 | + cut->AddCut(VarManager::kIsTPCrefit, 0.5, 1.5); |
| 131 | + cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0); |
| 132 | + cut->AddCut(VarManager::kITSchi2, 0.1, 36.0); |
| 133 | + cut->AddCut(VarManager::kTPCncls, 100.0, 161.); |
| 134 | + return cut; |
| 135 | + } |
| 136 | + |
| 137 | + if (!nameStr.compare("standardPrimaryTrack")) { |
| 138 | + cut->AddCut(VarManager::kTrackDCAxy, -1.0, 1.0); |
| 139 | + cut->AddCut(VarManager::kTrackDCAz, -3.0, 3.0); |
| 140 | + return cut; |
| 141 | + } |
| 142 | + |
| 143 | + TF1* cutLow1 = new TF1("cutLow1", "pol1", 0., 10.); |
| 144 | + cutLow1->SetParameters(130., -40.0); |
| 145 | + if (!nameStr.compare("electronPID1")) { |
| 146 | + cut->AddCut(VarManager::kTPCsignal, 70., 100.); |
| 147 | + cut->AddCut(VarManager::kTPCsignal, cutLow1, 100.0, false, VarManager::kPin, 0.5, 3.0); |
| 148 | + return cut; |
| 149 | + } |
| 150 | + |
| 151 | + if (!nameStr.compare("electronPID2")) { |
| 152 | + cut->AddCut(VarManager::kTPCsignal, 73., 100.); |
| 153 | + cut->AddCut(VarManager::kTPCsignal, cutLow1, 100.0, false, VarManager::kPin, 0.5, 3.0); |
| 154 | + return cut; |
| 155 | + } |
| 156 | + |
| 157 | + if (!nameStr.compare("pairNoCut")) { |
| 158 | + cut->AddCut(VarManager::kMass, 0.0, 1000.0); |
| 159 | + return cut; |
| 160 | + } |
| 161 | + |
| 162 | + if (!nameStr.compare("pairMassLow")) { |
| 163 | + cut->AddCut(VarManager::kMass, 2.5, 1000.0); |
| 164 | + return cut; |
| 165 | + } |
| 166 | + |
| 167 | + if (!nameStr.compare("pairJpsi")) { |
| 168 | + cut->AddCut(VarManager::kMass, 2.8, 3.3); |
| 169 | + return cut; |
| 170 | + } |
| 171 | + |
| 172 | + if (!nameStr.compare("pairPsi2S")) { |
| 173 | + cut->AddCut(VarManager::kMass, 3.4, 3.9); |
| 174 | + return cut; |
| 175 | + } |
| 176 | + |
| 177 | + if (!nameStr.compare("pairUpsilon")) { |
| 178 | + cut->AddCut(VarManager::kMass, 8.0, 11.0); |
| 179 | + return cut; |
| 180 | + } |
| 181 | + |
| 182 | + if (!nameStr.compare("pairPtLow1")) { |
| 183 | + cut->AddCut(VarManager::kPt, 2.0, 1000.0); |
| 184 | + return cut; |
| 185 | + } |
| 186 | + |
| 187 | + if (!nameStr.compare("pairPtLow2")) { |
| 188 | + cut->AddCut(VarManager::kPt, 5.0, 1000.0); |
| 189 | + return cut; |
| 190 | + } |
| 191 | + |
| 192 | + delete cut; |
| 193 | + return nullptr; |
| 194 | +} |
0 commit comments