@@ -66,6 +66,7 @@ using namespace o2::framework::expressions;
6666#define O2_DEFINE_CONFIGURABLE (NAME, TYPE, DEFAULT, HELP ) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
6767
6868struct PidFlowPtCorr {
69+ #pragma region // configurable
6970
7071 O2_DEFINE_CONFIGURABLE (cfgCutVertex, float , 10 .0f , " Accepted z-vertex range" )
7172 O2_DEFINE_CONFIGURABLE (cfgCutChi2prTPCcls, float , 2.5 , " Chi2 per TPC clusters" )
@@ -172,6 +173,15 @@ struct PidFlowPtCorr {
172173 // end separate k-p
173174 // end cfg for PID pt range
174175
176+ struct : ConfigurableGroup {
177+ std::string prefix = " particleAbundanceOpts" ;
178+ ConfigurableAxis cfgaxisAbundancePi{" cfgaxisAbundancePi" , {100 , 0 , 1100 }, " axis for Abundance Pi" };
179+ ConfigurableAxis cfgaxisAbundanceKa{" cfgaxisAbundanceKa" , {100 , 0 , 200 }, " axis for Abundance ka" };
180+ ConfigurableAxis cfgaxisAbundancePr{" cfgaxisAbundancePr" , {100 , 0 , 50 }, " axis for Abundance Pr" };
181+
182+ O2_DEFINE_CONFIGURABLE (cfgOutPutAbundanceDis, bool , false , " out put hists for pid particle Abundance QA" );
183+ } particleAbundanceOpts;
184+
175185 ConfigurableAxis cfgaxisVertex{" cfgaxisVertex" , {20 , -10 , 10 }, " vertex axis for histograms" };
176186 ConfigurableAxis cfgaxisPhi{" cfgaxisPhi" , {60 , 0.0 , constants::math::TwoPI}, " phi axis for histograms" };
177187 ConfigurableAxis cfgaxisEta{" cfgaxisEta" , {40 , -1 ., 1 .}, " eta axis for histograms" };
@@ -188,6 +198,9 @@ struct PidFlowPtCorr {
188198
189199 AxisSpec axisMultiplicity{{0 , 5 , 10 , 15 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 }, " Centrality (%)" };
190200
201+ #pragma endregion // configurable
202+
203+ #pragma region // filter
191204 // filter and using
192205 // data
193206 Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
@@ -210,6 +223,10 @@ struct PidFlowPtCorr {
210223 using FilteredCollisionsWithMCLabel = soa::Filtered<soa::Join<AodCollisions, aod::EvSels, aod::McCollisionLabels>>;
211224 // end using and filter
212225
226+ #pragma endregion // filter
227+
228+ #pragma region // others
229+
213230 Preslice<aod::Tracks> perCollision = aod::track::collisionId;
214231
215232 // Connect to ccdb
@@ -248,6 +265,7 @@ struct PidFlowPtCorr {
248265 kProton ,
249266 kNumberOfParticles
250267 };
268+
251269 enum OutputTH1Names {
252270 // here are TProfiles for vn-pt correlations that are not implemented in GFW
253271 hPhi = 0 ,
@@ -317,6 +335,8 @@ struct PidFlowPtCorr {
317335 std::vector<qaHist> qaHistVector;
318336 // end hists for QA runbyrun
319337
338+ #pragma endregion // others
339+
320340 void init (InitContext const &) // Initialization
321341 {
322342 ccdb->setURL (cfgurl.value );
@@ -434,6 +454,10 @@ struct PidFlowPtCorr {
434454 registry.add (" ptSpectra/hCentEventCountMcRec" , " " , {HistType::kTH1D , {axisMultiplicity}});
435455
436456 registry.add (" ptSpectra/hPtCentData4ITSOnly" , " " , {HistType::kTH2D , {cfgaxisPt, axisMultiplicity}});
457+
458+ registry.add (" c22PrimeVsc22/Pi" , " " , {HistType::kTH2D , {{100 , 0 ., 0.01 }, {100 , 0 ., 0.01 }}});
459+ registry.add (" c22PrimeVsc22/Ka" , " " , {HistType::kTH2D , {{100 , 0 ., 0.01 }, {100 , 0 ., 0.01 }}});
460+ registry.add (" c22PrimeVsc22/Pr" , " " , {HistType::kTH2D , {{100 , 0 ., 0.01 }, {100 , 0 ., 0.01 }}});
437461 } // cfgoutputptspectra
438462
439463 if (cfgOutputrunbyrun) {
@@ -446,6 +470,12 @@ struct PidFlowPtCorr {
446470 // end set "correction/hRunNumberPhiEtaVertex" axis0 label
447471 } // cfgooutputrunbyrun
448472
473+ if (particleAbundanceOpts.cfgOutPutAbundanceDis ) {
474+ registry.add (" abundance/hNumOfPiEventCount" , " " , {HistType::kTH1D , {particleAbundanceOpts.cfgaxisAbundancePi }});
475+ registry.add (" abundance/hNumOfKaEventCount" , " " , {HistType::kTH1D , {particleAbundanceOpts.cfgaxisAbundanceKa }});
476+ registry.add (" abundance/hNumOfPrEventCount" , " " , {HistType::kTH1D , {particleAbundanceOpts.cfgaxisAbundancePr }});
477+ }
478+
449479 // set bin label for hEventCount
450480 // processdata
451481 registry.add (" hEventCount/processData" , " " , {HistType::kTH1D , {{14 , 0 , 14 }}});
@@ -643,6 +673,8 @@ struct PidFlowPtCorr {
643673 funcV4->SetParameters (v4para[0 ], v4para[1 ], v4para[2 ], v4para[3 ], v4para[4 ]);
644674 }
645675
676+ #pragma region // pid utils function
677+
646678 /* *
647679 * @brief Identify whether the input track is a Pion
648680 *
@@ -773,6 +805,26 @@ struct PidFlowPtCorr {
773805 return resultKaon;
774806 }
775807
808+ #pragma endregion // pid util function
809+
810+ #pragma region // other utils
811+
812+ double getPidC22InOneEvent (const GFW::CorrConfig& corrconfA, const GFW::CorrConfig& corrconfB)
813+ {
814+ double NpairA = fGFW ->Calculate (corrconfA, 0 , true ).real ();
815+ double NpairB = fGFW ->Calculate (corrconfB, 0 , true ).real ();
816+
817+ if (NpairA == 0 && NpairB == 0 )
818+ return 0 ;
819+
820+ double ChC22A = NpairA ? fGFW ->Calculate (corrconfA, 0 , false ).real () / NpairA : 0 .;
821+ double ChC22B = NpairB ? fGFW ->Calculate (corrconfB, 0 , false ).real () / NpairB : 0 .;
822+
823+ double ChC22 = (ChC22A * NpairA + ChC22B * NpairB) / (NpairA + NpairB);
824+
825+ return ChC22;
826+ }
827+
776828 /* *
777829 * @brief get stable particle
778830 * @note stable particle include
@@ -804,6 +856,10 @@ struct PidFlowPtCorr {
804856 return false ;
805857 }
806858
859+ #pragma endregion // other utils
860+
861+ #pragma region // fgfw filling helpers
862+
807863 bool fillFC (MyParticleType type, const GFW::CorrConfig& corrconf, const double & cent, const double & rndm, const char * tarName)
808864 {
809865 double dnx, val;
@@ -943,6 +999,10 @@ struct PidFlowPtCorr {
943999 return ;
9441000 }
9451001
1002+ #pragma endregion // fill fgfw helper
1003+
1004+ #pragma region // correction apply functions
1005+
9461006 /* *
9471007 * @brief load NUE(1D) NUE(2D) NUA graphs
9481008 * @note if u write more than one path in cfg, the graph would not load, that's the strange way to close NUE/NUA corr separatly
@@ -1179,6 +1239,10 @@ struct PidFlowPtCorr {
11791239 return true ;
11801240 }
11811241
1242+ #pragma endregion // correction apply function
1243+
1244+ #pragma region // track cut functions
1245+
11821246 /* *
11831247 * @brief cut MC particles
11841248 * @note include
@@ -1296,6 +1360,10 @@ struct PidFlowPtCorr {
12961360 return true ;
12971361 }
12981362
1363+ #pragma endregion // track cut
1364+
1365+ #pragma region // event selection functions
1366+
12991367 /* *
13001368 * @brief fill eventCount for different function
13011369 *
@@ -1438,6 +1506,10 @@ struct PidFlowPtCorr {
14381506 return true ;
14391507 }
14401508
1509+ #pragma endregion // event selection
1510+
1511+ #pragma region // main functions
1512+
14411513 void processData (AodCollisions::iterator const & collision, aod::BCsWithTimestamps const &, AodTracks const & tracks)
14421514 {
14431515 // init
@@ -1562,7 +1634,10 @@ struct PidFlowPtCorr {
15621634 }
15631635
15641636 int totalGlobalTrack = 0 ;
1565-
1637+ // calculate number of pid particle
1638+ int numOfPi = 0 ;
1639+ int numOfKa = 0 ;
1640+ int numOfPr = 0 ;
15661641 // fill v2 flow
15671642 // use global track
15681643 for (const auto & track : tracks) {
@@ -1674,22 +1749,31 @@ struct PidFlowPtCorr {
16741749 // bitmask 18: 0010010
16751750 fGFW ->Fill (track.eta (), 0 , track.phi (), wacc * weff, 18 );
16761751 // fill PIONS and overlap Pions
1752+ numOfPi++;
16771753 }
16781754
16791755 if (isKaon (track)) {
16801756 // bitmask 36: 0100100
16811757 fGFW ->Fill (track.eta (), 0 , track.phi (), wacc * weff, 36 );
16821758 // fill KAONS and overlap Kaons
1759+ numOfKa++;
16831760 }
16841761
16851762 if (isProton (track)) {
16861763 // bitmask 72: 1001000
16871764 fGFW ->Fill (track.eta (), 0 , track.phi (), wacc * weff, 72 );
16881765 // fill PROTONS and overlap Protons
1766+ numOfPr++;
16891767 }
16901768 // end fill GFW
16911769 } // end track loop for v2 calculation
16921770
1771+ if (particleAbundanceOpts.cfgOutPutAbundanceDis ) {
1772+ registry.fill (HIST (" abundance/hNumOfPiEventCount" ), numOfPi);
1773+ registry.fill (HIST (" abundance/hNumOfKaEventCount" ), numOfKa);
1774+ registry.fill (HIST (" abundance/hNumOfPrEventCount" ), numOfPr);
1775+ } // outputabundacedis
1776+
16931777 if (cfgDebugMyCode) {
16941778 LOGF (info, Form (" global track num %d" , totalGlobalTrack));
16951779 }
@@ -1784,6 +1868,31 @@ struct PidFlowPtCorr {
17841868 fillProfilePOIvnpt (corrconfigs.at (9 ), HIST (" pr/c22dmeanpt" ), cent, ptSum, nch);
17851869 fillProfilePOIvnpt (corrconfigs.at (10 ), HIST (" pr/c22dmeanpt" ), cent, ptSum, nch);
17861870
1871+ if (cfgOutPutPtSpectra) {
1872+ // charged calculation
1873+ double NpairCharged = fGFW ->Calculate (corrconfigs.at (0 ), 0 , true ).real ();
1874+ double chargedC22 = NpairCharged > 0 ? fGFW ->Calculate (corrconfigs.at (0 ), 0 , false ).real () / NpairCharged : 0 ;
1875+ // end charged calculation
1876+
1877+ // pi
1878+ double pidChargedC22Pi = getPidC22InOneEvent (corrconfigs.at (5 ), corrconfigs.at (6 ));
1879+ if (pidChargedC22Pi > 0 && chargedC22 > 0 )
1880+ registry.fill (HIST (" c22PrimeVsc22/Pi" ), pidChargedC22Pi, chargedC22);
1881+ // end pi
1882+
1883+ // Ka
1884+ double pidKaonC22 = getPidC22InOneEvent (corrconfigs.at (7 ), corrconfigs.at (8 ));
1885+ if (pidKaonC22 > 0 && chargedC22 > 0 )
1886+ registry.fill (HIST (" c22PrimeVsc22/Ka" ), pidKaonC22, chargedC22);
1887+ // end Ka
1888+
1889+ // Pr
1890+ double pidProtonC22 = getPidC22InOneEvent (corrconfigs.at (9 ), corrconfigs.at (10 ));
1891+ if (pidProtonC22 > 0 && chargedC22 > 0 )
1892+ registry.fill (HIST (" c22PrimeVsc22/Pr" ), pidProtonC22, chargedC22);
1893+ // end Pr
1894+ }
1895+
17871896 fFCCh ->FillProfile (" hMeanPt" , cent, (ptSum / nch), nch, rndm);
17881897
17891898 double nchDiff = nch * nch - nchSquare;
@@ -2108,6 +2217,8 @@ struct PidFlowPtCorr {
21082217 // end cut && init
21092218 }
21102219 PROCESS_SWITCH (PidFlowPtCorr, processSim, " function used to do pt eff, NOTE (OutPutMc, processReco, processSim) should be open" , true );
2220+
2221+ #pragma endregion // main function
21112222};
21122223
21132224WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments