Skip to content

Commit 36b2112

Browse files
lhusovaLucia Anna Tarasovicova
andauthored
PWGLF: change in derivedcascadeanalysis.cxx (#5842)
* momentum thr for TOF usage * MegaLinter fix * MegaLinter fix_2 * MegaLinter fix_3 --------- Co-authored-by: Lucia Anna Tarasovicova <lucia.anna.husova@cern.ch>
1 parent fbb8af5 commit 36b2112

1 file changed

Lines changed: 58 additions & 37 deletions

File tree

PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@
3232
#include <TH2F.h>
3333
#include <TProfile.h>
3434
#include <TLorentzVector.h>
35-
#include <Math/Vector4D.h>
3635
#include <TPDGCode.h>
3736
#include <TDatabasePDG.h>
38-
#include <cmath>
39-
#include <array>
40-
#include <cstdlib>
41-
#include "Framework/ASoAHelpers.h"
4237

4338
// constants
4439
const float ctauxiPDG = 4.91; // from PDG
@@ -421,7 +416,7 @@ struct derivedCascadeAnalysis {
421416
}
422417

423418
template <typename TCascade>
424-
bool IsCascadeCandidateAccepted(TCascade casc, int counter, float /*centrality*/)
419+
bool IsCascadeCandidateAccepted(TCascade casc, int counter, float centrality)
425420
{
426421
float cut = masswin;
427422
histos.fill(HIST("hCutValue"), 2, cut);
@@ -462,17 +457,19 @@ struct derivedCascadeAnalysis {
462457
return false;
463458
}
464459
histos.fill(HIST("hCandidate"), ++counter);
465-
} else
460+
} else {
466461
++counter;
462+
}
467463

468464
if (doDCAV0DauCut) {
469465
cut = dcav0dau;
470466
histos.fill(HIST("hCutValue"), 5, cut);
471467
if (casc.dcaV0daughters() > dcav0dau)
472468
return false;
473469
histos.fill(HIST("hCandidate"), ++counter);
474-
} else
470+
} else {
475471
++counter;
472+
}
476473

477474
if (doCascadeRadiusCut) {
478475
if (doPtDepCascRadiusCut) {
@@ -491,8 +488,9 @@ struct derivedCascadeAnalysis {
491488
if (casc.cascradius() > maxRadius)
492489
return false;
493490
histos.fill(HIST("hCandidate"), ++counter);
494-
} else
491+
} else {
495492
counter += 2;
493+
}
496494

497495
if (doV0RadiusCut) {
498496
if (doPtDepV0RadiusCut) {
@@ -510,8 +508,9 @@ struct derivedCascadeAnalysis {
510508
if (casc.v0radius() > maxV0Radius)
511509
return false;
512510
histos.fill(HIST("hCandidate"), ++counter);
513-
} else
511+
} else {
514512
counter += 2;
513+
}
515514

516515
cut = lambdaMassWin;
517516
histos.fill(HIST("hCutValue"), 10, cut);
@@ -526,15 +525,17 @@ struct derivedCascadeAnalysis {
526525
return false;
527526
}
528527
histos.fill(HIST("hCandidate"), ++counter);
529-
} else
528+
} else {
530529
++counter;
530+
}
531531

532532
if (doV0CosPaCut) {
533533
if (!IsCosPAAccepted(casc, casc.x(), casc.y(), casc.z(), doPtDepV0CosPaCut, false))
534534
return false;
535535
histos.fill(HIST("hCandidate"), ++counter);
536-
} else
536+
} else {
537537
++counter;
538+
}
538539

539540
cut = rejcomp;
540541
histos.fill(HIST("hCutValue"), 13, cut);
@@ -562,8 +563,9 @@ struct derivedCascadeAnalysis {
562563
if (casc.sign() < 0 && (TMath::Abs(casc.dcapostopv()) < dcaBaryonToPV || TMath::Abs(casc.dcanegtopv()) < dcaMesonToPV))
563564
return false;
564565
histos.fill(HIST("hCandidate"), ++counter);
565-
} else
566+
} else {
566567
++counter;
568+
}
567569

