Skip to content

Commit 2f85f1e

Browse files
authored
Merge pull request #9 from alibuild/alibot-cleanup-13244
Please consider the following formatting changes to #13244
2 parents 5ee7132 + 1d0ca53 commit 2f85f1e

File tree

1 file changed

+105
-107
lines changed

1 file changed

+105
-107
lines changed

PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx

Lines changed: 105 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,29 @@ using namespace o2::framework::expressions;
4949
using namespace o2::aod::track;
5050

5151
AxisSpec PtAxis = {1001, -0.005, 10.005};
52-
AxisSpec DeltaZAxis = {61, -6.1, 6.1};
53-
AxisSpec ZAxis = {301, -30.1, 30.1};
54-
AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"};
55-
// AxisSpec EtaAxis = {18, -4.6, -1.};
56-
AxisSpec DCAxyAxis = {5000, -1, 500};
57-
AxisSpec DCAzAxis = {5000, -251, 250};
58-
AxisSpec CentAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}};
59-
60-
static constexpr TrackSelectionFlags::flagtype trackSelectionITS =
52+
AxisSpec DeltaZAxis = {61, -6.1, 6.1};
53+
AxisSpec ZAxis = {301, -30.1, 30.1};
54+
AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"};
55+
// AxisSpec EtaAxis = {18, -4.6, -1.};
56+
AxisSpec DCAxyAxis = {5000, -1, 500};
57+
AxisSpec DCAzAxis = {5000, -251, 250};
58+
AxisSpec CentAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}};
59+
60+
static constexpr TrackSelectionFlags::flagtype trackSelectionITS =
6161
TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF |
6262
TrackSelectionFlags::kITSHits;
6363

64-
static constexpr TrackSelectionFlags::flagtype trackSelectionTPC =
64+
static constexpr TrackSelectionFlags::flagtype trackSelectionTPC =
6565
TrackSelectionFlags::kTPCNCls |
6666
TrackSelectionFlags::kTPCCrossedRowsOverNCls |
6767
TrackSelectionFlags::kTPCChi2NDF;
6868

69-
static constexpr TrackSelectionFlags::flagtype trackSelectionDCA =
69+
static constexpr TrackSelectionFlags::flagtype trackSelectionDCA =
7070
TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy;
7171

72-
using MFTTracksLabeled = soa::Join<o2::aod::MFTTracks, aod::McMFTTrackLabels>;
72+
using MFTTracksLabeled = soa::Join<o2::aod::MFTTracks, aod::McMFTTrackLabels>;
7373

74-
struct PseudorapidityDensityMFT {
74+
struct PseudorapidityDensityMFT {
7575
SliceCache cache;
7676
Preslice<aod::MFTTracks> perCol = o2::aod::fwdtrack::collisionId;
7777
Preslice<aod::McParticles> perMcCol = aod::mcparticle::mcCollisionId;
@@ -80,7 +80,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
8080
Service<o2::framework::O2DatabasePDG> pdg;
8181

8282
Configurable<float> estimatorEta{"estimatorEta", 1.0,
83-
"eta range for INEL>0 sample definition"};
83+
"eta range for INEL>0 sample definition"};
8484

8585
Configurable<bool> useEvSel{"useEvSel", true, "use event selection"};
8686
Configurable<bool> disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROF cut for event selection"};
@@ -99,65 +99,63 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
9999
Configurable<float> cfgPhiCut{"cfgPhiCut", 0.1f,
100100
"Cut on azimuthal angle of MFT tracks"};
101101
Configurable<float> cfgPhiCut1{"cfgPhiCut1", 0.0f,
102-
"low Cut on azimuthal angle of MFT tracks"};
102+
"low Cut on azimuthal angle of MFT tracks"};
103103
Configurable<float> cfgPhiCut2{"cfgPhiCut2", 6.3f,
104-
"high Cut on azimuthal angle of MFT tracks"};
104+
"high Cut on azimuthal angle of MFT tracks"};
105105
Configurable<float> cfgVzCut1{"cfgVzCut1", -30.0f,
106106
"Cut1 on vertex position of MFT tracks"};
107107
Configurable<float> cfgVzCut2{"cfgVzCut2", 30.0f,
108108
"Cut2 on vertex position of MFT tracks"};
109109
Configurable<float> cfgnCluster{"cfgnCluster", 5.0f,
110110
"Cut on no of clusters per MFT track"};
111111
Configurable<float> cfgnEta1{"cfgnEta1", -4.5f,
112-
"Cut on eta1"};
112+
"Cut on eta1"};
113113
Configurable<float> cfgnEta2{"cfgnEta2", -1.0f,
114-
"Cut on eta1"};
114+
"Cut on eta1"};
115115
Configurable<float> cfgChi2NDFMax{"cfgChi2NDFMax", 2000.0f, "Max allowed chi2/NDF for MFT tracks"};
116116
Configurable<float> maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"};
117117
Configurable<float> maxDCAz{"maxDCAz", 2.0f, "Cut on dcaZ"};
118118

