Skip to content

Commit 6416658

Browse files
authored
Update trHeAnalysis.cxx
1 parent a66c5fb commit 6416658

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

PWGLF/TableProducer/Nuspex/trHeAnalysis.cxx

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ struct TrHeAnalysis {
219219
Configurable<float> cfgCutMinItsClusterSizeHe{"cfgCutMinItsClusterSizeHe", 1.f, "Minimum ITS Cluster Size for He"};
220220
Configurable<float> cfgCutMaxItsClusterSizeH3{"cfgCutMaxItsClusterSizeH3", 4.f, "Maximum ITS Cluster Size for Tr"};
221221
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"};
222+
Configurable<float> cfgCutMinTofMassH3{"cfgCutMinTofMassH3", 5f, "Minimum Tof mass H3"};
223+
Configurable<float> cfgCutMaxTofMassH3{"cfgCutMaxTofMassH3", 11f, "Maximum TOF mass H3"};
224224
// Set the kinematic and PID cuts for tracks
225225
struct : ConfigurableGroup {
226226
Configurable<float> pCut{"pCut", 0.6f, "Value of the p selection for spectra (default 0.3)"};
@@ -706,35 +706,36 @@ struct TrHeAnalysis {
706706
return hePID ? track.tpcInnerParam() / 2 : track.tpcInnerParam();
707707
}
708708
template <class T>
709-
float getMass(const T& track)
710-
{
711-
if (cfgMassMethod == 0) {
712-
return track.mass();
713-
}
714-
if (cfgMassMethod == 1) {
715-
const float beta = track.beta();
716-
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;
720-
}
721-
if (cfgMassMethod == 2) {
722-
const float rigidity = getRigidity(track);
723-
float tofStartTime = track.evTimeForTrack();
724-
float tofTime = track.tofSignal();
725-
constexpr float CInCmPs = 2.99792458e-2f;
726-
float length = track.length();
727-
float time = tofTime - tofStartTime;
728-
if (time > 0.f && length > 0.f) {
729-
float beta = length / (CInCmPs * time);
730-
float gamma = 1 / std::sqrt(1 - beta * beta);
731-
float mass = rigidity / std::sqrt(gamma * gamma - 1.f);
732-
return mass;
733-
}
734-
return -1.f;
709+
float getMassSquared(const T& track)
710+
{
711+
if (cfgMassMethod == 0) {
712+
float m = track.mass();
713+
return m * m;
714+
}
715+
if (cfgMassMethod == 1) {
716+
const float beta = track.beta();
717+
const float rigidity = getRigidity(track);
718+
float gamma = 1.f / std::sqrt(1.f - beta * beta);
719+
float mass = rigidity / std::sqrt(gamma * gamma - 1.f);
720+
return mass * mass;
721+
}
722+
if (cfgMassMethod == 2) {
723+
const float rigidity = getRigidity(track);
724+
float tofStartTime = track.evTimeForTrack();
725+
float tofTime = track.tofSignal();
726+
constexpr float CInCmPs = 2.99792458e-2f;
727+
float length = track.length();
728+
float time = tofTime - tofStartTime;
729+
if (time > 0.f && length > 0.f) {
730+
float beta = length / (CInCmPs * time);
731+
float gamma = 1.f / std::sqrt(1.f - beta * beta);
732+
float mass = rigidity / std::sqrt(gamma * gamma - 1.f);
733+
return mass * mass;
735734
}
736735
return -1.f;
737736
}
737+
return -1.f;
738+
}
738739
};
739740

740741
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)