Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ using namespace o2::analysis;

namespace o2::aod
{
namespace hf_selcollision
{
DECLARE_SOA_COLUMN(WhyRejectColl, whyRejectColl, int); //!
ginnocen marked this conversation as resolved.
Outdated
Show resolved Hide resolved
} // namespace hf_selcollision

DECLARE_SOA_TABLE(HFSelCollision, "AOD", "HFSELCOLLISION", //!
hf_selcollision::WhyRejectColl);

namespace hf_seltrack
{
DECLARE_SOA_COLUMN(IsSelProng, isSelProng, int); //!
Expand All @@ -49,12 +57,12 @@ using BigTracksPID = soa::Join<BigTracks,

namespace hf_track_index
{
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(IndexV0, indexV0, int, aod::V0Datas, "_V0"); //!
DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!
DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!

DECLARE_SOA_COLUMN(D0ToKPiFlag, d0ToKPiFlag, uint8_t); //!
DECLARE_SOA_COLUMN(JpsiToEEFlag, jpsiToEEFlag, uint8_t); //!
Expand Down Expand Up @@ -445,9 +453,9 @@ DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //!
v0data::MAntiLambda<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>,
v0data::MK0Short<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>);
/*,
v0data::MLambda<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>,
v0data::MAntiLambda<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>,
v0data::MK0Short<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>);
v0data::MLambda<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>,
v0data::MAntiLambda<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>,
v0data::MK0Short<v0data::PxPos, v0data::PyPos, v0data::PzPos, v0data::PxNeg, v0data::PyNeg, v0data::PzNeg>);
*/
// extended table with expression columns that can be used as arguments of dynamic columns
DECLARE_SOA_EXTENDED_TABLE_USER(HfCandCascExt, HfCandCascBase, "HFCANDCASCEXT", //!
Expand Down
84 changes: 65 additions & 19 deletions 84 Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "DetectorsVertexing/DCAFitterN.h"
#include "AnalysisDataModel/EventSelection.h"
#include "AnalysisDataModel/HFSecondaryVertex.h"
#include "AnalysisCore/trackUtilities.h"
#include "AnalysisCore/HFConfigurables.h"
Expand Down Expand Up @@ -58,8 +59,57 @@ using MyTracks = soa::Join<aod::FullTracks, aod::HFSelTrack, aod::TracksExtended
#define MY_DEBUG_MSG(condition, cmd)
#endif

/// Event selection
struct HfTagSelCollisions {

Produces<aod::HFSelCollision> rowSelectedCollision;

Configurable<bool> doValPlots{"doValPlots", true, "fill histograms"};
Configurable<std::string> triggerClassName{"triggerClassName", "kINT7", "trigger class"};
int triggerClass = std::distance(aliasLabels, std::find(aliasLabels, aliasLabels + kNaliases, triggerClassName.value.data()));

HistogramRegistry registry{
"registry",
{{"hEvents", "Events;;entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}}}};

void init(InitContext const&)
{
std::string labels[3] = {"processed collisions", "selected collisions", "rej. trigger class"};
for (int iBin = 0; iBin < 3; iBin++) {
registry.get<TH1>(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data());
}
}

// event selection
void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision)
{
int statusCollision = 0;

if (doValPlots) {
registry.get<TH1>(HIST("hEvents"))->Fill(1);
ginnocen marked this conversation as resolved.
Outdated
Show resolved Hide resolved
}

if (!collision.alias()[triggerClass]) {
statusCollision |= BIT(0);
if (doValPlots) {
registry.get<TH1>(HIST("hEvents"))->Fill(3);
}
}

//TODO: add more event selection criteria

// selected events
if (doValPlots && statusCollision == 0) {
registry.get<TH1>(HIST("hEvents"))->Fill(2);
}

// fill table row
rowSelectedCollision(statusCollision);
};
};

/// Track selection
struct SelectTracks {
struct HfTagSelTrack {

// enum for candidate type
enum CandidateType {
Expand Down Expand Up @@ -264,7 +314,7 @@ struct SelectTracks {
//____________________________________________________________________________________________________________________________________________

/// Pre-selection of 2-prong and 3-prong secondary vertices
struct HFTrackIndexSkimsCreator {
struct HfTrackIndexSkimsCreator {
Produces<aod::HfTrackIndexProng2> rowTrackIndexProng2;
Produces<aod::HfCutStatusProng2> rowProng2CutStatus;
Produces<aod::HfTrackIndexProng3> rowTrackIndexProng3;
Expand All @@ -273,8 +323,6 @@ struct HFTrackIndexSkimsCreator {
//Configurable<int> nCollsMax{"nCollsMax", -1, "Max collisions per file"}; //can be added to run over limited collisions per file - for tesing purposes
Configurable<bool> dovalplots{"dovalplots", true, "fill histograms"};
Configurable<int> do3prong{"do3prong", 0, "do 3 prong"};
// event selection
Configurable<int> triggerindex{"triggerindex", -1, "trigger index"};
// vertexing parameters
Configurable<double> bz{"bz", 5., "magnetic field kG"};
Configurable<bool> propdca{"propdca", true, "create tracks version propagated to PCA"};
Expand Down Expand Up @@ -309,6 +357,9 @@ struct HFTrackIndexSkimsCreator {
{"hmassXicToPKPi", "#Xi_{c} candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}}}};

Filter filterSelectTracks = (aod::hf_seltrack::isSelProng > 0 && aod::hf_seltrack::isSelProng < 4);
Filter filterSelectCollisions = (aod::hf_selcollision::whyRejectColl == 0);

using SelectedCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::HFSelCollision>>;
using SelectedTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksCov, aod::TracksExtra, aod::HFSelTrack>>;

// FIXME
Expand All @@ -323,7 +374,7 @@ struct HFTrackIndexSkimsCreator {
// int nColls{0}; //can be added to run over limited collisions per file - for tesing purposes

void process( //soa::Join<aod::Collisions, aod::Cents>::iterator const& collision, //FIXME add centrality when option for variations to the process function appears
aod::Collision const& collision,
SelectedCollisions::iterator const& collision,
aod::BCs const& bcs,
SelectedTracks const& tracks)
{
Expand All @@ -341,15 +392,6 @@ struct HFTrackIndexSkimsCreator {

//auto centrality = collision.centV0M(); //FIXME add centrality when option for variations to the process function appears

int trigindex = int{triggerindex};
if (trigindex != -1) {
uint64_t triggerMask = collision.bc().triggerMask();
bool isTriggerClassFired = triggerMask & 1ul << (trigindex - 1);
if (!isTriggerClassFired) {
return;
}
}

//FIXME move above process function
const int n2ProngDecays = hf_cand_prong2::DecayType::N2ProngDecays; // number of 2-prong hadron types
const int n3ProngDecays = hf_cand_prong3::DecayType::N3ProngDecays; // number of 3-prong hadron types
Expand Down Expand Up @@ -1003,7 +1045,7 @@ struct HFTrackIndexSkimsCreator {
/// to run: o2-analysis-weak-decay-indices --aod-file AO2D.root -b | o2-analysis-lambdakzerobuilder -b |
/// o2-analysis-trackextension -b | o2-analysis-hf-track-index-skims-creator -b

struct HFTrackIndexSkimsCreatorCascades {
struct HfTrackIndexSkimsCreatorCascades {
Produces<aod::HfTrackIndexCasc> rowTrackIndexCasc;
// Produces<aod::HfTrackIndexProng2> rowTrackIndexCasc;

Expand Down Expand Up @@ -1072,9 +1114,12 @@ struct HFTrackIndexSkimsCreatorCascades {
double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus);
double mass2K0sP{0.}; // WHY HERE?

Filter filterSelectCollisions = (aod::hf_selcollision::whyRejectColl == 0);

using FullTracksExt = soa::Join<aod::FullTracks, aod::TracksExtended>;
using SelectedCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::HFSelCollision>>;

void process(aod::Collision const& collision,
void process(SelectedCollisions::iterator const& collision,
aod::BCs const& bcs,
//soa::Filtered<aod::V0Datas> const& V0s,
aod::V0Datas const& V0s,
Expand Down Expand Up @@ -1265,12 +1310,13 @@ struct HFTrackIndexSkimsCreatorCascades {
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
WorkflowSpec workflow{
adaptAnalysisTask<SelectTracks>(cfgc, TaskName{"hf-produce-sel-track"}),
adaptAnalysisTask<HFTrackIndexSkimsCreator>(cfgc, TaskName{"hf-track-index-skims-creator"})};
adaptAnalysisTask<HfTagSelCollisions>(cfgc),
adaptAnalysisTask<HfTagSelTrack>(cfgc),
adaptAnalysisTask<HfTrackIndexSkimsCreator>(cfgc)};

const bool doLcK0Sp = cfgc.options().get<bool>("do-LcK0Sp");
if (doLcK0Sp) {
workflow.push_back(adaptAnalysisTask<HFTrackIndexSkimsCreatorCascades>(cfgc, TaskName{"hf-track-index-skims-cascades-creator"}));
workflow.push_back(adaptAnalysisTask<HfTrackIndexSkimsCreatorCascades>(cfgc));
}

return workflow;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.