1616
1717#include " Common/CCDB/EventSelectionParams.h"
1818#include " Common/CCDB/RCTSelectionFlags.h"
19- #include " Common/CCDB/ctpRateFetcher.h"
2019#include " Common/DataModel/Centrality.h"
2120#include " Common/DataModel/EventSelection.h"
2221#include " Common/DataModel/Multiplicity.h"
3433#include < Framework/HistogramRegistry.h>
3534#include < Framework/HistogramSpec.h>
3635#include < Framework/InitContext.h>
37- #include < Framework/StringHelpers.h>
3836#include < Framework/runDataProcessing.h>
3937
4038#include < TF1.h>
4543
4644#include < sys/types.h>
4745
48- #include < RtypesCore.h>
49-
5046#include < algorithm>
5147#include < chrono>
5248#include < cmath>
5551#include < map>
5652#include < memory>
5753#include < string>
54+ #include < string_view>
5855#include < utility>
5956#include < vector>
6057
@@ -129,7 +126,7 @@ struct FlowTransmutation {
129126 RCTFlagsChecker rctChecker{" CBT" };
130127 enum TrackSelectionGroup {
131128 TrkSelNch = 0 ,
132- TrkSelObs = 1 ,
129+ TrkSelObs,
133130 TrkCounter
134131 };
135132 enum TrackCut {
@@ -261,7 +258,7 @@ struct FlowTransmutation {
261258 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (FilteredEvent, " Filtered event" );
262259 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (Sel8, " after sel8" );
263260 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (RCTflags, " RCTflags" );
264- std::string itsLayersFlag[Count_ITSLayersFlag] = {" ITSLayers-Disabled" , " ITSLayersAll" , " ITSLayers0123" , " ITSLayer3" };
261+ std::array<std:: string, 4 > itsLayersFlag = {" ITSLayers-Disabled" , " ITSLayersAll" , " ITSLayers0123" , " ITSLayer3" };
265262 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (IsGoodITSLayers, Form (" kIsGood%s" , itsLayersFlag[cfgEventSelection.cfgEvSelkIsGoodITSLayersFlag ].c_str ()));
266263 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (NoSameBunchPileup, " kNoSameBunchPileup" );
267264 registryQA.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (NoITSROFrameBorder, " kNoITSROFrameBorder" );
@@ -283,19 +280,19 @@ struct FlowTransmutation {
283280 registryQA.addClone (" beforeEventSelQA/" , " afterEventSelQA/" );
284281 }
285282 eventSelectionCuts = {
286- EventCut ({(cfgEventSelection.cfgEvSelkIsGoodITSLayersFlag != Disabled) ? true : false , IsGoodITSLayers, getCorrectITSLayersFlag (cfgEventSelection.cfgEvSelkIsGoodITSLayersFlag )}),
287- EventCut ({cfgEventSelection.cfgEvSelkNoSameBunchPileup , NoSameBunchPileup, o2::aod::evsel::kNoSameBunchPileup }),
288- EventCut ({cfgEventSelection.cfgEvSelkNoITSROFrameBorder , NoITSROFrameBorder, o2::aod::evsel::kNoITSROFrameBorder }),
289- EventCut ({cfgEventSelection.cfgEvSelkNoTimeFrameBorder , NoTimeFrameBorder, o2::aod::evsel::kNoTimeFrameBorder }),
290- EventCut ({cfgEventSelection.cfgEvSelkIsGoodZvtxFT0vsPV , IsGoodZvtxFT0vsPV, o2::aod::evsel::kIsGoodZvtxFT0vsPV }),
291- EventCut ({cfgEventSelection.cfgEvSelkNoCollInTimeRangeStandard , NoCollInTimeRangeStandard, o2::aod::evsel::kNoCollInTimeRangeStandard }),
292- EventCut ({cfgEventSelection.cfgEvSelkNoCollInRofStandard , NoCollInRofStandard, o2::aod::evsel::kNoCollInRofStandard }),
293- EventCut ({cfgEventSelection.cfgEvSelkNoHighMultCollInPrevRof , NoHighMultCollInPrevRof, o2::aod::evsel::kNoHighMultCollInPrevRof })};
283+ EventCut ({. enabled = (cfgEventSelection.cfgEvSelkIsGoodITSLayersFlag != Disabled), . histBin = IsGoodITSLayers, . flag = getCorrectITSLayersFlag (cfgEventSelection.cfgEvSelkIsGoodITSLayersFlag )}),
284+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoSameBunchPileup , . histBin = NoSameBunchPileup, . flag = o2::aod::evsel::kNoSameBunchPileup }),
285+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoITSROFrameBorder , . histBin = NoITSROFrameBorder, . flag = o2::aod::evsel::kNoITSROFrameBorder }),
286+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoTimeFrameBorder , . histBin = NoTimeFrameBorder, . flag = o2::aod::evsel::kNoTimeFrameBorder }),
287+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkIsGoodZvtxFT0vsPV , . histBin = IsGoodZvtxFT0vsPV, . flag = o2::aod::evsel::kIsGoodZvtxFT0vsPV }),
288+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoCollInTimeRangeStandard , . histBin = NoCollInTimeRangeStandard, . flag = o2::aod::evsel::kNoCollInTimeRangeStandard }),
289+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoCollInRofStandard , . histBin = NoCollInRofStandard, . flag = o2::aod::evsel::kNoCollInRofStandard }),
290+ EventCut ({. enabled = cfgEventSelection.cfgEvSelkNoHighMultCollInPrevRof , . histBin = NoHighMultCollInPrevRof, . flag = o2::aod::evsel::kNoHighMultCollInPrevRof })};
294291 if (cfgEventSelection.cfgEvSelUsage ) {
295292 LOGF (info, " Event selection cuts are enabled" );
296293 LOGF (info, " Sel8 is %senabled" , (cfgEventSelection.cfgEvSel8 ) ? " " : " not " );
297294 if (!cfgEventSelection.cfgEvSelRCTflags .value .empty ()) {
298- rctChecker.init (cfgEventSelection.cfgEvSelRCTflags .value . c_str () );
295+ rctChecker.init (cfgEventSelection.cfgEvSelRCTflags .value );
299296 LOGF (info, " RCT is %senabled" , (!cfgEventSelection.cfgEvSelRCTflags .value .empty ()) ? " " : " not " );
300297 LOGF (info, " RCT selection flag: %s" , cfgEventSelection.cfgEvSelRCTflags .value .c_str ());
301298 }
@@ -381,7 +378,7 @@ struct FlowTransmutation {
381378 fDCAxyCut [TrkSelObs] = new TF1 (" pT-DCAxyObs" , Form (" [0]*%s" , cfgCutDCAxy->c_str ()), 0.001 , 100 );
382379 fDCAxyCut [TrkSelObs]->SetParameter (0 , trackSel[DCAxyNsigma][TrkSelObs]);
383380 LOGF (info, Form (" pT-dependent DCAxy cut for Nch : %f*%s" , fDCAxyCut [TrkSelObs]->GetParameter (0 ), cfgCutDCAxy->c_str ()));
384- std::string etaGapsFlag[EtaGapCounter] = {" 2-sub |#Delta#eta|>0" , " 2-sub |#Delta#eta|>0.2" , " 2-sub |#Delta#eta|>0.4" , " 2-sub |#Delta#eta|>0.6" , " 2-sub |#Delta#eta|>0.8" , " 2-sub |#Delta#eta|>1.0" , " 2-sub |#Delta#eta|>1.2" , " 2-sub |#Delta#eta|>1.4" };
381+ std::array<std:: string, 8 > etaGapsFlag = {" 2-sub |#Delta#eta|>0" , " 2-sub |#Delta#eta|>0.2" , " 2-sub |#Delta#eta|>0.4" , " 2-sub |#Delta#eta|>0.6" , " 2-sub |#Delta#eta|>0.8" , " 2-sub |#Delta#eta|>1.0" , " 2-sub |#Delta#eta|>1.2" , " 2-sub |#Delta#eta|>1.4" };
385382 if (cfgGetNumberOfCorr) {
386383 registryCorr.add (" hTwoParticleCorrelations" , " 2 particle correlations; Nch;" , {HistType::kTH2F , {axisNch, {8 , -0.5 , 7.5 }}});
387384 registryCorr.add (" hFourParticleCorrelations" , " 4 particle correlations; Nch;" , {HistType::kTH2F , {axisNch, {8 , -0.5 , 7.5 }}});
@@ -400,35 +397,26 @@ struct FlowTransmutation {
400397 ccdb->setCreatedNotAfter (now);
401398 }
402399 template <typename TCollision>
403- float getCentrality (TCollision const & collision)
400+ float getCentrality (const TCollision & collision)
404401 {
405- float cent;
406402 switch (cfgEventSelection.cfgCentEstimator ) {
407403 case CentFT0C:
408- cent = collision.centFT0C ();
409- break ;
404+ return collision.centFT0C ();
410405 case CentFT0CVariant1:
411- cent = collision.centFT0CVariant1 ();
412- break ;
406+ return collision.centFT0CVariant1 ();
413407 case CentFT0M:
414- cent = collision.centFT0M ();
415- break ;
408+ return collision.centFT0M ();
416409 case CentFV0A:
417- cent = collision.centFV0A ();
418- break ;
410+ return collision.centFV0A ();
419411 case CentNTPV:
420- cent = collision.centNTPV ();
421- break ;
412+ return collision.centNTPV ();
422413 case CentNGlobal:
423- cent = collision.centNGlobal ();
424- break ;
414+ return collision.centNGlobal ();
425415 case CentMFT:
426- cent = collision.centMFT ();
427- break ;
416+ return collision.centMFT ();
428417 default :
429- cent = collision.centFT0C ();
418+ return collision.centFT0C ();
430419 }
431- return cent;
432420 }
433421 template <typename TCollision>
434422 bool selectMultiplicityCorrelation (const TCollision& collision, const int multTrk, const float & centrality)
@@ -545,7 +533,6 @@ struct FlowTransmutation {
545533 }
546534 }
547535 }
548- return ;
549536 }
550537 double getTimeSinceStartOfFill (uint64_t timestamp, int firstRun)
551538 {
@@ -561,7 +548,7 @@ struct FlowTransmutation {
561548 auto bc = collision.bc_as <aod::BCsWithTimestamps>();
562549 int run = bc.runNumber ();
563550 int nch = 0 ;
564- std::array<TrackRegion, EtaGapCounter > trackCorr{TrackRegion{0 , 0 , 0 .}, TrackRegion{0 , 0 , 0.1 }, TrackRegion{0 , 0 , 0.2 }, TrackRegion{0 , 0 , 0.3 }, TrackRegion{0 , 0 , 0.4 }, TrackRegion{0 , 0 , 0.5 }, TrackRegion{0 , 0 , 0.6 }, TrackRegion{0 , 0 , 0.7 }};
551+ std::array<TrackRegion, 8 > trackCorr{TrackRegion{. forward = 0 , . backward = 0 , . gap = 0 .}, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.1 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.2 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.3 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.4 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.5 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.6 }, TrackRegion{. forward = 0 , . backward = 0 , . gap = 0.7 }};
565552 registryQA.fill (HIST (" hEventCount" ), FilteredEvent);
566553 if (tracks.size () < 1 ) {
567554 return ;
0 commit comments