Skip to content

Commit 1760388

Browse files
committed
Add linter changes
1 parent fa1838b commit 1760388

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
// \file lnnRecoTask.cxx
13-
// \brief Reconstruction task for the \f$\Lambda nn\f$ candidate
14-
// \autor Maria Paula Palhares
12+
/// \file lnnRecoTask.cxx
13+
/// \brief Reconstruction task for the \Lambda nn candidate
14+
/// \author Maria Paula Palhares
1515
// ==============================================================================
1616
#include "PWGLF/DataModel/LFLnnTables.h"
1717

18-
#include "Common/Core/PID/PIDTOF.h"
19-
#include "Common/Core/PID/TPCPIDResponse.h"
18+
#include "PID/PIDTOF.h"
19+
#include "PID/TPCPIDResponse.h"
2020
#include "Common/Core/RecoDecay.h"
2121
#include "Common/Core/trackUtilities.h"
2222
#include "Common/DataModel/Centrality.h"
@@ -210,7 +210,7 @@ struct lnnRecoTask {
210210
Configurable<int> cfgMaterialCorrection{"cfgMaterialCorrection", static_cast<int>(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"};
211211

212212
// CCDB options
213-
Configurable<double> d_bz_input{"d_bz_input", -999, "bz field, -999 is automatic"};
213+
Configurable<double> d_bz_input{"d_bz_input", -999., "bz field, -999 is automatic"};
214214
Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
215215
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
216216
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
@@ -367,11 +367,13 @@ struct lnnRecoTask {
367367
}
368368
auto run3grp_timestamp = bc.timestamp();
369369

370+
static const double kBzAutoThreshold = -990.;
371+
370372
o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, run3grp_timestamp);
371373
o2::parameters::GRPMagField* grpmag = 0x0;
372374
if (grpo) {
373375
o2::base::Propagator::initFieldFromGRP(grpo);
374-
if (d_bz_input < -990) {
376+
if (d_bz_input < kBzAutoThreshold) {
375377
// Fetch magnetic field from ccdb for current collision
376378
d_bz = grpo->getNominalL3Field();
377379
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
@@ -384,7 +386,7 @@ struct lnnRecoTask {
384386
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
385387
}
386388
o2::base::Propagator::initFieldFromGRP(grpmag);
387-
if (d_bz_input < -990) {
389+
if (d_bz_input < kBzAutoThreshold) {
388390
// Fetch magnetic field from ccdb for current collision
389391
d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
390392
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
@@ -550,7 +552,8 @@ struct lnnRecoTask {
550552
float h3lE = h3E + piE;
551553

552554
// Building the mother particle: lnn
553-
std::array<float, 3> lnnMom;
555+
constexpr std::size_t kMomDim = 3;
556+
std::array<float, kMomDim> lnnMom;
554557

555558
const auto& vtx = fitter.getPCACandidate();
556559
for (int i = 0; i < 3; i++) {
@@ -582,7 +585,8 @@ struct lnnRecoTask {
582585
continue;
583586
}
584587

585-
std::array<float, 3> primVtx = {collision.posX(), collision.posY(), collision.posZ()};
588+
constexpr std::size_t kprimVtxDim = 3;
589+
std::array<float, kprimVtxDim> primVtx = {collision.posX(), collision.posY(), collision.posZ()};
586590

587591
double cosPA = RecoDecay::cpa(primVtx, lnnCand.decVtx, lnnMom);
588592
if (cosPA < v0cospa) {
@@ -660,9 +664,11 @@ struct lnnRecoTask {
660664
continue;
661665

662666
// Checking primary and second vertex with MC simulations
663-
std::array<float, 3> posPrimVtx = {posMother.vx(), posMother.vy(), posMother.vz()};
664-
665-
std::array<float, 3> secVtx = {mcTrackPos.vx(), mcTrackPos.vy(), mcTrackPos.vz()};
667+
668+
constexpr std::size_t kposVtxDim = 3;
669+
std::array<float, kposVtxDim> posPrimVtx = {posMother.vx(), posMother.vy(), posMother.vz()};
670+
constexpr std::size_t ksecVtxDim = 3;
671+
std::array<float, ksecVtxDim> secVtx = {mcTrackPos.vx(), mcTrackPos.vy(), mcTrackPos.vz()};
666672

667673
lnnCand.gMom = posMother.pVector();
668674

@@ -806,13 +812,15 @@ struct lnnRecoTask {
806812
continue;
807813
}
808814
float cent = collisionFT0Ccent[mcPart.mcCollisionId()];
809-
std::array<float, 3> secVtx;
810-
std::array<float, 3> primVtx = {mcPart.vx(), mcPart.vy(), mcPart.vz()};
815+
constexpr std::size_t kVtxDim = 3;
816+
std::array<float, kVtxDim> secVtx;
817+
std::array<float, kVtxDim> primVtx = {mcPart.vx(), mcPart.vy(), mcPart.vz()};
811818

812-
std::array<float, 3> momMother = mcPart.pVector();
819+
constexpr std::size_t kArrayDim = 3;
820+
std::array<float, kArrayDim> momMother = mcPart.pVector();
813821

814-
std::array<float, 3> mom3H;
815-
std::array<float, 3> momPi;
822+
std::array<float, kArrayDim> mom3H;
823+
std::array<float, kArrayDim> momPi;
816824
bool is3HFound = false;
817825
bool isPiFound = false;
818826

0 commit comments

Comments
 (0)