Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Common/DataModel/PmdTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file PmdTable.h
///
/// \brief pmd index table define
/// \author Abhi Modak (abhi.modak@cern.ch)
/// \since May 17, 2025

#ifndef COMMON_DATAMODEL_PMDTABLE_H_
#define COMMON_DATAMODEL_PMDTABLE_H_

#include "Framework/AnalysisDataModel.h"

namespace o2::aod
{
namespace pmdtrack
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
DECLARE_SOA_ARRAY_INDEX_COLUMN(Collision, collisions);

Check failure on line 28 in Common/DataModel/PmdTable.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_INDEX_COLUMN(BC, bc);

Check failure on line 29 in Common/DataModel/PmdTable.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_SLICE_INDEX_COLUMN(Pmd, pmd);
} // namespace pmdtrack

DECLARE_SOA_INDEX_TABLE_USER(PMDTracksIndex, BCs, "PMDTRKIDX", pmdtrack::CollisionId, pmdtrack::BCId, pmdtrack::PmdIdSlice);
} // namespace o2::aod

#endif // COMMON_DATAMODEL_PMDTABLE_H_
7 changes: 6 additions & 1 deletion Common/LegacyDataQA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ o2physics_add_dpl_workflow(centqa
o2physics_add_dpl_workflow(tpcpidqa
SOURCES tpcpidqa.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(pmd-qa
SOURCES pmdQa.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
133 changes: 133 additions & 0 deletions Common/LegacyDataQA/pmdQa.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file pmdQa.cxx
///
/// \brief QA task to check PMD info on Run 2 converted data
/// \author Abhi Modak (abhi.modak@cern.ch)
/// \since May 17, 2025

#include <cstdlib>
#include <cmath>
#include <vector>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PmdTable.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "CCDB/BasicCCDBManager.h"
#include "TH1F.h"
#include "TH2F.h"

using namespace o2;
using namespace o2::aod::run2;
using namespace o2::framework;
using namespace o2::aod::evsel;
using namespace o2::framework::expressions;

struct BuiltPmdIndex {
// build the index table PMDTracksIndex
Builds<aod::PMDTracksIndex> idx;
void init(InitContext const&) {}
};

struct PmdQa {

HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
ConfigurableAxis axisEventBin{"axisEventBin", {4, 0.5, 4.5}, ""};
ConfigurableAxis axisVtxZBin{"axisVtxZBin", {40, -20, 20}, ""};
ConfigurableAxis axisNPMDtracksBin{"axisNPMDtracksBin", {500, 0, 500}, "Number of pmdtracks"};
ConfigurableAxis axisClsxyBin{"axisClsxyBin", {200, -100, 100}, ""};
ConfigurableAxis axisAdcBin{"axisAdcBin", {200, 0, 2000}, ""};
ConfigurableAxis axisEtaBin{"axisEtaBin", {10, 2.1, 4.1}, ""};
ConfigurableAxis axisNcellBin{"axisNcellBin", {50, -0.5, 49.5}, ""};
Configurable<int> fMipCut{"fMipCut", 432, "fMipCut"};
Configurable<int> fNcellCut{"fNcellCut", 2, "fNcellCut"};
Configurable<float> fEtalow{"fEtalow", 2.3, "fEtalow"};
Configurable<float> fEtahigh{"fEtahigh", 3.9, "fEtahigh"};
Configurable<float> fVtxCut{"fVtxCut", 10.0, "fVtxCut"};

void init(InitContext&)
{

AxisSpec axisEvent = {axisEventBin, "Event", "EventAxis"};
AxisSpec axisVtxZ = {axisVtxZBin, "VtxZ", "VtxZAxis"};
AxisSpec axisNPMDtracks = {axisNPMDtracksBin, "NPMDtracks", "NPMDtracksAxis"};
AxisSpec axisClsxy = {axisClsxyBin, "Clsxy", "ClsxyAxis"};
AxisSpec axisAdc = {axisAdcBin, "Adc", "AdcAxis"};
AxisSpec axisEta = {axisEtaBin, "Eta", "EtaAxis"};
AxisSpec axisNcell = {axisNcellBin, "Ncell", "NcellAxis"};

histos.add("hEventHist", "hEventHist", kTH1F, {axisEvent});
histos.add("hVtxZHist", "hVtxZHist", kTH1F, {axisVtxZ});
histos.add("hNPMDtracks", "Number of pmdtracks", kTH1F, {axisNPMDtracks});
histos.add("hClusXY", "hClusXY", kTH2F, {axisClsxy, axisClsxy});
histos.add("hClusAdc", "hClusAdc", kTH1F, {axisAdc});
histos.add("hetacls", "hetacls", kTH1F, {axisEta});
histos.add("hclsncell", "hclsncell", kTH1F, {axisNcell});
}

using ColTable = soa::Join<aod::Collisions, aod::PMDTracksIndex>;
using ColevSel = soa::Join<ColTable, aod::EvSels>;

void process(ColevSel::iterator const& collision, aod::Pmds const&)
{
histos.fill(HIST("hEventHist"), 1);
if (collision.sel7()) {
return;
}
histos.fill(HIST("hEventHist"), 2);
if (std::abs(collision.posZ()) >= fVtxCut) {
return;
}
histos.fill(HIST("hEventHist"), 3);
histos.fill(HIST("hVtxZHist"), collision.posZ());

if (collision.has_pmd()) {
histos.fill(HIST("hEventHist"), 4);
auto tracks = collision.pmd();
histos.fill(HIST("hNPMDtracks"), tracks.size());
for (const auto& track : tracks) {
if (track.pmddet() == 1) {
return;
}
if (track.pmdclsz() == 0) {
return;
}
if (!track.pmdmodule()) {
return;
}
histos.fill(HIST("hClusXY"), track.pmdclsx(), track.pmdclsy());
histos.fill(HIST("hClusAdc"), track.pmdclsadc());
float rdist = std::sqrt(track.pmdclsx() * track.pmdclsx() + track.pmdclsy() * track.pmdclsy());
float theta = std::atan2(rdist, track.pmdclsz());
float etacls = -std::log(std::tan(0.5 * theta));
if (track.pmdclsadc() > fMipCut && track.pmdncell() > fNcellCut) {
if (etacls > fEtalow && etacls < fEtahigh) {
histos.fill(HIST("hetacls"), etacls);
histos.fill(HIST("hclsncell"), track.pmdncell());
}
}
}
}
}
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<PmdQa>(cfgc),
adaptAnalysisTask<BuiltPmdIndex>(cfgc),
};
}
Loading