Skip to content

Commit

Permalink
[PWGCF] DptDpt - Per run QC. Addressing linter recommendations (Ali…
Browse files Browse the repository at this point in the history
…ceO2Group#10241)

Co-authored-by: Victor <[email protected]>
  • Loading branch information
victor-gonzalez and Victor authored Feb 28, 2025
1 parent 5443f10 commit a9d5b30
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
8 changes: 4 additions & 4 deletions PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ o2physics_add_dpl_workflow(dpt-dpt-efficiency-and-qc
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(twopartcorr-per-run-qc
SOURCES perRunQc.cxx
o2physics_add_dpl_workflow(dpt-dpt-per-run-qc
SOURCES dptDptPerRunQc.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(twopartcorr-per-run-extraqc
SOURCES perRunExtraQc.cxx
o2physics_add_dpl_workflow(dpt-dpt-per-run-extra-qc
SOURCES dptDptPerRunExtraQc.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
// 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.
//
// Minimal example to run this task:
// o2-analysis-centrality-table -b --configuration json://configuration.json | o2-analysis-timestamp -b --configuration json://configuration.json | o2-analysis-event-selection -b --configuration json://configuration.json | o2-analysis-multiplicity-table -b --configuration json://configuration.json | o2-analysis-lf-zdcsp -b --configuration json://configuration.json --aod-file @input_data.txt --aod-writer-json OutputDirector.json

/// \file dptDptPerRunExtraQc.cxx
/// \brief basic per run check of the per analyzed species p vs TPC IW momentum
/// \author [email protected]

#include <array>
#include <cmath>
#include <unordered_map>

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
Expand All @@ -31,21 +33,21 @@ using namespace o2::constants::physics;

using BCsWithTimestamps = soa::Join<aod::BCs, aod::Timestamps>;

namespace perrunextraqa
namespace perrunextraqc
{
std::unordered_map<int, TProfile3D*> gRunMapPvsTpcIwP;
TProfile3D* gCurrentRunPvsPtcIwP;
} // namespace perrunextraqa
} // namespace perrunextraqc

struct DptDptPerRunExtraQa {
struct DptDptPerRunExtraQc {
int mRunNumber{-1};
AxisSpec qaPAxis{150, 0.1, 5.0};

HistogramRegistry mHistos{"PerRunExtraQaHistograms", {}, OutputObjHandlingPolicy::AnalysisObject};
HistogramRegistry mHistos{"PerRunExtraQcHistograms", {}, OutputObjHandlingPolicy::AnalysisObject};

void initRunNumber(aod::BCsWithTimestamps::iterator const& bc)
{
using namespace perrunextraqa;
using namespace perrunextraqc;

if (mRunNumber == bc.runNumber()) {
return;
Expand All @@ -60,17 +62,17 @@ struct DptDptPerRunExtraQa {

void init(InitContext&)
{
using namespace perrunextraqa;
using namespace perrunextraqc;

qaPAxis.makeLogarithmic();
}

template <typename PassedTracks>
void processTracks(PassedTracks const& tracks)
{
using namespace perrunextraqa;
using namespace perrunextraqc;

for (auto& track : tracks) {
for (const auto& track : tracks) {
gCurrentRunPvsPtcIwP->Fill(track.trackacceptedid(), track.p(), track.tpcInnerParam(), track.pt());
}
}
Expand All @@ -95,5 +97,5 @@ struct DptDptPerRunExtraQa {
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<DptDptPerRunExtraQa>(cfgc)};
adaptAnalysisTask<DptDptPerRunExtraQc>(cfgc)};
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file perRunQc.cxx
/// \file dptDptPerRunQc.cxx
/// \brief basic per run check of the ITS dead chips and of the hadronic interaction rate
/// \author [email protected]

Expand Down Expand Up @@ -42,7 +42,7 @@ using namespace o2::framework::expressions;

using BCsWithTimestamps = soa::Join<aod::BCs, aod::Timestamps>;

namespace perrunqatask
namespace perrunqctask
{
static const int32_t nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches;
std::unordered_map<int, TH2*> gHadronicRate;
Expand All @@ -53,9 +53,9 @@ std::unordered_map<int, std::shared_ptr<TH1>> gCollisionOrbitAfter;
TH2* gCurrentHadronicRate;
std::shared_ptr<TH1> gCurrentCollisionOrbitBefore;
std::shared_ptr<TH1> gCurrentCollisionOrbitAfter;
} // namespace perrunqatask
} // namespace perrunqctask

struct DptDptPerRunQa {
struct DptDptPerRunQc {

Service<o2::ccdb::BasicCCDBManager> ccdb;

Expand All @@ -67,7 +67,7 @@ struct DptDptPerRunQa {

void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
{
using namespace perrunqatask;
using namespace perrunqctask;
using namespace analysis::dptdptfilter;

if (mRunNumber == bc.runNumber()) {
Expand Down Expand Up @@ -144,7 +144,7 @@ struct DptDptPerRunQa {

void process(soa::Join<aod::Collisions, aod::EvSels, aod::DptDptCFCollisionsInfo>::iterator const& collision, aod::BCsWithTimestamps const&)
{
using namespace perrunqatask;
using namespace perrunqctask;
using namespace analysis::dptdptfilter;

auto bc = collision.bc_as<aod::BCsWithTimestamps>();
Expand All @@ -166,5 +166,5 @@ struct DptDptPerRunQa {
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<DptDptPerRunQa>(cfgc)};
adaptAnalysisTask<DptDptPerRunQc>(cfgc)};
}

0 comments on commit a9d5b30

Please sign in to comment.