Skip to content
Closed
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
65 changes: 33 additions & 32 deletions PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,51 @@
/// \brief Task for analyzing v0(pT) of inclusive hadrons, pions, kaons, and, protons
/// \author Swati Saha

#include <CCDB/BasicCCDBManager.h>
#include <cstdlib>
#include <cmath>
#include <array>
#include <vector>
#include <string>
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/StepTHn.h"
#include "ReconstructionDataFormats/Track.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/Core/TrackSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/PIDResponseITS.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include <TList.h>
#include <TProfile.h>
#include <TProfile2D.h>
#include <TRandom3.h>
#include <TMath.h>
#include <TH1F.h>
#include <TH1D.h>
#include "DataFormatsParameters/GRPObject.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/StepTHn.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include <CCDB/BasicCCDBManager.h>

#include <TDirectory.h>
#include <TF1.h>
#include <TFile.h>
#include <TH1D.h>
#include <TH1F.h>
#include <TH2D.h>
#include <TH2F.h>
#include <THn.h>
#include <TList.h>
#include <TLorentzVector.h>

Check failure on line 48 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TObjArray.h>
#include <TFile.h>
#include <TH2F.h>
#include <TH2D.h>
#include <TLorentzVector.h>
#include <TPDGCode.h>
#include <TF1.h>
#include <TProfile.h>
#include <TProfile2D.h>
#include <TRandom3.h>

#include <array>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -99,7 +100,7 @@

// Filter command***********
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter trackFilter = (nabs(aod::track::eta) < 0.8f) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < cfgCutPtUpper) && (requireGlobalTrackInFilter()) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutTrackDcaZ);

Check failure on line 103 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.

// Filtering collisions and tracks***********
using aodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs, aod::Mults>>;
Expand All @@ -123,7 +124,7 @@
histos.add("Hist2D_cent_nch", "", {HistType::kTH2D, {nchAxis, centAxis}});
histos.add("hP", ";#it{p} (GeV/#it{c})", kTH1F, {{35, 0.2, 4.}});
histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis});
histos.add("hPhi", ";#phi", kTH1F, {{100, 0., 2. * M_PI}});

Check failure on line 127 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 127 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
histos.add("hEta", ";#eta", kTH1F, {{100, -2.01, 2.01}});
histos.add("hDcaXY", ";#it{dca}_{XY}", kTH1F, {{1000, -5, 5}});
histos.add("hDcaZ", ";#it{dca}_{Z}", kTH1F, {{1000, -5, 5}});
Expand Down Expand Up @@ -217,7 +218,7 @@
return false;
int flag = 0; //! pid check main flag

if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) {

Check failure on line 221 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.
if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) {
flag = 1;
}
Expand All @@ -225,17 +226,17 @@
flag = 1;
}
}
if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) {

Check failure on line 229 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.
const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0));
const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0));
const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0));

int flag2 = 0;
if (combNSigmaPr < 3.0)

Check failure on line 235 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.
flag2 += 1;
if (combNSigmaPi < 3.0)

Check failure on line 237 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.
flag2 += 1;
if (combNSigmaKa < 3.0)

Check failure on line 239 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.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.
flag2 += 1;
if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) {
if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) {
Expand Down Expand Up @@ -366,7 +367,7 @@
double N_sum_etaLeft_ka = 0.0;
double N_sum_etaLeft_prot = 0.0;

for (auto track : inputTracks) { // Loop over tracks

Check failure on line 370 in PWGCF/EbyEFluctuations/Tasks/v0pTHadPiKaProt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

if (!track.has_collision()) {
continue;
Expand Down
Loading