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
5 changes: 5 additions & 0 deletions PWGUD/Core/DGCutparHolder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ void DGCutparHolder::SetFITAmpLimits(std::vector<float> FITAmpLimits)
{
mFITAmpLimits = FITAmpLimits;
}
void DGCutparHolder::SetCollisionSel(std::vector<int> collisionSel)
{
mCollisionSel = collisionSel;
}

// getter
int DGCutparHolder::NDtcoll() const { return mNDtcoll; }
Expand Down Expand Up @@ -130,3 +134,4 @@ bool DGCutparHolder::withTCE() const { return mTCE; }
bool DGCutparHolder::withTOR() const { return mTOR; }
float DGCutparHolder::maxFITtime() const { return mMaxFITtime; }
std::vector<float> DGCutparHolder::FITAmpLimits() const { return mFITAmpLimits; }
std::vector<int> DGCutparHolder::collisionSel() const { return mCollisionSel; }
8 changes: 7 additions & 1 deletion PWGUD/Core/DGCutparHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class DGCutparHolder
bool TCE = false,
bool TOR = true,
float maxFITtime = 4,
std::vector<float> FITAmpLimits = {0., 0., 0., 0., 0.}) : mNDtcoll{ndtcoll}, mMinNBCs{nMinBCs}, mWithFwdTracks{withFwdTracks}, mGlobalTracksOnly{globalTracksOnly}, mITSOnlyTracks{ITSonlyTracks}, mMinRgtrwTOF{minrgtrwTOF}, mMinNTracks{MinNTracks}, mMaxNTracks{MaxNTracks}, mNetCharges{NetCharges}, mPidHypo{pidHypo}, mMinVertexPosz{MinPosz}, mMaxVertexPosz{MaxPosz}, mMinPt{minPt}, mMaxPt{maxPt}, mMinEta{minEta}, mMaxEta{maxEta}, mMinIVM{minIVM}, mMaxIVM{maxIVM}, mMaxNSigmaTPC{maxNSigmaTPC}, mMaxNSigmaTOF{maxNSigmaTOF}, mTVX{TVX}, mTSC{TSC}, mTCE{TCE}, mTOR{TOR}, mMaxFITtime{maxFITtime}, mFITAmpLimits{FITAmpLimits}
std::vector<float> FITAmpLimits = {0., 0., 0., 0., 0.},
std::vector<int> collisionSel = {0, 0, 0, 0, 0}) : mNDtcoll{ndtcoll}, mMinNBCs{nMinBCs}, mWithFwdTracks{withFwdTracks}, mGlobalTracksOnly{globalTracksOnly}, mITSOnlyTracks{ITSonlyTracks}, mMinRgtrwTOF{minrgtrwTOF}, mMinNTracks{MinNTracks}, mMaxNTracks{MaxNTracks}, mNetCharges{NetCharges}, mPidHypo{pidHypo}, mMinVertexPosz{MinPosz}, mMaxVertexPosz{MaxPosz}, mMinPt{minPt}, mMaxPt{maxPt}, mMinEta{minEta}, mMaxEta{maxEta}, mMinIVM{minIVM}, mMaxIVM{maxIVM}, mMaxNSigmaTPC{maxNSigmaTPC}, mMaxNSigmaTOF{maxNSigmaTOF}, mTVX{TVX}, mTSC{TSC}, mTCE{TCE}, mTOR{TOR}, mMaxFITtime{maxFITtime}, mFITAmpLimits{FITAmpLimits}, mCollisionSel{collisionSel}
{
}

Expand All @@ -64,6 +65,7 @@ class DGCutparHolder
void SetTOR(bool tor);
void SetMaxFITtime(float maxFITtime);
void SetFITAmpLimits(std::vector<float> FITAmpLimits);
void SetCollisionSel(std::vector<int> collisionSel);

// getter
int NDtcoll() const;
Expand Down Expand Up @@ -92,6 +94,7 @@ class DGCutparHolder
bool withTOR() const;
float maxFITtime() const;
std::vector<float> FITAmpLimits() const;
std::vector<int> collisionSel() const;

private:
// number of collision time resolutions to consider
Expand Down Expand Up @@ -141,6 +144,9 @@ class DGCutparHolder
// lower limits for FIT signals
std::vector<float> mFITAmpLimits;

