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