@@ -304,6 +304,12 @@ struct FlowTask {
304304 registry.add (" hDCAz" , " DCAz after cuts; DCAz (cm); Pt" , {HistType::kTH2D , {{200 , -0.5 , 0.5 }, {200 , 0 , 5 }}});
305305 registry.add (" hDCAxy" , " DCAxy after cuts; DCAxy (cm); Pt" , {HistType::kTH2D , {{200 , -0.5 , 0.5 }, {200 , 0 , 5 }}});
306306 registry.add (" hTrackCorrection2d" , " Correlation table for number of tracks table; uncorrected track; corrected track" , {HistType::kTH2D , {axisNch, axisNch}});
307+ registry.add (" hMeanPt" , " " , {HistType::kTProfile , {axisIndependent}});
308+ registry.add (" hMeanPtWithinGap08" , " " , {HistType::kTProfile , {axisIndependent}});
309+ registry.add (" c22_gap08_Weff" , " " , {HistType::kTProfile , {axisIndependent}});
310+ registry.add (" c22_gap08_trackMeanPt" , " " , {HistType::kTProfile , {axisIndependent}});
311+ registry.add (" PtVariance_partA_WithinGap08" , " " , {HistType::kTProfile , {axisIndependent}});
312+ registry.add (" PtVariance_partB_WithinGap08" , " " , {HistType::kTProfile , {axisIndependent}});
307313 if (doprocessMCGen) {
308314 registry.add (" MCGen/MChPhi" , " #phi distribution" , {HistType::kTH1D , {axisPhi}});
309315 registry.add (" MCGen/MChEta" , " #eta distribution" , {HistType::kTH1D , {axisEta}});
@@ -555,6 +561,25 @@ struct FlowTask {
555561 return ;
556562 }
557563
564+ template <char ... chars, char ... chars2>
565+ void fillpTvnProfile (const GFW::CorrConfig& corrconf, const double & sum_pt, const double & WeffEvent, const ConstStr<chars...>& vnWeff, const ConstStr<chars2...>& vnpT, const double & cent)
566+ {
567+ double meanPt = sum_pt / WeffEvent;
568+ double dnx, val;
569+ dnx = fGFW ->Calculate (corrconf, 0 , kTRUE ).real ();
570+ if (dnx == 0 )
571+ return ;
572+ if (!corrconf.pTDif ) {
573+ val = fGFW ->Calculate (corrconf, 0 , kFALSE ).real () / dnx;
574+ if (std::fabs (val) < 1 ) {
575+ registry.fill (vnWeff, cent, val, dnx * WeffEvent);
576+ registry.fill (vnpT, cent, val * meanPt, dnx * WeffEvent);
577+ }
578+ return ;
579+ }
580+ return ;
581+ }
582+
558583 template <DataType dt>
559584 void fillFC (const GFW::CorrConfig& corrconf, const double & cent, const double & rndm)
560585 {
@@ -898,6 +923,10 @@ struct FlowTask {
898923
899924 // track weights
900925 float weff = 1 , wacc = 1 ;
926+ double weffEvent = 0 ;
927+ double ptSum = 0 ., ptSum_Gap08 = 0 .;
928+ double weffEventWithinGap08 = 0 ., weffEventSquareWithinGap08 = 0 .;
929+ double sumPtsquareWsquareWithinGap08 = 0 ., sumPtWsquareWithinGap08 = 0 .;
901930 double nTracksCorrected = 0 ;
902931 int magnetfield = 0 ;
903932 float independent = cent;
@@ -943,6 +972,7 @@ struct FlowTask {
943972 continue ;
944973 bool withinPtPOI = (cfgCutPtPOIMin < track.pt ()) && (track.pt () < cfgCutPtPOIMax); // within POI pT range
945974 bool withinPtRef = (cfgCutPtRefMin < track.pt ()) && (track.pt () < cfgCutPtRefMax); // within RF pT range
975+ bool withinEtaGap08 = (std::abs (track.eta ()) < cfgEtaPtPt);
946976 if (cfgOutputNUAWeights) {
947977 if (cfgOutputNUAWeightsRefPt) {
948978 if (withinPtRef)
@@ -978,7 +1008,16 @@ struct FlowTask {
9781008 registry.fill (HIST (" hnTPCCrossedRow" ), track.tpcNClsCrossedRows ());
9791009 registry.fill (HIST (" hDCAz" ), track.dcaZ (), track.pt ());
9801010 registry.fill (HIST (" hDCAxy" ), track.dcaXY (), track.pt ());
1011+ weffEvent += weff;
1012+ ptSum += weff * track.pt ();
9811013 nTracksCorrected += weff;
1014+ if (withinEtaGap08) {
1015+ ptSum_Gap08 += weff * track.pt ();
1016+ sumPtWsquareWithinGap08 += weff * weff * track.pt ();
1017+ sumPtsquareWsquareWithinGap08 += weff * weff * track.pt () * track.pt ();
1018+ weffEventWithinGap08 += weff;
1019+ weffEventSquareWithinGap08 += weff * weff;
1020+ }
9821021 }
9831022 if (withinPtRef)
9841023 fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), wacc * weff, 1 );
@@ -993,6 +1032,26 @@ struct FlowTask {
9931032 }
9941033 registry.fill (HIST (" hTrackCorrection2d" ), tracks.size (), nTracksCorrected);
9951034
1035+ double weffEventDiffWithGap08 = weffEventWithinGap08 * weffEventWithinGap08 - weffEventSquareWithinGap08;
1036+ // MeanPt
1037+ if (weffEvent) {
1038+ registry.fill (HIST (" hMeanPt" ), independent, ptSum / weffEvent, weffEvent);
1039+ }
1040+ if (weffEventWithinGap08)
1041+ registry.fill (HIST (" hMeanPtWithinGap08" ), independent, ptSum_Gap08 / weffEventWithinGap08, weffEventWithinGap08);
1042+ // c22_gap8 * pt_withGap8
1043+ if (weffEventWithinGap08)
1044+ fillpTvnProfile (corrconfigs.at (7 ), ptSum_Gap08, weffEventWithinGap08, HIST (" c22_gap08_Weff" ), HIST (" c22_gap08_trackMeanPt" ), independent);
1045+ // PtVariance
1046+ if (weffEventDiffWithGap08) {
1047+ registry.fill (HIST (" PtVariance_partA_WithinGap08" ), independent,
1048+ (ptSum_Gap08 * ptSum_Gap08 - sumPtsquareWsquareWithinGap08) / weffEventDiffWithGap08,
1049+ weffEventDiffWithGap08);
1050+ registry.fill (HIST (" PtVariance_partB_WithinGap08" ), independent,
1051+ (weffEventWithinGap08 * ptSum_Gap08 - sumPtWsquareWithinGap08) / weffEventDiffWithGap08,
1052+ weffEventDiffWithGap08);
1053+ }
1054+
9961055 // Filling Flow Container
9971056 for (uint l_ind = 0 ; l_ind < corrconfigs.size (); l_ind++) {
9981057 fillFC<kReco >(corrconfigs.at (l_ind), independent, lRandom);
0 commit comments