Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Common/epvector.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -64,7 +64,7 @@
// Configurables.
struct : ConfigurableGroup {
Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
Configurable<int64_t> nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"};

Check failure on line 67 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
} cfgCcdbParam;

// Enable access to the CCDB for the offset and correction constants and save them in dedicated variables.
Expand Down Expand Up @@ -203,14 +203,14 @@
LOGF(info, "Getting alignment offsets from the CCDB...");
offsetFT0 = ccdb->getForTimeStamp<std::vector<o2::detectors::AlignParam>>("FT0/Calib/Align", cfgCcdbParam.nolaterthan.value);
offsetFV0 = ccdb->getForTimeStamp<std::vector<o2::detectors::AlignParam>>("FV0/Calib/Align", cfgCcdbParam.nolaterthan.value);
printf("Offset for FT0A: x = %.3f y = %.3f\n", (*offsetFT0)[0].getX(), (*offsetFT0)[0].getY());

Check failure on line 206 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
printf("Offset for FT0C: x = %.3f y = %.3f\n", (*offsetFT0)[1].getX(), (*offsetFT0)[1].getY());

Check failure on line 207 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
printf("Offset for FV0-left: x = %.3f y = %.3f\n", (*offsetFV0)[0].getX(), (*offsetFV0)[0].getY());

Check failure on line 208 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
printf("Offset for FV0-right: x = %.3f y = %.3f\n", (*offsetFV0)[1].getX(), (*offsetFV0)[1].getY());

Check failure on line 209 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}

template <typename TCollision>
bool eventSelected(TCollision collision, const float& centrality)
bool eventSelected(const TCollision& collision, const float& centrality)
{
if (collision.alias_bit(kTVXinTRD)) {
// TRD triggered // return 0;
Expand Down Expand Up @@ -342,8 +342,8 @@
qyFT0C = qyFT0C + ampl * TMath::Sin(cfgHarmonic.value * phiC);
}

for (auto& trk : tracks) {

Check failure on line 345 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!selectionTrack(trk) || TMath::Abs(trk.eta()) > 0.8 || trk.pt() > cfgCutPTMax || TMath::Abs(trk.eta()) < cfgMinEta) {

Check failure on line 346 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
qxTPC = qxTPC + trk.pt() * TMath::Cos(cfgHarmonic.value * trk.phi());
Expand Down Expand Up @@ -393,7 +393,7 @@
auto deltapsiTPC = 0.0;
auto deltapsiTPCL = 0.0;
auto deltapsiTPCR = 0.0;
for (int ishift = 1; ishift <= 10; ishift++) {

Check failure on line 396 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
auto coeffshiftxFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 1.5, ishift - 0.5));
deltapsiFT0C = deltapsiFT0C + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * cfgHarmonic.value * psiFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * cfgHarmonic.value * psiFT0C)));
Expand Down Expand Up @@ -463,7 +463,7 @@
histos.fill(HIST("ResFT0CTPCRSP"), centrality, qFT0Cmag * qTPCRmag * TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPCR)), occupancy);
histos.fill(HIST("ResTPCRTPCLSP"), centrality, qTPCRmag * qTPCLmag * TMath::Cos(cfgHarmonic.value * (psiTPCR - psiTPCL)), occupancy);

