Skip to content

Commit b18614c

Browse files
authored
[DPG] Adding table in HMPID task (#7070)
* Adding table to qa HMPID task
1 parent d0dadba commit b18614c

1 file changed

Lines changed: 72 additions & 2 deletions

File tree

DPG/Tasks/AOTTrack/PID/HMPID/qaHMPID.cxx

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@
1414
#include "Framework/runDataProcessing.h"
1515
#include "Framework/AnalysisTask.h"
1616
#include "Framework/AnalysisDataModel.h"
17+
#include "Framework/HistogramRegistry.h"
18+
#include "Framework/RunningWorkflowInfo.h"
19+
#include "ReconstructionDataFormats/TrackParametrization.h"
20+
#include "Common/DataModel/PIDResponse.h"
21+
#include "Common/Core/PID/PIDTOF.h"
22+
#include "Common/TableProducer/PID/pidTOFBase.h"
23+
#include "ReconstructionDataFormats/PID.h"
24+
#include "Common/Core/trackUtilities.h"
25+
#include "ReconstructionDataFormats/DCA.h"
1726
#include "Framework/ASoAHelpers.h"
27+
#include "Framework/ASoA.h"
28+
#include "Common/DataModel/EventSelection.h"
1829
#include "Common/DataModel/TrackSelectionTables.h"
1930

2031
#include <TTree.h>
@@ -23,7 +34,56 @@ using namespace o2;
2334
using namespace o2::framework;
2435
using namespace o2::framework::expressions;
2536

37+
namespace o2::aod
38+
{
39+
40+
namespace variables_table // declaration of columns to create
41+
{
42+
DECLARE_SOA_COLUMN(ChAngle, chAngle, float);
43+
DECLARE_SOA_COLUMN(Phi, phi, float);
44+
DECLARE_SOA_COLUMN(Eta, eta, float);
45+
DECLARE_SOA_COLUMN(MomHMPID, momMPID, float);
46+
DECLARE_SOA_COLUMN(MomTrackX, momTrackX, float);
47+
DECLARE_SOA_COLUMN(MomTrackY, momTrackY, float);
48+
DECLARE_SOA_COLUMN(MomTrackZ, momTrackZ, float);
49+
DECLARE_SOA_COLUMN(Xtrack, xtrack, float);
50+
DECLARE_SOA_COLUMN(Ytrack, ytrack, float);
51+
DECLARE_SOA_COLUMN(Xmip, xmip, float);
52+
DECLARE_SOA_COLUMN(Ymip, ymip, float);
53+
DECLARE_SOA_COLUMN(Nphotons, nphotons, float);
54+
DECLARE_SOA_COLUMN(ChargeMIP, chargeMIP, float);
55+
DECLARE_SOA_COLUMN(ClusterSize, clustersize, float);
56+
DECLARE_SOA_COLUMN(Chamber, chamber, float);
57+
DECLARE_SOA_COLUMN(Photons_charge, photons_charge, float);
58+
59+
DECLARE_SOA_COLUMN(EtaTrack, etatrack, float);
60+
DECLARE_SOA_COLUMN(PhiTrack, phitrack, float);
61+
62+
DECLARE_SOA_COLUMN(ITSNcluster, itsNcluster, float);
63+
DECLARE_SOA_COLUMN(TPCNcluster, tpcNcluster, float);
64+
DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, float);
65+
DECLARE_SOA_COLUMN(TPCchi2, tpcChi2, float);
66+
DECLARE_SOA_COLUMN(ITSchi2, itsChi2, float);
67+
68+
DECLARE_SOA_COLUMN(DCAxy, dcaxy, float);
69+
DECLARE_SOA_COLUMN(DCAz, dcaz, float);
70+
71+
} // namespace variables_table
72+
73+
DECLARE_SOA_TABLE(HMPID_analysis, "AOD", "HMPIDANALYSIS",
74+
variables_table::ChAngle, variables_table::Phi, variables_table::Eta, variables_table::MomHMPID,
75+
variables_table::MomTrackX, variables_table::MomTrackY, variables_table::MomTrackZ,
76+
variables_table::Xtrack, variables_table::Ytrack, variables_table::Xmip,
77+
variables_table::Ymip, variables_table::Nphotons, variables_table::ChargeMIP, variables_table::ClusterSize,
78+
variables_table::Chamber, variables_table::Photons_charge, variables_table::EtaTrack, variables_table::PhiTrack,
79+
variables_table::ITSNcluster, variables_table::TPCNcluster, variables_table::TPCNClsCrossedRows,
80+
variables_table::TPCchi2, variables_table::ITSchi2, variables_table::DCAxy, variables_table::DCAz);
81+
} // namespace o2::aod
82+
2683
struct pidHmpidQa {
84+
85+
Produces<aod::HMPID_analysis> HMPID_analysis;
86+
2787
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
2888
Configurable<int> nBinsP{"nBinsP", 500, "Number of momentum bins"};
2989
Configurable<float> minP{"minP", 0.01f, "Minimum momentum plotted (GeV/c)"};
@@ -73,21 +133,31 @@ struct pidHmpidQa {
73133
void process(const aod::HMPIDs& hmpids,
74134
const TrackCandidates& /*tracks*/,
75135
const aod::Collisions& /*colls*/)
136+
76137
{
77138

78139
for (const auto& t : hmpids) {
79140
if (t.track_as<TrackCandidates>().isGlobalTrack() != (uint8_t) true) {
80141
continue;
81142
}
82-
if (abs(t.track_as<TrackCandidates>().dcaXY()) > maxDCA) {
143+
144+
const auto& track = t.track_as<TrackCandidates>();
145+
146+
if (!track.hasITS() || !track.hasTPC() || !track.hasTOF()) {
83147
continue;
84148
}
85149

150+
HMPID_analysis(t.hmpidSignal(), t.track_as<TrackCandidates>().phi(), t.track_as<TrackCandidates>().eta(), t.hmpidMom(),
151+
track.px(), track.py(), track.pz(), t.hmpidXTrack(), t.hmpidYTrack(), t.hmpidXMip(),
152+
t.hmpidYMip(), t.hmpidNPhotons(), t.hmpidQMip(), (t.hmpidClusSize() % 1000000) / 1000, t.hmpidClusSize() / 1000000,
153+
*t.hmpidPhotsCharge(), track.eta(), track.phi(), track.itsNCls(), track.tpcNClsFound(), track.tpcNClsCrossedRows(),
154+
track.tpcChi2NCl(), track.itsChi2NCl(), track.dcaXY(), track.dcaZ());
155+
86156
histos.fill(HIST("hmpidSignal"), t.hmpidSignal());
87157
histos.fill(HIST("PhivsEta"), t.track_as<TrackCandidates>().eta(), t.track_as<TrackCandidates>().phi());
88158
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), abs(t.hmpidMom()));
89159
histos.fill(HIST("hmpidCkovvsMom"), abs(t.hmpidMom()), t.hmpidSignal());
90-
histos.fill(HIST("hmpidXTrack"), t.hmpidYTrack());
160+
histos.fill(HIST("hmpidXTrack"), t.hmpidXTrack());
91161
histos.fill(HIST("hmpidYTrack"), t.hmpidYTrack());
92162
histos.fill(HIST("hmpidXMip"), t.hmpidXMip());
93163
histos.fill(HIST("hmpidYMip"), t.hmpidYMip());

0 commit comments

Comments
 (0)