Skip to content

Commit 995b725

Browse files
authored
registry.add updated
1. HistogramConfigSpec removed and registry.add are updated. 2. kTrackType[] is removed 3. constexpr std::size_t nTypes{5} is removed and defined constexpr size_t nTypes{std::size(muonTrackType)}; 4. Replaced nMuTrackType to nMuType 5. Replaced muonTrackType to muonTypeSelect 6. nType defined as constexpr std::size_t nTypes{std::size(muonTypeSelect)} 7. Replaced kIndex to kType
1 parent fba152e commit 995b725

1 file changed

Lines changed: 36 additions & 49 deletions

File tree

PWGHF/HFL/Tasks/taskSingleMuonMult.cxx

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <cmath>
1717
#include <string>
1818
#include <vector>
19+
#include <array>
1920

2021
#include <TPDGCode.h>
2122
#include <TString.h>
@@ -55,8 +56,8 @@ struct HfTaskSingleMuonMult {
5556
Configurable<float> etaTrackMax{"etaTrackMax", 0.8, "maximum pseudorapidity of tracks"};
5657
Configurable<float> etaMin{"etaMin", -3.6, "minimum pseudorapidity"};
5758
Configurable<float> etaMax{"etaMax", -2.5, "maximum pseudorapidity"};
58-
Configurable<float> pDcaMin{"pDcaMin", 324., "p*DCA value for small Rabsorb"};
59-
Configurable<float> pDcaMax{"pDcaMax", 594., "p*DCA value for large Rabsorb"};
59+
Configurable<float> pDcaMin{"pDcaMin", 324., "p*DCA value for small RAbsorb"};
60+
Configurable<float> pDcaMax{"pDcaMax", 594., "p*DCA value for large RAbsorb"};
6061
Configurable<float> rAbsorbMin{"rAbsorbMin", 17.6, "R at absorber end minimum value"};
6162
Configurable<float> rAbsorbMax{"rAbsorbMax", 89.5, "R at absorber end maximum value"};
6263
Configurable<float> rAbsorbMid{"rAbsorbMid", 26.5, "R at absorber end split point for different p*DCA selections"};
@@ -71,7 +72,6 @@ struct HfTaskSingleMuonMult {
7172
Filter globalTrackFilter = ((o2::aod::track::isGlobalTrack == true) && (nabs(o2::aod::track::eta) < etaTrackMax) && ((o2::aod::track::pt) > ptTrackMin));
7273

7374
HistogramRegistry registry{"registry"};
74-
static constexpr std::string_view kTrackType[] = {"TrackType0", "TrackType1", "TrackType2", "TrackType3", "TrackType4"};
7575

7676
void init(InitContext&)
7777
{
@@ -96,41 +96,26 @@ struct HfTaskSingleMuonMult {
9696
AxisSpec axisTrackType{8, -1.5, 6.5, "TrackType"};
9797
AxisSpec axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"};
9898

99-
HistogramConfigSpec hCentrality{HistType::kTH1F, {axisCent}};
100-
HistogramConfigSpec hEvent{HistType::kTH1F, {axisEvent}};
101-
HistogramConfigSpec hEventSize{HistType::kTH1F, {axisEventSize}};
102-
HistogramConfigSpec hVtxZ{HistType::kTH1F, {axisVtxZ}};
103-
104-
HistogramConfigSpec hMuTrkSel{HistType::kTH1F, {axisMuTrk}};
105-
HistogramConfigSpec hTHnMu{HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10};
106-
HistogramConfigSpec hTHnMuDeltaPt{HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisDeltaPt}, 10};
107-
HistogramConfigSpec h3DCA{HistType::kTH3F, {axisDCAx, axisDCAx, axisTrackType}};
108-
HistogramConfigSpec hTHnCh{HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisSign}, 5};
109-
HistogramConfigSpec h3MultNchNmu{HistType::kTH3F, {axisCent, axisNCh, axisNMu}};
110-
111-
HistogramConfigSpec h2PtMc{HistType::kTH2F, {axisPt, axisPtDif}};
112-
HistogramConfigSpec h2EtaMc{HistType::kTH2F, {axisEta, axisEtaDif}};
113-
114-
registry.add("hCentrality", "", hCentrality);
115-
registry.add("hEvent", "", hEvent);
116-
registry.add("hEventSize", "", hEventSize);
117-
registry.add("hVtxZBeforeSel", "", hVtxZ);
118-
registry.add("hVtxZAfterSel", "", hVtxZ);
119-
120-
registry.add("hMuTrkSel", "", hMuTrkSel);
121-
registry.add("hMuBeforeMatchMFT", "", hTHnMu);
122-
registry.add("hMuBeforeAccCuts", "", hTHnMu);
123-
registry.add("h3DCABeforeAccCuts", "", h3DCA);
124-
registry.add("hMuDeltaPtBeforeAccCuts", "", hTHnMuDeltaPt);
125-
registry.add("hMuAfterEtaCuts", "", hTHnMu);
126-
registry.add("hMuAfterRabsorbCuts", "", hTHnMu);
127-
registry.add("hMuAfterPdcaCuts", "", hTHnMu);
128-
registry.add("hMuAfterAccCuts", "", hTHnMu);
129-
registry.add("h3DCAAfterAccCuts", "", h3DCA);
130-
registry.add("hMuDeltaPtAfterAccCuts", "", hTHnMuDeltaPt);
131-
132-
registry.add("hTHnTrk", "", hTHnCh);
133-
registry.add("h3MultNchNmu", "", h3MultNchNmu);
99+
registry.add("hCentrality", "Centrality Percentile", {HistType::kTH1F, {axisCent}});
100+
registry.add("hEvent", " Number of Events", {HistType::kTH1F, {axisEvent}});
101+
registry.add("hEventSize", "Event Size", {HistType::kTH1F, {axisEventSize}});
102+
registry.add("hVtxZBeforeSel", "Z-vertex distribution before zVtx Cut", {HistType::kTH1F, {axisVtxZ}});
103+
registry.add("hVtxZAfterSel", "Z-vertex distribution after zVtx Cut", {HistType::kTH1F, {axisVtxZ}});
104+
105+
registry.add("hMuTrkSel", "Selection of muon tracks at various kinematic cuts", {HistType::kTH1F, {axisMuTrk}});
106+
registry.add("hMuBeforeMatchMFT", "Muon information before any Kinemeatic cuts applied", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
107+
registry.add("hMuBeforeAccCuts", "Muon information before applying Acceptance cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
108+
registry.add("h3DCABeforeAccCuts", "DCAx,DCAy,DCAz information before Acceptance cuts", {HistType::kTH3F, {axisDCAx, axisDCAx, axisTrackType}});
109+
registry.add("hMuDeltaPtBeforeAccCuts", "Muon information with DeltaPt before applying Acceptance cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisDeltaPt}, 10});
110+
registry.add("hMuAfterEtaCuts", "Muon information after applying Eta cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
111+
registry.add("hMuAfterRAbsorbCuts", "Muon information after applying RAbsorb cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
112+
registry.add("hMuAfterPdcaCuts", "Muon information after applying Pdca cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
113+
registry.add("hMuAfterAccCuts", "Muon information after applying all Kinematic cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisTrackType}, 10});
114+
registry.add("h3DCAAfterAccCuts", "DCAx,DCAy,DCAz information after Acceptance cuts", {HistType::kTH3F, {axisDCAx, axisDCAx, axisTrackType}});
115+
registry.add("hMuDeltaPtAfterAccCuts", "Muon information with DeltaPt after applying Acceptance cuts", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisTheta, axisRAbsorb, axisDCA, axisPDca, axisChi2MatchMCHMFT, axisDeltaPt}, 10});
116+
117+
registry.add("hTHnTrk", "Muon information with multiplicity", {HistType::kTHnSparseF, {axisCent, axisNCh, axisPt, axisEta, axisSign}, 5});
118+
registry.add("h3MultNchNmu", "Number of muons and multiplicity", {HistType::kTH3F, {axisCent, axisNCh, axisNMu}});
134119

135120
auto hEvstat = registry.get<TH1>(HIST("hEvent"));
136121
auto* xEv = hEvstat->GetXaxis();
@@ -142,12 +127,14 @@ struct HfTaskSingleMuonMult {
142127
auto* xMu = hMustat->GetXaxis();
143128
xMu->SetBinLabel(1, "noCut");
144129
xMu->SetBinLabel(2, "etaCut");
145-
xMu->SetBinLabel(3, "RabsorbCut");
130+
xMu->SetBinLabel(3, "RAbsorbCut");
146131
xMu->SetBinLabel(4, "pDcaCut");
147132
xMu->SetBinLabel(5, "chi2Cut");
148133

149-
const uint8_t muonTrackType[]{0, 1, 2, 3, 4};
150-
for (const auto& trktype : muonTrackType) {
134+
// Select the types of muon tracks to be analysed.
135+
const uint8_t muonTypeSelect[]{0, 1, 2, 3, 4};
136+
constexpr std::size_t nTypes{std::size(muonTypeSelect)};
137+
for (const auto& trktype : muonTypeSelect) {
151138
registry.add(Form("h3MultNchNmu_TrackType%d", trktype), "", h3MultNchNmu);
152139
}
153140
}
@@ -185,10 +172,9 @@ struct HfTaskSingleMuonMult {
185172
registry.fill(HIST("hTHnTrk"), cent, nCh, track.pt(), track.eta(), track.sign());
186173
}
187174

188-
// muons
175+
// muons per event
189176
int nMu{0};
190-
constexpr std::size_t nTypes{5};
191-
int nMuTrackType[nTypes] = {0};
177+
int nMuType[nTypes] = {0};
192178

193179
for (const auto& muon : muons) {
194180
const auto pt{muon.pt()}, eta{muon.eta()}, theta{90.0f - ((std::atan(muon.tgl())) * constants::math::Rad2Deg)}, pDca{muon.pDca()}, rAbsorb{muon.rAtAbsorberEnd()}, chi2{muon.chi2MatchMCHMFT()};
@@ -223,7 +209,7 @@ struct HfTaskSingleMuonMult {
223209
continue;
224210
}
225211
registry.fill(HIST("hMuTrkSel"), 3);
226-
registry.fill(HIST("hMuAfterRabsorbCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
212+
registry.fill(HIST("hMuAfterRAbsorbCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
227213

228214
if ((rAbsorb < rAbsorbMid) && (pDca >= pDcaMin)) {
229215
continue;
@@ -244,7 +230,7 @@ struct HfTaskSingleMuonMult {
244230
registry.fill(HIST("hMuAfterAccCuts"), cent, nCh, pt, eta, theta, rAbsorb, dcaXY, pDca, chi2, muTrackType);
245231
registry.fill(HIST("h3DCAAfterAccCuts"), muon.fwdDcaX(), muon.fwdDcaY(), muTrackType);
246232
nMu++;
247-
nMuTrackType[muTrackType]++;
233+
nMuType[muTrackType]++;
248234

249235
if (muon.has_matchMCHTrack()) {
250236
auto muonType3 = muon.template matchMCHTrack_as<MyMuons>();
@@ -258,10 +244,11 @@ struct HfTaskSingleMuonMult {
258244

259245
registry.fill(HIST("h3MultNchNmu"), cent, nCh, nMu);
260246

247+
// Fill number of muons of various types with multiplicity
261248
static_for<0, 4>([&](auto i) {
262-
constexpr int kIndex = i.value;
263-
if (nMuTrackType[kIndex] > 0) {
264-
registry.fill(std::string(HIST("h3MultNchNmu_")) + std::string(HIST(kTrackType[kIndex])), cent, nCh, nMuTrackType[kIndex]);
249+
constexpr int kType = i.value;
250+
if (nMuType[kType] > 0) {
251+
registry.fill(std::string(HIST("h3MultNchNmu_TrackType")) + std::string(HIST(kType)), cent, nCh, nMuType[kType]);
265252
}
266253
});
267254
chTracks.clear();

0 commit comments

Comments
 (0)