Skip to content

Commit 7474d81

Browse files
authored
Merge branch 'master' into lambda-r2-update
2 parents ff80ec5 + 9775a2d commit 7474d81

62 files changed

Lines changed: 7091 additions & 2205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/Core/CollisionAssociation.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ enum TrackSelection {
4646
QualityTracksITS = 2
4747
};
4848

49+
enum PVContrReassocOpt {
50+
Disabled = 0,
51+
OnlySameBc = 1,
52+
SameBcAndLowMult = 2
53+
};
54+
4955
} // namespace track_association
5056
} // namespace o2::aod
5157

@@ -59,10 +65,11 @@ class CollisionAssociation
5965
void setNumSigmaForTimeCompat(float nSigma) { mNumSigmaForTimeCompat = nSigma; }
6066
void setTimeMargin(float timeMargin) { mTimeMargin = timeMargin; }
6167
void setTrackSelectionOptionForStdAssoc(int option) { mTrackSelection = option; }
62-
void setUsePvAssociation(bool enable = true) { mUsePvAssociation = enable; }
68+
void setUsePvAssociation(int option = o2::aod::track_association::PVContrReassocOpt::OnlySameBc) { mUsePvAssociation = option; }
6369
void setIncludeUnassigned(bool enable = true) { mIncludeUnassigned = enable; }
6470
void setFillTableOfCollIdsPerTrack(bool fill = true) { mFillTableOfCollIdsPerTrack = fill; }
6571
void setBcWindow(int bcWindow = 115) { mBcWindowForOneSigma = bcWindow; }
72+
void setMaxPvContributorsForLowMultReassoc(int pvContributorsMax) { mMaxPvContributorsForLowMultReassoc = pvContributorsMax; }
6673

