Skip to content

Commit 88bddde

Browse files
committed
fix build error++
1 parent 0d8bbb4 commit 88bddde

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ using namespace o2::constants::math;
7272
using namespace o2::aod::rctsel;
7373

7474
auto static constexpr CminCharge = 3.f;
75+
static constexpr float CnullInt = 0;
7576
static constexpr float Cnull = 0.0f;
77+
static constexpr float ConeInt = 1;
7678
static constexpr float Cone = 1.0f;
7779

7880
// FV0 specific constants
@@ -923,8 +925,8 @@ struct FlattenictyPikp {
923925
template <int pidSgn, o2::track::PID::ID id, typename P>
924926
bool isPID(const P& mcParticle)
925927
{
926-
static_assert(pidSgn == Cnull || pidSgn == 1);
927-
static_assert(id > Cnull || id < Npart);
928+
static_assert(pidSgn == CnullInt || pidSgn == ConeInt);
929+
static_assert(id > CnullInt || id < Npart);
928930
constexpr int Cidx = id + pidSgn * Npart;
929931
return mcParticle.pdgCode() == PidSgn[Cidx];
930932
}
@@ -2079,16 +2081,16 @@ struct FlattenictyPikp {
20792081
AxisSpec ptAxis{binOpt.axisPt, "#it{p}_{T} (GeV/#it{c})"};
20802082
constexpr int ChistIdx = id + pidSgn * Npart;
20812083
auto idx = static_cast<int>(id);
2082-
const std::string strID = Form("/%s/%s", (pidSgn == Cnull && id < Npart) ? "pos" : "neg", Pid[idx]);
2084+
const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]);
20832085
hPtEffRec[ChistIdx] = flatchrg.add<TH1>("Tracks/hPtEffRec" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis});
20842086
hPtEffGen[ChistIdx] = flatchrg.add<TH1>("Tracks/hPtEffGen" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis});
20852087
}
20862088

20872089
template <int pidSgn, o2::track::PID::ID id>
20882090
void initEfficiency()
20892091
{
2090-
static_assert(pidSgn == Cnull || pidSgn == 1);
2091-
static_assert(id > Cnull || id < Npart);
2092+
static_assert(pidSgn == CnullInt || pidSgn == ConeInt);
2093+
static_assert(id > CnullInt || id < Npart);
20922094
constexpr int Cidx = id + pidSgn * Npart;
20932095
const TString partName = PidChrg[Cidx];
20942096
THashList* lhash = new THashList();
@@ -2110,7 +2112,7 @@ struct FlattenictyPikp {
21102112
template <int pidSgn, o2::track::PID::ID id>
21112113
void fillEfficiency()
21122114
{
2113-
static_assert(pidSgn == Cnull || pidSgn == 1);
2115+
static_assert(pidSgn == CnullInt || pidSgn == ConeInt);
21142116
constexpr int ChistIdx = id + pidSgn * Npart;
21152117
const char* partName = PidChrg[ChistIdx];
21162118
THashList* lhash = static_cast<THashList*>(listEfficiency->FindObject(partName));
@@ -2134,8 +2136,10 @@ struct FlattenictyPikp {
21342136
template <int pidSgn, o2::track::PID::ID id>
21352137
void fillMCRecTrack(MyLabeledPIDTracks::iterator const& track, const float mult, const float flat)
21362138
{
2137-
static_assert(pidSgn == Cnull || pidSgn == 1);
2139+
static_assert(pidSgn == CnullInt || pidSgn == ConeInt);
21382140
constexpr int ChistIdx = id + pidSgn * Npart;
2141+
constexpr int Cidx = id;
2142+
LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast<int>(id) << " with index " << ChistIdx;
21392143
const aod::McParticles::iterator& mcParticle = track.mcParticle();
21402144
const CollsGen::iterator& collision = track.collision_as<CollsGen>();
21412145

@@ -2163,36 +2167,33 @@ struct FlattenictyPikp {
21632167
}
21642168

21652169
if (collision.has_mcCollision() && (mcParticle.mcCollisionId() == collision.mcCollisionId())) {
2166-
static_for<0, 4>([&](auto i) {
2167-
constexpr int Cidx = i.value;
2168-
if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma<Cidx>(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma<Cidx>(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) {
2169-
if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) {
2170-
if (!mcParticle.isPhysicalPrimary()) {
2171-
if (mcParticle.getProcess() == CprocessIdWeak) {
2172-
hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt());
2173-
hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY());
2174-
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), mult, flat, track.pt(), track.dcaXY());
2175-
} else {
2176-
hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt());
2177-
hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY());
2178-
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), mult, flat, track.pt(), track.dcaXY());
2179-
}
2170+
if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma<Cidx>(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma<Cidx>(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) {
2171+
if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) {
2172+
if (!mcParticle.isPhysicalPrimary()) {
2173+
if (mcParticle.getProcess() == CprocessIdWeak) {
2174+
hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt());
2175+
hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY());
2176+
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), mult, flat, track.pt(), track.dcaXY());
21802177
} else {
2181-
hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt());
2182-
hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY());
2183-
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), mult, flat, track.pt(), track.dcaXY());
2178+
hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt());
2179+
hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY());
2180+
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), mult, flat, track.pt(), track.dcaXY());
21842181
}
2185-
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), mult, flat, track.pt(), track.dcaXY());
2182+
} else {
2183+
hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt());
2184+
hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY());
2185+
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), mult, flat, track.pt(), track.dcaXY());
21862186
}
2187+
flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), mult, flat, track.pt(), track.dcaXY());
21872188
}
2188-
});
2189+
}
21892190
}
21902191
}
21912192

21922193
template <int pidSgn, o2::track::PID::ID id, bool recoEvt = false>
21932194
void fillMCGen(aod::McParticles::iterator const& mcParticle, const float mult, const float flat)
21942195
{
2195-
static_assert(pidSgn == Cnull || pidSgn == 1);
2196+
static_assert(pidSgn == CnullInt || pidSgn == ConeInt);
21962197
constexpr int ChistIdx = id + pidSgn * Npart;
21972198

21982199
if (!isPID<pidSgn, id>(mcParticle)) {

0 commit comments

Comments
 (0)