1313// / \author Fuchun Cui(fcui@cern.ch)
1414
1515#include < CCDB/BasicCCDBManager.h>
16+ #include < vector>
17+ #include < string>
1618#include < cmath>
1719#include " Framework/runDataProcessing.h"
1820#include " Framework/AnalysisTask.h"
@@ -86,6 +88,7 @@ struct FlowGFWOmegaXi {
8688 O2_DEFINE_CONFIGURABLE (cfgNSigmaCascPion, float , 3 , " NSigmaCascPion" )
8789 O2_DEFINE_CONFIGURABLE (cfgNSigmaCascProton, float , 3 , " NSigmaCascProton" )
8890 O2_DEFINE_CONFIGURABLE (cfgNSigmaCascKaon, float , 3 , " NSigmaCascKaon" )
91+ O2_DEFINE_CONFIGURABLE (cfgOutputNUAWeights, bool , true , " Fill and output NUA weights" )
8992 O2_DEFINE_CONFIGURABLE (cfgAcceptancePath, std::vector<std::string>, std::vector<std::string>{" PathtoRef" }, " CCDB path to acceptance object" )
9093 O2_DEFINE_CONFIGURABLE (cfgEfficiencyPath, std::vector<std::string>, std::vector<std::string>{" PathtoRef" }, " CCDB path to efficiency object" )
9194
@@ -117,6 +120,11 @@ struct FlowGFWOmegaXi {
117120
118121 // Define output
119122 HistogramRegistry registry{" registry" };
123+ OutputObj<GFWWeights> fWeightsREF {GFWWeights (" weightsREF" )};
124+ OutputObj<GFWWeights> fWeightsK0s {GFWWeights (" weightsK0s" )};
125+ OutputObj<GFWWeights> fWeightsLambda {GFWWeights (" weightsLambda" )};
126+ OutputObj<GFWWeights> fWeightsXi {GFWWeights (" weightsXiMinus" )};
127+ OutputObj<GFWWeights> fWeightsOmega {GFWWeights (" weightsOmegaMinus" )};
120128
121129 // define global variables
122130 GFW* fGFW = new GFW(); // GFW class used from main src
@@ -193,8 +201,10 @@ struct FlowGFWOmegaXi {
193201 registry.get <TH2>(HIST (" hEventCount" ))->GetYaxis ()->SetBinLabel (4 , " Omega" );
194202
195203 // cumulant of flow
196- registry.add (" c22" , " ;Centrality (%) ; C_{2}{2}" , {HistType::kTProfile2D , {cfgaxisPt, axisMultiplicity}});
197- registry.add (" c24" , " ;Centrality (%) ; C_{2}{4}" , {HistType::kTProfile2D , {cfgaxisPt, axisMultiplicity}});
204+ registry.add (" c22" , " ;Centrality (%) ; C_{2}{2} " , {HistType::kTProfile , {axisMultiplicity}});
205+ registry.add (" c24" , " ;Centrality (%) ; C_{2}{2} " , {HistType::kTProfile , {axisMultiplicity}});
206+ registry.add (" c22dpt" , " ;Centrality (%) ; C_{2}{2}" , {HistType::kTProfile2D , {cfgaxisPt, axisMultiplicity}});
207+ registry.add (" c24dpt" , " ;Centrality (%) ; C_{2}{4}" , {HistType::kTProfile2D , {cfgaxisPt, axisMultiplicity}});
198208 // pt-diff cumulant of flow
199209 registry.add (" Xic22dpt" , " ;pt ; C_{2}{2} " , {HistType::kTProfile3D , {cfgaxisPtXi, cfgaxisXiminusMassforflow, axisMultiplicity}});
200210 registry.add (" Omegac22dpt" , " ;pt ; C_{2}{2} " , {HistType::kTProfile3D , {cfgaxisPtXi, cfgaxisOmegaminusMassforflow, axisMultiplicity}});
@@ -264,8 +274,8 @@ struct FlowGFWOmegaXi {
264274 fGFW ->AddRegion (" poiLambdaN" , -0.8 , -0.4 , nLambdaptMassBins, 16 );
265275 fGFW ->AddRegion (" poiLambdafull" , -0.8 , 0.8 , nLambdaptMassBins, 16 );
266276 // pushback
267- corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" refP10dpt {2} refN10dpt {-2}" , " Ref10Gap22 " , kTRUE ));
268- corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" reffulldpt reffulldpt {2 2 -2 -2}" , " Ref10Gap24 " , kTRUE ));
277+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" refP10dpt {2} refN10dpt {-2}" , " Ref10Gap22dpt " , kTRUE ));
278+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" reffulldpt reffulldpt {2 2 -2 -2}" , " Ref10Gap24dpt " , kTRUE ));
269279 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiXiP {2} refN10 {-2}" , " Xi10Gap22a" , kTRUE ));
270280 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiXiN {2} refP10 {-2}" , " Xi10Gap22b" , kTRUE ));
271281 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiXifull reffull {2 2 -2 -2}" , " Xi10Gap24" , kTRUE ));
@@ -278,6 +288,8 @@ struct FlowGFWOmegaXi {
278288 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiLambdaP {2} refN10 {-2}" , " Lambda10Gap22a" , kTRUE ));
279289 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiLambdaN {2} refP10 {-2}" , " Lambda10Gap22b" , kTRUE ));
280290 corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiLambdaP reffull {2 2 -2 -2}" , " Xi10Gap24a" , kTRUE ));
291+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" refP10 {2} refN10 {-2}" , " Ref10Gap22" , kFALSE ));
292+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" reffull reffull {2 2 -2 -2}" , " Ref10Gap24" , kFALSE ));
281293 fGFW ->CreateRegions (); // finalize the initialization
282294
283295 // used for event selection
@@ -293,10 +305,40 @@ struct FlowGFWOmegaXi {
293305 fT0AV0AMean ->SetParameters (-1601.0581 , 9.417652e-01 );
294306 fT0AV0ASigma = new TF1 (" fT0AV0ASigma" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x" , 0 , 200000 );
295307 fT0AV0ASigma ->SetParameters (463.4144 , 6.796509e-02 , -9.097136e-07 , 7.971088e-12 , -2.600581e-17 );
308+
309+ // fWeight output
310+ if (cfgOutputNUAWeights) {
311+ fWeightsREF ->SetPtBins (nPtBins, &(axisPt.binEdges )[0 ]);
312+ fWeightsREF ->Init (true , false );
313+ fWeightsK0s ->SetPtBins (nPtBins, &(axisPt.binEdges )[0 ]);
314+ fWeightsK0s ->Init (true , false );
315+ fWeightsLambda ->SetPtBins (nPtBins, &(axisPt.binEdges )[0 ]);
316+ fWeightsLambda ->Init (true , false );
317+ fWeightsXi ->SetPtBins (nPtBins, &(axisPt.binEdges )[0 ]);
318+ fWeightsXi ->Init (true , false );
319+ fWeightsOmega ->SetPtBins (nPtBins, &(axisPt.binEdges )[0 ]);
320+ fWeightsOmega ->Init (true , false );
321+ }
322+ }
323+
324+ template <char ... chars>
325+ void FillProfile (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double & cent)
326+ {
327+ double dnx, val;
328+ dnx = fGFW ->Calculate (corrconf, 0 , kTRUE ).real ();
329+ if (dnx == 0 )
330+ return ;
331+ if (!corrconf.pTDif ) {
332+ val = fGFW ->Calculate (corrconf, 0 , kFALSE ).real () / dnx;
333+ if (TMath::Abs (val) < 1 )
334+ registry.fill (tarName, cent, val, dnx);
335+ return ;
336+ }
337+ return ;
296338 }
297339
298340 template <char ... chars>
299- void FillProfile (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int & ptbin, const double & cent)
341+ void FillProfilepT (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int & ptbin, const double & cent)
300342 {
301343 float dnx = 0 ;
302344 float val = 0 ;
@@ -311,7 +353,7 @@ struct FlowGFWOmegaXi {
311353 }
312354
313355 template <char ... chars>
314- void FillProfilepT (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int & ptbin, const int & PDGCode, const float & cent)
356+ void FillProfilepTMass (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int & ptbin, const int & PDGCode, const float & cent)
315357 {
316358 int nMassBins = 0 ;
317359 int nptbins = 0 ;
@@ -489,6 +531,8 @@ struct FlowGFWOmegaXi {
489531 if ((track.pt () > cfgCutPtMin) && (track.pt () < cfgCutPtMax)) {
490532 fGFW ->Fill (track.eta (), ptbin, track.phi (), wacc * weff, 1 ); // (eta, ptbin, phi, wacc*weff, bitmask)
491533 }
534+ if (cfgOutputNUAWeights)
535+ fWeightsREF ->Fill (track.phi (), track.eta (), vtxz, track.pt (), cent, 0 );
492536 }
493537 // fill GFW of V0 flow
494538 for (auto & v0 : V0s) {
@@ -526,18 +570,22 @@ struct FlowGFWOmegaXi {
526570 if (v0.dcaV0daughters () > cfgv0_dcav0dau)
527571 continue ;
528572 if (PDGCode == kK0Short ) {
529- if (TMath::Abs (v0.mK0Short () - 0.49761 ) < cfgv0_mk0swindow) {
573+ if (TMath::Abs (v0.mK0Short () - o2::constants::physics::MassK0Short ) < cfgv0_mk0swindow) {
530574 CandNum[0 ] = CandNum[0 ] + 1 ;
531575 registry.fill (HIST (" InvMassK0s" ), v0.pt (), v0.mK0Short (), v0.eta (), cent);
532576 registry.fill (HIST (" hEtaPhiVtxzPOIK0s" ), v0.phi (), v0.eta (), vtxz);
533577 fGFW ->Fill (v0.eta (), fV0PtAxis ->FindBin (v0.pt ()) - 1 + ((fK0sMass ->FindBin (v0.mK0Short ()) - 1 ) * nV0PtBins), v0.phi (), wacc * weff, 8 );
578+ if (cfgOutputNUAWeights)
579+ fWeightsK0s ->Fill (v0.phi (), v0.eta (), vtxz, v0.pt (), cent, 0 );
534580 }
535581 } else if (PDGCode == kLambda0 ) {
536- if (TMath::Abs (v0.mLambda () - 1.115683 ) < cfgv0_mlambdawindow) {
582+ if (TMath::Abs (v0.mLambda () - o2::constants::physics::MassLambda0 ) < cfgv0_mlambdawindow) {
537583 CandNum[1 ] = CandNum[1 ] + 1 ;
538584 registry.fill (HIST (" InvMassLambda" ), v0.pt (), v0.mLambda (), v0.eta (), cent);
539585 registry.fill (HIST (" hEtaPhiVtxzPOILambda" ), v0.phi (), v0.eta (), vtxz);
540586 fGFW ->Fill (v0.eta (), fV0PtAxis ->FindBin (v0.pt ()) - 1 + ((fLambdaMass ->FindBin (v0.mLambda ()) - 1 ) * nV0PtBins), v0.phi (), wacc * weff, 16 );
587+ if (cfgOutputNUAWeights)
588+ fWeightsLambda ->Fill (v0.phi (), v0.eta (), vtxz, v0.pt (), cent, 0 );
541589 }
542590 }
543591 }
@@ -581,7 +629,7 @@ struct FlowGFWOmegaXi {
581629 continue ;
582630 if (casc.dcaV0daughters () > cfgcasc_dcav0dau)
583631 continue ;
584- if (TMath::Abs (casc.mLambda () - 1.115683 ) > cfgcasc_mlambdawindow)
632+ if (TMath::Abs (casc.mLambda () - o2::constants::physics::MassLambda0 ) > cfgcasc_mlambdawindow)
585633 continue ;
586634 // track quality check
587635 if (bachelor.tpcNClsFound () < cfgtpcclusters)
@@ -603,6 +651,8 @@ struct FlowGFWOmegaXi {
603651 if ((casc.pt () < cfgCutPtPOIMax) && (casc.pt () > cfgCutPtPOIMin) && (casc.mOmega () > 1.63 ) && (casc.mOmega () < 1.71 )) {
604652 fGFW ->Fill (casc.eta (), fXiPtAxis ->FindBin (casc.pt ()) - 1 + ((fOmegaMass ->FindBin (casc.mOmega ()) - 1 ) * nXiPtBins), casc.phi (), wacc * weff, 4 );
605653 }
654+ if (cfgOutputNUAWeights)
655+ fWeightsOmega ->Fill (casc.phi (), casc.eta (), vtxz, casc.pt (), cent, 0 );
606656 }
607657 if (PDGCode == kXiMinus ) {
608658 CandNum[2 ] = CandNum[2 ] + 1 ;
@@ -611,6 +661,8 @@ struct FlowGFWOmegaXi {
611661 if ((casc.pt () < cfgCutPtPOIMax) && (casc.pt () > cfgCutPtPOIMin) && (casc.mXi () > 1.30 ) && (casc.mXi () < 1.37 )) {
612662 fGFW ->Fill (casc.eta (), fXiPtAxis ->FindBin (casc.pt ()) - 1 + ((fXiMass ->FindBin (casc.mXi ()) - 1 ) * nXiPtBins), casc.phi (), wacc * weff, 2 );
613663 }
664+ if (cfgOutputNUAWeights)
665+ fWeightsXi ->Fill (casc.phi (), casc.eta (), vtxz, casc.pt (), cent, 0 );
614666 }
615667 }
616668 for (int i = 0 ; i < 4 ; i++) {
@@ -622,25 +674,27 @@ struct FlowGFWOmegaXi {
622674 }
623675 }
624676 // Filling cumulant with ROOT TProfile and loop for all ptBins
677+ FillProfile (corrconfigs.at (14 ), HIST (" c22" ), cent);
678+ FillProfile (corrconfigs.at (15 ), HIST (" c24" ), cent);
625679 for (int i = 1 ; i <= nPtBins; i++) {
626- FillProfile (corrconfigs.at (0 ), HIST (" c22 " ), i, cent);
627- FillProfile (corrconfigs.at (1 ), HIST (" c24 " ), i, cent);
680+ FillProfilepT (corrconfigs.at (0 ), HIST (" c22dpt " ), i, cent);
681+ FillProfilepT (corrconfigs.at (1 ), HIST (" c24dpt " ), i, cent);
628682 }
629683 for (int i = 1 ; i <= nV0PtBins; i++) {
630- FillProfilepT (corrconfigs.at (8 ), HIST (" K0sc22dpt" ), i, kK0Short , cent);
631- FillProfilepT (corrconfigs.at (9 ), HIST (" K0sc22dpt" ), i, kK0Short , cent);
632- FillProfilepT (corrconfigs.at (10 ), HIST (" K0sc24dpt" ), i, kK0Short , cent);
633- FillProfilepT (corrconfigs.at (11 ), HIST (" Lambdac22dpt" ), i, kLambda0 , cent);
634- FillProfilepT (corrconfigs.at (12 ), HIST (" Lambdac22dpt" ), i, kLambda0 , cent);
635- FillProfilepT (corrconfigs.at (13 ), HIST (" Lambdac24dpt" ), i, kLambda0 , cent);
684+ FillProfilepTMass (corrconfigs.at (8 ), HIST (" K0sc22dpt" ), i, kK0Short , cent);
685+ FillProfilepTMass (corrconfigs.at (9 ), HIST (" K0sc22dpt" ), i, kK0Short , cent);
686+ FillProfilepTMass (corrconfigs.at (10 ), HIST (" K0sc24dpt" ), i, kK0Short , cent);
687+ FillProfilepTMass (corrconfigs.at (11 ), HIST (" Lambdac22dpt" ), i, kLambda0 , cent);
688+ FillProfilepTMass (corrconfigs.at (12 ), HIST (" Lambdac22dpt" ), i, kLambda0 , cent);
689+ FillProfilepTMass (corrconfigs.at (13 ), HIST (" Lambdac24dpt" ), i, kLambda0 , cent);
636690 }
637691 for (int i = 1 ; i <= nXiPtBins; i++) {
638- FillProfilepT (corrconfigs.at (2 ), HIST (" Xic22dpt" ), i, kXiMinus , cent);
639- FillProfilepT (corrconfigs.at (3 ), HIST (" Xic22dpt" ), i, kXiMinus , cent);
640- FillProfilepT (corrconfigs.at (4 ), HIST (" Xic24dpt" ), i, kXiMinus , cent);
641- FillProfilepT (corrconfigs.at (5 ), HIST (" Omegac22dpt" ), i, kOmegaMinus , cent);
642- FillProfilepT (corrconfigs.at (6 ), HIST (" Omegac22dpt" ), i, kOmegaMinus , cent);
643- FillProfilepT (corrconfigs.at (7 ), HIST (" Omegac24dpt" ), i, kOmegaMinus , cent);
692+ FillProfilepTMass (corrconfigs.at (2 ), HIST (" Xic22dpt" ), i, kXiMinus , cent);
693+ FillProfilepTMass (corrconfigs.at (3 ), HIST (" Xic22dpt" ), i, kXiMinus , cent);
694+ FillProfilepTMass (corrconfigs.at (4 ), HIST (" Xic24dpt" ), i, kXiMinus , cent);
695+ FillProfilepTMass (corrconfigs.at (5 ), HIST (" Omegac22dpt" ), i, kOmegaMinus , cent);
696+ FillProfilepTMass (corrconfigs.at (6 ), HIST (" Omegac22dpt" ), i, kOmegaMinus , cent);
697+ FillProfilepTMass (corrconfigs.at (7 ), HIST (" Omegac24dpt" ), i, kOmegaMinus , cent);
644698 }
645699 }
646700};
0 commit comments