6774
template <typename TTracks, typename Slice, typename Assoc, typename RevIndices>
6875
void runStandardAssoc(o2::aod::Collisions const& collisions,
@@ -234,7 +241,7 @@ class CollisionAssociation
234241
float trackTime = 0;
235242
float trackTimeRes = 0;
236243
if constexpr (isCentralBarrel) {
237-
if (mUsePvAssociation && trackInWindow.isPVContributor()) {
244+
if ((mUsePvAssociation == o2::aod::track_association::PVContrReassocOpt::OnlySameBc && trackInWindow.isPVContributor()) || (mUsePvAssociation == o2::aod::track_association::PVContrReassocOpt::SameBcAndLowMult && trackInWindow.isPVContributor() && trackInWindow.collision().numContrib() > mMaxPvContributorsForLowMultReassoc)) {
238245
trackTime = trackInWindow.collision().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
239246
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
240247
} else {
@@ -252,7 +259,7 @@ class CollisionAssociation
252259

253260
float thresholdTime = 0.;
254261
if constexpr (isCentralBarrel) {
255-
if (mUsePvAssociation && trackInWindow.isPVContributor()) {
262+
if ((mUsePvAssociation == o2::aod::track_association::PVContrReassocOpt::OnlySameBc && trackInWindow.isPVContributor()) || (mUsePvAssociation == o2::aod::track_association::PVContrReassocOpt::SameBcAndLowMult && trackInWindow.isPVContributor() && trackInWindow.collision().numContrib() > mMaxPvContributorsForLowMultReassoc)) {
256263
thresholdTime = trackTimeRes;
257264
} else if (TESTBIT(trackInWindow.flags(), o2::aod::track::TrackTimeResIsRange)) {
258265
// the track time resolution is a range, not a gaussian resolution
@@ -306,7 +313,8 @@ class CollisionAssociation
306313
float mNumSigmaForTimeCompat{4.}; // number of sigma for time compatibility
307314
float mTimeMargin{500.}; // additional time margin in ns
308315
int mTrackSelection{o2::aod::track_association::TrackSelection::GlobalTrackWoDCA}; // track selection for central barrel tracks (standard association only)
309-
bool mUsePvAssociation{true}; // use the information of PV contributors
316+
int mUsePvAssociation{1}; // use the information of PV contributors (0: off, 1: reassociate only with collisions in the same BC, 2: reassociate with collisions in the same BC, or within time resolution in case of low mult PVs)
317+
int mMaxPvContributorsForLowMultReassoc{10}; // maximum value of PV contributors to reassociate tracks that are PV contributors to other vertices
310318
bool mIncludeUnassigned{true}; // include tracks that were originally not assigned to any collision
311319
bool mFillTableOfCollIdsPerTrack{false}; // fill additional table with vectors of compatible collisions per track
312320
int mBcWindowForOneSigma{115}; // BC window to be multiplied by the number of sigmas to define maximum window to be considered

Common/TableProducer/fwdtrackToCollisionAssociator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct FwdTrackToCollisionAssociation {
6363
collisionAssociator.setNumSigmaForTimeCompat(nSigmaForTimeCompat);
6464
collisionAssociator.setTimeMargin(timeMargin);
6565
collisionAssociator.setTrackSelectionOptionForStdAssoc(track_association::TrackSelection::None);
66-
collisionAssociator.setUsePvAssociation(false);
66+
collisionAssociator.setUsePvAssociation(track_association::PVContrReassocOpt::Disabled);
6767
collisionAssociator.setIncludeUnassigned(includeUnassigned);
6868
collisionAssociator.setFillTableOfCollIdsPerTrack(fillTableOfCollIdsPerTrack);
6969
collisionAssociator.setBcWindow(bcWindowForOneSigma);

Common/TableProducer/trackToCollisionAssociator.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ struct TrackToCollisionAssociation {
3939
Configurable<float> nSigmaForTimeCompat{"nSigmaForTimeCompat", 4.f, "number of sigmas for time compatibility"};
4040
Configurable<float> timeMargin{"timeMargin", 0.f, "time margin in ns added to uncertainty because of uncalibrated TPC"};
4141
Configurable<int> setTrackSelections{"setTrackSelections", 1, "flag to apply track selections: -1=minimal track selection for Run 2 (standard association); 0=none; 1=global track w/o DCA selection; 2=only ITS quality"};
42-
Configurable<bool> usePVAssociation{"usePVAssociation", true, "if the track is a PV contributor, use the collision time for it"};
42+
Configurable<int> usePVAssociation{"usePVAssociation", 1, "use information of PV contribution in reassociation; 0 -> off, 1 -> reassociate only with collisions in the same BC, 2 -> as 1 only for tracks associated to high multiplicity vertices"};
4343
Configurable<bool> includeUnassigned{"includeUnassigned", false, "consider also tracks which are not assigned to any collision"};
4444
Configurable<bool> fillTableOfCollIdsPerTrack{"fillTableOfCollIdsPerTrack", false, "fill additional table with vector of collision ids per track"};
4545
Configurable<int> bcWindowForOneSigma{"bcWindowForOneSigma", 60, "BC window to be multiplied by the number of sigmas to define maximum window to be considered"};
46+
Configurable<int> maxPvContributorsForLowMultReassoc{"maxPvContributorsForLowMultReassoc", 10, "Maximum number of PV contributors to consider a collision at low multiplicity and reassociate tracks even if PV contributors if enabled"};
4647

4748
CollisionAssociation<true> collisionAssociator;
4849

@@ -67,6 +68,7 @@ struct TrackToCollisionAssociation {
6768
collisionAssociator.setIncludeUnassigned(includeUnassigned);
6869
collisionAssociator.setFillTableOfCollIdsPerTrack(fillTableOfCollIdsPerTrack);
6970
collisionAssociator.setBcWindow(bcWindowForOneSigma);
71+
collisionAssociator.setMaxPvContributorsForLowMultReassoc(maxPvContributorsForLowMultReassoc);
7072
}
7173

7274
void processAssocWithTime(Collisions const& collisions, TracksWithSel const& tracksUnfiltered, TracksWithSelFilter const& tracks, AmbiguousTracks const& ambiguousTracks, BCs const& bcs)

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ struct HfFilter { // Main struct for HF triggers
492492
bool isSelectedPvZ = (std::fabs(collision.posZ()) < evSel.maxPvZ);
493493
if (!isSelectedTVX || !isSelectedTFBorder || !isSelectedITSROFBorder || !isSelectedPvZ) {
494494
tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P], keepEvent[kCharmBarToXi2Bach], keepEvent[kPrCharm2P], keepEvent[kBtoJPsiKa], keepEvent[kBtoJPsiKstar], keepEvent[kBtoJPsiPhi], keepEvent[kBtoJPsiPrKa], keepEvent[kBtoJPsiPi], keepEvent[kSigmaCPr]);
495+
hProcessedEvents->Fill(1); // rejected
495496
continue;
496497
}
497498

EventFiltering/macros/uploadOTSobjects.C

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ void uploadOTSobjects(std::string inputList, std::string passName, bool useAlien
7575
if (!hCounterTVX) {
7676
hCounterTVX = static_cast<TH1*>(scalersFile->Get("lumi-task/hCounterTVX"));
7777
if (!hCounterTVX) {
78-
std::cout << "No hCounterTVX histogram found in the file, skipping upload for run " << runString << std::endl;
79-
continue;
78+
hCounterTVX = static_cast<TH1*>(scalersFile->Get("eventselection-run3/luminosity/hCounterTVX"));
79+
if (!hCounterTVX) {
80+
std::cout << "No hCounterTVX histogram found in the file, skipping upload for run " << runString << std::endl;
81+
continue;
82+
}
8083
}
8184
}
8285
api.storeAsTFile(hCounterTVX, baseCCDBpath + "InspectedTVX", metadata, duration.first, duration.second + 1);

PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,41 @@ using namespace o2;
5353
using namespace o2::framework;
5454
using namespace o2::framework::expressions;
5555

56+
namespace o2::aod
57+
{
58+
59+
// ===== Event columns =====
60+
DECLARE_SOA_COLUMN(EventId, eventId, int);
61+
DECLARE_SOA_COLUMN(MyCent, myCent, float);
62+
DECLARE_SOA_COLUMN(Vz, vz, float);
63+
DECLARE_SOA_COLUMN(Ntrk, ntrk, int);
64+
DECLARE_SOA_COLUMN(Np, np, int);
65+
DECLARE_SOA_COLUMN(Npbar, npbar, int);
66+
67+
// ===== Track columns =====
68+
DECLARE_SOA_COLUMN(Pt, pt, float);
69+
DECLARE_SOA_COLUMN(Eta, eta, float);
70+
DECLARE_SOA_COLUMN(Pid, pid, int);
71+
DECLARE_SOA_COLUMN(Eff, eff, float);
72+
73+
// ===== Tables =====
74+
DECLARE_SOA_TABLE(EventTable, "AOD", "MYEVENT",
75+
EventId,
76+
MyCent,
77+
Vz,
78+
Ntrk,
79+
Np,
80+
Npbar);
81+
82+
DECLARE_SOA_TABLE(MYTrackTable, "AOD", "MYTRACK",
83+
EventId,
84+
Pt,
85+
Eta,
86+
Pid,
87+
Eff);
88+
89+
} // namespace o2::aod
90+
5691
struct NetProtCumulants {
5792
// events
5893
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
@@ -110,6 +145,26 @@ struct NetProtCumulants {
110145

111146
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
112147

148+
Produces<aod::EventTable> eventTable;
149+
Produces<aod::MYTrackTable> trackTable;
150+
151+
int eventCounter = 0;
152+
int eventId = 0;
153+
154+
// event variables
155+
int Ntrk_event = 0;
156+
int Np_event = 0;
157+
int Npbar_event = 0;
158+
159+
float cent_event = 0;
160+
float vz_event = 0;
161+
162+
// track variables
163+
float pt_track = 0;
164+
float eta_track = 0;
165+
int pid_track = 0;
166+
float eff_track = 0;
167+
113168
TRandom3* fRndm = new TRandom3(0);
114169

115170
// Eff histograms 2d: eff(pT, eta)
@@ -855,6 +910,7 @@ struct NetProtCumulants {
855910
if (cfgUsePtDepDCAz) {
856911
fPtDepDCAz = new TF1("ptDepDCAz", cfgDCAzFunc->c_str(), 0.001, 10.0);
857912
}
913+
858914
} // end init()
859915

860916
template <typename T>
@@ -2134,6 +2190,18 @@ struct NetProtCumulants {
21342190

21352191
void processDataRec(AodCollisions::iterator const& coll, aod::BCsWithTimestamps const&, AodTracks const& inputTracks)
21362192
{
2193+
2194+
// reset per event
2195+
Ntrk_event = 0;
2196+
Np_event = 0;
2197+
Npbar_event = 0;
2198+
2199+
// assign event ID
2200+
eventId = eventCounter++;
2201+
2202+
// store event info
2203+
cent_event = coll.centFT0C();
2204+
vz_event = coll.posZ();
21372205
if (!coll.sel8()) {
21382206
return;
21392207
}
@@ -2263,6 +2331,7 @@ struct NetProtCumulants {
22632331
if (cfgIfMandatoryTOF && !track.hasTOF()) {
22642332
continue;
22652333
}
2334+
Ntrk_event++;
22662335

22672336
bool trackSelected = false;
22682337
if (cfgPIDchoice == 0)
@@ -2293,11 +2362,18 @@ struct NetProtCumulants {
22932362

22942363
if (track.pt() < cfgCutPtUpper) {
22952364
nProt = nProt + 1.0;
2365+
Np_event++;
22962366
float pEff = getEfficiency(track); // get efficiency of track
22972367
if (pEff != 0) {
22982368
for (int i = 1; i < 7; i++) {
22992369
powerEffProt[i] += std::pow(1.0 / pEff, i);
23002370
}
2371+
pt_track = track.pt();
2372+
eta_track = track.eta();
2373+
pid_track = +1;
2374+
eff_track = pEff;
2375+
2376+
trackTable(eventId, pt_track, eta_track, pid_track, eff_track);
23012377
}
23022378
}
23032379
}
@@ -2311,18 +2387,27 @@ struct NetProtCumulants {
23112387
histos.fill(HIST("hrecDcaZAntiproton"), track.dcaZ());
23122388
if (track.pt() < cfgCutPtUpper) {
23132389
nAntiprot = nAntiprot + 1.0;
2390+
Npbar_event++;
23142391
float pEff = getEfficiency(track); // get efficiency of track
23152392
if (pEff != 0) {
23162393
for (int i = 1; i < 7; i++) {
23172394
powerEffAntiprot[i] += std::pow(1.0 / pEff, i);
23182395
}
2396+
pt_track = track.pt();
2397+
eta_track = track.eta();
2398+
pid_track = -1;
2399+
eff_track = pEff;
2400+
2401+
trackTable(eventId, pt_track, eta_track, pid_track, eff_track);
23192402
}
23202403
}
23212404
}
23222405

23232406
} //! checking PID
23242407
} //! end track loop
23252408

2409+
eventTable(eventId, cent_event, vz_event, Ntrk_event, Np_event, Npbar_event);
2410+
23262411
float netProt = nProt - nAntiprot;
23272412
float nTracks = nProt + nAntiprot;
23282413
histos.fill(HIST("hNTracksVsCent"), cent, nTracks);

PWGCF/Femto/Core/pairHistManager.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ enum PairHist {
100100

101101
// mixing qa
102102
kSeNpart1VsNpart2, // number of unique particles 1 vs unique number of particles 2 in each same event
103-
kMeMixingWindow, // mixing window size
103+
kMeMixingWindowRaw, // mixing window size
104+
kMeMixingWindowEffective, // mixing window size, counting event pairs with particle pairs
104105
kMeNpart1VsNpart2, // number of unique particles 1 vs number of unique particles 2 in each mixed event
105106
kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2, // correlation of event properties in each mixing bin
106107

@@ -233,7 +234,8 @@ constexpr std::array<histmanager::HistInfo<PairHist>, kPairHistogramLast>
233234
{kTrueMultVsMult, o2::framework::HistType::kTH2F, "hTrueMultVsMult", "Multiplicity_{True} vs Multiplicity; Multiplicity_{True} ; Multiplicity"},
234235
{kTrueCentVsCent, o2::framework::HistType::kTH2F, "hTrueCentVsCent", "Centrality_{True} vs Centrality; Centrality_{True} (%); Centrality (%)"},
235236
{kSeNpart1VsNpart2, o2::framework::HistType::kTH2F, "hSeNpart1VsNpart2", "# unique particle 1 vs # unique particle 2 in each same event; # partilce 1; # particle 2"},
236-
{kMeMixingWindow, o2::framework::HistType::kTH1F, "hMeMixingWindow", "Mixing Window; Mixing Windown ; Entries"},
237+
{kMeMixingWindowRaw, o2::framework::HistType::kTH1F, "hMeMixingWindowRaw", "Raw Mixing Window; Raw Mixing Window ; Entries"},
238+
{kMeMixingWindowEffective, o2::framework::HistType::kTH1F, "hMeMixingWindowEffective", "Effective Mixing Window; Effective Mixing Windown ; Entries"},
237239
{kMeNpart1VsNpart2, o2::framework::HistType::kTH2F, "hMeNpart1VsNpart2", "# unique particle 1 vs # unique partilce 2 in each mixing bin; # partilce 1; # particle 2"},
238240
{kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2, o2::framework::HistType::kTHnSparseF, "hVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2", "Mixing bins; V_{z,1} (cm); multiplicity_{1}; centrality_{1} (%); V_{z,2} (cm); multiplicity_{2}; centrality_{2} (%)"},
239241
}};
@@ -276,7 +278,8 @@ constexpr std::array<histmanager::HistInfo<PairHist>, kPairHistogramLast>
276278
{kKstarVsMtVsMinvVsPt1VsPt2VsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.massInv, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity, confAnalysis.centrality}}, \
277279
{kDalitz, {confAnalysis.kstar, confAnalysis.dalitzMtot, confAnalysis.dalitzM12, confAnalysis.dalitzM13}}, \
278280
{kSeNpart1VsNpart2, {confMixing.particleBinning, confMixing.particleBinning}}, \
279-
{kMeMixingWindow, {confMixing.particleBinning}}, \
281+
{kMeMixingWindowRaw, {confMixing.particleBinning}}, \
282+
{kMeMixingWindowEffective, {confMixing.particleBinning}}, \
280283
{kMeNpart1VsNpart2, {confMixing.particleBinning, confMixing.particleBinning}}, \
281284
{kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2, {confMixing.vtxBins, confMixing.multBins, confMixing.centBins, confMixing.vtxBins, confMixing.multBins, confMixing.centBins}},
282285

@@ -599,7 +602,9 @@ class PairHistManager
599602
void resetTrackedParticlesPerEvent()
600603
{
601604
mParticles1PerEvent.clear();
605+
mParticles1PerEvent.reserve(100);
602606
mParticles2PerEvent.clear();
607+
mParticles2PerEvent.reserve(100);
603608
}
604609

605610
void fillMixingQaSe()
@@ -616,10 +621,11 @@ class PairHistManager
616621
}
617622
}
618623

619-
void fillMixingQaMePerMixingBin(int windowSize)
624+
void fillMixingQaMePerMixingBin(int windowSizeRaw, int windowSizeEffective)
620625
{
621-
if (mEventMixingQa) {
622-
mHistogramRegistry->fill(HIST(prefix) + HIST(MixingQaDir) + HIST(getHistName(kMeMixingWindow, HistTable)), windowSize);
626+
if (mPairCorrelationQa) {
627+
mHistogramRegistry->fill(HIST(prefix) + HIST(MixingQaDir) + HIST(getHistName(kMeMixingWindowRaw, HistTable)), windowSizeRaw);
628+
mHistogramRegistry->fill(HIST(prefix) + HIST(MixingQaDir) + HIST(getHistName(kMeMixingWindowEffective, HistTable)), windowSizeEffective);
623629
}
624630
}
625631

@@ -732,7 +738,8 @@ class PairHistManager
732738
{
733739
std::string mcDir = std::string(prefix) + std::string(MixingQaDir);
734740
if (mPairCorrelationQa) {
735-
mHistogramRegistry->add(mcDir + getHistNameV2(kMeMixingWindow, HistTable), getHistDesc(kMeMixingWindow, HistTable), getHistType(kMeMixingWindow, HistTable), {Specs.at(kMeMixingWindow)});
741+
mHistogramRegistry->add(mcDir + getHistNameV2(kMeMixingWindowRaw, HistTable), getHistDesc(kMeMixingWindowRaw, HistTable), getHistType(kMeMixingWindowRaw, HistTable), {Specs.at(kMeMixingWindowRaw)});
742+
mHistogramRegistry->add(mcDir + getHistNameV2(kMeMixingWindowEffective, HistTable), getHistDesc(kMeMixingWindowEffective, HistTable), getHistType(kMeMixingWindowEffective, HistTable), {Specs.at(kMeMixingWindowEffective)});
736743
mHistogramRegistry->add(mcDir + getHistNameV2(kMeNpart1VsNpart2, HistTable), getHistDesc(kMeNpart1VsNpart2, HistTable), getHistType(kMeNpart1VsNpart2, HistTable), {Specs.at(kMeNpart1VsNpart2)});
737744
}
738745
if (mEventMixingQa) {

0 commit comments

Comments
 (0)