// collision selections to consider from event selection task
std::vector<int> mCollisionSel;

ClassDefNV(DGCutparHolder, 1);
};

Expand Down
29 changes: 29 additions & 0 deletions PWGUD/Core/DGSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef PWGUD_CORE_DGSELECTOR_H_
#define PWGUD_CORE_DGSELECTOR_H_

#include <vector>

#include "TDatabasePDG.h"
#include "TLorentzVector.h"
#include "Framework/Logger.h"
Expand Down Expand Up @@ -155,6 +157,33 @@ class DGSelector
return 12;
}

// good collision selection according to event-selection task
/* if (!goodCollision(collision, diffCuts)){
return 13;
}*/
// good collision selection per-partes
std::vector<int> sels = diffCuts.collisionSel();
// timeframe border
if (sels[0] && !udhelpers::cutNoTimeFrameBorder(collision)) {
return 13;
}
// same bunch pileup
if (sels[1] && !udhelpers::cutNoSameBunchPileup(collision)) {
return 14;
}
// ITS ROF border
if (sels[2] && !udhelpers::cutNoITSROFrameBorder(collision)) {
return 15;
}
// z-vtx from PV and FT0 agrees
if (sels[3] && !udhelpers::cutIsGoodZvtxFT0vsPV(collision)) {
return 16;
}
// is ITS-TPC track
if (sels[4] && !udhelpers::cutIsVertexITSTPC(collision)) {
return 17;
}

// if we arrive here then the event is good!
return 0;
};
Expand Down
78 changes: 78 additions & 0 deletions PWGUD/Core/UDHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,84 @@ bool FITveto(T const& bc, DGCutparHolder const& diffCuts)
return false;
}

// -----------------------------------------------------------------------------

template <typename T>
bool cutNoTimeFrameBorder(T const& coll)
// Reject collisions close to TF borders due to incomplete TPC drift volume.
// https://its.cern.ch/jira/browse/O2-4623
// Return true when event is good.
{
return coll.selection_bit(o2::aod::evsel::kNoTimeFrameBorder);
}

// -----------------------------------------------------------------------------

template <typename T>
bool cutNoSameBunchPileup(T const& coll)
// Rejects collisions which are associated with the same "found-by-T0" bunch crossing.
// Could be partially due to the pileup with another collision in the same foundBC.
// See more in slides 12-14 of https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof.
// Return true when event is good.
{
return coll.selection_bit(o2::aod::evsel::kNoSameBunchPileup);
}

// -----------------------------------------------------------------------------

template <typename T>
bool cutNoITSROFrameBorder(T const& coll)
// Reject events affected by the ITS ROF border.
// https://its.cern.ch/jira/browse/O2-4309
// Return true when event is good.
{
return coll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder);
}

// -----------------------------------------------------------------------------

template <typename T>
bool cutIsGoodZvtxFT0vsPV(T const& coll)
// Removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference.
// The large vertexZ difference can be due to the in-bunch pileup or wrong BC assigned to a collision.
// Return true when event is good.
{
return coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV);
}

// -----------------------------------------------------------------------------

template <typename T>
bool cutIsVertexITSTPC(T const& coll)
// Selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks.
// Has an effect only on the pp data, in Pb-Pb ITS-only vertices are already rejected by default.
// Return true when event is good.
{
return coll.selection_bit(o2::aod::evsel::kIsVertexITSTPC);
}

// -----------------------------------------------------------------------------

template <typename T>
bool goodCollision(T const& coll, DGCutparHolder const& diffCuts)
// Return true if collision is accepted according to user-chosen rules from event selection task
{
bool accepted = true;
std::vector<int> sels = diffCuts.collisionSel();
if (sels[0])
accepted = cutNoTimeFrameBorder(coll);
if (sels[1])
accepted = cutNoSameBunchPileup(coll);
if (sels[2])
accepted = cutNoITSROFrameBorder(coll);
if (sels[3])
accepted = cutIsGoodZvtxFT0vsPV(coll);
if (sels[4])
accepted = cutIsVertexITSTPC(coll);

return accepted;
}

// -----------------------------------------------------------------------------
// fill BB and BG information into FITInfo
template <typename BCR>
Expand Down
Loading