Skip to content

Commit e2f7270

Browse files
authored
Add files via upload
1 parent 2da1841 commit e2f7270

File tree

1 file changed

+140
-0
lines changed

1 file changed

+140
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
///
12+
/// \file pmdqa.cxx
13+
///
14+
/// \brief QA task to check PMD info on Run 2 converted data
15+
/// \author Abhi Modak (abhi.modak@cern.ch)
16+
/// \since February 19, 2025
17+
18+
#include "Framework/runDataProcessing.h"
19+
#include "Framework/AnalysisTask.h"
20+
#include "Framework/ASoA.h"
21+
#include "Framework/AnalysisDataModel.h"
22+
#include "Common/DataModel/EventSelection.h"
23+
#include "Framework/O2DatabasePDGPlugin.h"
24+
#include "CCDB/BasicCCDBManager.h"
25+
#include "TH1F.h"
26+
#include "TH2F.h"
27+
#include <cstdlib>
28+
#include <cmath>
29+
#include <vector>
30+
31+
using namespace o2;
32+
using namespace o2::aod::run2;
33+
using namespace o2::framework;
34+
using namespace o2::aod::evsel;
35+
using namespace o2::framework::expressions;
36+
37+
namespace o2::aod
38+
{
39+
namespace pmdtrack
40+
{
41+
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
42+
DECLARE_SOA_ARRAY_INDEX_COLUMN(Collision, collisions);
43+
DECLARE_SOA_INDEX_COLUMN(BC, bc);
44+
DECLARE_SOA_SLICE_INDEX_COLUMN(Pmd,pmd);
45+
} // namespace pmdtrack
46+
47+
DECLARE_SOA_INDEX_TABLE_USER(PMDTracksIndex, BCs, "PMDTRKIDX", pmdtrack::CollisionId, pmdtrack::BCId, pmdtrack::PmdIdSlice);
48+
}
49+
50+
struct BuiltPmdIndex {
51+
// build the index table PMDTracksIndex
52+
Builds<aod::PMDTracksIndex> idx;
53+
void init(InitContext const&){};
54+
};
55+
56+
struct PmdQa {
57+
58+
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
59+
ConfigurableAxis axisEventBin{"axisEventBin", {4, 0.5, 4.5}, ""};
60+
ConfigurableAxis axisVtxZBin{"axisVtxZBin", {40, -20, 20}, ""};
61+
ConfigurableAxis axisNPMDtracksBin{"axisNPMDtracksBin", {500, 0, 500}, "Number of pmdtracks"};
62+
ConfigurableAxis axisClsxyBin{"axisClsxyBin", {200,-100,100}, ""};
63+
ConfigurableAxis axisAdcBin{"axisAdcBin", {200,0,2000}, ""};
64+
ConfigurableAxis axisEtaBin{"axisEtaBin", {10,2.1,4.1}, ""};
65+
ConfigurableAxis axisNcellBin{"axisNcellBin", {50,-0.5,49.5}, ""};
66+
Configurable<int> fMipCut{"fMipCut", 432, "fMipCut"};
67+
68+
void init(InitContext&)
69+
{
70+
71+
AxisSpec axisEvent = {axisEventBin, "Event", "EventAxis"};
72+
AxisSpec axisVtxZ = {axisVtxZBin, "VtxZ", "VtxZAxis"};
73+
AxisSpec axisNPMDtracks = {axisNPMDtracksBin, "NPMDtracks", "NPMDtracksAxis"};
74+
AxisSpec axisClsxy = {axisClsxyBin, "Clsxy", "ClsxyAxis"};
75+
AxisSpec axisAdc = {axisAdcBin, "Adc", "AdcAxis"};
76+
AxisSpec axisEta = {axisEtaBin, "Eta", "EtaAxis"};
77+
AxisSpec axisNcell = {axisNcellBin, "Ncell", "NcellAxis"};
78+
79+
histos.add("hEventHist", "hEventHist", kTH1F, {axisEvent});
80+
histos.add("hVtxZHist", "hVtxZHist", kTH1F, {axisVtxZ});
81+
histos.add("hNPMDtracks", "Number of pmdtracks", kTH1F, {axisNPMDtracks});
82+
histos.add("hClusXY", "hClusXY", kTH2F, {axisClsxy, axisClsxy});
83+
histos.add("hClusAdc", "hClusAdc", kTH1F, {axisAdc});
84+
histos.add("hetacls", "hetacls", kTH1F, {axisEta});
85+
histos.add("hclsncell", "hclsncell", kTH1F, {axisNcell});
86+
}
87+
88+
using coltable = soa::Join<aod::Collisions, aod::PMDTracksIndex>;
89+
using colevsel = soa::Join<coltable, aod::EvSels>;
90+
91+
void process(colevsel::iterator const& collision, aod::Pmds const&)
92+
{
93+
histos.fill(HIST("hEventHist"), 1);
94+
if (collision.sel7()) {
95+
return;
96+
}
97+
histos.fill(HIST("hEventHist"), 2);
98+
if (std::abs(collision.posZ()) >= 10.) {
99+
return;
100+
}
101+
histos.fill(HIST("hEventHist"), 3);
102+
histos.fill(HIST("hVtxZHist"), collision.posZ());
103+
104+
if (collision.has_pmd()) {
105+
histos.fill(HIST("hEventHist"), 4);
106+
auto tracks = collision.pmd();
107+
histos.fill(HIST("hNPMDtracks"), tracks.size());
108+
for (const auto& track : tracks) {
109+
if (track.pmddet() == 1) {
110+
return;
111+
}
112+
if(track.pmdclsz() == 0) {
113+
return;
114+
}
115+
if (!track.pmdmodule()) {
116+
return;
117+
}
118+
histos.fill(HIST("hClusXY"), track.pmdclsx(), track.pmdclsy());
119+
histos.fill(HIST("hClusAdc"), track.pmdclsadc());
120+
float rdist = TMath::Sqrt(track.pmdclsx()*track.pmdclsx() + track.pmdclsy()*track.pmdclsy());
121+
float theta = TMath::ATan2(rdist,track.pmdclsz());
122+
float etacls = -TMath::Log(TMath::Tan(0.5*theta));
123+
if (track.pmdclsadc() > fMipCut && track.pmdncell() > 2) {
124+
if(etacls>2.3 && etacls<3.9){
125+
histos.fill(HIST("hetacls"), etacls);
126+
histos.fill(HIST("hclsncell"), track.pmdncell());
127+
}
128+
}
129+
}
130+
}
131+
}
132+
};
133+
134+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
135+
{
136+
return WorkflowSpec{
137+
adaptAnalysisTask<PmdQa>(cfgc),
138+
adaptAnalysisTask<BuiltPmdIndex>(cfgc),
139+
};
140+
}

0 commit comments

Comments
 (0)