@@ -110,10 +110,7 @@ void fitCorrelDs(const TString& cfgFileName = "config_CorrAnalysis.json")
110110 const int nBinsPtCand = binsPtCandIntervalsVec .size () - 1 ;
111111 const int nBinsPtHad = binsPtHadIntervals .size () - 1 ;
112112
113- double binsPtCandIntervals [nBinsPtCand + 1 ];
114- for (int i = 0 ; i < nBinsPtCand + 1 ; i ++ ) {
115- binsPtCandIntervals [i ] = binsPtCandIntervalsVec [i ];
116- }
113+ std ::vector < double > binsPtCandIntervals {binsPtCandIntervalsVec };
117114
118115 const Value & fitFuncValue = config ["FitFunction" ];
119116 readArray (fitFuncValue , fitFunc );
@@ -122,17 +119,14 @@ void fitCorrelDs(const TString& cfgFileName = "config_CorrAnalysis.json")
122119 int const fixMean = config ["FixMean" ].GetInt ();
123120
124121 int const nBaselinePoints = config ["nBaselinePoints" ].GetInt ();
125- vector < int > pointsForBaselineVec ;
122+ std :: vector < int > pointsForBaselineVec ;
126123 const Value & pointsForBaselineValue = config ["binsForBaseline" ];
127124 readArray (pointsForBaselineValue , pointsForBaselineVec );
128125 if (pointsForBaselineVec .size () != nBaselinePoints ) {
129126 cout << "ERROR: size of the vector pointsForBaseline is different from the number of nBaselinePoints" << endl ;
130127 return ;
131128 }
132- int pointsForBaseline [nBaselinePoints ];
133- for (int i = 0 ; i < nBaselinePoints ; i ++ ) {
134- pointsForBaseline [i ] = pointsForBaselineVec [i ];
135- }
129+ std ::vector < int > pointsForBaseline {pointsForBaselineVec };
136130
137131 std ::cout << "=========================== " << std ::endl ;
138132 std ::cout << "Input variables from config" << std ::endl ;
@@ -202,7 +196,7 @@ void fitCorrelDs(const TString& cfgFileName = "config_CorrAnalysis.json")
202196 corrFitter [iBinPtHad ][iBinPtCand ]-> setHistoIsReflected (refl );
203197 corrFitter [iBinPtHad ][iBinPtCand ]-> setFixBaseline (fixBase );
204198 corrFitter [iBinPtHad ][iBinPtCand ]-> setBaselineUpOrDown (shiftBaseUp , shiftBaseDown );
205- corrFitter [iBinPtHad ][iBinPtCand ]-> setPointsForBaseline (nBaselinePoints , pointsForBaseline );
199+ corrFitter [iBinPtHad ][iBinPtCand ]-> setPointsForBaseline (nBaselinePoints , pointsForBaseline . data () );
206200 corrFitter [iBinPtHad ][iBinPtCand ]-> setv2 (v2AssocPart [iBinPtCand ], v2Dmeson [iBinPtCand ]);
207201 corrFitter [iBinPtHad ][iBinPtCand ]-> setReflectedCorrHisto (isReflected );
208202
@@ -222,14 +216,14 @@ void fitCorrelDs(const TString& cfgFileName = "config_CorrAnalysis.json")
222216 canvasCorrPhi [iBinPtHad ]-> Divide (3 , 2 );
223217 }
224218 // histograms with fir parameters
225- hBaselin [iBinPtHad ] = new TH1D (Form ("hBaselin_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
226- hNSYield [iBinPtHad ] = new TH1D (Form ("hNSYield_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
227- hNSSigma [iBinPtHad ] = new TH1D (Form ("hNSSigma_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
228- hASYield [iBinPtHad ] = new TH1D (Form ("hASYield_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
229- hASSigma [iBinPtHad ] = new TH1D (Form ("hASSigma_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
230- hBeta [iBinPtHad ] = new TH1D (Form ("hBeta_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
231- hNSYieldBinCount [iBinPtHad ] = new TH1D (Form ("hNSYieldBinCount_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
232- hASYieldBinCount [iBinPtHad ] = new TH1D (Form ("hASYieldBinCount_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals );
219+ hBaselin [iBinPtHad ] = new TH1D (Form ("hBaselin_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
220+ hNSYield [iBinPtHad ] = new TH1D (Form ("hNSYield_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
221+ hNSSigma [iBinPtHad ] = new TH1D (Form ("hNSSigma_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
222+ hASYield [iBinPtHad ] = new TH1D (Form ("hASYield_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
223+ hASSigma [iBinPtHad ] = new TH1D (Form ("hASSigma_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
224+ hBeta [iBinPtHad ] = new TH1D (Form ("hBeta_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
225+ hNSYieldBinCount [iBinPtHad ] = new TH1D (Form ("hNSYieldBinCount_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
226+ hASYieldBinCount [iBinPtHad ] = new TH1D (Form ("hASYieldBinCount_PtBinAssoc%d" , iBinPtHad + 1 ), "" , nBinsPtCand , binsPtCandIntervals . data () );
233227
234228 for (int iBinPtCand = 0 ; iBinPtCand < nBinsPtCand ; iBinPtCand ++ ) {
235229 setTH1HistoStyle (hCorrPhi [iBinPtCand ][iBinPtHad ], "" , "#Delta#phi [rad]" , "#frac{1}{N_{D_{s}}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]" , kFullCircle , kRed + 1 , 1.4 , kRed + 1 , 3 );
0 commit comments