Skip to content

Commit 8a8ea55

Browse files
rolavickalibuild
andauthored
[PWG-UD] Adding latest cuts from event selection task as an option to DGselector (#5521)
* changing inv mass plot resolution * Rearranging TOF histos, adding histos for jpsi TPC study, fixing GT reinstallment * Start of reinstallment of Run2 Jpsi cuts * resolve problems * renaming of histos, adding histos for pion hypo but with muon mass, adding histos for tracks in pos/neg eta only * typo fix * reworking study of TPC borders effect * small fix * adding proper TPC borders cut * Adding histos as asked by Ruben * setting up event-cleaning selections from event-selection task * using the event selections in DG selector * small fix * Please consider the following formatting changes * adding include for vectors as suggested by megalinter --------- Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent d66dab9 commit 8a8ea55

5 files changed

Lines changed: 671 additions & 64 deletions

File tree

PWGUD/Core/DGCutparHolder.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ void DGCutparHolder::SetFITAmpLimits(std::vector<float> FITAmpLimits)
102102
{
103103
mFITAmpLimits = FITAmpLimits;
104104
}
105+
void DGCutparHolder::SetCollisionSel(std::vector<int> collisionSel)
106+
{
107+
mCollisionSel = collisionSel;
108+
}
105109

106110
// getter
107111
int DGCutparHolder::NDtcoll() const { return mNDtcoll; }
@@ -130,3 +134,4 @@ bool DGCutparHolder::withTCE() const { return mTCE; }
130134
bool DGCutparHolder::withTOR() const { return mTOR; }
131135
float DGCutparHolder::maxFITtime() const { return mMaxFITtime; }
132136
std::vector<float> DGCutparHolder::FITAmpLimits() const { return mFITAmpLimits; }
137+
std::vector<int> DGCutparHolder::collisionSel() const { return mCollisionSel; }

PWGUD/Core/DGCutparHolder.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class DGCutparHolder
3838
bool TCE = false,
3939
bool TOR = true,
4040
float maxFITtime = 4,
41-
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}
41+
std::vector<float> FITAmpLimits = {0., 0., 0., 0., 0.},
42+
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}
4243
{
4344
}
4445

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

6870
// getter
6971
int NDtcoll() const;
@@ -92,6 +94,7 @@ class DGCutparHolder
9294
bool withTOR() const;
9395
float maxFITtime() const;
9496
std::vector<float> FITAmpLimits() const;
97+
std::vector<int> collisionSel() const;
9598

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

147+
// collision selections to consider from event selection task
148+
std::vector<int> mCollisionSel;
149+
144150
ClassDefNV(DGCutparHolder, 1);
145151
};
146152

PWGUD/Core/DGSelector.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef PWGUD_CORE_DGSELECTOR_H_
1313
#define PWGUD_CORE_DGSELECTOR_H_
1414

15+
#include <vector>
16+
1517
#include "TDatabasePDG.h"
1618
#include "TLorentzVector.h"
1719
#include "Framework/Logger.h"
@@ -155,6 +157,33 @@ class DGSelector
155157
return 12;
156158
}
157159

160+
// good collision selection according to event-selection task
161+
/* if (!goodCollision(collision, diffCuts)){
162+
return 13;
163+
}*/
164+
// good collision selection per-partes
165+
std::vector<int> sels = diffCuts.collisionSel();
166+
// timeframe border
167+
if (sels[0] && !udhelpers::cutNoTimeFrameBorder(collision)) {
168+
return 13;
169+
}
170+
// same bunch pileup
171+
if (sels[1] && !udhelpers::cutNoSameBunchPileup(collision)) {
172+
return 14;
173+
}
174+
// ITS ROF border
175+
if (sels[2] && !udhelpers::cutNoITSROFrameBorder(collision)) {
176+
return 15;
177+
}
178+
// z-vtx from PV and FT0 agrees
179+
if (sels[3] && !udhelpers::cutIsGoodZvtxFT0vsPV(collision)) {
180+
return 16;
181+
}
182+
// is ITS-TPC track
183+
if (sels[4] && !udhelpers::cutIsVertexITSTPC(collision)) {
184+
return 17;
185+
}
186+
158187
// if we arrive here then the event is good!
159188
return 0;
160189
};

PWGUD/Core/UDHelpers.h

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,84 @@ bool FITveto(T const& bc, DGCutparHolder const& diffCuts)
540540
return false;
541541
}
542542

543+
// -----------------------------------------------------------------------------
544+
545+
template <typename T>
546+
bool cutNoTimeFrameBorder(T const& coll)
547+
// Reject collisions close to TF borders due to incomplete TPC drift volume.
548+
// https://its.cern.ch/jira/browse/O2-4623
549+
// Return true when event is good.
550+
{
551+
return coll.selection_bit(o2::aod::evsel::kNoTimeFrameBorder);
552+
}
553+
554+
// -----------------------------------------------------------------------------
555+
556+
template <typename T>
557+
bool cutNoSameBunchPileup(T const& coll)
558+
// Rejects collisions which are associated with the same "found-by-T0" bunch crossing.
559+
// Could be partially due to the pileup with another collision in the same foundBC.
560+
// See more in slides 12-14 of https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof.
561+
// Return true when event is good.
562+
{
563+
return coll.selection_bit(o2::aod::evsel::kNoSameBunchPileup);
564+
}
565+
566+
// -----------------------------------------------------------------------------
567+
568+
template <typename T>
569+
bool cutNoITSROFrameBorder(T const& coll)
570+
// Reject events affected by the ITS ROF border.
571+
// https://its.cern.ch/jira/browse/O2-4309
572+
// Return true when event is good.
573+
{
574+
return coll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder);
575+
}
576+
577+
// -----------------------------------------------------------------------------
578+
579+
template <typename T>
580+
bool cutIsGoodZvtxFT0vsPV(T const& coll)
581+
// Removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference.
582+
// The large vertexZ difference can be due to the in-bunch pileup or wrong BC assigned to a collision.
583+
// Return true when event is good.
584+
{
585+
return coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV);
586+
}
587+
588+
// -----------------------------------------------------------------------------
589+
590+
template <typename T>
591+
bool cutIsVertexITSTPC(T const& coll)
592+
// Selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks.
593+
// Has an effect only on the pp data, in Pb-Pb ITS-only vertices are already rejected by default.
594+
// Return true when event is good.
595+
{
596+
return coll.selection_bit(o2::aod::evsel::kIsVertexITSTPC);
597+
}
598+
599+
// -----------------------------------------------------------------------------
600+
601+
template <typename T>
602+
bool goodCollision(T const& coll, DGCutparHolder const& diffCuts)
603+
// Return true if collision is accepted according to user-chosen rules from event selection task
604+
{
605+
bool accepted = true;
606+
std::vector<int> sels = diffCuts.collisionSel();
607+
if (sels[0])
608+
accepted = cutNoTimeFrameBorder(coll);
609+
if (sels[1])
610+
accepted = cutNoSameBunchPileup(coll);
611+
if (sels[2])
612+
accepted = cutNoITSROFrameBorder(coll);
613+
if (sels[3])
614+
accepted = cutIsGoodZvtxFT0vsPV(coll);
615+
if (sels[4])
616+
accepted = cutIsVertexITSTPC(coll);
617+
618+
return accepted;
619+
}
620+
543621
// -----------------------------------------------------------------------------
544622
// fill BB and BG information into FITInfo
545623
template <typename BCR>

0 commit comments

Comments
 (0)