Skip to content

Commit ad32fca

Browse files
committed
Fix some linter errors
1 parent c8b6d61 commit ad32fca

2 files changed

Lines changed: 42 additions & 40 deletions

File tree

PWGLF/TableProducer/Common/kinkBuilder.cxx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ struct kinkBuilder {
157157

158158
o2::vertexing::DCAFitterN<2> fitter;
159159
o2::base::MatLayerCylSet* lut = nullptr;
160+
int nItsInnerBarrelLayers = 3;
161+
int nItsOuterBarrelLayers = 4;
162+
int nItsTotalLayers = 7;
163+
int nCoords = 7;
160164

161165
// constants
162166
float radToDeg = o2::constants::math::Rad2Deg;
@@ -348,9 +352,11 @@ struct kinkBuilder {
348352
hMothDecRad2->GetYaxis()->SetBinLabel(3, "(+,-)");
349353
hMothDecRad2->GetYaxis()->SetBinLabel(4, "(-,+)");
350354

351-
for (int i = 0; i < 5; i++) {
352-
mBBparamsDaug[i] = cfgBetheBlochParams->get("Daughter", Form("p%i", i));
353-
}
355+
mBBparamsDaug[0] = cfgBetheBlochParams->get("Daughter", Form("p%i", 0));
356+
mBBparamsDaug[1] = cfgBetheBlochParams->get("Daughter", Form("p%i", 1));
357+
mBBparamsDaug[2] = cfgBetheBlochParams->get("Daughter", Form("p%i", 2));
358+
mBBparamsDaug[3] = cfgBetheBlochParams->get("Daughter", Form("p%i", 3));
359+
mBBparamsDaug[4] = cfgBetheBlochParams->get("Daughter", Form("p%i", 4));
354360
mBBparamsDaug[5] = cfgBetheBlochParams->get("Daughter", "resolution");
355361

356362
if (doprocessMc || doprocessMcWCent) {
@@ -396,11 +402,11 @@ struct kinkBuilder {
396402
hSelMotherQA->Fill(4.f, isPositive);
397403

398404
h2ItsClsMothBeforeSel->Fill(candidate.itsNCls(), candidate.itsNClsInnerBarrel());
399-
if (candidate.itsNCls() >= 6)
405+
if (candidate.itsNCls() >= nItsTotalLayers-1)
400406
return false;
401407
hSelMotherQA->Fill(5.f, isPositive);
402408

403-
if (candidate.itsNClsInnerBarrel() != 3)
409+
if (candidate.itsNClsInnerBarrel() != nItsInnerBarrelLayers)
404410
return false;
405411
hSelMotherQA->Fill(6.f, isPositive);
406412

@@ -438,7 +444,7 @@ struct kinkBuilder {
438444
return false;
439445
hSelDaugQA->Fill(4.f, isPositive);
440446

441-
if (candidate.itsNCls() >= 4)
447+
if (candidate.itsNCls() >= nItsOuterBarrelLayers)
442448
return false;
443449
hSelDaugQA->Fill(5.f, isPositive);
444450

@@ -546,20 +552,21 @@ struct kinkBuilder {
546552
// cut on decay radius to 17 cm
547553
float decRad2 = kinkCand.decVtx[0] * kinkCand.decVtx[0] + kinkCand.decVtx[1] * kinkCand.decVtx[1];
548554
hMothDecRad2->Fill(decRad2, chargeCombSvCand);
549-
if (doSVRadiusCut && decRad2 < LayerRadii[3] * LayerRadii[3]) {
555+
int idxFirstOuterBarrelLayer = nItsInnerBarrelLayers;
556+
if (doSVRadiusCut && decRad2 < LayerRadii[idxFirstOuterBarrelLayer] * LayerRadii[idxFirstOuterBarrelLayer]) {
550557
return;
551558
}
552559
hSelKinkedTrackQA->Fill(8.f, chargeCombSvCand); // MothDecRad2InsideL4 cut bin
553560

554561
// get last layer hitted by the mother and the first layer hitted by the daughter
555562
int lastLayerMoth = 0, firstLayerDaug = 0;
556-
for (int i = 0; i < 7; i++) {
563+
for (int i = 0; i < nItsTotalLayers; i++) {
557564
if (trackMoth.itsClusterMap() & (1 << i)) {
558565
lastLayerMoth = i;
559566
}
560567
}
561568

562-
for (int i = 0; i < 7; i++) {
569+
for (int i = 0; i < nItsTotalLayers; i++) {
563570
if (trackDaug.itsClusterMap() & (1 << i)) {
564571
firstLayerDaug = i;
565572
break;
@@ -576,13 +583,13 @@ struct kinkBuilder {
576583
}
577584
hSelKinkedTrackQA->Fill(10.f, chargeCombSvCand); // MothLastLayerRadiusCheck cut bin
578585

579-
for (int i = 0; i < 3; i++) {
586+
for (int i = 0; i < nCoords; i++) {
580587
kinkCand.decVtx[i] -= kinkCand.primVtx[i];
581588
}
582589

583590
propMothTrack.getPxPyPzGlo(kinkCand.momMoth);
584591
propDaugTrack.getPxPyPzGlo(kinkCand.momDaug);
585-
for (int i = 0; i < 3; i++) {
592+
for (int i = 0; i < nCoords; i++) {
586593
kinkCand.momMoth[i] *= charge;
587594
kinkCand.momDaug[i] *= charge;
588595
}
@@ -592,7 +599,7 @@ struct kinkBuilder {
592599
kinkCand.kinkAngle = std::acos(spKink / (pMoth * pDaug));
593600

594601
std::array<float, 3> neutDauMom{0.f, 0.f, 0.f};
595-
for (int i = 0; i < 3; i++) {
602+
for (int i = 0; i < nCoords; i++) {
596603
neutDauMom[i] = kinkCand.momMoth[i] - kinkCand.momDaug[i];
597604
}
598605

PWGLF/Tasks/Resonances/lambda1405analysis.cxx

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ struct lambda1405analysis {
106106
HistogramRegistry rSigmaPlus{"sigmaPlus", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
107107
HistogramRegistry rSelections{"selections", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
108108
// Configurable for event selection
109-
Configurable<float> cutzvertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"};
110-
Configurable<float> cutEtaDaught{"cutEtaDaughter", 0.8f, "Eta cut for daughter tracks"};
109+
Configurable<float> cutZVertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"};
110+
Configurable<float> cutEtaDaughter{"cutEtaDaughter", 0.8f, "Eta cut for daughter tracks"};
111111
Configurable<float> cutDCAtoPvSigma{"cutDCAtoPvSigma", 0.1f, "Max DCA to primary vertex for Sigma candidates (cm)"};
112112
Configurable<float> cutDCAtoPvPiFromSigma{"cutDCAtoPvPiFromSigma", 2., "Min DCA to primary vertex for pion from Sigma candidates (cm)"};
113113

@@ -135,15 +135,10 @@ struct lambda1405analysis {
135135
Configurable<float> ptDownSampleMax{"ptDownSampleMax", 10., "Maximum pt for the application of the downsampling factor"};
136136

137137
Configurable<bool> fillOutputTree{"fillOutputTree", true, "If true, fill the output tree with Lambda(1405) candidates"};
138-
Configurable<bool> doLSBkg{"doLikeSignBkg", false, "Use like-sign background"};
138+
Configurable<bool> doLikeSignBkg{"doLikeSignBkg", false, "Use like-sign background"};
139139
Configurable<bool> useTof{"useTof", false, "Use Tof for PId for pion candidates"};
140140

141-
TF1* funcMinQtAlphaAP = nullptr;
142-
TF1* funcMaxQtAlphaAP = nullptr;
143-
TF1* funcMinBachPiPtVsL1405Pt = nullptr;
144-
TF1* funcMaxBachPiPtVsL1405Pt = nullptr;
145-
TF1* funcMinSigmaPtVsL1405Pt = nullptr;
146-
TF1* funcMaxSigmaPtVsL1405Pt = nullptr;
141+
TF1 funcMinQtAlphaAP, funcMaxQtAlphaAP, funcMinBachPiPtVsL1405Pt, funcMaxBachPiPtVsL1405Pt, funcMinSigmaPtVsL1405Pt, funcMaxSigmaPtVsL1405Pt;
147142

148143
using CollisionsCentSel = soa::Filtered<CollisionsFullWCentQVecs>;
149144
using McRecoCollisionsCentSel = soa::Filtered<CollisionsFullMcWCent>;
@@ -342,17 +337,17 @@ struct lambda1405analysis {
342337
}
343338

344339
// Functional selections
345-
funcMinQtAlphaAP = new TF1("funcMinQtAlphaAP", Form("%s", cutSigmaQtAPMin.value.data()), -1, 1);
340+
funcMinQtAlphaAP = TF1("funcMinQtAlphaAP", Form("%s", cutSigmaQtAPMin.value.data()), -1, 1);
346341
LOGF(info, "funcMinQtAlphaAP: %s", Form("%s", cutSigmaQtAPMin.value.data()));
347-
funcMaxQtAlphaAP = new TF1("funcMaxQtAlphaAP", Form("%s", cutSigmaQtAPMax.value.data()), -1, 1);
342+
funcMinQtAlphaAP = TF1("funcMaxQtAlphaAP", Form("%s", cutSigmaQtAPMax.value.data()), -1, 1);
348343
LOGF(info, "funcMaxQtAlphaAP: %s", Form("%s", cutSigmaQtAPMax.value.data()));
349-
funcMinBachPiPtVsL1405Pt = new TF1("funcMinBachPiPtVsL1405Pt", Form("%s", cutMinBachPiPtVsL1405Pt.value.data()), 0., 100);
344+
funcMinQtAlphaAP = TF1("funcMinBachPiPtVsL1405Pt", Form("%s", cutMinBachPiPtVsL1405Pt.value.data()), 0., 100);
350345
LOGF(info, "funcMinBachPiPtVsL1405Pt: %s", Form("%s", cutMinBachPiPtVsL1405Pt.value.data()));
351-
funcMaxBachPiPtVsL1405Pt = new TF1("funcMaxBachPiPtVsL1405Pt", Form("%s", cutMaxBachPiPtVsL1405Pt.value.data()), 0., 100);
346+
funcMinQtAlphaAP = TF1("funcMaxBachPiPtVsL1405Pt", Form("%s", cutMaxBachPiPtVsL1405Pt.value.data()), 0., 100);
352347
LOGF(info, "funcMaxBachPiPtVsL1405Pt: %s", Form("%s", cutMaxBachPiPtVsL1405Pt.value.data()));
353-
funcMinSigmaPtVsL1405Pt = new TF1("funcMinSigmaPtVsL1405Pt", Form("%s", cutMinSigmaPtVsL1405Pt.value.data()), 0., 100);
348+
funcMinQtAlphaAP = TF1("funcMinSigmaPtVsL1405Pt", Form("%s", cutMinSigmaPtVsL1405Pt.value.data()), 0., 100);
354349
LOGF(info, "funcMinSigmaPtVsL1405Pt: %s", Form("%s", cutMinSigmaPtVsL1405Pt.value.data()));
355-
funcMaxSigmaPtVsL1405Pt = new TF1("funcMaxSigmaPtVsL1405Pt", Form("%s", cutMaxSigmaPtVsL1405Pt.value.data()), 0., 100);
350+
funcMinQtAlphaAP = TF1("funcMaxSigmaPtVsL1405Pt", Form("%s", cutMaxSigmaPtVsL1405Pt.value.data()), 0., 100);
356351
LOGF(info, "funcMaxSigmaPtVsL1405Pt: %s", Form("%s", cutMaxSigmaPtVsL1405Pt.value.data()));
357352
}
358353

@@ -385,7 +380,7 @@ struct lambda1405analysis {
385380
}
386381
rSelections.fill(HIST("hSelectionsBachPi"), 3); // Tpc clusters
387382

388-
if (std::abs(std::abs(candidate.eta()) > cutEtaDaught)) {
383+
if (std::abs(candidate.eta()) > cutEtaDaughter) {
389384
return false;
390385
}
391386
rSelections.fill(HIST("hSelectionsBachPi"), 4); // Eta selection
@@ -408,7 +403,7 @@ struct lambda1405analysis {
408403
}
409404
rSelections.fill(HIST("hSelectionsKinkPi"), 2); // Tpc clusters
410405

411-
if (std::abs(std::abs(candidate.eta()) > cutEtaDaught)) {
406+
if (std::abs(candidate.eta()) > cutEtaDaughter) {
412407
return false;
413408
}
414409
rSelections.fill(HIST("hSelectionsKinkPi"), 3); // Eta selection
@@ -446,7 +441,7 @@ struct lambda1405analysis {
446441
}
447442
rSelections.fill(HIST("hSelectionsKinkPr"), 2); // Tpc clusters
448443

449-
if (std::abs(candidate.eta()) > cutEtaDaught) {
444+
if (std::abs(candidate.eta()) > cutEtaDaughter) {
450445
return false;
451446
}
452447
rSelections.fill(HIST("hSelectionsKinkPr"), 3); // eta selection
@@ -618,8 +613,8 @@ struct lambda1405analysis {
618613
lambda1405Cand.sigmaRadius = sigmaRad;
619614
lambda1405Cand.kinkDcaDauToPv = sigmaCand.dcaDaugPv();
620615

621-
if (lambda1405Cand.sigmaQtAP < funcMinQtAlphaAP->Eval(lambda1405Cand.sigmaAlphaAP) ||
622-
lambda1405Cand.sigmaQtAP > funcMaxQtAlphaAP->Eval(lambda1405Cand.sigmaAlphaAP)) {
616+
if (lambda1405Cand.sigmaQtAP < funcMinQtAlphaAP.Eval(lambda1405Cand.sigmaAlphaAP) ||
617+
lambda1405Cand.sigmaQtAP > funcMaxQtAlphaAP.Eval(lambda1405Cand.sigmaAlphaAP)) {
623618
return;
624619
}
625620
if (sigmaCand.mothSign() < 0) {
@@ -643,7 +638,7 @@ struct lambda1405analysis {
643638
rSelections.fill(HIST("hSelectionsBachPi"), 0); // All bachelors
644639

645640
bool isUnlikeSign = (piTrack.sign() != sigmaCand.mothSign());
646-
bool acceptPair = doLSBkg ? !isUnlikeSign : isUnlikeSign;
641+
bool acceptPair = doLikeSignBkg ? !isUnlikeSign : isUnlikeSign;
647642
if (!acceptPair) {
648643
continue;
649644
}
@@ -687,14 +682,14 @@ struct lambda1405analysis {
687682
lambda1405Cand.scalarProd = -1;
688683

689684
// Check correlations between transverse momenta of L1405, sigma and bachelor pi
690-
if (std::hypot(sigmaCand.pxMoth(), sigmaCand.pyMoth()) < funcMinSigmaPtVsL1405Pt->Eval(lambda1405Cand.pt()) ||
691-
std::hypot(sigmaCand.pxMoth(), sigmaCand.pyMoth()) > funcMaxSigmaPtVsL1405Pt->Eval(lambda1405Cand.pt())) {
685+
if (std::hypot(sigmaCand.pxMoth(), sigmaCand.pyMoth()) < funcMinSigmaPtVsL1405Pt.Eval(lambda1405Cand.pt()) ||
686+
std::hypot(sigmaCand.pxMoth(), sigmaCand.pyMoth()) > funcMaxSigmaPtVsL1405Pt.Eval(lambda1405Cand.pt())) {
692687
continue;
693688
}
694689
rSelections.fill(HIST("hSelectionsL1405"), 4); // Accepted
695690

696-
if (piTrack.pt() < funcMinBachPiPtVsL1405Pt->Eval(lambda1405Cand.pt()) ||
697-
piTrack.pt() > funcMaxBachPiPtVsL1405Pt->Eval(lambda1405Cand.pt())) {
691+
if (piTrack.pt() < funcMinBachPiPtVsL1405Pt.Eval(lambda1405Cand.pt()) ||
692+
piTrack.pt() > funcMaxBachPiPtVsL1405Pt.Eval(lambda1405Cand.pt())) {
698693
continue;
699694
}
700695
rSelections.fill(HIST("hSelectionsL1405"), 5); // Accepted
@@ -734,7 +729,7 @@ struct lambda1405analysis {
734729
return;
735730
}
736731
}
737-
if (std::abs(collision.posZ()) > cutzvertex || !collision.sel8()) {
732+
if (std::abs(collision.posZ()) > cutZVertex || !collision.sel8()) {
738733
return;
739734
}
740735
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
@@ -896,7 +891,7 @@ struct lambda1405analysis {
896891
return;
897892
}
898893
}
899-
if (std::abs(collision.posZ()) > cutzvertex) { // || !collision.sel8()) {
894+
if (std::abs(collision.posZ()) > cutZVertex) { // || !collision.sel8()) {
900895
continue;
901896
}
902897
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
@@ -931,7 +926,7 @@ struct lambda1405analysis {
931926
}
932927
rLambda1405.fill(HIST("hRecoL1405"), 2., lambda1405Cand.pt()); // Has kink decay in MC
933928

934-
if (std::abs(mcTrackPi.pdgCode()) != 211) {
929+
if (std::abs(mcTrackPi.pdgCode()) != PDG_t::kPiPlus) {
935930
continue; // Skip if not a valid pion candidate
936931
}
937932
rLambda1405.fill(HIST("hRecoL1405"), 3., lambda1405Cand.pt()); // Has bach pi

0 commit comments

Comments
 (0)