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
67 changes: 47 additions & 20 deletions PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,33 @@
/// \brief Analysis of cascades in pp collisions
/// \author Roman Nepeivoda (roman.nepeivoda@cern.ch)

#include <algorithm>
#include <vector>
#include <TPDGCode.h>
#include "PWGLF/DataModel/cascqaanalysis.h"

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/mcCentrality.h"
#include "PWGLF/Utils/inelGt.h"

#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "PWGLF/DataModel/cascqaanalysis.h"
#include "TRandom2.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/AnalysisTask.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "PWGLF/Utils/inelGt.h"
#include "PWGLF/DataModel/mcCentrality.h"
#include "Framework/runDataProcessing.h"

#include "TRandom2.h"
#include <TPDGCode.h>

#include <algorithm>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::aod::rctsel;

// using DauTracks = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCPr, aod::pidTPCKa, aod::pidTOFPi, aod::pidTOFPr>;
using TrkPidInfo = soa::Join<aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTOFPi, aod::pidTOFPr, aod::pidTOFKa>;
Expand Down Expand Up @@ -79,6 +85,14 @@
Configurable<bool> isNoITSROFrameBorder{"isNoITSROFrameBorder", 1, "ITS ROF border cut"};
Configurable<bool> isNoCollInTimeRangeNarrow{"isNoCollInTimeRangeNarrow", 1, "No collisions in +-2us window"};

Configurable<bool> requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"};
Configurable<std::string> cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"};
Configurable<bool> cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"};
Configurable<bool> cfgEvtRCTFlagCheckerFV0Check{"cfgEvtRCTFlagCheckerFV0Check", false, "Evt sel: RCT flag checker FV0 check"};
Configurable<bool> cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", false, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"};

RCTFlagsChecker rctChecker;

// Cascade selection criteria
Configurable<float> scalefactor{"scalefactor", 1.0, "Scaling factor"};
Configurable<double> casccospa{"casccospa", 0.97, "Casc CosPA"};
Expand Down Expand Up @@ -119,9 +133,9 @@
{
TString hCandidateCounterLabels[4] = {"All candidates", "passed topo cuts", "has associated MC particle", "associated with Xi(Omega)"};
TString hNEventsMCLabels[6] = {"All", "z vrtx", "INEL", "INEL>0", "INEL>1", "Associated with rec. collision"};
TString hNEventsLabels[13] = {"All", "kIsTriggerTVX", "kNoTimeFrameBorder", "kNoITSROFrameBorder", "kIsVertexITSTPC", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "isVertexTOFmatched", "kNoCollInTimeRangeNarrow", "z vrtx", "INEL", "INEL>0", "INEL>1"};
TString hNEventsLabels[14] = {"All", "kIsTriggerTVX", "kNoTimeFrameBorder", "kNoITSROFrameBorder", "kIsVertexITSTPC", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "isVertexTOFmatched", "kNoCollInTimeRangeNarrow", "z vrtx", "RCTFlagsChecker", "INEL", "INEL>0", "INEL>1"};

registry.add("hNEvents", "hNEvents", {HistType::kTH1D, {{13, 0.f, 13.f}}});
registry.add("hNEvents", "hNEvents", {HistType::kTH1D, {{14, 0.f, 14.f}}});

for (int n = 1; n <= registry.get<TH1>(HIST("hNEvents"))->GetNbinsX(); n++) {
registry.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(n, hNEventsLabels[n - 1]);
Expand Down Expand Up @@ -169,6 +183,11 @@
registry.add("hFT0MFV0Asignal", "hFT0MFV0Asignal", {HistType::kTH2D, {signalFT0MAxis, signalFV0AAxis}});
registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}});
}

rctChecker.init(cfgEvtRCTFlagCheckerLabel, cfgEvtRCTFlagCheckerZDCCheck, cfgEvtRCTFlagCheckerLimitAcceptAsBad);
if (cfgEvtRCTFlagCheckerFV0Check) {
rctChecker.set(o2::aod::rctsel::kFV0Bad);
}
}

Filter preFilter =
Expand All @@ -179,7 +198,7 @@
aod::cascdata::dcacascdaughters < dcacascdau);

