Skip to content

Commit a20262a

Browse files
mutechowenyaCern
andauthored
[PWGCF] Update on femtoDream Framework:Event Plane & Qn (#13801)
Co-authored-by: wenyaCern <wenya.wu@cern.ch>
1 parent a830ab1 commit a20262a

File tree

6 files changed

+532
-130
lines changed

6 files changed

+532
-130
lines changed

PWGCF/DataModel/FemtoDerived.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ enum CollisionBinning {
3737
kMult, //! Bin collision in number of charged tracks for mixing
3838
kMultPercentile, //! Bin collision in multiplicity percentile for mixing
3939
kMultMultPercentile, //! Bin collision in number of charged tracks and multiplicity percentile for mixing
40-
kMultPercentileQn, //! Bin collision in multiplicity percentile an qn value for mixing
40+
kMultPercentileQn, //! Bin collision in multiplicity percentile and qn value for mixing
41+
kMultPercentileEP, //! Bin collision in multiplicity percentile and event plane (deg) for mixing
4142
kNCollisionBinning
4243
};
4344

@@ -54,8 +55,9 @@ DECLARE_SOA_COLUMN(BitMaskTrackThree, bitmaskTrackThree, BitMaskType); //! Bit f
5455

5556
DECLARE_SOA_COLUMN(Downsample, downsample, bool); //! Flag for downsampling
5657

57-
DECLARE_SOA_COLUMN(QnVal, qnVal, int); //! qn values for dividing events
58-
DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! Occupancy of the event
58+
DECLARE_SOA_COLUMN(QnVal, qnVal, double); //! qn values for dividing events
59+
DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! Occupancy of the event
60+
DECLARE_SOA_COLUMN(EventPlane, eventPlane, double); //! Event-plane of the event (deg)
5961
} // namespace femtodreamcollision
6062

