Skip to content

Commit 777bb8d

Browse files
committed
Update
1 parent 041560b commit 777bb8d

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

ALICE3/Tasks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ o2physics_add_dpl_workflow(alice3-pid-ftof-qa
4040
COMPONENT_NAME Analysis)
4141

4242
o2physics_add_dpl_workflow(alice3-pid-separation-power
43-
SOURCES pidSeparationPower.cxx
43+
SOURCES alice3SeparationPower.cxx
4444
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
4545
COMPONENT_NAME Analysis)
4646

ALICE3/Tasks/alice3Efficiency.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,24 @@
3030
using namespace o2;
3131
using namespace o2::framework;
3232
std::map<int, TEfficiency*> effVsPt;
33+
std::map<int, TEfficiency*> effVsEta;
3334

3435
struct alice3Efficiency {
3536
Configurable<std::vector<int>> pdgCodes{"pdgCodes", {211}, "List of PDG codes to consider for efficiency calculation"};
3637
OutputObj<THashList> outList{"output"};
3738
void init(o2::framework::InitContext&)
3839
{
3940
outList.setObject(new THashList);
41+
auto createEff = [&](const char* baseName, const char* axisTitle, int pdg, int nBins, double min, double max) {
42+
auto eff = new TEfficiency(Form("%s_pdg%d", baseName, pdg),
43+
Form("Efficiency for PDG %d; %s; Efficiency", pdg, axisTitle),
44+
nBins, min, max);
45+
outList->Add(eff);
46+
return eff;
47+
};
4048
for (auto pdg : pdgCodes.value) {
41-
effVsPt[pdg] = new TEfficiency(Form("efficiency_pdg%d", pdg),
42-
Form("Efficiency for PDG %d; p_{T} (GeV/c); Efficiency", pdg),
43-
100, 0, 10);
44-
outList->Add(effVsPt[pdg]);
49+
effVsPt[pdg] = createEff("efficiency", "p_{T} (GeV/c)", pdg, 100, 0, 10);
50+
effVsEta[pdg] = createEff("efficiency_eta", "#eta", pdg, 100, -5, 5);
4551
}
4652
}
4753

@@ -67,9 +73,9 @@ struct alice3Efficiency {
6773

6874
std::vector<int64_t>& indices = pdgIndices[mcParticle.pdgCode()];
6975
// Fill efficiency histogram
70-
auto& eff = effVsPt[mcParticle.pdgCode()];
7176
const bool found = std::find(indices.begin(), indices.end(), track.globalIndex()) != indices.end();
72-
eff->Fill(track.pt(), found);
77+
effVsPt[mcParticle.pdgCode()]->Fill(found, track.pt());
78+
effVsEta[mcParticle.pdgCode()]->Fill(found, track.eta());
7379
}
7480
}
7581
};
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
///
12-
/// \file pidSeparationPower.cxx
12+
/// \file alice3SeparationPower.cxx
1313
///
1414
/// \brief This task produces the separation power of the ALICE3 detector
1515
///
@@ -38,7 +38,7 @@ using namespace o2::framework;
3838
std::array<TProfile2D*, 5> separationInnerTOF;
3939
std::array<TProfile2D*, 5> separationOuterTOF;
4040
std::array<TProfile2D*, 5> separationRICH;
41-
struct pidSeparationPower {
41+
struct alice3SeparationPower {
4242

4343
ConfigurableAxis etaAxis{"etaAxis", {100, -1.f, 1.f}, "Binning in eta"};
4444
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -103,4 +103,4 @@ struct pidSeparationPower {
103103
}
104104
};
105105

106-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<pidSeparationPower>(cfgc)}; }
106+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<alice3SeparationPower>(cfgc)}; }

0 commit comments

Comments
 (0)