119119
HistogramRegistry registry{
120120
"registry",
121-
{
122-
{"TracksEtaZvtx",
123-
"; #eta; #it{z}_{vtx} (cm); tracks",
124-
{HistType::kTH2F, {EtaAxis, ZAxis}}}, //
125-
{"Tracks/EtaZvtx_gt0",
126-
"; #eta; #it{z}_{vtx} (cm); tracks",
127-
{HistType::kTH2F, {EtaAxis, ZAxis}}}, //
128-
{"TracksPhiEta",
129-
"; #varphi; #eta; tracks",
130-
{HistType::kTH2F, {PhiAxis, EtaAxis}}}, //
131-
{"TracksPhiZvtx",
132-
"; #varphi; #it{z}_{vtx} (cm); tracks",
133-
{HistType::kTH2F, {PhiAxis, ZAxis}}}, //
134-
{"TracksPtEta",
135-
" ; p_{T} (GeV/c); #eta",
136-
{HistType::kTH2F, {PtAxis, EtaAxis}}}, //
137-
{"EventSelection",
138-
";status;events",
139-
{HistType::kTH1F, {{15, 0.5, 15.5}}}},
140-
{"EventCounts",
141-
";status;events",
142-
{HistType::kTH1F, {{2, 0.5, 2.5}}}},
143-
{"Tracks/Control/TrackCount", ";status;Track counts", {HistType::kTH1F, {{15, 0.5, 15.5}}}}, // added
144-
// Purity-related histograms
145-
{"Purity/SelectedAfterDCAxy/All",
146-
";bin;counts",
147-
{HistType::kTH1F, {{1, 0.5, 1.5}}}},
148-
{"Purity/SelectedAfterDCAxy/AllEta",
149-
";#eta;counts",
150-
{HistType::kTH1F, {EtaAxis}}},
151-
{"Purity/Gen/PrimaryEta",
152-
";#eta;primaries",
153-
{HistType::kTH1F, {EtaAxis}}},
154-
{"Purity/Gen/All",
155-
";bin;counts",
156-
{HistType::kTH1F, {{1, 0.5, 1.5}}}},
157-
{"Purity/Gen/AllEta",
158-
";#eta;counts",
159-
{HistType::kTH1F, {EtaAxis}}}
160-
}};
121+
{{"TracksEtaZvtx",
122+
"; #eta; #it{z}_{vtx} (cm); tracks",
123+
{HistType::kTH2F, {EtaAxis, ZAxis}}}, //
124+
{"Tracks/EtaZvtx_gt0",
125+
"; #eta; #it{z}_{vtx} (cm); tracks",
126+
{HistType::kTH2F, {EtaAxis, ZAxis}}}, //
127+
{"TracksPhiEta",
128+
"; #varphi; #eta; tracks",
129+
{HistType::kTH2F, {PhiAxis, EtaAxis}}}, //
130+
{"TracksPhiZvtx",
131+
"; #varphi; #it{z}_{vtx} (cm); tracks",
132+
{HistType::kTH2F, {PhiAxis, ZAxis}}}, //
133+
{"TracksPtEta",
134+
" ; p_{T} (GeV/c); #eta",
135+
{HistType::kTH2F, {PtAxis, EtaAxis}}}, //
136+
{"EventSelection",
137+
";status;events",
138+
{HistType::kTH1F, {{15, 0.5, 15.5}}}},
139+
{"EventCounts",
140+
";status;events",
141+
{HistType::kTH1F, {{2, 0.5, 2.5}}}},
142+
{"Tracks/Control/TrackCount", ";status;Track counts", {HistType::kTH1F, {{15, 0.5, 15.5}}}}, // added
143+
// Purity-related histograms
144+
{"Purity/SelectedAfterDCAxy/All",
145+
";bin;counts",
146+
{HistType::kTH1F, {{1, 0.5, 1.5}}}},
147+
{"Purity/SelectedAfterDCAxy/AllEta",
148+
";#eta;counts",
149+
{HistType::kTH1F, {EtaAxis}}},
150+
{"Purity/Gen/PrimaryEta",
151+
";#eta;primaries",
152+
{HistType::kTH1F, {EtaAxis}}},
153+
{"Purity/Gen/All",
154+
";bin;counts",
155+
{HistType::kTH1F, {{1, 0.5, 1.5}}}},
156+
{"Purity/Gen/AllEta",
157+
";#eta;counts",
158+
{HistType::kTH1F, {EtaAxis}}}}};
161159