for (int ishift = 1; ishift <= 10; ishift++) {

Check failure on line 466 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
histos.fill(HIST("ShiftFT0C"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiFT0C));
histos.fill(HIST("ShiftFT0C"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiFT0C));

Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ struct DeuteronInTriggeredEvents {

HistogramRegistry spectra{"spectra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

double computeAbsoDecL(aod::McParticles::iterator particle)
double computeAbsoDecL(const aod::McParticles::iterator& particle)
{
if (!particle.has_daughters())
return -1.f;
Expand Down
30 changes: 15 additions & 15 deletions PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct DaughterParticle {
std::array<float, nBetheParams> betheParams;
std::array<float, nTrkSettings> trkSettings;
bool active;
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)
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)
{
for (unsigned int i = 0; i < betheParams.size(); i++) {
betheParams[i] = bethe.get(name, i);
Expand All @@ -220,19 +220,19 @@ struct HyperNucleus {
bool active, savePrimary;
std::vector<int> daughters, daughterTrackSigns, v0DaughterVec;
std::vector<float> primSettings;
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_)
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_)
{
init(name_, daughters_, daughterTrackSigns_, v0DaughterVec_);
init(std::move(name_), std::move(daughters_), std::move(daughterTrackSigns_), std::move(v0DaughterVec_));
for (unsigned int i = 0; i < nSelPrim; i++) {
primSettings.push_back(primSettings_.get(name, i));
}
}
HyperNucleus(std::string name_, int pdgCode_, bool active_, int hypDaughter, std::vector<int> daughters_, std::vector<int> daughterTrackSigns_) : pdgCode(pdgCode_), active(active_), savePrimary(active_)
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_)
{
daughters.push_back(hypDaughter);
init(name_, daughters_, daughterTrackSigns_);
init(std::move(name_), std::move(daughters_), std::move(daughterTrackSigns_));
}
void init(std::string name_, std::vector<int> daughters_, std::vector<int> daughterTrackSigns_, std::vector<int> v0DaughterVec_ = {})
void init(const std::string& name_, const std::vector<int>& daughters_, const std::vector<int>& daughterTrackSigns_, const std::vector<int>& v0DaughterVec_ = {})
{
name = TString(name_);
for (const int& d : daughters_)
Expand Down Expand Up @@ -265,8 +265,8 @@ struct DaughterKf {
float dcaToPv, dcaToPvXY, dcaToPvZ, tpcNsigma, tpcNsigmaNLP, tpcNsigmaNHP;
bool active;
std::vector<float> vtx;
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_) {}
void addKfp(KFParticle daughterKfp_)
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_)) {}
void addKfp(const KFParticle& daughterKfp_)
{
daughterKfp = daughterKfp_;
dcaToPvXY = daughterKfp.GetDistanceFromVertexXY(&vtx[0]);
Expand All @@ -290,7 +290,7 @@ struct HyperNucCandidate {
bool mcTrue, isPhysPrimary, isPrimaryCandidate, isSecondaryCandidate, isUsedSecondary;
int64_t mcParticleId;
int tableId;
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)
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)
{
for (const auto& d : daughters_)
daughters.push_back(d);
Expand Down Expand Up @@ -402,7 +402,7 @@ struct HyperNucCandidate {
}
return calcSubDaughterMass(daughters.at(d1)->daughterKfp, hypNucDaughter->daughters.at(d2)->daughterKfp);
}
float calcSubDaughterMass(KFParticle d1, KFParticle d2)
float calcSubDaughterMass(const KFParticle& d1, const KFParticle& d2)
{
KFParticle subDaughter;
subDaughter.SetConstructMethod(2);
Expand Down Expand Up @@ -475,7 +475,7 @@ struct DaughterCombinations {
int nVecs, nCombinations;
bool end;
std::vector<int> nonV0daughters;
DaughterCombinations(std::vector<std::vector<DaughterKf>*>& vecs, std::vector<int> nonV0daughters_) : nVecs(0), nCombinations(1), end(false), nonV0daughters(nonV0daughters_)
DaughterCombinations(std::vector<std::vector<DaughterKf>*>& vecs, std::vector<int> nonV0daughters_) : nVecs(0), nCombinations(1), end(false), nonV0daughters(std::move(nonV0daughters_))
{
for (const auto& vec : vecs) {
nVecs++;
Expand Down Expand Up @@ -1311,15 +1311,15 @@ struct HypKfRecoTask {
}
//----------------------------------------------------------------------------------------------------------------

int getHypDaughterVec(unsigned int cascade, LabeledArray<std::string> cfg)
int getHypDaughterVec(unsigned int cascade, const LabeledArray<std::string>& cfg)
{
std::string daughter = cfg.get(cascade, 0u);
if (std::find(hyperNucNames.begin(), hyperNucNames.end(), daughter) == hyperNucNames.end())
return -1;
return std::find(hyperNucNames.begin(), hyperNucNames.end(), daughter) - hyperNucNames.begin();
}
//----------------------------------------------------------------------------------------------------------------
std::vector<int> getDaughterVec(unsigned int hypNuc, LabeledArray<std::string> cfg)
std::vector<int> getDaughterVec(unsigned int hypNuc, const LabeledArray<std::string>& cfg)
{
std::vector<int> vec;
for (unsigned int i = kD1; i <= kD4; i++) {
Expand All @@ -1332,7 +1332,7 @@ struct HypKfRecoTask {
}
//----------------------------------------------------------------------------------------------------------------

std::vector<int> getDaughterSignVec(unsigned int hypNuc, LabeledArray<std::string> cfg)
std::vector<int> getDaughterSignVec(unsigned int hypNuc, const LabeledArray<std::string>& cfg)
{
std::vector<int> vec;
std::string signs = cfg.get(hypNuc, "daughterSigns");
Expand All @@ -1345,7 +1345,7 @@ struct HypKfRecoTask {
return vec;
}
//----------------------------------------------------------------------------------------------------------------
std::vector<int> getV0DaughterVec(unsigned int hypNuc, LabeledArray<std::string> cfg)
std::vector<int> getV0DaughterVec(unsigned int hypNuc, const LabeledArray<std::string>& cfg)
{
std::vector<int> vec;
std::string v0ds = cfg.get(hypNuc, "useV0for");
Expand Down
12 changes: 6 additions & 6 deletions PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ struct HypKfTreeCreator {
PROCESS_SWITCH(HypKfTreeCreator, processMC, "MC tree", false);

//___________________________________________________________________________________________________________________________________________________________
std::vector<float> dcaTracksAll(std::vector<arr3>& posVec, TString opt = "")
std::vector<float> dcaTracksAll(std::vector<arr3>& posVec, const TString& opt = "")
{
std::vector<float> vec;
int n = posVec.size();
Expand All @@ -450,7 +450,7 @@ struct HypKfTreeCreator {
return vec;
}
template <class T>
std::vector<float> dcaTrackSvAll(std::vector<arr3>& posVec, T const& hypNuc, TString opt = "")
std::vector<float> dcaTrackSvAll(std::vector<arr3>& posVec, T const& hypNuc, const TString& opt = "")
{
std::vector<float> vec;
for (size_t i = 0; i < posVec.size(); i++) {
Expand All @@ -463,22 +463,22 @@ struct HypKfTreeCreator {
{
return *max_element(vec.begin(), vec.end());
}
float meanValue(std::vector<float> vec)
float meanValue(const std::vector<float>& vec)
{
float sum = 0;
for (const auto& value : vec)
sum += value;
return sum / vec.size();
}
float mean2Value(std::vector<float> vec)
float mean2Value(const std::vector<float>& vec)
{
float sum = 0;
for (const auto& value : vec)
sum += (value * value);
return std::sqrt(sum / vec.size());
}

float dcaTracks(std::vector<arr3> v, int track1, int track2, TString opt = "XY")
float dcaTracks(std::vector<arr3> v, int track1, int track2, const TString& opt = "XY")
{
if (opt == "XY")
return RecoDecay::distanceXY(v.at(track1), v.at(track2));
Expand All @@ -488,7 +488,7 @@ struct HypKfTreeCreator {
return RecoDecay::distance(v.at(track1), v.at(track2));
}
template <class T>
float dcaTrackSv(std::vector<arr3>& v, int track, T const& hypNuc, TString opt = "")
float dcaTrackSv(std::vector<arr3>& v, int track, T const& hypNuc, const TString& opt = "")
{
if (opt == "XY")
return RecoDecay::distanceXY(v.at(track), decayVtx(hypNuc));
Expand Down
4 changes: 2 additions & 2 deletions PWGLF/TableProducer/Nuspex/hyperkinkRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ struct HyperkinkQa {

// QA for mother track selection
template <typename TTrack>
bool motherTrackCheck(const TTrack& track, const std::shared_ptr<TH1> hist)
bool motherTrackCheck(const TTrack& track, const std::shared_ptr<TH1>& hist)
{
hist->Fill(1);

Expand Down Expand Up @@ -1206,7 +1206,7 @@ struct HyperkinkQa {

// qa for daughter track selection
template <typename TTrack>
bool daughterTrackCheck(const TTrack& track, const std::shared_ptr<TH1> hist, float tpcNSigma)
bool daughterTrackCheck(const TTrack& track, const std::shared_ptr<TH1>& hist, float tpcNSigma)
{
hist->Fill(1);

Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ struct nucleiSpectra {

HistogramRegistry spectra{"spectra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

double computeAbsoDecL(aod::McParticles::iterator particle)
double computeAbsoDecL(const aod::McParticles::iterator& particle)
{
if (!particle.has_daughters())
return -1.f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ struct TrackedHypertritonRecoTask {
}

template <class TTracksTo, typename TTracked3body>
std::array<float, 2> getItsTrackDCAToSV(TTracked3body tracked3Body)
std::array<float, 2> getItsTrackDCAToSV(const TTracked3body& tracked3Body)
{
const auto itsTrack = tracked3Body.template itsTrack_as<TTracksTo>();
auto itsTrackParCov = getTrackParCov(itsTrack);
Expand Down
4 changes: 2 additions & 2 deletions PWGLF/TableProducer/Resonances/HeptaQuarktable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ struct heptaquarktable {

auto posThisColl = posTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
auto negThisColl = negTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
for (auto track1 : posThisColl) {
for (const auto& track1 : posThisColl) {
if (!selectionTrack(track1))
continue;

Expand All @@ -279,7 +279,7 @@ struct heptaquarktable {
}
*/
auto track1ID = track1.globalIndex();
for (auto track2 : negThisColl) {
for (const auto& track2 : negThisColl) {
if (!selectionTrack(track2))
continue;

Expand Down
8 changes: 4 additions & 4 deletions PWGLF/TableProducer/Resonances/doublephitable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ struct doublephitable {
hProcessedEvents->Fill(2.5);
auto posThisColl = posTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
auto negThisColl = negTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
for (auto track1 : posThisColl) {
for (const auto& track1 : posThisColl) {
// track selection
if (!selectionTrack(track1)) {
continue;
Expand All @@ -283,7 +283,7 @@ struct doublephitable {
qaRegistry.fill(HIST("hNsigmaPtkaonTOF"), track1.tofNSigmaKa(), track1.pt());
}
auto track1ID = track1.globalIndex();
for (auto track2 : negThisColl) {
for (const auto& track2 : negThisColl) {
auto track2ID = track2.globalIndex();
if (track2ID == track1ID) {
continue;
Expand Down Expand Up @@ -600,7 +600,7 @@ struct doublephitable {
selectedNeg.reserve(negThisColl.size());
selectedPosITS.reserve(posThisColl.size());
selectedNegITS.reserve(negThisColl.size());
for (auto track : posThisColl) {
for (const auto& track : posThisColl) {
if (!selectionTrack(track)) {
continue;
}
Expand All @@ -622,7 +622,7 @@ struct doublephitable {
}
}

for (auto track : negThisColl) {
for (const auto& track : negThisColl) {
if (!selectionTrack(track)) {
continue;
}
Expand Down
8 changes: 4 additions & 4 deletions PWGLF/TableProducer/Resonances/f1protonInitializer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ struct f1protoninitializer {
bool triggerF1 = false;
bool triggerF1Proton = false;
bool triggerF1ProtonFemto = false;
for (auto track1 : tracks) {
for (const auto& track1 : tracks) {
if (!SelectionTrack(track1)) {
continue;
}
Expand All @@ -242,7 +242,7 @@ struct f1protoninitializer {
qaRegistry.fill(HIST("hNsigmaPtpionTOF"), track1.tofNSigmaPi(), track1.pt());
}
auto track1ID = track1.globalIndex();
for (auto track2 : tracks) {
for (const auto& track2 : tracks) {
if (!SelectionTrack(track2)) {
continue;
}
Expand Down Expand Up @@ -273,7 +273,7 @@ struct f1protoninitializer {
int track2Sign = track2.sign();
numberPiKpair = numberPiKpair + 1;

for (auto track3 : V0s) {
for (const auto& track3 : V0s) {
if (!SelectionV0(collision, track3)) {
continue;
}
Expand Down Expand Up @@ -308,7 +308,7 @@ struct f1protoninitializer {
F1Vector.SetXYZM(track1.px() + track2.px() + track3.px(), track1.py() + track2.py() + track3.py(), track1.pz() + track2.pz() + track3.pz(), massF1);

////////////// proton loop for F1-proton trigger/////////////////
for (auto track4 : tracks) {
for (const auto& track4 : tracks) {
auto collisionId4 = track4.collisionId();
if (collisionId1 != collisionId4) {
continue;
Expand Down
8 changes: 4 additions & 4 deletions PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ struct f1protonreducedtable {
return false;
}

inline bool passProtonPID(float nsigmaTPC, float nsigmaTOF, float TOFHit, ROOT::Math::PtEtaPhiMVector proton)
inline bool passProtonPID(float nsigmaTPC, float nsigmaTOF, float TOFHit, const ROOT::Math::PtEtaPhiMVector& proton)
{
// pidMode:
// 0 = default: p < thr -> |TPC| < 2.5 ; p >= thr -> TOF mandatory AND circular(TPC,TOF) < 2.0
Expand Down Expand Up @@ -424,8 +424,8 @@ struct f1protonreducedtable {
return true;
}

float getkstar(const ROOT::Math::PtEtaPhiMVector part1,
const ROOT::Math::PtEtaPhiMVector part2)
float getkstar(const ROOT::Math::PtEtaPhiMVector& part1,
const ROOT::Math::PtEtaPhiMVector& part2)
{
const ROOT::Math::PtEtaPhiMVector trackSum = part1 + part2;
const float beta = trackSum.Beta();
Expand All @@ -444,7 +444,7 @@ struct f1protonreducedtable {
return 0.5 * trackRelK.P();
}

std::vector<double> setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::string ccdbPath)
std::vector<double> setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::string& ccdbPath)
{
std::map<std::string, std::string> metadata;
auto h = ccdbApi.retrieveFromTFileAny<TH1F>(ccdbPath, metadata, bunchCrossing.timestamp());
Expand Down
6 changes: 3 additions & 3 deletions PWGLF/TableProducer/Resonances/filterf1proton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ struct filterf1proton {
return true;
}

float getkstar(const ROOT::Math::PtEtaPhiMVector part1,
const ROOT::Math::PtEtaPhiMVector part2)
float getkstar(const ROOT::Math::PtEtaPhiMVector& part1,
const ROOT::Math::PtEtaPhiMVector& part2)
{
const ROOT::Math::PtEtaPhiMVector trackSum = part1 + part2;
const float beta = trackSum.Beta();
Expand All @@ -375,7 +375,7 @@ struct filterf1proton {
return 0.5 * trackRelK.P();
}

std::vector<double> setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::string ccdbPath)
std::vector<double> setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::string& ccdbPath)
{
std::map<std::string, std::string> metadata;
auto h = ccdbApi.retrieveFromTFileAny<TH1F>(ccdbPath, metadata, bunchCrossing.timestamp());
Expand Down
6 changes: 3 additions & 3 deletions PWGLF/TableProducer/Resonances/resonanceInitializer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ struct ResonanceInitializer {

// Centralicity estimator selection
template <typename ResoColl>
float centEst(ResoColl ResoEvents)
float centEst(const ResoColl& ResoEvents)
{
float returnValue = -999.0;
switch (multEstimator) {
Expand Down Expand Up @@ -673,7 +673,7 @@ struct ResonanceInitializer {
}

template <typename ResoColl>
float getEvtPl(ResoColl ResoEvents)
float getEvtPl(const ResoColl& ResoEvents)
{
float returnValue = -999.0;
if (ResoEvents.qvecAmp()[evtPlDetId] > 1e-8)
Expand All @@ -682,7 +682,7 @@ struct ResonanceInitializer {
}

template <typename ResoColl>
float getEvtPlRes(ResoColl ResoEvents, int a, int b)
float getEvtPlRes(const ResoColl& ResoEvents, int a, int b)
{
float returnValue = -999.0;
if (ResoEvents.qvecAmp()[a] < 1e-8 || ResoEvents.qvecAmp()[b] < 1e-8)
Expand Down
Loading
Loading