@@ -198,7 +198,7 @@ struct DaughterParticle {
198198 std::array<float , nBetheParams> betheParams;
199199 std::array<float , nTrkSettings> trkSettings;
200200 bool active;
201- DaughterParticle (std::string name_, int pdgCode_, double mass_, int charge_, LabeledArray<double > bethe, LabeledArray<double > settings) : name(name_), pdgCode(pdgCode_), charge(charge_), mass(mass_), active(false )
201+ DaughterParticle (const std::string& name_, int pdgCode_, double mass_, int charge_, const LabeledArray<double >& bethe, const LabeledArray<double >& settings) : name(name_), pdgCode(pdgCode_), charge(charge_), mass(mass_), active(false )
202202 {
203203 for (unsigned int i = 0 ; i < betheParams.size (); i++) {
204204 betheParams[i] = bethe.get (name, i);
@@ -220,19 +220,19 @@ struct HyperNucleus {
220220 bool active, savePrimary;
221221 std::vector<int > daughters, daughterTrackSigns, v0DaughterVec;
222222 std::vector<float > primSettings;
223- HyperNucleus (std::string name_, int pdgCode_, bool active_, std::vector<int > daughters_, std::vector<int > daughterTrackSigns_, std::vector<int > v0DaughterVec_, LabeledArray<double > primSettings_) : pdgCode(pdgCode_), active(active_), savePrimary(active_)
223+ HyperNucleus (const std::string& name_, int pdgCode_, bool active_, const std::vector<int >& daughters_, const std::vector<int >& daughterTrackSigns_, const std::vector<int >& v0DaughterVec_, const LabeledArray<double >& primSettings_) : pdgCode(pdgCode_), active(active_), savePrimary(active_)
224224 {
225- init (name_, daughters_, daughterTrackSigns_, v0DaughterVec_);
225+ init (std::move ( name_), std::move ( daughters_), std::move ( daughterTrackSigns_), std::move ( v0DaughterVec_) );
226226 for (unsigned int i = 0 ; i < nSelPrim; i++) {
227227 primSettings.push_back (primSettings_.get (name, i));
228228 }
229229 }
230- HyperNucleus (std::string name_, int pdgCode_, bool active_, int hypDaughter, std::vector<int > daughters_, std::vector<int > daughterTrackSigns_) : pdgCode(pdgCode_), active(active_), savePrimary(active_)
230+ HyperNucleus (const std::string& name_, int pdgCode_, bool active_, int hypDaughter, const std::vector<int >& daughters_, const std::vector<int >& daughterTrackSigns_) : pdgCode(pdgCode_), active(active_), savePrimary(active_)
231231 {
232232 daughters.push_back (hypDaughter);
233- init (name_, daughters_, daughterTrackSigns_);
233+ init (std::move ( name_), std::move ( daughters_), std::move ( daughterTrackSigns_) );
234234 }
235- void init (std::string name_, std::vector<int > daughters_, std::vector<int > daughterTrackSigns_, std::vector<int > v0DaughterVec_ = {})
235+ void init (const std::string& name_, const std::vector<int >& daughters_, const std::vector<int >& daughterTrackSigns_, const std::vector<int >& v0DaughterVec_ = {})
236236 {
237237 name = TString (name_);
238238 for (const int & d : daughters_)
@@ -265,8 +265,8 @@ struct DaughterKf {
265265 float dcaToPv, dcaToPvXY, dcaToPvZ, tpcNsigma, tpcNsigmaNLP, tpcNsigmaNHP;
266266 bool active;
267267 std::vector<float > vtx;
268- DaughterKf (int species_, int64_t daughterTrackId_, int sign_, std::vector<float > vtx_, float tpcNsigma_, float tpcNsigmaNLP_, float tpcNsigmaNHP_) : daughterTrackId(daughterTrackId_), id(uniqueId++), species(species_), sign(sign_), hypNucId(-1 ), tpcNsigma(tpcNsigma_), tpcNsigmaNLP(tpcNsigmaNLP_), tpcNsigmaNHP(tpcNsigmaNHP_), vtx(vtx_) {}
269- void addKfp (KFParticle daughterKfp_)
268+ DaughterKf (int species_, int64_t daughterTrackId_, int sign_, std::vector<float > vtx_, float tpcNsigma_, float tpcNsigmaNLP_, float tpcNsigmaNHP_) : daughterTrackId(daughterTrackId_), id(uniqueId++), species(species_), sign(sign_), hypNucId(-1 ), tpcNsigma(tpcNsigma_), tpcNsigmaNLP(tpcNsigmaNLP_), tpcNsigmaNHP(tpcNsigmaNHP_), vtx(std::move( vtx_) ) {}
269+ void addKfp (const KFParticle& daughterKfp_)
270270 {
271271 daughterKfp = daughterKfp_;
272272 dcaToPvXY = daughterKfp.GetDistanceFromVertexXY (&vtx[0 ]);
@@ -290,7 +290,7 @@ struct HyperNucCandidate {
290290 bool mcTrue, isPhysPrimary, isPrimaryCandidate, isSecondaryCandidate, isUsedSecondary;
291291 int64_t mcParticleId;
292292 int tableId;
293- HyperNucCandidate (int species_, HyperNucCandidate* hypNucDaughter_, std::vector<DaughterKf*> daughters_) : species(species_), hypNucDaughter(hypNucDaughter_), devToPvXY(-999 ), dcaToPvXY(-999 ), dcaToPvZ(-999 ), dcaToVtxXY(-999 ), dcaToVtxZ(-999 ), chi2(-999 ), itsMeanClsSize(-1 ), mcTrue(false ), isPhysPrimary(false ), isPrimaryCandidate(false ), isSecondaryCandidate(false ), isUsedSecondary(false ), mcParticleId(-1 ), tableId(-1 )
293+ HyperNucCandidate (int species_, HyperNucCandidate* hypNucDaughter_, const std::vector<DaughterKf*>& daughters_) : species(species_), hypNucDaughter(hypNucDaughter_), devToPvXY(-999 ), dcaToPvXY(-999 ), dcaToPvZ(-999 ), dcaToVtxXY(-999 ), dcaToVtxZ(-999 ), chi2(-999 ), itsMeanClsSize(-1 ), mcTrue(false ), isPhysPrimary(false ), isPrimaryCandidate(false ), isSecondaryCandidate(false ), isUsedSecondary(false ), mcParticleId(-1 ), tableId(-1 )
294294 {
295295 for (const auto & d : daughters_)
296296 daughters.push_back (d);
@@ -402,7 +402,7 @@ struct HyperNucCandidate {
402402 }
403403 return calcSubDaughterMass (daughters.at (d1)->daughterKfp , hypNucDaughter->daughters .at (d2)->daughterKfp );
404404 }
405- float calcSubDaughterMass (KFParticle d1, KFParticle d2)
405+ float calcSubDaughterMass (const KFParticle& d1, const KFParticle& d2)
406406 {
407407 KFParticle subDaughter;
408408 subDaughter.SetConstructMethod (2 );
@@ -475,7 +475,7 @@ struct DaughterCombinations {
475475 int nVecs, nCombinations;
476476 bool end;
477477 std::vector<int > nonV0daughters;
478- DaughterCombinations (std::vector<std::vector<DaughterKf>*>& vecs, std::vector<int > nonV0daughters_) : nVecs(0 ), nCombinations(1 ), end(false ), nonV0daughters(nonV0daughters_)
478+ DaughterCombinations (std::vector<std::vector<DaughterKf>*>& vecs, std::vector<int > nonV0daughters_) : nVecs(0 ), nCombinations(1 ), end(false ), nonV0daughters(std::move( nonV0daughters_) )
479479 {
480480 for (const auto & vec : vecs) {
481481 nVecs++;
@@ -1311,15 +1311,15 @@ struct HypKfRecoTask {
13111311 }
13121312 // ----------------------------------------------------------------------------------------------------------------
13131313
1314- int getHypDaughterVec (unsigned int cascade, LabeledArray<std::string> cfg)
1314+ int getHypDaughterVec (unsigned int cascade, const LabeledArray<std::string>& cfg)
13151315 {
13161316 std::string daughter = cfg.get (cascade, 0u );
13171317 if (std::find (hyperNucNames.begin (), hyperNucNames.end (), daughter) == hyperNucNames.end ())
13181318 return -1 ;
13191319 return std::find (hyperNucNames.begin (), hyperNucNames.end (), daughter) - hyperNucNames.begin ();
13201320 }
13211321 // ----------------------------------------------------------------------------------------------------------------
1322- std::vector<int > getDaughterVec (unsigned int hypNuc, LabeledArray<std::string> cfg)
1322+ std::vector<int > getDaughterVec (unsigned int hypNuc, const LabeledArray<std::string>& cfg)
13231323 {
13241324 std::vector<int > vec;
13251325 for (unsigned int i = kD1 ; i <= kD4 ; i++) {
@@ -1332,7 +1332,7 @@ struct HypKfRecoTask {
13321332 }
13331333 // ----------------------------------------------------------------------------------------------------------------
13341334
1335- std::vector<int > getDaughterSignVec (unsigned int hypNuc, LabeledArray<std::string> cfg)
1335+ std::vector<int > getDaughterSignVec (unsigned int hypNuc, const LabeledArray<std::string>& cfg)
13361336 {
13371337 std::vector<int > vec;
13381338 std::string signs = cfg.get (hypNuc, " daughterSigns" );
@@ -1345,7 +1345,7 @@ struct HypKfRecoTask {
13451345 return vec;
13461346 }
13471347 // ----------------------------------------------------------------------------------------------------------------
1348- std::vector<int > getV0DaughterVec (unsigned int hypNuc, LabeledArray<std::string> cfg)
1348+ std::vector<int > getV0DaughterVec (unsigned int hypNuc, const LabeledArray<std::string>& cfg)
13491349 {
13501350 std::vector<int > vec;
13511351 std::string v0ds = cfg.get (hypNuc, " useV0for" );
0 commit comments