162160
void init(InitContext&)
163161
{
@@ -167,9 +165,9 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
167165
static_cast<int>(doprocessCountingCentrality) >
168166
1) {
169167
LOGP(fatal,
170-
"Exactly one process function between processMult, "
171-
"processMultReassoc, processMultReassoc3d and processCountingCentrality should be "
172-
"enabled!");
168+
"Exactly one process function between processMult, "
169+
"processMultReassoc, processMultReassoc3d and processCountingCentrality should be "
170+
"enabled!");
173171
}
174172
AxisSpec MultAxis = {multBinning, "N_{trk}"};
175173
auto hstat = registry.get<TH1>(HIST("EventSelection"));
@@ -479,7 +477,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
479477
x->SetBinLabel(2, "Selected");
480478

481479
registry.add("Events/Centrality/CentPercentileMCGen",
482-
"CentPercentileMCGen", kTH1D, {CentAxis}, false);
480+
"CentPercentileMCGen", kTH1D, {CentAxis}, false);
483481
registry.add({"Events/Centrality/NtrkZvtxGen",
484482
"; N_{trk}; Z_{vtx} (cm); centrality",
485483
{HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}});
@@ -507,7 +505,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
507505
for (const auto& bc : bcs) {
508506
if (!useEvSel ||
509507
(useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) &&
510-
bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) {
508+
bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) {
511509
registry.fill(HIST("EventSelection"), 8); // added 5->12
512510
cols.clear();
513511
for (const auto& collision : collisions) {
@@ -531,7 +529,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
531529
}
532530

533531
PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging,
534-
"Collect event sample stats", true);
532+
"Collect event sample stats", true);
535533

536534
Partition<aod::MFTTracks> sample =
537535
(aod::fwdtrack::eta < -2.8f) && (aod::fwdtrack::eta > -3.2f);
@@ -547,10 +545,10 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
547545
expressions::Filter trackSelectionCentral =
548546
((aod::track::trackCutFlag & trackSelectionITS) == trackSelectionITS) &&
549547
ifnode((aod::track::v001::detectorMap & (uint8_t)o2::aod::track::TPC) ==
550-
(uint8_t)o2::aod::track::TPC,
551-
(aod::track::trackCutFlag & trackSelectionTPC) ==
552-
trackSelectionTPC,
553-
true) &&
548+
(uint8_t)o2::aod::track::TPC,
549+
(aod::track::trackCutFlag & trackSelectionTPC) ==
550+
trackSelectionTPC,
551+
true) &&
554552
((aod::track::trackCutFlag & trackSelectionDCA) == trackSelectionDCA) &&
555553
(nabs(aod::track::eta) < estimatorEta);
556554

