5353#include < memory>
5454#include < string>
5555#include < vector>
56+ #include < unordered_map>
57+ #include < map>
5658
5759using namespace o2 ;
5860using namespace o2 ::framework;
@@ -79,6 +81,19 @@ std::shared_ptr<TProfile3D> omegac22[10];
7981std::shared_ptr<TProfile3D> omegac24[10 ];
8082std::shared_ptr<TProfile3D> omegac22Full[10 ];
8183std::shared_ptr<TProfile3D> omegac32[10 ];
84+
85+ // std::shared_ptr<TH3D>histosPhi[10];
86+ // std::shared_ptr<TH3D>histosPhicorr[10];
87+ // std::shared_ptr<TH3D>histosPhiK0s[10];
88+ // std::shared_ptr<TH3D>histosPhiLambda[10];
89+ // std::shared_ptr<TH3D>histosPhiXi[10];
90+ // std::shared_ptr<TH3D>histosPhiOmega[10];
91+ // std::shared_ptr<TH3D>histosPhiK0scorr[10];
92+ // std::shared_ptr<TH3D>histosPhiLambdacorr[10];
93+ // std::shared_ptr<TH3D>histosPhiXicorr[10];
94+ // std::shared_ptr<TH3D>histosPhiOmegacorr[10];
95+
96+ // std::shared_ptr<TH3D>nuaTH3[50];
8297} // namespace
8398
8499#define O2_DEFINE_CONFIGURABLE (NAME, TYPE, DEFAULT, HELP ) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
@@ -166,13 +181,15 @@ struct FlowGfwOmegaXi {
166181 O2_DEFINE_CONFIGURABLE (cfgLocDenParaOmega, std::vector<double >, (std::vector<double >{-0.000444324 , -6.0424 , -0.000566208 , -5.42168 , -0.000580338 , -4.96967 , -0.000721054 , -4.41994 , -0.000626394 , -4.27934 , -0.000652167 , -3.9543 , -0.000592327 , -3.79053 , -0.000544721 , -3.73292 , -0.000613419 , -3.43849 , -0.000402506 , -3.47687 , -0.000602687 , -3.24491 , -0.000460848 , -3.056 , -0.00039428 , -2.35188 , -0.00041908 , -2.03642 }), " Local density efficiency function parameter for Omega, exp(Ax + B)" )
167182 O2_DEFINE_CONFIGURABLE (cfgLocDenParaK0s, std::vector<double >, (std::vector<double >{-0.00043057 , -3.2435 , -0.000385085 , -2.97687 , -0.000350298 , -2.81502 , -0.000326159 , -2.71091 , -0.000299563 , -2.65448 , -0.000294284 , -2.60865 , -0.000277938 , -2.589 , -0.000277091 , -2.56983 , -0.000272783 , -2.56825 , -0.000252706 , -2.58996 , -0.000247834 , -2.63158 , -0.00024379 , -2.76976 , -0.000286468 , -2.92484 , -0.000310149 , -3.27746 }), " Local density efficiency function parameter for K0s, exp(Ax + B)" )
168183 O2_DEFINE_CONFIGURABLE (cfgLocDenParaLambda, std::vector<double >, (std::vector<double >{-0.000510948 , -4.4846 , -0.000460629 , -4.14465 , -0.000433729 , -3.94173 , -0.000412751 , -3.81839 , -0.000411211 , -3.72502 , -0.000401511 , -3.68426 , -0.000407461 , -3.67005 , -0.000379371 , -3.71153 , -0.000392828 , -3.73214 , -0.000403996 , -3.80717 , -0.000403376 , -3.90917 , -0.000354624 , -4.34629 , -0.000477606 , -4.66307 , -0.000541139 , -4.61364 }), " Local density efficiency function parameter for Lambda, exp(Ax + B)" )
184+ O2_DEFINE_CONFIGURABLE (cfgRunNumbers, std::vector<int >, (std::vector<int >{544095 , 544098 , 544116 , 544121 , 544122 , 544123 , 544124 }), " Preconfigured run numbers" )
169185 // switch
170186 O2_DEFINE_CONFIGURABLE (cfgDoAccEffCorr, bool , false , " do acc and eff corr" )
171187 O2_DEFINE_CONFIGURABLE (cfgDoLocDenCorr, bool , false , " do local density corr" )
172188 O2_DEFINE_CONFIGURABLE (cfgDoJackknife, bool , false , " do jackknife" )
173189 O2_DEFINE_CONFIGURABLE (cfgOutputV0, bool , true , " Fill and output V0s flow" )
174190 O2_DEFINE_CONFIGURABLE (cfgOutputCasc, bool , true , " Fill and output cascades flow" )
175191 O2_DEFINE_CONFIGURABLE (cfgOutputNUAWeights, bool , false , " Fill and output NUA weights" )
192+ O2_DEFINE_CONFIGURABLE (cfgOutputrunbyrun, bool , false , " Fill and output NUA weights run by run" )
176193 O2_DEFINE_CONFIGURABLE (cfgOutputLocDenWeights, bool , false , " Fill and output local density weights" )
177194 O2_DEFINE_CONFIGURABLE (cfgOutputQA, bool , false , " do QA" )
178195
@@ -221,6 +238,9 @@ struct FlowGfwOmegaXi {
221238 std::vector<std::string> cfgEfficiency;
222239 std::vector<float > cfgNSigma;
223240 std::vector<int > cfgmassbins;
241+ std::vector<int > runNumbers;
242+ std::map<int , std::vector<std::shared_ptr<TH1>>> th1sList;
243+ std::map<int , std::vector<std::shared_ptr<TH3>>> th3sList;
224244
225245 std::vector<GFWWeights*> mAcceptance ;
226246 std::vector<TH1D*> mEfficiency ;
@@ -325,6 +345,32 @@ struct FlowGfwOmegaXi {
325345 registry.add (" hEtaPhiVtxzPOIK0s" , " " , {HistType::kTH3D , {cfgaxisPhi, cfgaxisEta, {20 , -10 , 10 }}});
326346 registry.add (" hEtaPhiVtxzPOILambda" , " " , {HistType::kTH3D , {cfgaxisPhi, cfgaxisEta, {20 , -10 , 10 }}});
327347
348+ if (cfgOutputrunbyrun) {
349+ runNumbers = cfgRunNumbers;
350+ for (const auto & runNumber : runNumbers) {
351+ std::vector<std::shared_ptr<TH1>> histosPhi;
352+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhi" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
353+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhicorr" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
354+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiK0s" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
355+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiLambda" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
356+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiXi" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
357+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiOmega" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
358+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiK0scorr" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
359+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiLambdacorr" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
360+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiXicorr" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
361+ histosPhi.push_back (registry.add <TH1>(Form (" %d/hPhiOmegacorr" , runNumber), " " , {HistType::kTH1D , {cfgaxisPhi}}));
362+ th1sList.insert (std::make_pair (runNumber, histosPhi));
363+
364+ std::vector<std::shared_ptr<TH3>> nuaTH3;
365+ nuaTH3.push_back (registry.add <TH3>(Form (" %d/hPhiEtaVtxz" , runNumber), " ;#varphi;#eta;v_{z}" , {HistType::kTH3D , {cfgaxisPhi, {64 , -1.6 , 1.6 }, cfgaxisVertex}}));
366+ nuaTH3.push_back (registry.add <TH3>(Form (" %d/hPhiEtaVtxzK0s" , runNumber), " ;#varphi;#eta;v_{z}" , {HistType::kTH3D , {cfgaxisPhi, {64 , -1.6 , 1.6 }, cfgaxisVertex}}));
367+ nuaTH3.push_back (registry.add <TH3>(Form (" %d/hPhiEtaVtxzLambda" , runNumber), " ;#varphi;#eta;v_{z}" , {HistType::kTH3D , {cfgaxisPhi, {64 , -1.6 , 1.6 }, cfgaxisVertex}}));
368+ nuaTH3.push_back (registry.add <TH3>(Form (" %d/hPhiEtaVtxzXi" , runNumber), " ;#varphi;#eta;v_{z}" , {HistType::kTH3D , {cfgaxisPhi, {64 , -1.6 , 1.6 }, cfgaxisVertex}}));
369+ nuaTH3.push_back (registry.add <TH3>(Form (" %d/hPhiEtaVtxzOmega" , runNumber), " ;#varphi;#eta;v_{z}" , {HistType::kTH3D , {cfgaxisPhi, {64 , -1.6 , 1.6 }, cfgaxisVertex}}));
370+ th3sList.insert (std::make_pair (runNumber, nuaTH3));
371+ }
372+ }
373+
328374 registry.add (" hEventCount" , " " , {HistType::kTH1D , {{12 , 0 , 12 }}});
329375 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (1 , " Filtered event" );
330376 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (2 , " after sel8" );
@@ -446,7 +492,7 @@ struct FlowGfwOmegaXi {
446492 registry.add (" MC/Lambdac22dptMC" , " ;pt ; C_{2}{2} " , {HistType::kTProfile2D , {cfgaxisPtLambda, axisMultiplicity}});
447493 // InvMass(GeV) of casc and v0
448494 AxisSpec axisOmegaMass = {80 , 1 .63f , 1 .71f , " Inv. Mass (GeV)" };
449- AxisSpec axisXiMass = {70 , 1 .3f , 1 .37f , " Inv. Mass (GeV)" };
495+ AxisSpec axisXiMass = {80 , 1 .29f , 1 .37f , " Inv. Mass (GeV)" };
450496 AxisSpec axisK0sMass = {400 , 0 .4f , 0 .6f , " Inv. Mass (GeV)" };
451497 AxisSpec axisLambdaMass = {160 , 1 .08f , 1 .16f , " Inv. Mass (GeV)" };
452498 registry.add (" InvMassXi_all" , " " , {HistType::kTHnSparseF , {cfgaxisPtXi, axisXiMass, cfgaxisEta, axisMultiplicity}});
@@ -919,6 +965,7 @@ struct FlowGfwOmegaXi {
919965 return ;
920966 TH1D* hLocalDensity = new TH1D (" hphi" , " hphi" , 400 , -constants::math::TwoPI, constants::math::TwoPI);
921967 auto bc = collision.bc_as <aod::BCsWithTimestamps>();
968+ int runNumber = bc.runNumber ();
922969 loadCorrections (bc.timestamp ());
923970 float vtxz = collision.posZ ();
924971 registry.fill (HIST (" hVtxZ" ), vtxz);
@@ -954,6 +1001,12 @@ struct FlowGfwOmegaXi {
9541001 }
9551002 if (cfgOutputNUAWeights)
9561003 fWeightsREF ->fill (track.phi (), track.eta (), vtxz, track.pt (), cent, 0 );
1004+
1005+ if (cfgOutputrunbyrun) {
1006+ th1sList[runNumber][0 ]->Fill (track.phi ());
1007+ th1sList[runNumber][1 ]->Fill (track.phi (), wacc);
1008+ th3sList[runNumber][0 ]->Fill (track.phi (), track.eta (), vtxz);
1009+ }
9571010 }
9581011 if (cfgDoLocDenCorr) {
9591012 registry.fill (HIST (" hCentvsNch" ), cent, nch);
@@ -1080,6 +1133,11 @@ struct FlowGfwOmegaXi {
10801133 fGFW ->Fill (v0.eta (), fK0sPtAxis ->FindBin (v0.pt ()) - 1 + ((fK0sMass ->FindBin (v0.mK0Short ()) - 1 ) * nK0sPtBins), v0.phi (), wacc * weff * wloc, 8 );
10811134 if (cfgOutputNUAWeights)
10821135 fWeightsK0s ->fill (v0.phi (), v0.eta (), vtxz, v0.pt (), cent, 0 );
1136+ if (cfgOutputrunbyrun) {
1137+ th1sList[runNumber][2 ]->Fill (v0.phi ());
1138+ th1sList[runNumber][6 ]->Fill (v0.phi (), wacc);
1139+ th3sList[runNumber][1 ]->Fill (v0.phi (), v0.eta (), vtxz);
1140+ }
10831141 }
10841142 if (isLambda) {
10851143 if (cfgDoAccEffCorr)
@@ -1099,6 +1157,11 @@ struct FlowGfwOmegaXi {
10991157 fGFW ->Fill (v0.eta (), fK0sPtAxis ->FindBin (v0.pt ()) - 1 + ((fLambdaMass ->FindBin (v0.mLambda ()) - 1 ) * nK0sPtBins), v0.phi (), wacc * weff * wloc, 16 );
11001158 if (cfgOutputNUAWeights)
11011159 fWeightsLambda ->fill (v0.phi (), v0.eta (), vtxz, v0.pt (), cent, 0 );
1160+ if (cfgOutputrunbyrun) {
1161+ th1sList[runNumber][3 ]->Fill (v0.phi ());
1162+ th1sList[runNumber][7 ]->Fill (v0.phi (), wacc);
1163+ th3sList[runNumber][2 ]->Fill (v0.phi (), v0.eta (), vtxz);
1164+ }
11021165 }
11031166 }
11041167 }
@@ -1222,7 +1285,7 @@ struct FlowGfwOmegaXi {
12221285 isXi = false ;
12231286 }
12241287 if (isOmega && std::fabs (casc.mXi () - o2::constants::physics::MassXiMinus) < cascBuilderOpts.cfgcasc_compmassrej .value ) {
1225- isXi = false ;
1288+ isOmega = false ;
12261289 }
12271290 // fill QA
12281291 if (cfgOutputQA) {
@@ -1264,6 +1327,11 @@ struct FlowGfwOmegaXi {
12641327
12651328 if (cfgOutputNUAWeights)
12661329 fWeightsOmega ->fill (casc.phi (), casc.eta (), vtxz, casc.pt (), cent, 0 );
1330+ if (cfgOutputrunbyrun) {
1331+ th1sList[runNumber][5 ]->Fill (casc.phi ());
1332+ th1sList[runNumber][9 ]->Fill (casc.phi (), wacc);
1333+ th3sList[runNumber][4 ]->Fill (casc.phi (), casc.eta (), vtxz);
1334+ }
12671335 }
12681336 if (isXi) {
12691337 if (cfgDoAccEffCorr) {
@@ -1285,6 +1353,11 @@ struct FlowGfwOmegaXi {
12851353
12861354 if (cfgOutputNUAWeights)
12871355 fWeightsXi ->fill (casc.phi (), casc.eta (), vtxz, casc.pt (), cent, 0 );
1356+ if (cfgOutputrunbyrun) {
1357+ th1sList[runNumber][4 ]->Fill (casc.phi ());
1358+ th1sList[runNumber][8 ]->Fill (casc.phi (), wacc);
1359+ th3sList[runNumber][3 ]->Fill (casc.phi (), casc.eta (), vtxz);
1360+ }
12881361 }
12891362 }
12901363 }
0 commit comments