@@ -384,37 +384,7 @@ struct TreeWriterTpcV0 {
384384 }
385385 }
386386
387- double tsalisCharged (const double pt, const double mass)
388- {
389- const double a = 6.81 , b = 59.24 ;
390- const double c = 0.082 , d = 0.151 ;
391- const double mt = std::sqrt (mass * mass + pt * pt);
392- const double n = a + b / sqrtSNN;
393- const double t = c + d / sqrtSNN;
394- const double p0 = n * t;
395- const double result = std::pow ((1 . + mt / p0), -n);
396- return result;
397- };
398-
399- // / Random downsampling trigger function using Tsalis/Hagedorn spectra fit (sqrt(s) = 62.4 GeV to 13 TeV)
400- // / as in https://iopscience.iop.org/article/10.1088/2399-6528/aab00f/pdf
401387 TRandom3* fRndm = new TRandom3(0 );
402- bool downsampleTsalisCharged (const double pt, const double factor1Pt, const double mass, const double maxPt)
403- {
404- if (factor1Pt < 0 .) {
405- return true ;
406- }
407- if (pt > maxPt) {
408- return true ;
409- }
410- const double prob = tsalisCharged (pt, mass) * pt;
411- const double probNorm = tsalisCharged (1 ., mass);
412- if ((fRndm ->Rndm () * ((prob / probNorm) * pt * pt)) > factor1Pt) {
413- return false ;
414- } else {
415- return true ;
416- }
417- };
418388
419389 void init (o2::framework::InitContext&)
420390 {
@@ -479,7 +449,7 @@ struct TreeWriterTpcV0 {
479449 rowTPCTree.reserve (tracks.size ());
480450
481451 auto fillDaughterTrack = [&](const auto & mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter) {
482- const bool passDownsamplig = downsampleTsalisCharged (dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , daughter.maxPt4dwnsmplTsalis );
452+ const bool passDownsamplig = downsampleTsalisCharged (fRndm , dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , sqrtSNN , daughter.maxPt4dwnsmplTsalis );
483453 const bool passNSigmaTofCut = std::fabs (daughter.tofNSigma ) < daughter.nSigmaTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) < FloatEqualityTolerance;
484454 const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) > FloatEqualityTolerance;
485455 if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
@@ -570,7 +540,7 @@ struct TreeWriterTpcV0 {
570540 }
571541
572542 auto fillDaughterTrack = [&](const auto & mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter, const aod::TracksQA& trackQAInstance, const bool existTrkQA) {
573- const bool passDownsamplig = downsampleTsalisCharged (dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , daughter.maxPt4dwnsmplTsalis );
543+ const bool passDownsamplig = downsampleTsalisCharged (fRndm , dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , sqrtSNN , daughter.maxPt4dwnsmplTsalis );
574544 const bool passNSigmaTofCut = std::fabs (daughter.tofNSigma ) < daughter.nSigmaTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) < FloatEqualityTolerance;
575545 const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) > FloatEqualityTolerance;
576546 if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
@@ -755,34 +725,7 @@ struct TreeWriterTPCTOF {
755725 double nSigmaTpcTpctof;
756726 };
757727
758- double tsalisCharged (const double pt, const double mass)
759- {
760- const double a = 6.81 , b = 59.24 ;
761- const double c = 0.082 , d = 0.151 ;
762- double mt = std::sqrt (mass * mass + pt * pt);
763- double n = a + b / sqrtSNN;
764- double t = c + d / sqrtSNN;
765- double p0 = n * t;
766- double result = std::pow ((1 . + mt / p0), -n);
767- return result;
768- };
769-
770- // / Random downsampling trigger function using Tsalis/Hagedorn spectra fit (sqrt(s) = 62.4 GeV to 13 TeV)
771- // / as in https://iopscience.iop.org/article/10.1088/2399-6528/aab00f/pdf
772728 TRandom3* fRndm = new TRandom3(0 );
773- bool downsampleTsalisCharged (const double pt, const float factor1Pt, const double mass)
774- {
775- if (factor1Pt < 0 .) {
776- return true ;
777- }
778- const double prob = tsalisCharged (pt, mass) * pt;
779- const double probNorm = tsalisCharged (1 ., mass);
780- if ((fRndm ->Rndm () * ((prob / probNorm) * pt * pt)) > factor1Pt) {
781- return false ;
782- } else {
783- return true ;
784- }
785- };
786729
787730 // / Function to fill trees
788731 template <bool DoCorrectDeDx = false , typename T, typename C>
@@ -963,7 +906,7 @@ struct TreeWriterTPCTOF {
963906 if ((!tofTrack->isApplyHardCutOnly || trk.tpcInnerParam () < tofTrack->maxMomHardCutOnly ) &&
964907 ((trk.tpcInnerParam () <= tofTrack->maxMomTPCOnly && std::fabs (tofTrack->tpcNSigma ) < tofTrack->nSigmaTPCOnly ) ||
965908 (trk.tpcInnerParam () > tofTrack->maxMomTPCOnly && std::fabs (tofTrack->tofNSigma ) < tofTrack->nSigmaTofTpctof && std::fabs (tofTrack->tpcNSigma ) < tofTrack->nSigmaTpcTpctof )) &&
966- downsampleTsalisCharged (trk.pt (), tofTrack->downsamplingTsalis , tofTrack->mass )) {
909+ downsampleTsalisCharged (fRndm , trk.pt (), tofTrack->downsamplingTsalis , tofTrack->mass , sqrtSNN )) {
967910 fillSkimmedTPCTOFTable<IsCorrectedDeDx>(trk, collision, tofTrack->tpcNSigma , tofTrack->tofNSigma , tofTrack->itsNSigma , tofTrack->tpcExpSignal , tofTrack->pid , runnumber, tofTrack->dwnSmplFactor , hadronicRate);
968911 }
969912 }
@@ -1047,7 +990,7 @@ struct TreeWriterTPCTOF {
1047990 if ((!tofTrack->isApplyHardCutOnly || trk.tpcInnerParam () < tofTrack->maxMomHardCutOnly ) &&
1048991 ((trk.tpcInnerParam () <= tofTrack->maxMomTPCOnly && std::fabs (tofTrack->tpcNSigma ) < tofTrack->nSigmaTPCOnly ) ||
1049992 (trk.tpcInnerParam () > tofTrack->maxMomTPCOnly && std::fabs (tofTrack->tofNSigma ) < tofTrack->nSigmaTofTpctof && std::fabs (tofTrack->tpcNSigma ) < tofTrack->nSigmaTpcTpctof )) &&
1050- downsampleTsalisCharged (trk.pt (), tofTrack->downsamplingTsalis , tofTrack->mass )) {
993+ downsampleTsalisCharged (fRndm , trk.pt (), tofTrack->downsamplingTsalis , tofTrack->mass , sqrtSNN )) {
1051994 fillSkimmedTPCTOFTableWithTrkQAGeneric<IsCorrectedDeDx, IsWithdEdx>(trk, trackQA, existTrkQA, collision, tofTrack->tpcNSigma , tofTrack->tofNSigma , tofTrack->itsNSigma , tofTrack->tpcExpSignal , tofTrack->pid , runnumber, tofTrack->dwnSmplFactor , hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame);
1052995 }
1053996 }
0 commit comments