6163
DECLARE_SOA_TABLE_STAGED(FDCollisions, "FDCOLLISION",
@@ -71,6 +73,9 @@ DECLARE_SOA_TABLE(FDExtQnCollisions, "AOD", "FDEXTQNCOLLISION",
7173
femtodreamcollision::QnVal,
7274
femtodreamcollision::Occupancy);
7375

76+
DECLARE_SOA_TABLE(FDExtEPCollisions, "AOD", "FDEXTEPCOLLISION",
77+
femtodreamcollision::EventPlane);
78+
7479
DECLARE_SOA_TABLE(FDColMasks, "AOD", "FDCOLMASK",
7580
femtodreamcollision::BitMaskTrackOne,
7681
femtodreamcollision::BitMaskTrackTwo,

PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "Framework/HistogramRegistry.h"
2525
#include "Framework/Logger.h"
2626

27+
#include "TMath.h"
28+
2729
#include <iostream>
2830
#include <string>
2931
#include <vector>
@@ -212,18 +214,16 @@ class FemtoDreamCollisionSelection
212214

213215
/// Initializes histograms for qn bin
214216
/// \param registry Histogram registry to be passed
215-
void initQn(HistogramRegistry* registry, int mumQnBins = 10)
217+
void initEPQA(HistogramRegistry* registry)
216218
{
217219
mHistogramQn = registry;
218-
mHistogramQn->add("Event/centFT0CBefore", "; cent", kTH1F, {{10, 0, 100}});
219-
mHistogramQn->add("Event/centFT0CAfter", "; cent", kTH1F, {{10, 0, 100}});
220+
mHistogramQn->add("Event/centFT0CBeforeQn", "; cent", kTH1F, {{10, 0, 100}});
221+
mHistogramQn->add("Event/centFT0CAfterQn", "; cent", kTH1F, {{10, 0, 100}});
220222
mHistogramQn->add("Event/centVsqn", "; cent; qn", kTH2F, {{10, 0, 100}, {100, 0, 1000}});
221223
mHistogramQn->add("Event/centVsqnVsSpher", "; cent; qn; Sphericity", kTH3F, {{10, 0, 100}, {100, 0, 1000}, {100, 0, 1}});
222224
mHistogramQn->add("Event/qnBin", "; qnBin; entries", kTH1F, {{20, 0, 20}});
225+
mHistogramQn->add("Event/psiEP", "; #Psi_{EP} (deg); entries", kTH1F, {{100, 0, 180}});
223226

224-
for (int iqn(0); iqn < mumQnBins; ++iqn) {
225-
qnMults.push_back(mHistogramQn->add(("Qn/mult_" + std::to_string(iqn)).c_str(), "; cent; c22", kTH1F, {{100, 0, 3500}}));
226-
}
227227
return;
228228
}
229229

@@ -242,12 +242,12 @@ class FemtoDreamCollisionSelection
242242
mMQWeightthisEvt = new TH2D("MQWeightthisEvt", "", binPt, 0., 5., binEta, -0.8, 0.8);
243243

244244
mHistogramQn = registry;
245-
mHistogramQn->add<TProfile>("Event/profileC22", "; cent; c22", kTProfile, {{10, 0, 100}});
246-
mHistogramQn->add<TProfile>("Event/profileC24", "; cent; c24", kTProfile, {{10, 0, 100}});
245+
mHistogramQn->add<TProfile>("Event/profileC22", "; cent; c22", kTProfile, {{10, 0, 100}}, "s");
246+
mHistogramQn->add<TProfile>("Event/profileC24", "; cent; c24", kTProfile, {{10, 0, 100}}, "s");
247247

248248
if (doQnSeparation) {
249249
for (int iqn(0); iqn < mumQnBins; ++iqn) {
250-
profilesC22.push_back(mHistogramQn->add<TProfile>(("Qn/profileC22_" + std::to_string(iqn)).c_str(), "; cent; c22", kTProfile, {{10, 0, 100}}));
250+
profilesC22.push_back(mHistogramQn->add<TProfile>(("Qn/profileC22_" + std::to_string(iqn)).c_str(), "; cent; c22", kTProfile, {{10, 0, 100}}, "s"));
251251
}
252252
}
253253
return;
@@ -324,7 +324,6 @@ class FemtoDreamCollisionSelection
324324
return spt;
325325
}
326326

327-
/// \todo to be implemented!
328327
/// Compute the qn-vector(FT0C) of an event
329328
/// \tparam T type of the collision
330329
/// \param col Collision
@@ -336,7 +335,21 @@ class FemtoDreamCollisionSelection
336335
return qn;
337336
}
338337

339-
/// \todo to be implemented!
338+
/// Compute the event plane of an event
339+
/// \tparam T type of the collision
340+
/// \param col Collision
341+
/// \param nmode EP in which harmonic(default 2nd harmonic)
342+
/// \return angle of the event plane (rad) of FT0C of the event
343+
template <typename T>
344+
float computeEP(T const& col, int nmode)
345+
{
346+
double EP = ((1. / nmode) * (TMath::ATan2(col.qvecFT0CImVec()[0], col.qvecFT0CReVec()[0])));
347+
if (EP < 0)
348+
EP += TMath::Pi();
349+
// atan2 return in rad -pi/2-pi/2, then make it 0-pi
350+
return EP;
351+
}
352+
340353
/// \return the 1-d qn-vector separator to 2-d
341354
std::vector<std::vector<float>> getQnBinSeparator2D(std::vector<float> flat, const int numQnBins = 10)
342355
{
@@ -359,21 +372,21 @@ class FemtoDreamCollisionSelection
359372
return res;
360373
}
361374

