Skip to content

Commit 08e99cf

Browse files
mherzer28alibuild
andauthored
[PWGLF] fixing bb implementation and adding cfg for tof mass cut (#12183)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent ba58e6f commit 08e99cf

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

PWGLF/TableProducer/Nuspex/trHeAnalysis.cxx

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ struct TrHeAnalysis {
194194
Configurable<bool> cfgTPCPidMethod{"cfgTPCPidMethod", false, "Using own or built in bethe parametrization"}; // false for built in
195195
Configurable<int> cfgMassMethod{"cfgMassMethod", 0, "0: Using built in 1: mass calculated with beta 2: mass calculated with the event time"};
196196
Configurable<bool> cfgEnableItsClusterSizeCut{"cfgEnableItsClusterSizeCut", false, "Enable ITS cluster size cut"};
197+
Configurable<bool> cfgEnableTofMassCut{"cfgEnableTofMassCut", false, "Enable TOF mass cut"};
198+
Configurable<float> cfgTofMassCutPt{"cfgTofMassCutPt", 1.6f, "Pt value for which the TOF-cut starts to be used"};
197199
// Set the multiplity event limits
198200
Configurable<float> cfgLowMultCut{"cfgLowMultCut", 0.0f, "Accepted multiplicity percentage lower limit"};
199201
Configurable<float> cfgHighMultCut{"cfgHighMultCut", 100.0f, "Accepted multiplicity percentage higher limit"};
@@ -219,8 +221,11 @@ struct TrHeAnalysis {
219221
Configurable<float> cfgCutMinItsClusterSizeHe{"cfgCutMinItsClusterSizeHe", 1.f, "Minimum ITS Cluster Size for He"};
220222
Configurable<float> cfgCutMaxItsClusterSizeH3{"cfgCutMaxItsClusterSizeH3", 4.f, "Maximum ITS Cluster Size for Tr"};
221223
Configurable<float> cfgCutMinItsClusterSizeH3{"cfgCutMinItsClusterSizeH3", 1.f, "Minimum ITS Cluster Size for Tr"};
222-
Configurable<float> cfgCutMinTofMassH3{"cfgCutMinTofMassH3", 2.24f, "Minimum Tof mass H3"};
223-
Configurable<float> cfgCutMaxTofMassH3{"cfgCutMaxTofMassH3", 3.32f, "Maximum TOF mass H3"};
224+
Configurable<float> cfgCutMinTofMassH3{"cfgCutMinTofMassH3", 5.f, "Minimum Tof mass H3"};
225+
Configurable<float> cfgCutMaxTofMassH3{"cfgCutMaxTofMassH3", 11.f, "Maximum TOF mass H3"};
226+
Configurable<float> cfgMaxRigidity{"cfgMaxRigidity", 10.f, "Maximum rigidity value"};
227+
Configurable<float> cfgMaxPt{"cfgMaxPt", 10.f, "Maximum pT value"};
228+
224229
// Set the kinematic and PID cuts for tracks
225230
struct : ConfigurableGroup {
226231
Configurable<float> pCut{"pCut", 0.6f, "Value of the p selection for spectra (default 0.3)"};
@@ -345,6 +350,9 @@ struct TrHeAnalysis {
345350
histos.fill(HIST("histogram/cuts"), 2);
346351
continue;
347352
}
353+
if (track.pt() > cfgMaxPt || getRigidity(track) > cfgMaxRigidity) {
354+
continue;
355+
}
348356
if (track.tpcNClsFound() < cfgCutTpcClusters) {
349357
histos.fill(HIST("histogram/cuts"), 3);
350358
continue;
@@ -399,9 +407,11 @@ struct TrHeAnalysis {
399407
continue;
400408
}
401409
}
402-
if (getMass(track) < cfgCutMinTofMassH3 || getMass(track) > cfgCutMaxTofMassH3) {
403-
histos.fill(HIST("histogram/cuts"), 13);
404-
continue;
410+
if (cfgEnableTofMassCut && track.pt() > cfgTofMassCutPt) {
411+
if (getMass(track) < cfgCutMinTofMassH3 || getMass(track) > cfgCutMaxTofMassH3) {
412+
histos.fill(HIST("histogram/cuts"), 13);
413+
continue;
414+
}
405415
}
406416
histos.fill(HIST("histogram/H3/H3-TPCsignVsTPCmomentum"),
407417
getRigidity(track) * track.sign(),
@@ -510,6 +520,9 @@ struct TrHeAnalysis {
510520
histos.fill(HIST("histogram/cuts"), 2);
511521
continue;
512522
}
523+
if (track.pt() > cfgMaxPt || getRigidity(track) > cfgMaxRigidity) {
524+
continue;
525+
}
513526
if (track.tpcNClsFound() < cfgCutTpcClusters) {
514527
histos.fill(HIST("histogram/cuts"), 3);
515528
continue;
@@ -562,9 +575,11 @@ struct TrHeAnalysis {
562575
continue;
563576
}
564577
}
565-
if (getMass(track) < cfgCutMinTofMassH3 || getMass(track) > cfgCutMaxTofMassH3) {
566-
histos.fill(HIST("histogram/cuts"), 13);
567-
continue;
578+
if (cfgEnableTofMassCut && track.pt() > cfgTofMassCutPt) {
579+
if (getMass(track) < cfgCutMinTofMassH3 || getMass(track) > cfgCutMaxTofMassH3) {
580+
histos.fill(HIST("histogram/cuts"), 13);
581+
continue;
582+
}
568583
}
569584
histos.fill(HIST("histogram/H3/H3-TPCsignVsTPCmomentum"),
570585
getRigidity(track) * (1.f * track.sign()),
@@ -709,14 +724,15 @@ struct TrHeAnalysis {
709724
float getMass(const T& track)
710725
{
711726
if (cfgMassMethod == 0) {
712-
return track.mass();
727+
float m = track.mass();
728+
return m * m;
713729
}
714730
if (cfgMassMethod == 1) {
715731
const float beta = track.beta();
716732
const float rigidity = getRigidity(track);
717-
float gamma = 1 / std::sqrt(1 - beta * beta);
718-
float mass = (rigidity / std::sqrt(gamma * gamma - 1.f));
719-
return mass;
733+
float gamma = 1.f / std::sqrt(1.f - beta * beta);
734+
float mass = rigidity / std::sqrt(gamma * gamma - 1.f);
735+
return mass * mass;
720736
}
721737
if (cfgMassMethod == 2) {
722738
const float rigidity = getRigidity(track);
@@ -727,9 +743,9 @@ struct TrHeAnalysis {
727743
float time = tofTime - tofStartTime;
728744
if (time > 0.f && length > 0.f) {
729745
float beta = length / (CInCmPs * time);
730-
float gamma = 1 / std::sqrt(1 - beta * beta);
746+
float gamma = 1.f / std::sqrt(1.f - beta * beta);
731747
float mass = rigidity / std::sqrt(gamma * gamma - 1.f);
732-
return mass;
748+
return mass * mass;
733749
}
734750
return -1.f;
735751
}

0 commit comments

Comments
 (0)