1616#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMCOLLISIONSELECTION_H_
1717#define PWGCF_FEMTODREAM_CORE_FEMTODREAMCOLLISIONSELECTION_H_
1818
19- #include < string>
20- #include < iostream>
21- #include < vector>
2219#include " Common/CCDB/TriggerAliases.h"
20+ #include " Common/Core/EventPlaneHelper.h"
2321#include " Common/DataModel/EventSelection.h"
22+ #include " Common/DataModel/Qvectors.h"
23+
2424#include " Framework/HistogramRegistry.h"
2525#include " Framework/Logger.h"
2626
27- #include " Common/Core/EventPlaneHelper.h"
28- #include " Common/DataModel/Qvectors.h"
27+ #include < iostream>
28+ #include < string>
29+ #include < vector>
2930
3031using namespace o2 ::framework;
3132
@@ -165,17 +166,15 @@ class FemtoDreamCollisionSelection
165166 // / \param col Collision
166167 // / \return whether or not the collisions fulfills the specified selections
167168 template <typename C>
168- bool isPileUpCollisionPbPb (C const & col,
169- bool noSameBunchPileup, bool isGoodITSLayersAll,
170- int tpcOccupancyMin, int tpcOccupancyMax)
169+ bool isPileUpCollisionPbPb (C const & col,
170+ bool noSameBunchPileup, bool isGoodITSLayersAll,
171+ int tpcOccupancyMin, int tpcOccupancyMax)
171172 {
172173 const auto occupancy = col.trackOccupancyInTimeRange ();
173174 if ((occupancy < tpcOccupancyMin || occupancy > tpcOccupancyMax)) {
174175 return false ;
175176 }
176- if ((noSameBunchPileup && !col.selection_bit (aod::evsel::kNoSameBunchPileup ))
177- || (isGoodITSLayersAll && !col.selection_bit (aod::evsel::kIsGoodITSLayersAll ))
178- ) {
177+ if ((noSameBunchPileup && !col.selection_bit (aod::evsel::kNoSameBunchPileup )) || (isGoodITSLayersAll && !col.selection_bit (aod::evsel::kIsGoodITSLayersAll ))) {
179178 return false ;
180179 }
181180
@@ -207,11 +206,11 @@ class FemtoDreamCollisionSelection
207206 {
208207 mHistogramQn = registry;
209208 mHistogramQn ->add (" Event/centFT0CBefore" , " ; cent" , kTH1F , {{10 , 0 , 100 }});
210- mHistogramQn ->add (" Event/centFT0CAfter" , " ; cent" , kTH1F , {{10 , 0 , 100 }});
209+ mHistogramQn ->add (" Event/centFT0CAfter" , " ; cent" , kTH1F , {{10 , 0 , 100 }});
211210 mHistogramQn ->add (" Event/centVsqn" , " ; cent; qn" , kTH2F , {{10 , 0 , 100 }, {100 , 0 , 1000 }});
212211 mHistogramQn ->add (" Event/centVsqnVsSpher" , " ; cent; qn; Sphericity" , kTH3F , {{10 , 0 , 100 }, {100 , 0 , 1000 }, {100 , 0 , 1 }});
213212 mHistogramQn ->add (" Event/qnBin" , " ; qnBin; entries" , kTH1F , {{20 , 0 , 20 }});
214-
213+
215214 for (int iqn (0 ); iqn < mumQnBins; ++iqn) {
216215 mHistogramQn ->add ((" Qn/mult_" + std::to_string (iqn)).c_str (), " ; cent; c22" , kTH1F , {{100 , 0 , 3500 }});
217216 }
@@ -230,12 +229,12 @@ class FemtoDreamCollisionSelection
230229 mReQ2thisEvt = new TH2D (" ReQ2thisEvt" , " " , binPt, 0 ., 5 ., binEta, -0.8 , 0.8 );
231230 mImQ2thisEvt = new TH2D (" ImQ2thisEvt" , " " , binPt, 0 ., 5 ., binEta, -0.8 , 0.8 );
232231 mMQthisEvt = new TH2D (" MQthisEvt" , " " , binPt, 0 ., 5 ., binEta, -0.8 , 0.8 );
233- mMQWeightthisEvt = new TH2D (" MQWeightthisEvt" , " " , binPt, 0 ., 5 ., binEta, -0.8 , 0.8 );
234-
232+ mMQWeightthisEvt = new TH2D (" MQWeightthisEvt" , " " , binPt, 0 ., 5 ., binEta, -0.8 , 0.8 );
233+
235234 mHistogramQn = registry;
236235 mHistogramQn ->add <TProfile>(" Event/profileC22" , " ; cent; c22" , kTProfile , {{10 , 0 , 100 }});
237236 mHistogramQn ->add <TProfile>(" Event/profileC24" , " ; cent; c24" , kTProfile , {{10 , 0 , 100 }});
238- if (doQnSeparation){
237+ if (doQnSeparation) {
239238 for (int iqn (0 ); iqn < mumQnBins; ++iqn) {
240239 mHistogramQn ->add <TProfile>((" Qn/profileC22_" + std::to_string (iqn)).c_str (), " ; cent; c22" , kTProfile , {{10 , 0 , 100 }});
241240 }
@@ -328,14 +327,14 @@ class FemtoDreamCollisionSelection
328327
329328 // / \todo to be implemented!
330329 // / \return the 1-d qn-vector separator to 2-d
331- std::vector<std::vector<float >> getQnBinSeparator2D (std::vector<float > flat, const int numQnBins = 10 )
330+ std::vector<std::vector<float >> getQnBinSeparator2D (std::vector<float > flat, const int numQnBins = 10 )
332331 {
333- size_t nBins = numQnBins+ 1 ;
332+ size_t nBins = numQnBins + 1 ;
334333
335334 if (flat.empty () || flat.size () % nBins != 0 ) {
336- LOGP (error, " ConfQnBinSeparator size = {} is not divisible by {}" ,
335+ LOGP (error, " ConfQnBinSeparator size = {} is not divisible by {}" ,
337336 flat.size (), nBins);
338- return {{-999 , -999 }};
337+ return {{-999 , -999 }};
339338 }
340339
341340 size_t nCent = flat.size () / nBins;
@@ -362,14 +361,14 @@ class FemtoDreamCollisionSelection
362361 }
363362
364363 if (doFillHisto)
365- mHistogramQn ->fill (HIST (" Event/centFT0CBefore" ), centrality);
364+ mHistogramQn ->fill (HIST (" Event/centFT0CBefore" ), centrality);
366365
367366 int qnBin = -999 ;
368367 int mycentBin = static_cast <int >(centrality / centBinWidth);
369368 if (mycentBin >= static_cast <int >(centMax / centBinWidth))
370369 return qnBin;
371370
372- if (mycentBin > static_cast <int >(twoDSeparator.size ()) -1 )
371+ if (mycentBin > static_cast <int >(twoDSeparator.size ()) - 1 )
373372 return qnBin;
374373
375374 for (int iqn (0 ); iqn < static_cast <int >(twoDSeparator[mycentBin].size ()) - 1 ; ++iqn) {
@@ -383,12 +382,12 @@ class FemtoDreamCollisionSelection
383382
384383 mQnBin = qnBin;
385384
386- if (doFillHisto){
385+ if (doFillHisto) {
387386 mHistogramQn ->fill (HIST (" Event/centFT0CAfter" ), centrality);
388387 mHistogramQn ->fill (HIST (" Event/centVsqn" ), centrality, qn);
389388 mHistogramQn ->fill (HIST (" Event/centVsqnVsSpher" ), centrality, qn, fSpher );
390389 mHistogramQn ->fill (HIST (" Event/qnBin" ), qnBin);
391- if (qnBin >= 0 && qnBin < numQnBins){
390+ if (qnBin >= 0 && qnBin < numQnBins) {
392391 switch (qnBin) {
393392 case 0 :
394393 mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 0" ), mult);
@@ -397,8 +396,8 @@ class FemtoDreamCollisionSelection
397396 mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 1" ), mult);
398397 break ;
399398 case 2 :
400- mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 2" ), mult);
401- break ;
399+ mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 2" ), mult);
400+ break ;
402401 case 3 :
403402 mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 3" ), mult);
404403 break ;
@@ -419,11 +418,11 @@ class FemtoDreamCollisionSelection
419418 break ;
420419 case 9 :
421420 mHistogramQn ->fill (HIST (" Qn/mult_" ) + HIST (" 9" ), mult);
422- break ;
421+ break ;
423422 default :
424- return qnBin; // invalid qn bin
423+ return qnBin; // invalid qn bin
425424 }
426- }
425+ }
427426 }
428427
429428 return qnBin;
@@ -436,34 +435,34 @@ class FemtoDreamCollisionSelection
436435 // / \tparam T2 type of the tracks
437436 // / \param tracks All tracks
438437 template <typename T1, typename T2>
439- bool fillCumulants (T1 const & col, T2 const & tracks, float fHarmonic = 2 .f)
440- {
438+ bool fillCumulants (T1 const & col, T2 const & tracks, float fHarmonic = 2 .f)
439+ {
441440 int numOfTracks = col.numContrib ();
442441 if (numOfTracks < 3 )
443442 return false ;
444443
445444 mReQthisEvt ->Reset ();
446445 mImQthisEvt ->Reset ();
447- mReQ2thisEvt ->Reset ();
448- mImQ2thisEvt ->Reset ();
446+ mReQ2thisEvt ->Reset ();
447+ mImQ2thisEvt ->Reset ();
449448 mMQthisEvt ->Reset ();
450- mMQWeightthisEvt ->Reset ();
449+ mMQWeightthisEvt ->Reset ();
451450
452451 for (auto const & track : tracks) {
453- double weight= 1 ; // Will implement NUA&NUE correction
452+ double weight = 1 ; // Will implement NUA&NUE correction
454453 double phi = track.phi ();
455454 double pt = track.pt ();
456455 double eta = track.eta ();
457- double cosnphi = weight * TMath::Cos (fHarmonic * phi);
458- double sinnphi = weight * TMath::Sin (fHarmonic * phi);
459- double cos2nphi = weight * TMath::Cos (2 * fHarmonic * phi);
460- double sin2nphi = weight * TMath::Sin (2 * fHarmonic * phi);
456+ double cosnphi = weight * TMath::Cos (fHarmonic * phi);
457+ double sinnphi = weight * TMath::Sin (fHarmonic * phi);
458+ double cos2nphi = weight * TMath::Cos (2 * fHarmonic * phi);
459+ double sin2nphi = weight * TMath::Sin (2 * fHarmonic * phi);
461460 mReQthisEvt ->Fill (pt, eta, cosnphi);
462461 mImQthisEvt ->Fill (pt, eta, sinnphi);
463- mReQ2thisEvt ->Fill (pt,eta,cos2nphi);
464- mImQ2thisEvt ->Fill (pt, eta, sin2nphi);
465- mMQthisEvt ->Fill (pt, eta);
466- mMQWeightthisEvt ->Fill (pt, eta, weight);
462+ mReQ2thisEvt ->Fill (pt, eta, cos2nphi);
463+ mImQ2thisEvt ->Fill (pt, eta, sin2nphi);
464+ mMQthisEvt ->Fill (pt, eta);
465+ mMQWeightthisEvt ->Fill (pt, eta, weight);
467466 }
468467 return true ;
469468 }
@@ -480,73 +479,72 @@ class FemtoDreamCollisionSelection
480479 if (!fillCumulants (col, tracks))
481480 return ;
482481
483- if (mMQthisEvt ->Integral (1 , binPt, 1 , binEta) < 2 )
482+ if (mMQthisEvt ->Integral (1 , binPt, 1 , binEta) < 2 )
484483 return ;
485-
486- double allReQ = mReQthisEvt ->Integral (1 , binPt, 1 , binEta);
487- double allImQ = mImQthisEvt ->Integral (1 , binPt, 1 , binEta);
484+
485+ double allReQ = mReQthisEvt ->Integral (1 , binPt, 1 , binEta);
486+ double allImQ = mImQthisEvt ->Integral (1 , binPt, 1 , binEta);
488487 TComplex Q (allReQ, allImQ);
489488 TComplex QStar = TComplex::Conjugate (Q);
490-
491- double posEtaRe = mReQthisEvt ->Integral (1 , binPt, mReQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
492- double posEtaIm = mImQthisEvt ->Integral (1 , binPt, mImQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
493- if (mMQthisEvt ->Integral (1 , binPt, mMQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta) < 2 )
489+
490+ double posEtaRe = mReQthisEvt ->Integral (1 , binPt, mReQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
491+ double posEtaIm = mImQthisEvt ->Integral (1 , binPt, mImQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
492+ if (mMQthisEvt ->Integral (1 , binPt, mMQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta) < 2 )
494493 return ;
495- float posEtaMQ = mMQWeightthisEvt ->Integral (1 , binPt, mMQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
494+ float posEtaMQ = mMQWeightthisEvt ->Integral (1 , binPt, mMQthisEvt ->GetYaxis ()->FindBin (fEtaGap + 1e-6 ), binEta);
496495 TComplex posEtaQ = TComplex (posEtaRe, posEtaIm);
497496 TComplex posEtaQStar = TComplex::Conjugate (posEtaQ);
498-
499- double negEtaRe = mReQthisEvt ->Integral (1 , binPt, 1 , mReQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
500- double negEtaIm = mImQthisEvt ->Integral (1 , binPt, 1 , mImQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
501- if (mMQthisEvt ->Integral (1 , binPt, 1 , mMQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 )) < 2 )
497+
498+ double negEtaRe = mReQthisEvt ->Integral (1 , binPt, 1 , mReQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
499+ double negEtaIm = mImQthisEvt ->Integral (1 , binPt, 1 , mImQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
500+ if (mMQthisEvt ->Integral (1 , binPt, 1 , mMQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 )) < 2 )
502501 return ;
503- float negEtaMQ = mMQWeightthisEvt ->Integral (1 , binPt, 1 , mMQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
502+ float negEtaMQ = mMQWeightthisEvt ->Integral (1 , binPt, 1 , mMQthisEvt ->GetYaxis ()->FindBin (-1 * fEtaGap - 1e-6 ));
504503 TComplex negEtaQ = TComplex (negEtaRe, negEtaIm);
505504 TComplex negEtaQStar = TComplex::Conjugate (negEtaQ);
506505
507- mHistogramQn ->get <TProfile>(HIST (" Event/profileC22" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
508- if (doQnSeparation && mQnBin >= 0 && mQnBin < numQnBins){
506+ mHistogramQn ->get <TProfile>(HIST (" Event/profileC22" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
507+ if (doQnSeparation && mQnBin >= 0 && mQnBin < numQnBins) {
509508 switch (mQnBin ) {
510509 case 0 :
511- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 0" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
510+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 0" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
512511 break ;
513512 case 1 :
514- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 1" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
513+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 1" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
515514 break ;
516515 case 2 :
517- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 2" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
516+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 2" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
518517 break ;
519518 case 3 :
520- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 3" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
519+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 3" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
521520 break ;
522521 case 4 :
523- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 4" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
522+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 4" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
524523 break ;
525524 case 5 :
526- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 5" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
525+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 5" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
527526 break ;
528527 case 6 :
529- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 6" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
528+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 6" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
530529 break ;
531530 case 7 :
532- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 7" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
531+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 7" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
533532 break ;
534533 case 8 :
535- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 8" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
534+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 8" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
536535 break ;
537536 case 9 :
538- mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 9" ))->Fill (centrality, (negEtaQ* posEtaQStar).Re ()/ (negEtaMQ* posEtaMQ), (negEtaMQ* posEtaMQ));
539- break ;
537+ mHistogramQn ->get <TProfile>(HIST (" Qn/profileC22_" ) + HIST (" 9" ))->Fill (centrality, (negEtaQ * posEtaQStar).Re () / (negEtaMQ * posEtaMQ), (negEtaMQ * posEtaMQ));
538+ break ;
540539 default :
541- return ; // invalid qn bin
540+ return ; // invalid qn bin
542541 }
543542 }
544543 return ;
545544 }
546545
547-
548546 private:
549- HistogramRegistry* mHistogramRegistry = nullptr ; // /< For QA output
547+ HistogramRegistry* mHistogramRegistry = nullptr ; // /< For QA output
550548 bool mCutsSet = false ; // /< Protection against running without cuts
551549 bool mCheckTrigger = false ; // /< Check for trigger
552550 bool mCheckOffline = false ; // /< Check for offline criteria (might change)
@@ -557,13 +555,13 @@ class FemtoDreamCollisionSelection
557555 float mMinSphericity = 0 .f;
558556 float mSphericityPtmin = 0 .f;
559557 int mQnBin = -999 ;
560- HistogramRegistry* mHistogramQn = nullptr ; // /< For flow cumulant output
561- TH2D* mReQthisEvt = nullptr ; // /< For flow cumulant in an event
562- TH2D* mImQthisEvt = nullptr ; // /< For flow cumulant in an event
563- TH2D* mReQ2thisEvt = nullptr ; // /< For flow cumulant in an event
564- TH2D* mImQ2thisEvt = nullptr ; // /< For flow cumulant in an event
565- TH2D* mMQthisEvt = nullptr ; // /< For flow cumulant in an event
566- TH2D* mMQWeightthisEvt = nullptr ; // /< For flow cumulant in an event
558+ HistogramRegistry* mHistogramQn = nullptr ; // /< For flow cumulant output
559+ TH2D* mReQthisEvt = nullptr ; // /< For flow cumulant in an event
560+ TH2D* mImQthisEvt = nullptr ; // /< For flow cumulant in an event
561+ TH2D* mReQ2thisEvt = nullptr ; // /< For flow cumulant in an event
562+ TH2D* mImQ2thisEvt = nullptr ; // /< For flow cumulant in an event
563+ TH2D* mMQthisEvt = nullptr ; // /< For flow cumulant in an event
564+ TH2D* mMQWeightthisEvt = nullptr ; // /< For flow cumulant in an event
567565};
568566} // namespace o2::analysis::femtoDream
569567
0 commit comments