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
49 changes: 26 additions & 23 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/RunningWorkflowInfo.h"
#include <CCDB/BasicCCDBManager.h>
#include <CCDB/CcdbApi.h>
#include <CommonConstants/PhysicsConstants.h>
Expand All @@ -51,15 +50,16 @@
#include <Framework/AnalysisTask.h>
#include <Framework/Array2D.h>
#include <Framework/Configurable.h>
#include <Framework/DeviceSpec.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/RunningWorkflowInfo.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/Track.h>

#include <TH1.h>
#include <TH2.h>
#include <TJAlienCredentials.h>
#include <TRandom3.h>
#include <TString.h>

Expand Down Expand Up @@ -157,10 +157,7 @@ struct HfFilter { // Main struct for HF triggers
Configurable<bool> acceptBdtBkgOnly{"acceptBdtBkgOnly", true, "Enable / disable selection based on BDT bkg score only"};

// CCDB configuration
o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
int currentRun{0}; // needed to detect if the run changed and trigger update of calibrations etc.

// TPC PID calibrations
Configurable<int> setTPCCalib{"setTPCCalib", 0, "0 is not use re-calibrations, 1 is compute TPC post-calibrated n-sigmas, 2 is using TPC Spline"};
Expand All @@ -170,7 +167,7 @@ struct HfFilter { // Main struct for HF triggers
Configurable<std::string> ccdbBBAntiPion{"ccdbBBAntiPion", "Users/l/lserksny/PIDAntiPion", "Path to the CCDB ocject for antiPion BB param"};
Configurable<std::string> ccdbBBKaon{"ccdbBBKaon", "Users/l/lserksny/PIDPion", "Path to the CCDB ocject for Kaon BB param"};
Configurable<std::string> ccdbBBAntiKaon{"ccdbBBAntiKaon", "Users/l/lserksny/PIDAntiPion", "Path to the CCDB ocject for antiKaon BB param"};
Configurable<string> ccdbPathTPC{"ccdbPathTPC", "Users/i/iarsene/Calib/TPCpostCalib", "base path to the CCDB object"};
Configurable<std::string> ccdbPathTPC{"ccdbPathTPC", "Users/i/iarsene/Calib/TPCpostCalib", "base path to the CCDB object"};

// parameter for Optimisation Tree
Configurable<bool> applyOptimisation{"applyOptimisation", false, "Flag to enable or disable optimisation"};
Expand All @@ -179,6 +176,27 @@ struct HfFilter { // Main struct for HF triggers
Configurable<bool> applyDownscale{"applyDownscale", false, "Flag to enable or disable the application of downscale factors"};
Configurable<LabeledArray<double>> downscaleFactors{"downscaleFactors", {defDownscaleFactors[0], kNtriggersHF, 1, hfTriggerNames, labelsDownscaleFactor}, "Downscale factors for each trigger (from 0 to 1)"};

Service<o2::ccdb::BasicCCDBManager> ccdb;

using BigTracksMCPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe, aod::McTrackLabels>;
using BigTracksPID = soa::Join<aod::Tracks, aod::TracksWCovDcaExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe>;
using TracksIUPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullPi, aod::pidTOFFullPi>;
using CollsWithEvSel = soa::Join<aod::Collisions, aod::EvSels>;

using Hf2ProngsWithMl = soa::Join<aod::Hf2Prongs, aod::Hf2ProngMlProbs>;
using Hf3ProngsWithMl = soa::Join<aod::Hf3Prongs, aod::Hf3ProngMlProbs>;

Preslice<aod::TrackAssoc> trackIndicesPerCollision = aod::track_association::collisionId;
Preslice<aod::V0s> v0sPerCollision = aod::v0::collisionId;
Preslice<Hf2ProngsWithMl> hf2ProngPerCollision = aod::track_association::collisionId;
Preslice<Hf3ProngsWithMl> hf3ProngPerCollision = aod::track_association::collisionId;
Preslice<aod::Cascades> cascPerCollision = aod::cascade::collisionId;
Preslice<aod::V0PhotonsKF> photonsPerCollision = aod::v0photonkf::collisionId;
PresliceUnsorted<aod::AssignedTrackedCascades> trackedCascadesPerCollision = aod::track::collisionId;

o2::ccdb::CcdbApi ccdbApi;
int currentRun{0}; // needed to detect if the run changed and trigger update of calibrations etc.

// array of BDT thresholds
std::array<LabeledArray<double>, kNCharmParticles> thresholdBDTScores;

Expand All @@ -189,7 +207,6 @@ struct HfFilter { // Main struct for HF triggers
o2::vertexing::DCAFitterN<3> dfBtoDstar; // fitter for Beauty Hadron to D* vertex (3-prong vertex fitter)
o2::vertexing::DCAFitterN<2> dfStrangeness; // fitter for V0s and cascades (2-prong vertex fitter)

HistogramRegistry registry{"registry"};
std::shared_ptr<TH1> hProcessedEvents;

// QA histos
Expand Down Expand Up @@ -218,6 +235,8 @@ struct HfFilter { // Main struct for HF triggers
// helper object
HfFilterHelper helper;

HistogramRegistry registry{"registry"};

void init(InitContext& initContext)
{
helper.setHighPtTriggerThresholds(ptThresholds->get(0u, 0u), ptThresholds->get(0u, 1u));
Expand Down Expand Up @@ -404,22 +423,6 @@ struct HfFilter { // Main struct for HF triggers
thresholdBDTScores = {thresholdBDTScoreD0ToKPi, thresholdBDTScoreDPlusToPiKPi, thresholdBDTScoreDSToPiKK, thresholdBDTScoreLcToPiKP, thresholdBDTScoreXicToPiKP};
}

using BigTracksMCPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe, aod::McTrackLabels>;
using BigTracksPID = soa::Join<aod::Tracks, aod::TracksWCovDcaExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullDe, aod::pidTOFFullDe>;
using TracksIUPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullPi, aod::pidTOFFullPi>;
using CollsWithEvSel = soa::Join<aod::Collisions, aod::EvSels>;

using Hf2ProngsWithMl = soa::Join<aod::Hf2Prongs, aod::Hf2ProngMlProbs>;
using Hf3ProngsWithMl = soa::Join<aod::Hf3Prongs, aod::Hf3ProngMlProbs>;

Preslice<aod::TrackAssoc> trackIndicesPerCollision = aod::track_association::collisionId;
Preslice<aod::V0s> v0sPerCollision = aod::v0::collisionId;
Preslice<Hf2ProngsWithMl> hf2ProngPerCollision = aod::track_association::collisionId;
Preslice<Hf3ProngsWithMl> hf3ProngPerCollision = aod::track_association::collisionId;
Preslice<aod::Cascades> cascPerCollision = aod::cascade::collisionId;
Preslice<aod::V0PhotonsKF> photonsPerCollision = aod::v0photonkf::collisionId;
PresliceUnsorted<aod::AssignedTrackedCascades> trackedCascadesPerCollision = aod::track::collisionId;

void process(CollsWithEvSel const& collisions,
aod::BCsWithTimestamps const&,
aod::V0s const& v0s,
Expand Down