568570
return true;
569571
}
@@ -613,17 +615,19 @@ struct derivedCascadeAnalysis {
613615
if (!IsCosPAAccepted(casc, coll.posX(), coll.posY(), coll.posZ(), doPtDepCosPaCut, true))
614616
continue;
615617
histos.fill(HIST("hCandidate"), ++counter);
616-
} else
618+
} else {
617619
++counter;
620+
}
618621

619622
cut = dcaV0ToPV;
620623
histos.fill(HIST("hCutValue"), 17, cut);
621624
if (doDCAV0ToPVCut) {
622625
if (TMath::Abs(casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ())) < dcaV0ToPV)
623626
continue;
624627
histos.fill(HIST("hCandidate"), ++counter);
625-
} else
628+
} else {
626629
++counter;
630+
}
627631

628632
if (doNTPCSigmaCut) {
629633
if (casc.sign() < 0) {
@@ -639,8 +643,9 @@ struct derivedCascadeAnalysis {
639643
continue;
640644
histos.fill(HIST("hCandidate"), ++counter);
641645
}
642-
} else
646+
} else {
643647
++counter;
648+
}
644649

645650
if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows)
646651
continue;
@@ -667,27 +672,31 @@ struct derivedCascadeAnalysis {
667672
cut = ctau;
668673
histos.fill(HIST("hCutValue"), 22, cut);
669674

675+
double fullmomentum;
676+
670677
if (posExtra.hasTOF()) {
678+
fullmomentum = TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2));
671679
if (doNTOFSigmaProtonCut && casc.sign() < 0) {
672-
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2)), coll.centFT0C());
673-
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr)
680+
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentum, coll.centFT0C());
681+
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr && fullmomentum > 0.6)
674682
continue;
675683
}
676684
if (doNTOFSigmaV0PionCut && casc.sign() > 0) {
677-
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2)), coll.centFT0C());
685+
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentum, coll.centFT0C());
678686
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > nsigmatofPion)
679687
continue;
680688
}
681689
}
682690

683691
if (negExtra.hasTOF()) {
692+
fullmomentum = TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2));
684693
if (doNTOFSigmaProtonCut && casc.sign() > 0) {
685-
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2)), coll.centFT0C());
686-
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr)
694+
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentum, coll.centFT0C());
695+
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr && fullmomentum > 0.6)
687696
continue;
688697
}
689698
if (doNTOFSigmaV0PionCut && casc.sign() < 0) {
690-
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2)), coll.centFT0C());
699+
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentum, coll.centFT0C());
691700
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > nsigmatofPion)
692701
continue;
693702
}
@@ -702,8 +711,9 @@ struct derivedCascadeAnalysis {
702711
if (TMath::Abs(bachExtra.tpcNSigmaPi()) > nsigmatpcPi)
703712
continue;
704713
histos.fill(HIST("hCandidate"), ++counter);
705-
} else
714+
} else {
706715
++counter;
716+
}
707717

708718
if (bachExtra.hasTOF() && doNTOFSigmaBachelorCut) {
709719
histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), coll.centFT0C());
@@ -725,8 +735,9 @@ struct derivedCascadeAnalysis {
725735
if (TMath::Abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa)
726736
continue;
727737
histos.fill(HIST("hCandidate"), ++counter);
728-
} else
738+
} else {
729739
++counter;
740+
}
730741

731742
if (bachExtra.hasTOF() && doNTOFSigmaBachelorCut) {
732743
histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), coll.centFT0C());
@@ -739,8 +750,9 @@ struct derivedCascadeAnalysis {
739750
if (ctau > proplifetime)
740751
continue;
741752
histos.fill(HIST("hCandidate"), ++counter);
742-
} else
753+
} else {
743754
++counter;
755+
}
744756
}
745757

746758
if (casc.sign() < 0) {
@@ -839,15 +851,17 @@ struct derivedCascadeAnalysis {
839851
if (!IsCosPAAccepted(casc, coll.posX(), coll.posY(), coll.posZ(), doPtDepCosPaCut, true))
840852
continue;
841853
histos.fill(HIST("hCandidate"), ++counter);
842-
} else
854+
} else {
843855
++counter;
856+
}
844857

