Skip to content

Commit 55af663

Browse files
authored
[PWGUD] redifine the default cuts and diphistar cut (#14530)
1 parent f07cf36 commit 55af663

File tree

2 files changed

+298
-211
lines changed

2 files changed

+298
-211
lines changed

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 99 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct CalcNchUpc {
6969

7070
using UdTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>;
7171
using UdTracksFull = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>;
72-
using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced>;
72+
using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::UDCollisionSelExtras>;
7373

7474
Produces<aod::Multiplicity> multiplicityNch;
7575

@@ -103,6 +103,9 @@ struct FlowCorrelationsUpc {
103103
O2_DEFINE_CONFIGURABLE(cfgSampleSize, double, 10, "Sample size for mixed event")
104104
O2_DEFINE_CONFIGURABLE(cfgUsePtOrder, bool, true, "enable trigger pT < associated pT cut")
105105
O2_DEFINE_CONFIGURABLE(cfgUsePtOrderInMixEvent, bool, true, "enable trigger pT < associated pT cut in mixed event")
106+
O2_DEFINE_CONFIGURABLE(cfgCutMerging, float, 0.0, "Merging cut on track merge")
107+
O2_DEFINE_CONFIGURABLE(cfgRadiusLow, float, 0.8, "Low radius for merging cut")
108+
O2_DEFINE_CONFIGURABLE(cfgRadiusHigh, float, 2.5, "High radius for merging cut")
106109

107110
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
108111
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -135,7 +138,7 @@ struct FlowCorrelationsUpc {
135138

136139
using UdTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>;
137140
using UdTracksFull = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>;
138-
using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::Multiplicity>;
141+
using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced, aod::Multiplicity, aod::UDCollisionSelExtras>;
139142

140143
// Define the outputs
141144
OutputObj<CorrelationContainer> same{Form("sameEvent_%i_%i", static_cast<int>(cfgMinMult), static_cast<int>(cfgMaxMult))};
@@ -180,6 +183,63 @@ struct FlowCorrelationsUpc {
180183
MixedEvent = 3
181184
};
182185

186+
template <typename TTrack>
187+
float getDPhiStar(TTrack const& track1, TTrack const& track2, float radius, int runnum, float phi1, float phi2)
188+
{
189+
float charge1 = track1.sign();
190+
float charge2 = track2.sign();
191+
192+
float pt1 = track1.pt();
193+
float pt2 = track2.pt();
194+
195+
int fbSign = 1;
196+
197+
int zzo = 544868;
198+
if (runnum >= zzo) {
199+
fbSign = -1;
200+
}
201+
202+
float dPhiStar = phi1 - phi2 - charge1 * fbSign * std::asin(0.075 * radius / pt1) + charge2 * fbSign * std::asin(0.075 * radius / pt2);
203+
204+
if (dPhiStar > constants::math::PI)
205+
dPhiStar = constants::math::TwoPI - dPhiStar;
206+
if (dPhiStar < -constants::math::PI)
207+
dPhiStar = -constants::math::TwoPI - dPhiStar;
208+
209+
return dPhiStar;
210+
}
211+
212+
template <typename TTrack>
213+
bool trackSelected(TTrack track)
214+
{
215+
// UPC selection
216+
if (!track.isPVContributor()) {
217+
return false;
218+
}
219+
constexpr float kDcazCut = 2.0;
220+
if (!(std::fabs(track.dcaZ()) < kDcazCut)) {
221+
return false;
222+
}
223+
double dcaLimit = 0.0105 + 0.035 / std::pow(track.pt(), 1.1);
224+
if (!(std::fabs(track.dcaXY()) < dcaLimit)) {
225+
return false;
226+
}
227+
constexpr int kMinTPCClusters = 70;
228+
constexpr int kMinITSClusters = 5;
229+
constexpr int kMaxTPCChi2NCl = 4;
230+
231+
if (track.tpcNClsFindableMinusCrossedRows() <= kMinTPCClusters) {
232+
return false;
233+
}
234+
if (track.itsClusterSizes() <= kMinITSClusters) {
235+
return false;
236+
}
237+
if (track.tpcChi2NCl() >= kMaxTPCChi2NCl) {
238+
return false;
239+
}
240+
return true;
241+
}
242+
183243
// fill multiple histograms
184244
template <typename TCollision, typename TTracks>
185245
void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms.
@@ -196,7 +256,7 @@ struct FlowCorrelationsUpc {
196256
}
197257

198258
template <CorrelationContainer::CFStep step, typename TTracks>
199-
void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
259+
void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, int runnum) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
200260
{
201261

202262
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
@@ -209,6 +269,8 @@ struct FlowCorrelationsUpc {
209269
}
210270

211271
for (auto const& track2 : tracks2) {
272+
if (!trackSelected(track2))
273+
continue;
212274

213275
if (track1.globalIndex() == track2.globalIndex())
214276
continue; // For pt-differential correlations, skip if the trigger and associate are the same track
@@ -217,11 +279,37 @@ struct FlowCorrelationsUpc {
217279

218280
auto momentum1 = std::array<double, 3>{track1.px(), track1.py(), track1.pz()};
219281
auto momentum2 = std::array<double, 3>{track2.px(), track2.py(), track2.pz()};
282+
double pt2 = RecoDecay::pt(momentum2);
220283
double phi1 = RecoDecay::phi(momentum1);
221284
double phi2 = RecoDecay::phi(momentum2);
222285
float deltaPhi = RecoDecay::constrainAngle(phi1 - phi2, -PIHalf);
223286
float deltaEta = RecoDecay::eta(momentum1) - RecoDecay::eta(momentum2);
224287

288+
if (pt2 < cfgPtCutMin || pt2 > cfgPtCutMax)
289+
continue;
290+
291+
if (std::abs(deltaEta) < cfgCutMerging) {
292+
293+
double dPhiStarHigh = getDPhiStar(track1, track2, cfgRadiusHigh, runnum, phi1, phi2);
294+
double dPhiStarLow = getDPhiStar(track1, track2, cfgRadiusLow, runnum, phi1, phi2);
295+
296+
const double kLimit = 3.0 * cfgCutMerging;
297+
298+
bool bIsBelow = false;
299+
300+
if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) {
301+
for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) {
302+
double dPhiStar = getDPhiStar(track1, track2, rad, runnum, phi1, phi2);
303+
if (std::abs(dPhiStar) < kLimit) {
304+
bIsBelow = true;
305+
break;
306+
}
307+
}
308+
if (bIsBelow)
309+
continue;
310+
}
311+
}
312+
225313
// fill the right sparse and histograms
226314
if (system == SameEvent) {
227315
same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta);
@@ -236,17 +324,17 @@ struct FlowCorrelationsUpc {
236324

237325
void processSame(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks)
238326
{
239-
if (std::abs(collision.posZ()) > cfgZVtxCut) {
327+
if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) {
240328
return;
241329
}
242-
if (tracks.size() < cfgMinMult || tracks.size() > cfgMaxMult) {
330+
if (collision.trs() == 0) {
243331
return;
244332
}
245333

246334
int gapSide = collision.gapSide();
247335
const int minGapSide = 0;
248336
const int maxGapSide = 2;
249-
if (gapSide < minGapSide || gapSide > maxGapSide) {
337+
if (gapSide > minGapSide && gapSide < maxGapSide) {
250338
return;
251339
}
252340

@@ -256,9 +344,11 @@ struct FlowCorrelationsUpc {
256344
return;
257345
}
258346

347+
int runIndex = collision.runNumber();
348+
259349
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
260350
fillYield(collision, tracks);
261-
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), SameEvent); // fill the SE histogram and Sparse
351+
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), SameEvent, runIndex); // fill the SE histogram and Sparse
262352
}
263353
PROCESS_SWITCH(FlowCorrelationsUpc, processSame, "Process same event", true);
264354

@@ -275,8 +365,8 @@ struct FlowCorrelationsUpc {
275365
SameKindPair<UDCollisionsFull, UdTracksFull, MixedBinning> pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
276366

277367
for (auto const& [collision1, tracks1, collision2, tracks2] : pairs) {
278-
registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
279-
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent);
368+
registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
369+
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent, collision1.runNumber()); // fill the ME histogram and Sparse
280370
}
281371
}
282372
PROCESS_SWITCH(FlowCorrelationsUpc, processMixed, "Process mixed events", true);

0 commit comments

Comments
 (0)