@@ -559,8 +557,8 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
559557
aod::TracksDCA>>; // central tracks for INEL>0
560558

561559
void processMult(CollwEv::iterator const& collision,
562-
aod::MFTTracks const& tracks,
563-
FiCentralTracks const& midtracks, aod::Tracks const&)
560+
aod::MFTTracks const& tracks,
561+
FiCentralTracks const& midtracks, aod::Tracks const&)
564562
{
565563

566564
registry.fill(HIST("EventSelection"), 1.);
@@ -590,7 +588,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
590588
((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) ||
591589
(phi > o2::constants::math::TwoPI - cfgPhiCut) ||
592590
((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) &&
593-
(phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut)))
591+
(phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut)))
594592
continue;
595593
}
596594

@@ -613,7 +611,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
613611
}
614612

615613
PROCESS_SWITCH(PseudorapidityDensityMFT, processMult,
616-
"Process reco or data info", true);
614+
"Process reco or data info", true);
617615
// Common implementation for both BestCollisionsFwd and BestCollisionsFwd3d
618616
template <typename RetracksT>
619617
void processMultReassocCommon(CollwEv::iterator const& collision,
@@ -725,26 +723,26 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
725723
float dcaxy_cut = retrack.bestDCAXY();
726724
o2::math_utils::bringTo02Pi(phi);
727725
// Declare dcaz_cut only if needed below.
728-
if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) {
729-
if (usePhiCut) {
730-
if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21))
731-
continue;
732-
}
733-
if (useDCAxyCut) {
734-
if (dcaxy_cut > maxDCAxy)
735-
continue;
736-
}
737-
if constexpr (std::is_same_v<RetracksT, soa::SmallGroups<aod::BestCollisionsFwd3d>>) {
738-
float dcaz_cut = retrack.bestDCAZ();
739-
if (useDCAzCut) {
740-
if (dcaz_cut > maxDCAz)
726+
if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) {
727+
if (usePhiCut) {
728+
if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21))
741729
continue;
742730
}
743-
}
744-
// Purity denominator: all tracks that pass the DCA selection and other quality cuts
745-
registry.fill(HIST("Purity/SelectedAfterDCAxy/All"), 1.);
746-
registry.fill(HIST("Purity/SelectedAfterDCAxy/AllEta"), track.eta());
747-
registry.fill(HIST("TracksEtaZvtx"), track.eta(), z);
731+
if (useDCAxyCut) {
732+
if (dcaxy_cut > maxDCAxy)
733+
continue;
734+
}
735+
if constexpr (std::is_same_v<RetracksT, soa::SmallGroups<aod::BestCollisionsFwd3d>>) {
736+
float dcaz_cut = retrack.bestDCAZ();
737+
if (useDCAzCut) {
738+
if (dcaz_cut > maxDCAz)
739+
continue;
740+
}
741+
}
742+
// Purity denominator: all tracks that pass the DCA selection and other quality cuts
743+
registry.fill(HIST("Purity/SelectedAfterDCAxy/All"), 1.);
744+
registry.fill(HIST("Purity/SelectedAfterDCAxy/AllEta"), track.eta());
745+
registry.fill(HIST("TracksEtaZvtx"), track.eta(), z);
748746
if (midtracks.size() > 0 && retrack.ambDegree() > 0) {
749747
registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z);
750748
registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0"), track.eta(), z);
@@ -898,15 +896,15 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
898896
processMultReassocCommon(collision, mft, retracks, midtracks, trk);
899897
}
900898
PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc,
901-
"Process reco or data info", false);
899+
"Process reco or data info", false);
902900

