Skip to content

Commit

Permalink
updating nuclei task for skimming (AliceO2Group#5275)
Browse files Browse the repository at this point in the history
* updating nuclei task for skimming

* clang fixes
  • Loading branch information
akalweit authored and jgrosseo committed Aug 18, 2021
1 parent a055879 commit 839d07a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Tasks/PWGLF/CMakeLists.txt
Expand Up @@ -45,7 +45,7 @@ o2_add_dpl_workflow(spectra-tpc-tiny

o2_add_dpl_workflow(nuclei-spectra
SOURCES NucleiSpectraTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(lambdakzerobuilder
Expand Down
60 changes: 40 additions & 20 deletions Tasks/PWGLF/NucleiSpectraTask.cxx
Expand Up @@ -17,9 +17,9 @@
#include "AnalysisDataModel/PID/PIDResponse.h"
#include "AnalysisDataModel/TrackSelectionTables.h"

// #include "AnalysisDataModel/EventSelection.h"
// #include "AnalysisDataModel/TrackSelectionTables.h"
// #include "AnalysisDataModel/Centrality.h"
#include "AnalysisDataModel/EventSelection.h"
#include "AnalysisDataModel/TrackSelectionTables.h"
#include "AnalysisDataModel/Centrality.h"

#include "Framework/HistogramRegistry.h"

Expand All @@ -43,45 +43,65 @@ struct NucleiSpecraTask {
AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"};
AxisSpec centAxis = {centBinning, "V0M (%)"};

spectra.add("fCollZpos", "collision z position", HistType::kTH1F, {{600, -20., +20., "z position (cm)"}});
spectra.add("fKeepEvent", "skimming histogram", HistType::kTH1F, {{2, -0.5, +1.5, "true: keep event, false: reject event"}});
spectra.add("fTPCsignal", "Specific energy loss", HistType::kTH2F, {{600, 0., 3, "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}});

spectra.add("fTPCcounts", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -5, 5, "n#sigma_{d} (a. u.)"}});
spectra.add("fTPCcounts", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -100., +100., "n#sigma_{He} (a. u.)"}});
}

Configurable<float> yMin{"yMin", -0.5, "Maximum rapidity"};
Configurable<float> yMax{"yMax", 0.5, "Minimum rapidity"};
Configurable<float> yMin{"yMin", -0.8, "Maximum rapidity"};
Configurable<float> yMax{"yMax", 0.8, "Minimum rapidity"};
Configurable<float> yBeam{"yBeam", 0., "Beam rapidity"};

Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"};
Configurable<float> nsigmacut{"nsigmacut", 3, "Value of the Nsigma cut"};
Configurable<float> nsigmacutLow{"nsigmacutLow", -30.0, "Value of the Nsigma cut"};
Configurable<float> nsigmacutHigh{"nsigmacutHigh", +3., "Value of the Nsigma cut"};

Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::isGlobalTrack == (uint8_t) true);

using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::pidRespTOFbeta, aod::TrackSelection>>;

void process(/*soa::Join<aod::Collisions, aod::EvSels, aod::Cents> aod::Collisions::iterator const& col, */ TrackCandidates const& tracks)
void process(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator const& collision, aod::BCsWithTimestamps const&, TrackCandidates const& tracks)
{
/*
if (!col.alias()[kINT7])
//
// collision process loop
//
bool keepEvent = kFALSE;
if (!collision.alias()[kINT7]) {
return;
if (!col.sel7())
}
if (!collision.sel7()) {
return;
fMultiplicity->Fill(col.centV0M());
*/
for (auto track : tracks) {
}
//
spectra.fill(HIST("fCollZpos"), collision.posZ());
//
for (auto track : tracks) { // start loop over tracks

TLorentzVector cutVector{};
cutVector.SetPtEtaPhiM(track.pt(), track.eta(), track.phi(), constants::physics::MassDeuteron);
cutVector.SetPtEtaPhiM(track.pt() * 2.0, track.eta(), track.phi(), constants::physics::MassHelium3);
if (cutVector.Rapidity() < yMin + yBeam || cutVector.Rapidity() > yMax + yBeam) {
continue;
}

//
// fill QA histograms
//
spectra.fill(HIST("fTPCsignal"), track.tpcInnerParam(), track.tpcSignal());
spectra.fill(HIST("fTPCcounts"), fabs(track.pt()), track.tpcNSigmaDe());
}
spectra.fill(HIST("fTPCcounts"), track.tpcInnerParam(), track.tpcNSigmaHe());
//
// check offline-trigger (skimming) condidition
//
if (track.tpcNSigmaHe() > nsigmacutLow && track.tpcNSigmaHe() < nsigmacutHigh) {
keepEvent = kTRUE;
}

} // end loop over tracks
//
// fill trigger (skimming) results
//
spectra.fill(HIST("fKeepEvent"), keepEvent);
}
};

Expand Down

0 comments on commit 839d07a

Please sign in to comment.