Partition<DauTracks> pvContribTracksIUEta1 = (nabs(aod::track::eta) < 1.0f) && ((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor));
Partition<DauTracks> globalTracksIUEta05 = (nabs(aod::track::eta) < 0.5f) && (requireGlobalTrackInFilter());

Check failure on line 201 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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.

template <class TCascTracksTo, typename TCascade>
bool acceptCascCandidate(TCascade const& cascCand, float const& pvx, float const& pvy, float const& pvz)
Expand Down Expand Up @@ -219,7 +238,7 @@
if (pdgInfo->Charge() == 0) {
continue;
}
if (mcParticle.eta() < -3.3 || mcParticle.eta() > 4.9 || (mcParticle.eta() > -2.1 && mcParticle.eta() < 3.5)) {

Check failure on line 241 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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; // select on T0M Nch region
}
nchFT0++; // increment
Expand All @@ -243,7 +262,7 @@
if (pdgInfo->Charge() == 0) {
continue;
}
if (mcParticle.eta() < 2.2 || mcParticle.eta() > 5.1) {

Check failure on line 265 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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; // select on V0A Nch region
}
nchFV0A++; // increment
Expand All @@ -256,14 +275,14 @@
{
// 0 - INEL, 1 - INEL>0, 2 - INEL>1
int evFlag = 0;
registry.fill(HIST("hNEvents"), 10.5); // INEL
registry.fill(HIST("hNEvents"), 11.5); // INEL
if (collision.isInelGt0()) {
evFlag += 1;
registry.fill(HIST("hNEvents"), 11.5); // INEL>0
registry.fill(HIST("hNEvents"), 12.5); // INEL>0
}
if (collision.isInelGt1()) {
evFlag += 1;
registry.fill(HIST("hNEvents"), 12.5); // INEL>1
registry.fill(HIST("hNEvents"), 13.5); // INEL>1
}
return evFlag;
}
Expand Down Expand Up @@ -347,6 +366,14 @@
registry.fill(HIST("hZCollision"), collision.posZ());
}

// RCTFlagChecker selection
if (requireRCTFlagChecker && !rctChecker(collision)) {
return false;
}
if (isFillEventSelectionQA) {
registry.fill(HIST("hNEvents"), 10.5);
}

return true;
}

Expand Down Expand Up @@ -398,7 +425,7 @@

// ITS N hits
int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0;
for (unsigned int i = 0; i < 7; i++) {

Check failure on line 428 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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 (posdau.itsClusterMap() & (1 << i)) {
posITSNhits++;
}
Expand Down Expand Up @@ -483,15 +510,15 @@
uint16_t nchFV0 = getGenNchInFV0Aregion(mcPartSlice);

int evType = 0;
registry.fill(HIST("hNEvents"), 10.5); // INEL
registry.fill(HIST("hNEvents"), 11.5); // INEL
// Rec. collision associated with INEL>0 gen. one
if (pwglf::isINELgtNmc(mcPartSlice, 0, pdgDB)) {
registry.fill(HIST("hNEvents"), 11.5); // INEL
registry.fill(HIST("hNEvents"), 12.5); // INEL
evType++;
}
// Rec. collision associated with INEL>1 gen. one
if (pwglf::isINELgtNmc(mcPartSlice, 1, pdgDB)) {
registry.fill(HIST("hNEvents"), 12.5); // INEL
registry.fill(HIST("hNEvents"), 13.5); // INEL
evType++;
}

Expand Down Expand Up @@ -543,7 +570,7 @@

// ITS N hits
int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0;
for (unsigned int i = 0; i < 7; i++) {

Check failure on line 573 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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 (posdau.itsClusterMap() & (1 << i)) {
posITSNhits++;
}
Expand Down Expand Up @@ -664,7 +691,7 @@

registry.fill(HIST("hNchFT0MNAssocMCCollisions"), nchFT0, nAssocColl, evType);

if (numberOfContributors.size() == 2) {

Check failure on line 694 in PWGLF/TableProducer/Strangeness/cascqaanalysis.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.
std::sort(numberOfContributors.begin(), numberOfContributors.end());
registry.fill(HIST("hNContributorsCorrelation"), numberOfContributors[0], numberOfContributors[1]);
}
Expand Down
Loading
Loading