845858
if (doDCAV0ToPVCut) {
846859
if (TMath::Abs(casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ())) < dcaV0ToPV)
847860
continue;
848861
histos.fill(HIST("hCandidate"), ++counter);
849-
} else
862+
} else {
850863
++counter;
864+
}
851865

852866
if (doNTPCSigmaCut) {
853867
if (casc.sign() < 0) {
@@ -863,8 +877,9 @@ struct derivedCascadeAnalysis {
863877
continue;
864878
histos.fill(HIST("hCandidate"), ++counter);
865879
}
866-
} else
880+
} else {
867881
++counter;
882+
}
868883

869884
if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows)
870885
continue;
@@ -888,28 +903,31 @@ struct derivedCascadeAnalysis {
888903
float cascpos = std::hypot(casc.x() - coll.posX(), casc.y() - coll.posY(), casc.z() - coll.posZ());
889904
float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz());
890905
float ctau = -10;
906+
double fullmomentum;
891907

892908
if (posExtra.hasTOF()) {
909+
fullmomentum = TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2));
893910
if (doNTOFSigmaProtonCut && casc.sign() < 0) {
894-
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2)), coll.centFT0C());
895-
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr)
911+
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentum, coll.centFT0C());
912+
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr && fullmomentum > 0.6)
896913
continue;
897914
}
898915
if (doNTOFSigmaV0PionCut && casc.sign() > 0) {
899-
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), TMath::Sqrt(TMath::Power(casc.pxpos(), 2) + TMath::Power(casc.pypos(), 2) + TMath::Power(casc.pzpos(), 2)), coll.centFT0C());
916+
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentum, coll.centFT0C());
900917
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > nsigmatofPion)
901918
continue;
902919
}
903920
}
904921

905922
if (negExtra.hasTOF()) {
923+
fullmomentum = TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2));
906924
if (doNTOFSigmaProtonCut && casc.sign() > 0) {
907-
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2)), coll.centFT0C());
908-
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr)
925+
histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentum, coll.centFT0C());
926+
if (TMath::Abs(casc.tofNSigmaXiLaPr()) > nsigmatofPr && fullmomentum > 0.6)
909927
continue;
910928
}
911929
if (doNTOFSigmaV0PionCut && casc.sign() < 0) {
912-
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), TMath::Sqrt(TMath::Power(casc.pxneg(), 2) + TMath::Power(casc.pyneg(), 2) + TMath::Power(casc.pzneg(), 2)), coll.centFT0C());
930+
histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentum, coll.centFT0C());
913931
if (TMath::Abs(casc.tofNSigmaXiLaPi()) > nsigmatofPion)
914932
continue;
915933
}
@@ -924,8 +942,9 @@ struct derivedCascadeAnalysis {
924942
if (TMath::Abs(bachExtra.tpcNSigmaPi()) > nsigmatpcPi)
925943
continue;
926944
histos.fill(HIST("hCandidate"), ++counter);
927-
} else
945+
} else {
928946
++counter;
947+
}
929948

930949
if (bachExtra.hasTOF() && doNTOFSigmaBachelorCut) {
931950
histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), coll.centFT0C());
@@ -949,8 +968,9 @@ struct derivedCascadeAnalysis {
949968
if (TMath::Abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa)
950969
continue;
951970
histos.fill(HIST("hCandidate"), ++counter);
952-
} else
971+
} else {
953972
++counter;
973+
}
954974

955975
if (bachExtra.hasTOF() && doNTOFSigmaBachelorCut) {
956976
histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), coll.centFT0C());
@@ -963,8 +983,9 @@ struct derivedCascadeAnalysis {
963983
if (ctau > proplifetime)
964984
continue;
965985
histos.fill(HIST("hCandidate"), ++counter);
966-
} else
986+
} else {
967987
++counter;
988+
}
968989
invmass = casc.mOmega();
969990
}
970991

0 commit comments

Comments
 (0)