Skip to content
Merged
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
23 changes: 19 additions & 4 deletions PWGEM/Dilepton/Tasks/createTTP.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 PWGEM/Dilepton/Tasks/createTTP.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 PWGEM/Dilepton/Tasks/createTTP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -76,7 +76,7 @@

struct createTTP {
// Configurables
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 79 in PWGEM/Dilepton/Tasks/createTTP.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.)
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
Expand Down Expand Up @@ -140,6 +140,12 @@

Configurable<float> min_TPCNsigmaEl{"min_TPCNsigmaEl", -2, "min. TPC n sigma for electron inclusion"};
Configurable<float> max_TPCNsigmaEl{"max_TPCNsigmaEl", +3, "max. TPC n sigma for electron inclusion"};
Configurable<float> min_TPCNsigmaPi{"min_TPCNsigmaPi", -1e+10, "min n sigma pi in TPC for exclusion"};
Configurable<float> max_TPCNsigmaPi{"max_TPCNsigmaPi", +3, "max n sigma pi in TPC for exclusion"};
Configurable<float> min_TPCNsigmaKa{"min_TPCNsigmaKa", -3, "min n sigma ka in TPC for exclusion"};
Configurable<float> max_TPCNsigmaKa{"max_TPCNsigmaKa", +3, "max n sigma ka in TPC for exclusion"};
Configurable<float> min_TPCNsigmaPr{"min_TPCNsigmaPr", -3, "min n sigma pr in TPC for exclusion"};
Configurable<float> max_TPCNsigmaPr{"max_TPCNsigmaPr", +3, "max n sigma pr in TPC for exclusion"};
Configurable<float> min_TOFNsigmaEl{"min_TOFNsigmaEl", -3, "min. TOF n sigma for electron inclusion"};
Configurable<float> max_TOFNsigmaEl{"max_TOFNsigmaEl", +3, "max. TOF n sigma for electron inclusion"};
} tagCut;
Expand Down Expand Up @@ -395,9 +401,18 @@
template <typename TTrack>
bool isTagElectron(TTrack const& track)
{
bool is_El_TPC = tagCut.min_TPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < tagCut.max_TPCNsigmaEl;
bool is_El_TOF = tagCut.min_TOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < tagCut.max_TOFNsigmaEl;
return is_El_TPC && is_El_TOF;
bool is_OK_El_TPC = tagCut.min_TPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < tagCut.max_TPCNsigmaEl;
bool is_OK_El_TOFreq = tagCut.min_TOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < tagCut.max_TOFNsigmaEl;

bool is_OK_Pi_TPC = !(tagCut.min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < tagCut.max_TPCNsigmaPi);
bool is_OK_Ka_TPC = !(tagCut.min_TPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < tagCut.max_TPCNsigmaKa);
bool is_OK_Pr_TPC = !(tagCut.min_TPCNsigmaPr < track.tpcNSigmaPr() && track.tpcNSigmaPr() < tagCut.max_TPCNsigmaPr);
bool is_OK_El_TOFif = track.hasTOF() ? tagCut.min_TOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < tagCut.max_TOFNsigmaEl : true;

bool isTOFreq = is_OK_El_TPC && is_OK_Pi_TPC && is_OK_El_TOFreq;
bool isTPC_had_rej = is_OK_El_TPC && is_OK_Pi_TPC && is_OK_Ka_TPC && is_OK_Pr_TPC && is_OK_El_TOFif;

return isTOFreq || isTPC_had_rej;
}

template <typename TTrack>
Expand Down Expand Up @@ -492,7 +507,7 @@
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::BcSels>;
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
using MyTracks = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU,
aod::pidTPCFullEl, /*aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,*/
aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
aod::pidTOFFullEl /*, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFbeta*/>;

Filter collisionFilter_zvtx = eventCut.cfgZvtxMin < o2::aod::collision::posZ && o2::aod::collision::posZ < eventCut.cfgZvtxMax;
Expand Down Expand Up @@ -542,7 +557,7 @@
// }

auto tracks_per_coll = tracks.sliceBy(perCol, collision.globalIndex());
if (tracks_per_coll.size() < 2) { // at least 2 tracks are necessary to make a pair.

Check failure on line 560 in PWGEM/Dilepton/Tasks/createTTP.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.
continue;
}

Expand Down Expand Up @@ -755,7 +770,7 @@
}
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
auto mcCollision = mcParticle.template mcCollision_as<aod::McCollisions>();
if (std::abs(mcParticle.pdgCode()) != 11) {

Check failure on line 773 in PWGEM/Dilepton/Tasks/createTTP.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.

Check failure on line 773 in PWGEM/Dilepton/Tasks/createTTP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
if (!(mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator())) {
Expand Down Expand Up @@ -811,19 +826,19 @@
if (omegaId > 0) {
auto mcMother = mcParticles.rawIteratorAt(omegaId);
int ndau = mcMother.daughtersIds()[1] - mcMother.daughtersIds()[0] + 1;
if (ndau == 2) {

Check failure on line 829 in PWGEM/Dilepton/Tasks/createTTP.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.
fRegistry.fill(HIST("Pair/hMvsPt_omega"), v12.M(), v12.Pt());
}
} else if (phiId > 0) {
auto mcMother = mcParticles.rawIteratorAt(phiId);
int ndau = mcMother.daughtersIds()[1] - mcMother.daughtersIds()[0] + 1;
if (ndau == 2) {

Check failure on line 835 in PWGEM/Dilepton/Tasks/createTTP.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.
fRegistry.fill(HIST("Pair/hMvsPt_phi"), v12.M(), v12.Pt());
}
} else if (jpsiId > 0) {
auto mcMother = mcParticles.rawIteratorAt(jpsiId);
int ndau = mcMother.daughtersIds()[1] - mcMother.daughtersIds()[0] + 1;
if (ndau == 2) {

Check failure on line 841 in PWGEM/Dilepton/Tasks/createTTP.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.
fRegistry.fill(HIST("Pair/hMvsPt_jpsi"), v12.M(), v12.Pt());
}
}
Expand All @@ -843,5 +858,5 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<createTTP>(cfgc, TaskName{"create-ttp"})};

Check failure on line 861 in PWGEM/Dilepton/Tasks/createTTP.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names create-ttp and create-t-t-p generated from the specified task name create-ttp and from the struct name createTTP, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to CreateTtp and removing TaskName.
}
Loading