Skip to content

Commit c71eeb1

Browse files
Paola Vargas TorresPaola Vargas Torres
authored andcommitted
Fix code-check errors for dedxPidAnalysis.cxx and multiplicityPt.cxx
1 parent c8871cc commit c71eeb1

2 files changed

Lines changed: 33 additions & 54 deletions

File tree

PWGLF/Tasks/Nuspex/dedxPidAnalysis.cxx

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include <cstdint>
5252
#include <memory>
5353
#include <string>
54-
#include <string_view>
54+
// #include <string_view>
5555
#include <vector>
5656

5757
using namespace o2;
@@ -275,7 +275,7 @@ struct DedxPidAnalysis {
275275
// phi cut fits
276276
TF1* fphiCutHigh = nullptr;
277277
TF1* fphiCutLow = nullptr;
278-
Service<ccdb::BasicCCDBManager> ccdb;
278+
Service<ccdb::BasicCCDBManager> ccdb{};
279279

280280
TrackSelection myTrackSelection()
281281
{
@@ -284,7 +284,7 @@ struct DedxPidAnalysis {
284284
selectedTracks.SetEtaRange(etaMin, etaMax);
285285
selectedTracks.SetRequireITSRefit(true);
286286
selectedTracks.SetRequireTPCRefit(true);
287-
selectedTracks.SetMinNCrossedRowsTPC(minNCrossedRowsTPC);
287+
selectedTracks.SetMinNCrossedRowsTPC(static_cast<int>(minNCrossedRowsTPC.value));
288288
selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC);
289289
selectedTracks.SetMaxChi2PerClusterTPC(maxChi2TPC);
290290
selectedTracks.SetRequireHitsInITSLayers(1, {0, 1, 2});
@@ -1353,36 +1353,24 @@ struct DedxPidAnalysis {
13531353
phi += o2::constants::math::PI / 18.0f;
13541354
phi = std::fmod(phi, o2::constants::math::PI / 9.0f);
13551355

1356-
// cut phi
1357-
if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt))
1358-
return false; // reject track
1359-
1360-
return true;
1356+
// cut phi, reject track if inside the gap
1357+
return !(phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt));
13611358
}
13621359

13631360
// NclCutTPC
13641361
template <typename T>
13651362
bool passedNClTPCFoundCutSecondaries(const T& trk)
13661363
{
1367-
auto nTPCCl = trk.tpcNClsFound();
1368-
1369-
if (nTPCCl < minTPCnClsFound)
1370-
return false;
1371-
1372-
return true;
1364+
return trk.tpcNClsFound() >= minTPCnClsFound;
13731365
}
13741366

13751367
// NclCutPIDTPC secondary
13761368
template <typename T>
13771369
bool passedNClTPCPIDCutSecondaries(const T& trk)
13781370
{
1379-
auto nTPCCl = trk.tpcNClsPID();
1380-
1381-
if (nTPCCl < minTPCnClsPID)
1382-
return false;
1383-
1384-
return true;
1371+
return trk.tpcNClsPID() >= minTPCnClsPID;
13851372
}
1373+
13861374
// Get Multiplicity
13871375
template <typename T>
13881376
float getMultiplicity(const T& collision)

PWGLF/Tasks/Nuspex/multiplicityPt.cxx

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,11 @@
1313
/// \file multiplicityPt.cxx
1414
/// \brief Analysis to do PID with MC - Full correction factors for pions, kaons, protons
1515

16-
#include "PWGLF/DataModel/LFParticleIdentification.h"
17-
#include "PWGLF/DataModel/mcCentrality.h"
18-
#include "PWGLF/DataModel/spectraTOF.h"
19-
#include "PWGLF/Utils/inelGt.h"
20-
21-
#include "Common/Core/RecoDecay.h"
2216
#include "Common/Core/TrackSelection.h"
2317
#include "Common/Core/TrackSelectionDefaults.h"
2418
#include "Common/DataModel/Centrality.h"
2519
#include "Common/DataModel/EventSelection.h"
26-
#include "Common/DataModel/McCollisionExtra.h"
2720
#include "Common/DataModel/Multiplicity.h"
28-
#include "Common/DataModel/PIDResponseTOF.h"
2921
#include "Common/DataModel/PIDResponseTPC.h"
3022
#include "Common/DataModel/TrackSelectionTables.h"
3123

