Skip to content
Closed
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
29 changes: 13 additions & 16 deletions DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// 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.

Check failure on line 11 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// O2 includes
#include "ReconstructionDataFormats/Track.h"
#include "Framework/runDataProcessing.h"
Expand All @@ -27,7 +27,7 @@
#include "Framework/ASoA.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
//#include "ReconstructionDataFormats/MatchInfoHMP.h"
// #include "ReconstructionDataFormats/MatchInfoHMP.h"

#include "tableHMPID.h"

Expand All @@ -41,22 +41,19 @@
using namespace o2::framework::expressions;
using namespace o2::constants::physics;


struct pidHmpidAnalysis {

Check failure on line 44 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

const AxisSpec axisEvtCounter{1, 0, +1, ""};


// CCDB configurable
Service<o2::ccdb::BasicCCDBManager> ccdb;
struct : ConfigurableGroup {
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 53 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
} ccdbConfig;


Produces<aod::HMPID_analysis> HMPID_analysis;

Check failure on line 56 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

// using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>;

Expand All @@ -66,7 +63,6 @@
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTPCFullDe,
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe>;


void init(o2::framework::InitContext&)
{
// Configure CCDB
Expand All @@ -77,7 +73,7 @@
histos.add("eventCounter", "eventCounter", kTH1F, {axisEvtCounter});
}

//function to manage ccdb
// function to manage ccdb
int mCCDBRunNumber = 0;
void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
{
Expand All @@ -92,22 +88,23 @@
TrackCandidates const&,
aod::BCsWithTimestamps const&)
{
//counter for all events processed (move into tracks loop if good event counter is needed)
// counter for all events processed (move into tracks loop if good event counter is needed)
histos.fill(HIST("eventCounter"), 0.5);

initCCDB(event.bc_as<aod::BCsWithTimestamps>());

//loop sulle tracce hmpid
for (const auto& t : hmpids)
{
//global tracks associated to hmpid tracks

// loop sulle tracce hmpid
for (const auto& t : hmpids) {
// global tracks associated to hmpid tracks
const auto& global_track = t.track_as<TrackCandidates>();

Check failure on line 99 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
if (!global_track.isGlobalTrack()) continue;
if (!global_track.hasITS() || !global_track.hasTPC() || !global_track.hasTOF()) continue;
if (!global_track.isGlobalTrack())
continue;
if (!global_track.hasITS() || !global_track.hasTPC() || !global_track.hasTOF())
continue;

float hmpidPhotsCharge2[10];

for (int i = 0; i < 10; i++) {

Check failure on line 107 in DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
hmpidPhotsCharge2[i] = t.hmpidPhotsCharge()[i];
}

Expand All @@ -116,10 +113,10 @@
global_track.p(), t.hmpidXTrack(), t.hmpidYTrack(), t.hmpidXMip(),
t.hmpidYMip(), t.hmpidNPhotons(), t.hmpidQMip(), (t.hmpidClusSize() % 1000000) / 1000, t.hmpidClusSize() / 1000000,
hmpidPhotsCharge2, global_track.eta(), global_track.phi(), global_track.px(), global_track.py(), global_track.pz(),
global_track.itsNCls(), global_track.tpcNClsFound(), global_track.tpcNClsCrossedRows(),global_track.tpcChi2NCl(), global_track.itsChi2NCl(),
global_track.itsNCls(), global_track.tpcNClsFound(), global_track.tpcNClsCrossedRows(), global_track.tpcChi2NCl(), global_track.itsChi2NCl(),
global_track.dcaXY(), global_track.dcaZ(), global_track.tpcNSigmaPi(), global_track.tofNSigmaPi(), global_track.tpcNSigmaKa(), global_track.tofNSigmaKa(),
global_track.tpcNSigmaPr(), global_track.tofNSigmaPr(), global_track.tpcNSigmaDe(), global_track.tofNSigmaDe());
} //end hmpid tracks loop
} // end hmpid tracks loop
}
};

Expand Down
81 changes: 37 additions & 44 deletions DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID_pb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,34 @@
// or submit itself to any jurisdiction.

// O2 includes
#include "ReconstructionDataFormats/Track.h"
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/RunningWorkflowInfo.h"
#include "ReconstructionDataFormats/TrackParametrization.h"
#include "Common/DataModel/PIDResponse.h"
#include "tableHMPIDPb.h"

#include "Common/Core/PID/PIDTOF.h"
#include "Common/TableProducer/PID/pidTOFBase.h"
#include "ReconstructionDataFormats/PID.h"
#include "Common/Core/trackUtilities.h"
#include "ReconstructionDataFormats/DCA.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/ASoA.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/TableProducer/PID/pidTOFBase.h"

#include "tableHMPIDPb.h"
#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
#include "Framework/ASoA.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/DCA.h"
#include "ReconstructionDataFormats/PID.h"
#include "ReconstructionDataFormats/Track.h"
#include "ReconstructionDataFormats/TrackParametrization.h"