903901
PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc3d,
904-
"Process reco or data info (3d)", false);
902+
"Process reco or data info (3d)", false);
905903

906904
using ExColsCent = soa::Join<aod::Collisions, aod::CentFT0Cs, aod::EvSels>;
907905

908906
void processCountingCentrality(ExColsCent::iterator const& collision,
909-
aod::MFTTracks const& tracks)
907+
aod::MFTTracks const& tracks)
910908
{
911909
auto c = collision.centFT0C();
912910
registry.fill(HIST("Events/Centrality/Selection"), 1., c);
@@ -930,7 +928,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
930928
((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) ||
931929
(phi > o2::constants::math::TwoPI - cfgPhiCut) ||
932930
((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) &&
933-
(phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut)))
931+
(phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut)))
934932
continue;
935933
}
936934

@@ -945,12 +943,12 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
945943
}
946944

947945
PROCESS_SWITCH(PseudorapidityDensityMFT, processCountingCentrality,
948-
"Count tracks in centrality bins", false);
946+
"Count tracks in centrality bins", false);
949947

950948
using Particles = soa::Filtered<aod::McParticles>;
951949
expressions::Filter primaries =
952950
(aod::mcparticle::flags &
953-
(uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) ==
951+
(uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) ==
954952
(uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary;
955953
Partition<Particles> mcSample = nabs(aod::mcparticle::eta) < 1.1f;
956954
Partition<Particles> mcSampleCentral =
@@ -959,7 +957,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
959957
void processGen(
960958
aod::McCollisions::iterator const& mcCollision,
961959
o2::soa::SmallGroups<soa::Join<aod::Collisions, aod::EvSels,
962-
aod::McCollisionLabels>> const& collisions,
960+
aod::McCollisionLabels>> const& collisions,
963961
Particles const& particles, aod::MFTTracks const& /*tracks*/,
964962
FiCentralTracks const& midtracks)
965963
{
@@ -1009,7 +1007,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
10091007
int moreThanOne = 0;
10101008

10111009
LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(),
1012-
collisions.size());
1010+
collisions.size());
10131011
for (const auto& collision : collisions) {
10141012
registry.fill(HIST("EventEfficiency"), 3.);
10151013
if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) {
@@ -1103,11 +1101,11 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
11031101
}
11041102

11051103
PROCESS_SWITCH(PseudorapidityDensityMFT, processGen,
1106-
"Process generator-level info", false);
1104+
"Process generator-level info", false);
11071105

11081106
using ExColsGenCent =
11091107
soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions,
1110-
aod::CentFT0Cs, aod::EvSels>>;
1108+
aod::CentFT0Cs, aod::EvSels>>;
11111109

11121110
void processGenCent(aod::McCollisions::iterator const& mcCollision,
11131111
ExColsGenCent const& collisions,
@@ -1116,7 +1114,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
11161114
{
11171115

11181116
LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(),
1119-
collisions.size());
1117+
collisions.size());
11201118

11211119
float c_gen = -1;
11221120
bool atLeastOne = false;
@@ -1195,7 +1193,7 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
11951193
}
11961194

11971195
PROCESS_SWITCH(PseudorapidityDensityMFT, processGenCent,
1198-
"Process generator-level info in centrality bins", false);
1196+
"Process generator-level info in centrality bins", false);
11991197

12001198
void processGenPt(
12011199
soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision,
@@ -1216,10 +1214,10 @@ AxisSpec PtAxis = {1001, -0.005, 10.005};
12161214
}
12171215

12181216
PROCESS_SWITCH(PseudorapidityDensityMFT, processGenPt,
1219-
"Process particle-level info of pt", false);
1220-
};
1217+
"Process particle-level info of pt", false);
1218+
};
12211219

1222-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
1223-
{
1220+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
1221+
{
12241222
return WorkflowSpec{adaptAnalysisTask<PseudorapidityDensityMFT>(cfgc)};
1225-
}
1223+
}

0 commit comments

Comments
 (0)