@@ -127,7 +127,7 @@ struct lmeelfcocktail {
127127 return true ;
128128 }
129129
130- bool isAcceptedSingle (ROOT ::Math::PtEtaPhiMVector p1)
130+ bool isAcceptedSingle (const ROOT ::Math::PtEtaPhiMVector& p1)
131131 {
132132 if (p1.Pt () < fConfigMinPt )
133133 return false ;
@@ -138,7 +138,7 @@ struct lmeelfcocktail {
138138 return true ;
139139 }
140140
141- bool isAcceptedPair (ROOT ::Math::PtEtaPhiMVector p1, ROOT ::Math::PtEtaPhiMVector p2)
141+ bool isAcceptedPair (const ROOT ::Math::PtEtaPhiMVector& p1, const ROOT ::Math::PtEtaPhiMVector& p2)
142142 {
143143 if (!isAcceptedSingle (p1)) {
144144 return false ;
@@ -167,21 +167,21 @@ struct lmeelfcocktail {
167167 }
168168
169169 template <typename T>
170- bool isAcceptedPair (T& p1, T& p2)
170+ bool isAcceptedPair (const T& p1, const T& p2)
171171 {
172172 ROOT ::Math::PtEtaPhiMVector v1 (p1.ptSmeared (), p1.etaSmeared (), p1.phiSmeared (), o2::constants::physics::MassElectron);
173173 ROOT ::Math::PtEtaPhiMVector v2 (p2.ptSmeared (), p2.etaSmeared (), p2.phiSmeared (), o2::constants::physics::MassElectron);
174174 return isAcceptedPair (v1, v2);
175175 }
176176
177177 template <typename T>
178- bool isAcceptedSingle (T& p1)
178+ bool isAcceptedSingle (const T& p1)
179179 {
180180 ROOT ::Math::PtEtaPhiMVector v1 (p1.ptSmeared (), p1.etaSmeared (), p1.phiSmeared (), o2::constants::physics::MassElectron);
181181 return isAcceptedSingle (v1);
182182 }
183183
184- void addHistogram1D_stage (TString histname, AxisSpec axis, int & i, TString s)
184+ void addHistogram1D_stage (const TString& histname, const AxisSpec& axis, int & i, const TString& s)
185185 {
186186 i++;
187187 TString name = s + histname;
@@ -201,14 +201,14 @@ struct lmeelfcocktail {
201201 }
202202 }
203203
204- void addHistogram1D (TString histname, AxisSpec axis, int & i)
204+ void addHistogram1D (const TString& histname, const AxisSpec& axis, int & i)
205205 {
206- for (auto s : stage) {
206+ for (const auto & s : stage) {
207207 addHistogram1D_stage (histname, axis, i, s);
208208 }
209209 }
210210
211- void addHistogram1D_mother (TString histname, AxisSpec axis, int & i) // mother histograms only for gen. level, no decay channels
211+ void addHistogram1D_mother (const TString& histname, const AxisSpec& axis, int & i) // mother histograms only for gen. level, no decay channels
212212 {
213213 i++;
214214 TString name = stage[0 ] + histname;
@@ -222,7 +222,7 @@ struct lmeelfcocktail {
222222 }
223223 }
224224
225- void addHistogram2D_stage (TString histname, AxisSpec axis1, AxisSpec axis2, int & i, TString s)
225+ void addHistogram2D_stage (const TString& histname, const AxisSpec& axis1, const AxisSpec& axis2, int & i, const TString& s)
226226 {
227227 i++;
228228 TString name = s + histname;
@@ -242,15 +242,15 @@ struct lmeelfcocktail {
242242 }
243243 }
244244
245- void addHistogram2D (TString histname, AxisSpec axis1, AxisSpec axis2, int & i)
245+ void addHistogram2D (const TString& histname, const AxisSpec& axis1, const AxisSpec& axis2, int & i)
246246 {
247- for (auto s : stage) {
247+ for (const auto & s : stage) {
248248 addHistogram2D_stage (histname, axis1, axis2, i, s);
249249 }
250250 }
251251
252252 template <typename TAxes>
253- void addHistogramND_stage (TString histname, TAxes const & axes, int & i, TString s)
253+ void addHistogramND_stage (const TString& histname, TAxes const & axes, int & i, const TString& s)
254254 {
255255 i++;
256256 TString name = s + histname;
@@ -271,34 +271,34 @@ struct lmeelfcocktail {
271271 }
272272
273273 template <typename TAxes>
274- void addHistogramND (TString histname, TAxes const & axes, int & i)
274+ void addHistogramND (const TString& histname, TAxes const & axes, int & i)
275275 {
276- for (auto s : stage) {
276+ for (const auto & s : stage) {
277277 addHistogramND_stage (histname, axes, i, s);
278278 }
279279 }
280280
281- void fillHistogram1D (TString histname, int s, int pdg, int other_daughter_pdg, float value, float weight)
281+ void fillHistogram1D (const TString& histname, int s, int pdg, int other_daughter_pdg, float value, float weight)
282282 {
283283 histograms1D[histogramId[stage[s] + histname]]->Fill (value, weight);
284284 histograms1D[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill (value, weight);
285285 histograms1D[histogramId[stage[s] + mesons[pdg].name + decays[other_daughter_pdg] + histname]]->Fill (value, weight);
286286 }
287287
288- void fillHistogram1D_mother (TString histname, int pdg, float value, float weight)
288+ void fillHistogram1D_mother (const TString& histname, int pdg, float value, float weight)
289289 {
290290 histograms1D[histogramId[stage[0 ] + histname]]->Fill (value, weight);
291291 histograms1D[histogramId[stage[0 ] + mesons[pdg].name + histname]]->Fill (value, weight);
292292 }
293293
294- void fillHistogram2D (TString histname, int s, int pdg, int other_daughter_pdg, float value1, float value2, float weight)
294+ void fillHistogram2D (const TString& histname, int s, int pdg, int other_daughter_pdg, float value1, float value2, float weight)
295295 {
296296 histograms2D[histogramId[stage[s] + histname]]->Fill (value1, value2, weight);
297297 histograms2D[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill (value1, value2, weight);
298298 histograms2D[histogramId[stage[s] + mesons[pdg].name + decays[other_daughter_pdg] + histname]]->Fill (value1, value2, weight);
299299 }
300300
301- void fillHistogramND (TString histname, int s, int pdg, int other_daughter_pdg, double * values, double weight)
301+ void fillHistogramND (const TString& histname, int s, int pdg, int other_daughter_pdg, double * values, double weight)
302302 {
303303 histogramsND[histogramId[stage[s] + histname]]->Fill (values, weight);
304304 histogramsND[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill (values, weight);
0 commit comments