@@ -34,23 +26,22 @@
3426
#include <Framework/ASoAHelpers.h>
3527
#include <Framework/AnalysisDataModel.h>
3628
#include <Framework/AnalysisTask.h>
29+
#include <Framework/Configurable.h>
3730
#include <Framework/HistogramRegistry.h>
3831
#include <Framework/Logger.h>
3932
#include <Framework/O2DatabasePDGPlugin.h>
4033
#include <Framework/runDataProcessing.h>
4134
#include <ReconstructionDataFormats/Track.h>
4235

4336
#include <TF1.h>
37+
#include <TH2.h>
38+
#include <TH3.h>
4439
#include <TMCProcess.h>
4540
#include <TPDGCode.h>
4641

47-
#include <algorithm>
4842
#include <array>
4943
#include <cmath>
50-
#include <map>
5144
#include <memory>
52-
#include <numeric>
53-
#include <set>
5445
#include <string>
5546
#include <vector>
5647

@@ -81,31 +72,31 @@ using TracksMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA,
8172
aod::TrackSelection, aod::McTrackLabels,
8273
aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
8374

84-
static constexpr int NCentHists{10};
85-
static constexpr int NPartHists{5};
86-
std::array<std::shared_ptr<TH3>, NCentHists> hDedxVsMomentumVsCentPos{};
87-
std::array<std::shared_ptr<TH3>, NCentHists> hDedxVsMomentumVsCentNeg{};
88-
std::array<std::shared_ptr<TH3>, NCentHists + 1> hDedxVspTMomentumVsCent{};
89-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hMomentumVsEtaPos{};
90-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hMomentumVsEtaNeg{};
91-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hpTVsEtaPos{};
92-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hpTVsEtaNeg{};
93-
// Total counts
94-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalMomPosCent{};
95-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalMomNegCent{};
96-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalPtPosCent{};
97-
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalPtNegCent{};
98-
// Counts for particles
99-
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracMomPosCent{};
100-
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracMomNegCent{};
101-
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracPtPosCent{};
102-
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracPtNegCent{};
103-
10475
struct MultiplicityPt {
10576

10677
// ── Services ──────────────────────────────────────────────
107-
Service<o2::framework::O2DatabasePDG> pdg;
108-
Service<ccdb::BasicCCDBManager> ccdb;
78+
Service<o2::framework::O2DatabasePDG> pdg{};
79+
Service<ccdb::BasicCCDBManager> ccdb{};
80+
81+
static constexpr int NCentHists{10};
82+
static constexpr int NPartHists{5};
83+
std::array<std::shared_ptr<TH3>, NCentHists> hDedxVsMomentumVsCentPos{};
84+
std::array<std::shared_ptr<TH3>, NCentHists> hDedxVsMomentumVsCentNeg{};
85+
std::array<std::shared_ptr<TH3>, NCentHists + 1> hDedxVspTMomentumVsCent{};
86+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hMomentumVsEtaPos{};
87+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hMomentumVsEtaNeg{};
88+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hpTVsEtaPos{};
89+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hpTVsEtaNeg{};
90+
// Total counts
91+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalMomPosCent{};
92+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalMomNegCent{};
93+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalPtPosCent{};
94+
std::array<std::shared_ptr<TH2>, NCentHists + 1> hTotalPtNegCent{};
95+
// Counts for particles
96+
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracMomPosCent{};
97+
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracMomNegCent{};
98+
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracPtPosCent{};
99+
std::array<std::array<std::shared_ptr<TH2>, NCentHists + 1>, NPartHists> hFracPtNegCent{};
109100

110101
// ── Constant values ──────────────────────────────────
111102
static constexpr int CentBinMax = 100;

0 commit comments

Comments
 (0)