Skip to content

Commit 9e13d85

Browse files
committed
O2linter fixes, new TrueGap enumerator
1 parent 60ae872 commit 9e13d85

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

PWGUD/Core/SGSelector.h

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
//
12+
/// \file SGSelector.h
13+
/// \author Alexander Bylinkin
14+
/// \author Adam Matyja
15+
/// \since 2023-11-21
16+
/// \brief Support class holding tools to work with Single Gap selection in central barrel UPCs
17+
///
1118

1219
#ifndef PWGUD_CORE_SGSELECTOR_H_
1320
#define PWGUD_CORE_SGSELECTOR_H_
@@ -20,9 +27,6 @@
2027
#include "Framework/AnalysisTask.h"
2128
#include "Framework/Logger.h"
2229

23-
#include "TDatabasePDG.h"
24-
#include "TLorentzVector.h"
25-
2630
#include <cmath>
2731
using namespace o2::aod::rctsel;
2832

@@ -32,10 +36,20 @@ struct SelectionResult {
3236
BC* bc; // Pointer to the BC object
3337
};
3438

39+
namespace o2::aod::sgselector
40+
{
41+
enum TrueGap : int {
42+
NoGap = -1,
43+
SingleGapA = 0,
44+
SingleGapC = 1,
45+
DoubleGap = 2
46+
};
47+
}
48+
3549
class SGSelector
3650
{
3751
public:
38-
SGSelector() : fPDG(TDatabasePDG::Instance()), myRCTChecker{"CBT"}, myRCTCheckerHadron{"CBT_hadronPID"}, myRCTCheckerZDC{"CBT", true}, myRCTCheckerHadronZDC{"CBT_hadronPID", true} {}
52+
SGSelector() : myRCTChecker{"CBT"}, myRCTCheckerHadron{"CBT_hadronPID"}, myRCTCheckerZDC{"CBT", true}, myRCTCheckerHadronZDC{"CBT_hadronPID", true} {}
3953

4054
template <typename CC, typename BCs, typename TCs, typename FWs>
4155
int Print(SGCutParHolder /*diffCuts*/, CC& collision, BCs& /*bcRange*/, TCs& /*tracks*/, FWs& /*fwdtracks*/)
@@ -113,7 +127,8 @@ class SGSelector
113127
template <typename TFwdTrack>
114128
int FwdTrkSelector(TFwdTrack const& fwdtrack)
115129
{
116-
if (fwdtrack.trackType() == 0 || fwdtrack.trackType() == 3)
130+
// if (fwdtrack.trackType() == 0 || fwdtrack.trackType() == 3)
131+
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)
117132
return 1;
118133
else
119134
return 0;
@@ -131,21 +146,21 @@ class SGSelector
131146
FT0C = collision.totalFT0AmplitudeC();
132147
ZNA = collision.energyCommonZNA();
133148
ZNC = collision.energyCommonZNC();
134-
if (gap == 0) {
149+
if (gap == o2::aod::sgselector::SingleGapA) { // gap == 0
135150
if (FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut)
136-
true_gap = -1;
137-
} else if (gap == 1) {
151+
true_gap = o2::aod::sgselector::NoGap; // -1
152+
} else if (gap == o2::aod::sgselector::SingleGapC) { // gap == 1
138153
if (FT0C > fit_cut[2] || ZNC > zdc_cut)
139-
true_gap = -1;
140-
} else if (gap == 2) {
154+
true_gap = o2::aod::sgselector::NoGap; // -1
155+
} else if (gap == o2::aod::sgselector::DoubleGap) { // gap == 2
141156
if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut))
142-
true_gap = -1;
157+
true_gap = o2::aod::sgselector::NoGap; // -1
143158
else if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C <= fit_cut[2] && ZNC <= zdc_cut))
144-
true_gap = 1;
159+
true_gap = o2::aod::sgselector::SingleGapC; // 1
145160
else if ((FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut))
146-
true_gap = 0;
161+
true_gap = o2::aod::sgselector::SingleGapA; // 0
147162
else if (FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut && FT0C <= fit_cut[2] && ZNC <= zdc_cut)
148-
true_gap = 2;
163+
true_gap = o2::aod::sgselector::DoubleGap; // 2
149164
else
150165
LOGF(info, "Something wrong with DG");
151166
}
@@ -189,7 +204,6 @@ class SGSelector
189204
}
190205

191206
private:
192-
TDatabasePDG* fPDG;
193207
RCTFlagsChecker myRCTChecker;
194208
RCTFlagsChecker myRCTCheckerHadron;
195209
RCTFlagsChecker myRCTCheckerZDC;

0 commit comments

Comments
 (0)