#include <TTree.h>


//CREATE AND FILL TABLE FOR PBPB COLLISIONS
// CREATE AND FILL TABLE FOR PBPB COLLISIONS

using namespace o2;
using namespace o2::framework;
Expand All @@ -50,15 +49,12 @@ struct pidHmpidAnalysisPb {

const AxisSpec axisEvtCounter{1, 0, +1, ""};


// CCDB configurable
Service<o2::ccdb::BasicCCDBManager> ccdb;
struct : ConfigurableGroup {
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
} ccdbConfig;



Produces<aod::HMPID_analysisPb> HMPID_analysisPb;

// using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>;
Expand All @@ -69,8 +65,7 @@ struct pidHmpidAnalysisPb {
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTPCFullDe,
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe>;

//using CentralityClass = o2::soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFV0As>;

// using CentralityClass = o2::soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFV0As>;

void init(o2::framework::InitContext&)
{
Expand All @@ -82,7 +77,7 @@ struct pidHmpidAnalysisPb {
histos.add("eventCounter", "eventCounter", kTH1F, {axisEvtCounter});
}

//function to manage ccdb
// function to manage ccdb
int mCCDBRunNumber = 0;
void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
{
Expand All @@ -92,25 +87,23 @@ struct pidHmpidAnalysisPb {
mCCDBRunNumber = bc.runNumber();
}



void process(soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFV0As>::iterator const& col,
const aod::HMPIDs& hmpids,
TrackCandidates const&,
aod::BCsWithTimestamps const&)
void process(soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFV0As>::iterator const& col,
const aod::HMPIDs& hmpids,
TrackCandidates const&,
aod::BCsWithTimestamps const&)
{
histos.fill(HIST("eventCounter"), 0.5);
histos.fill(HIST("eventCounter"), 0.5);

initCCDB(col.bc_as<aod::BCsWithTimestamps>());


for (const auto& t : hmpids) {

//global tracks associated to hmpid tracks
// global tracks associated to hmpid tracks
const auto& global_track = t.track_as<TrackCandidates>();
if (!global_track.isGlobalTrack()) continue;
if (!global_track.hasITS() || !global_track.hasTPC() || !global_track.hasTOF()) continue;

if (!global_track.isGlobalTrack())
continue;
if (!global_track.hasITS() || !global_track.hasTPC() || !global_track.hasTOF())
continue;

// Verifica se la collisione è accessibile
if (!global_track.has_collision()) {
Expand All @@ -122,17 +115,17 @@ struct pidHmpidAnalysisPb {
for (int i = 0; i < 10; i++) {
hmpidPhotsCharge2[i] = t.hmpidPhotsCharge()[i];
}

float centrality = col.centFV0A();

/////FILL TABLE
HMPID_analysisPb(t.hmpidSignal(), global_track.phi(), global_track.eta(), t.hmpidMom(),
global_track.p(), t.hmpidXTrack(), t.hmpidYTrack(), t.hmpidXMip(),
t.hmpidYMip(), t.hmpidNPhotons(), t.hmpidQMip(), (t.hmpidClusSize() % 1000000) / 1000, t.hmpidClusSize() / 1000000,
hmpidPhotsCharge2, global_track.eta(), global_track.phi(), global_track.px(), global_track.py(), global_track.pz(),
global_track.itsNCls(), global_track.tpcNClsFound(), global_track.tpcNClsCrossedRows(),global_track.tpcChi2NCl(), global_track.itsChi2NCl(),
global_track.dcaXY(), global_track.dcaZ(), global_track.tpcNSigmaPi(), global_track.tofNSigmaPi(), global_track.tpcNSigmaKa(), global_track.tofNSigmaKa(),
global_track.tpcNSigmaPr(), global_track.tofNSigmaPr(), global_track.tpcNSigmaDe(), global_track.tofNSigmaDe(),centrality);
global_track.p(), t.hmpidXTrack(), t.hmpidYTrack(), t.hmpidXMip(),
t.hmpidYMip(), t.hmpidNPhotons(), t.hmpidQMip(), (t.hmpidClusSize() % 1000000) / 1000, t.hmpidClusSize() / 1000000,
hmpidPhotsCharge2, global_track.eta(), global_track.phi(), global_track.px(), global_track.py(), global_track.pz(),
global_track.itsNCls(), global_track.tpcNClsFound(), global_track.tpcNClsCrossedRows(), global_track.tpcChi2NCl(), global_track.itsChi2NCl(),
global_track.dcaXY(), global_track.dcaZ(), global_track.tpcNSigmaPi(), global_track.tofNSigmaPi(), global_track.tpcNSigmaKa(), global_track.tofNSigmaKa(),
global_track.tpcNSigmaPr(), global_track.tofNSigmaPr(), global_track.tpcNSigmaDe(), global_track.tofNSigmaDe(), centrality);
}
}
};
Expand Down
Loading
Loading