Skip to content

Commit 5cf734b

Browse files
committed
Merge branch 'dev1' of github.com:wenyaCern/O2Physics into O2ep_d1
2 parents 75a19da + d5a4f6e commit 5cf734b

File tree

6 files changed

+446
-163
lines changed

6 files changed

+446
-163
lines changed

PWGCF/DataModel/FemtoDerived.h

Lines changed: 49 additions & 44 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,
@@ -228,47 +233,47 @@ enum CharmHadronMassHypo {
228233
lcToPiKP = 2,
229234
dplusToPiKPi = 4
230235
};
231-
DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision
232-
DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision
233-
DECLARE_SOA_COLUMN(VertexZ, vertexZ, float); //! VertexZ for the collision
234-
DECLARE_SOA_COLUMN(TrackId, trackId, int); //! track id to match associate particle with charm hadron prongs
235-
DECLARE_SOA_COLUMN(Charge, charge, int8_t); //! Charge of charm hadron
236-
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Track id of charm hadron prong0
237-
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Track id of charm hadron prong1
238-
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Track id of charm hadron prong2
239-
DECLARE_SOA_COLUMN(Prong0Pt, prong0Pt, float); //! Track pT of charm hadron prong0
240-
DECLARE_SOA_COLUMN(Prong1Pt, prong1Pt, float); //! Track pT of charm hadron prong1
241-
DECLARE_SOA_COLUMN(Prong2Pt, prong2Pt, float); //! Track pT of charm hadron prong2
242-
DECLARE_SOA_COLUMN(Prong0Eta, prong0Eta, float); //! Track eta of charm hadron prong0
243-
DECLARE_SOA_COLUMN(Prong1Eta, prong1Eta, float); //! Track eta of charm hadron prong1
244-
DECLARE_SOA_COLUMN(Prong2Eta, prong2Eta, float); //! Track eta of charm hadron prong2
245-
DECLARE_SOA_COLUMN(Prong0Phi, prong0Phi, float); //! Track phi of charm hadron prong0
246-
DECLARE_SOA_COLUMN(Prong1Phi, prong1Phi, float); //! Track phi of charm hadron prong1
247-
DECLARE_SOA_COLUMN(Prong2Phi, prong2Phi, float); //! Track phi of charm hadron prong2
248-
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
249-
DECLARE_SOA_COLUMN(BDTBkg, bdtBkg, float); //! Background score using Boosted Decision Tree for charm hadron
250-
DECLARE_SOA_COLUMN(BDTPrompt, bdtPrompt, float); //! Prompt signal score using Boosted Decision Tree for charm hadron
251-
DECLARE_SOA_COLUMN(BDTFD, bdtFD, float); //! Feed-down score using Boosted Decision Tree for charm hadron
252-
DECLARE_SOA_COLUMN(FlagMc, flagMc, int); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 17, DsToKKPi = 6, XicToPKPi = 21, N3ProngD = 2ecays };
253-
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
254-
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
255-
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
256-
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
257-
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
258-
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle
259-
DECLARE_SOA_COLUMN(Kstar, kstar, float); //! Relative momentum in particles pair frame
260-
DECLARE_SOA_COLUMN(KT, kT, float); //! kT distribution of particle pairs
261-
DECLARE_SOA_COLUMN(MT, mT, float); //! Transverse mass distribution
262-
DECLARE_SOA_COLUMN(CharmM, charmM, float); //! Charm hadron mass
263-
DECLARE_SOA_COLUMN(CharmTrkM, charmtrkM, float); //! Charm hadron track mass
264-
DECLARE_SOA_COLUMN(CharmPt, charmPt, float); //! Transverse momentum of charm hadron for result task
265-
DECLARE_SOA_COLUMN(CharmEta, charmEta, float); //! Eta of charm hadron for result task
266-
DECLARE_SOA_COLUMN(CharmPhi, charmPhi, float); //! Phi of charm hadron for result task
267-
DECLARE_SOA_COLUMN(Mult, mult, int); //! Charge particle multiplicity
268-
DECLARE_SOA_COLUMN(MultPercentile, multPercentile, float); //! Multiplicity precentile
269-
DECLARE_SOA_COLUMN(PairSign, pairSign, int8_t); //! Selection between like sign (1) and unlike sign pair (2)
270-
DECLARE_SOA_COLUMN(ProcessType, processType, int64_t); //! Selection between same-event (1), and mixed-event (2)
271-
DECLARE_SOA_DYNAMIC_COLUMN(M, m, //!
236+
DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision
237+
DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision
238+
DECLARE_SOA_COLUMN(VertexZ, vertexZ, float); //! VertexZ for the collision
239+
DECLARE_SOA_COLUMN(TrackId, trackId, int); //! track id to match associate particle with charm hadron prongs
240+
DECLARE_SOA_COLUMN(Charge, charge, int8_t); //! Charge of charm hadron
241+
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Track id of charm hadron prong0
242+
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Track id of charm hadron prong1
243+
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Track id of charm hadron prong2
244+
DECLARE_SOA_COLUMN(Prong0Pt, prong0Pt, float); //! Track pT of charm hadron prong0
245+
DECLARE_SOA_COLUMN(Prong1Pt, prong1Pt, float); //! Track pT of charm hadron prong1
246+
DECLARE_SOA_COLUMN(Prong2Pt, prong2Pt, float); //! Track pT of charm hadron prong2
247+
DECLARE_SOA_COLUMN(Prong0Eta, prong0Eta, float); //! Track eta of charm hadron prong0
248+
DECLARE_SOA_COLUMN(Prong1Eta, prong1Eta, float); //! Track eta of charm hadron prong1
249+
DECLARE_SOA_COLUMN(Prong2Eta, prong2Eta, float); //! Track eta of charm hadron prong2
250+
DECLARE_SOA_COLUMN(Prong0Phi, prong0Phi, float); //! Track phi of charm hadron prong0
251+
DECLARE_SOA_COLUMN(Prong1Phi, prong1Phi, float); //! Track phi of charm hadron prong1
252+
DECLARE_SOA_COLUMN(Prong2Phi, prong2Phi, float); //! Track phi of charm hadron prong2
253+
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
254+
DECLARE_SOA_COLUMN(BDTBkg, bdtBkg, float); //! Background score using Boosted Decision Tree for charm hadron
255+
DECLARE_SOA_COLUMN(BDTPrompt, bdtPrompt, float); //! Prompt signal score using Boosted Decision Tree for charm hadron
256+
DECLARE_SOA_COLUMN(BDTFD, bdtFD, float); //! Feed-down score using Boosted Decision Tree for charm hadron
257+
DECLARE_SOA_COLUMN(FlagMc, flagMc, int); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 17, DsToKKPi = 6, XicToPKPi = 21, N3ProngD = 2ecays };
258+
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
259+
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
260+
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
261+
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
262+
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
263+
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle
264+
DECLARE_SOA_COLUMN(Kstar, kstar, float); //! Relative momentum in particles pair frame
265+
DECLARE_SOA_COLUMN(KT, kT, float); //! kT distribution of particle pairs
266+
DECLARE_SOA_COLUMN(MT, mT, float); //! Transverse mass distribution
267+
DECLARE_SOA_COLUMN(CharmM, charmM, float); //! Charm hadron mass
268+
DECLARE_SOA_COLUMN(CharmTrkM, charmtrkM, float); //! Charm hadron track mass
269+
DECLARE_SOA_COLUMN(CharmPt, charmPt, float); //! Transverse momentum of charm hadron for result task
270+
DECLARE_SOA_COLUMN(CharmEta, charmEta, float); //! Eta of charm hadron for result task
271+
DECLARE_SOA_COLUMN(CharmPhi, charmPhi, float); //! Phi of charm hadron for result task
272+
DECLARE_SOA_COLUMN(Mult, mult, int); //! Charge particle multiplicity
273+
DECLARE_SOA_COLUMN(MultPercentile, multPercentile, float); //! Multiplicity precentile
274+
DECLARE_SOA_COLUMN(PairSign, pairSign, int8_t); //! Selection between like sign (1) and unlike sign pair (2)
275+
DECLARE_SOA_COLUMN(ProcessType, processType, int64_t); //! Selection between same-event (1), and mixed-event (2)
276+
DECLARE_SOA_DYNAMIC_COLUMN(M, m, //!
272277
[](float pt0, float phi0, float eta0, float pt1, float phi1, float eta1, float pt2, float phi2, float eta2, const std::array<double, 3>& m) -> float { return RecoDecay::m(std::array{
273278
RecoDecayPtEtaPhi::pVector(pt0, eta0, phi0),
274279
RecoDecayPtEtaPhi::pVector(pt1, eta1, phi1),

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)