362-
/// \todo to be implemented!
363375
/// Get the bin number of qn-vector(FT0C) of an event
364376
/// \param centBinWidth centrality bin width, example: per 1%, per 10% ...
365377
/// \return bin number of qn-vector of the event
366-
int myqnBin(float centrality, float centMax, std::vector<float> qnBinSeparator, bool doFillHisto, float fSpher, float qn, const int numQnBins, float mult, float centBinWidth = 1.f)
378+
// add a param : bool doFillHisto ?
379+
int myqnBin(float centrality, float centMax, bool doFillCent, std::vector<float> qnBinSeparator, float qn, const int numQnBins, float centBinWidth = 1.f)
367380
{
368381
auto twoDSeparator = getQnBinSeparator2D(qnBinSeparator, numQnBins);
369382
if (twoDSeparator.empty() || twoDSeparator[0][0] == -999.) {
370383
LOGP(warning, "ConfQnBinSeparator not set, using default fallback!");
371384
return -999; // safe fallback
372385
}
373386

374-
if (doFillHisto)
375-
mHistogramQn->fill(HIST("Event/centFT0CBefore"), centrality);
376-
387+
// if (doFillHisto)
388+
// mHistogramQn->fill(HIST("Event/centFT0CBefore"), centrality);
389+
// add a param : bool doFillHisto ?
377390
int qnBin = -999;
378391
int mycentBin = static_cast<int>(centrality / centBinWidth);
379392
if (mycentBin >= static_cast<int>(centMax / centBinWidth))
@@ -382,6 +395,9 @@ class FemtoDreamCollisionSelection
382395
if (mycentBin > static_cast<int>(twoDSeparator.size()) - 1)
383396
return qnBin;
384397

398+
if (doFillCent)
399+
mHistogramQn->fill(HIST("Event/centFT0CAfterQn"), centrality);
400+
385401
for (int iqn(0); iqn < static_cast<int>(twoDSeparator[mycentBin].size()) - 1; ++iqn) {
386402
if (qn > twoDSeparator[mycentBin][iqn] && qn <= twoDSeparator[mycentBin][iqn + 1]) {
387403
qnBin = iqn;
@@ -392,20 +408,19 @@ class FemtoDreamCollisionSelection
392408
}
393409

394410
mQnBin = qnBin;
395-
396-
if (doFillHisto) {
397-
mHistogramQn->fill(HIST("Event/centFT0CAfter"), centrality);
398-
mHistogramQn->fill(HIST("Event/centVsqn"), centrality, qn);
399-
mHistogramQn->fill(HIST("Event/centVsqnVsSpher"), centrality, qn, fSpher);
400-
mHistogramQn->fill(HIST("Event/qnBin"), qnBin);
401-
if (qnBin >= 0 && qnBin < numQnBins) {
402-
std::get<std::shared_ptr<TH1>>(qnMults[qnBin])->Fill(mult);
403-
}
404-
}
405-
406411
return qnBin;
407412
}
408413

414+
/// \fill event-wise informations
415+
void fillEPQA(float centrality, float fSpher, float qn, float psiEP)
416+
{
417+
mHistogramQn->fill(HIST("Event/centFT0CBeforeQn"), centrality);
418+
mHistogramQn->fill(HIST("Event/centVsqn"), centrality, qn);
419+
mHistogramQn->fill(HIST("Event/centVsqnVsSpher"), centrality, qn, fSpher);
420+
mHistogramQn->fill(HIST("Event/qnBin"), mQnBin + 0.f);
421+
mHistogramQn->fill(HIST("Event/psiEP"), psiEP);
422+
}
423+
409424
/// \todo to be implemented!
410425
/// Fill cumulants histo for flow calculation
411426
/// Reset hists event-by-event
@@ -501,7 +516,6 @@ class FemtoDreamCollisionSelection
501516
float mSphericityPtmin = 0.f;
502517
int mQnBin = -999;
503518
HistogramRegistry* mHistogramQn = nullptr; ///< For flow cumulant output
504-
std::vector<HistPtr> qnMults; /// Histograms of multiplicity (TH1F) per Qn bin. Stored as HistPtr (variant of shared_ptr) from HistogramManager.
505519
std::vector<HistPtr> profilesC22; /// Pofile Histograms of c22 per Qn bin
506520
TH2D* mReQthisEvt = nullptr; ///< For flow cumulant in an event
507521
TH2D* mImQthisEvt = nullptr; ///< For flow cumulant in an event

0 commit comments

Comments
 (0)