@@ -147,6 +147,8 @@ struct PidFlowPtCorr {
147147 O2_DEFINE_CONFIGURABLE (cfgOutPutPtSpectra, bool , false , " output pt spectra for data, MC and RECO" );
148148 O2_DEFINE_CONFIGURABLE (cfgCheck2MethodDiff, bool , false , " check difference between v2' && v2''" );
149149 O2_DEFINE_CONFIGURABLE (cfgClosureTest, int , 0 , " choose (val) percent particle from charged to pass Pion PID selection" );
150+
151+ O2_DEFINE_CONFIGURABLE (cfgProcessQAOutput, bool , false , " QA plots for processQA" );
150152 } switchsOpts;
151153
152154 /* *
@@ -309,6 +311,7 @@ struct PidFlowPtCorr {
309311 funcFillCorrectionGraph,
310312 funcProcessReco,
311313 funcProcessSim,
314+ funcProcessQA,
312315 funcNumber
313316 };
314317
@@ -621,6 +624,28 @@ struct PidFlowPtCorr {
621624 // end pid
622625 // end init tprofile3d for <2'> - meanpt
623626
627+ // / @note init QA plot for processQA
628+ if (switchsOpts.cfgProcessQAOutput .value ) {
629+ // / @note track QA
630+ registry.add (" hProcessQA/hDCAz" , " DCAz after collision cuts; DCAz (cm); Pt" , {HistType::kTH2D , {{200 , -5 , 5 }, {200 , 0 , 3 }}});
631+ registry.add (" hProcessQA/hDCAxy" , " DCAxy after cuts; DCAxy (cm); Pt" , {HistType::kTH2D , {{200 , -0.5 , 0.5 }, {200 , 0 , 5 }}});
632+
633+ registry.add (" hProcessQA/hChi2prTPCcls" , " #chi^{2}/cluster for the TPC track segment" , {HistType::kTH1D , {{100 , 0 ., 5 .}}});
634+ registry.add (" hProcessQA/hChi2prITScls" , " #chi^{2}/cluster for the ITS track" , {HistType::kTH1D , {{100 , 0 ., 50 .}}});
635+
636+ registry.add (" hProcessQA/hnTPCClu" , " Number of found TPC clusters" , {HistType::kTH1D , {{100 , 40 , 180 }}});
637+ registry.add (" hProcessQA/hnITSClu" , " Number of found ITS clusters" , {HistType::kTH1D , {{10 , 0 , 10 }}});
638+ registry.add (" hProcessQA/hnTPCCrossedRow" , " Number of crossed TPC Rows" , {HistType::kTH1D , {{100 , 40 , 180 }}});
639+ // end track QA
640+
641+ // / @note evetn QA
642+ registry.add (" hProcessQA/centVsMult" , " cent Vs Mult;Centrality T0C;mulplicity global tracks" , {HistType::kTH2D , {axisMultiplicity, cfgaxisNch}});
643+ registry.add (" hProcessQA/IR" , " " , {HistType::kTH1D , {{100 , 0 , 100 }}});
644+ registry.add (" hProcessQA/Occupacy" , " " , {HistType::kTH1D , {{1000 , 0 , 10000 }}});
645+ // end evetn QA
646+ }
647+ // end init QA plot for processQA
648+
624649 // fgfw set up and correlation config setup
625650 // Data stored in fGFW
626651 double etaMax = trkQualityOpts.cfgCutEta .value ;
@@ -2410,6 +2435,65 @@ struct PidFlowPtCorr {
24102435 }
24112436 PROCESS_SWITCH (PidFlowPtCorr, fillCorrectionGraph, " " , true );
24122437
2438+ void processQA (AodCollisions::iterator const & collision, aod::BCsWithTimestamps const &, AodTracks const & tracks)
2439+ {
2440+ if (!switchsOpts.cfgProcessQAOutput .value ) {
2441+ LOGF (fatal, " processQAOutput no open!" );
2442+ }
2443+
2444+ // / @note init && collision cut
2445+ int nTot = tracks.size ();
2446+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
2447+ int runNumber = bc.runNumber ();
2448+ double interactionRate = rateFetcher.fetch (ccdb.service , bc.timestamp (), runNumber, " ZNC hadronic" ) * 1 .e -3 ;
2449+ // end init
2450+
2451+ // / @note collision cut
2452+ // include : 1.track.size 2.collision.sel8 3. evenSelected
2453+ if (nTot < 1 )
2454+ return ;
2455+
2456+ const auto cent = collision.centFT0C ();
2457+ if (!collision.sel8 ())
2458+ return ;
2459+
2460+ // / @note event qa
2461+ registry.fill (HIST (" hProcessQA/centVsMult" ), cent, tracks.size ());
2462+ registry.fill (HIST (" hProcessQA/IR" ), interactionRate);
2463+ registry.fill (HIST (" hProcessQA/Occupacy" ), collision.trackOccupancyInTimeRange ());
2464+ // end event qa
2465+
2466+ // i dont want to fill event count again as it's filled in other 5 function
2467+ if (!eventSelected (collision, cent, interactionRate, MyFunctionName::funcProcessQA))
2468+ return ;
2469+ // end init && collision cut
2470+
2471+ // / @note track loop
2472+ for (const auto & track : tracks) {
2473+ // / @note select global track
2474+ // track cut isnt applied, this is track QA function!
2475+ if (!track.hasITS ())
2476+ continue ;
2477+ if (!track.hasTPC ())
2478+ continue ;
2479+ // end select global track
2480+
2481+ // / @note fill QA graphs
2482+ registry.fill (HIST (" hProcessQA/hDCAz" ), track.dcaZ (), track.pt ());
2483+ registry.fill (HIST (" hProcessQA/hDCAxy" ), track.dcaXY (), track.pt ());
2484+
2485+ registry.fill (HIST (" hProcessQA/hChi2prTPCcls" ), track.tpcChi2NCl ());
2486+ registry.fill (HIST (" hProcessQA/hChi2prITScls" ), track.itsChi2NCl ());
2487+
2488+ registry.fill (HIST (" hProcessQA/hnTPCClu" ), track.tpcNClsFound ());
2489+ registry.fill (HIST (" hProcessQA/hnITSClu" ), track.itsNCls ());
2490+ registry.fill (HIST (" hProcessQA/hnTPCCrossedRow" ), track.tpcNClsCrossedRows ());
2491+ // end fill QA grahps
2492+ }
2493+ // end track loop
2494+ }
2495+ PROCESS_SWITCH (PidFlowPtCorr, processQA, " " , true );
2496+
24132497 /* *
24142498 * @brief this main function is used to check the PID performance of ITS TOC TPC, also used to do QA
24152499 * @note open switch outputQA if use it
0 commit comments