Skip to content

Commit f00cbf1

Browse files
syntax fixes, electron conversion radius is now configurable
1 parent 04168ad commit f00cbf1

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct Candidate {
152152
float cosPAMother = -999.f; // Cosine of the pointing angle of the mother
153153
float massMother = -999.f; // Invariant mass of the mother
154154
int pdgCode = 0;
155-
}
155+
};
156156

157157
struct LfTreeCreatorClusterStudies {
158158

@@ -196,6 +196,8 @@ struct LfTreeCreatorClusterStudies {
196196
Configurable<float> v0setting_nsigmatpcPr{"v0setting_nsigmaTPCPr", 2.f, "Number of sigmas for the TPC PID for protons"};
197197
Configurable<float> lambdasetting_qtAPcut{"lambdasetting_qtAPcut", 0.02f, "Cut on the qt for the Armenteros-Podolanski plot for photon rejection"};
198198
Configurable<float> lambdasetting_pmin{"lambdasetting_pmin", 0.0f, "Minimum momentum for the V0 daughters"};
199+
Configurable<float> electronsetting_conversion_rmin{"electron_conversion_rmin", 1.76f, "Minimum radius for the photon conversion (cm)"};
200+
Configurable<float> electronsetting_conversion_rmax{"electron_conversion_rmax", 19.77f, "Maximum radius for the photon conversion (cm)"};
199201

200202
Configurable<float> cascsetting_dcaCascDaughters{"casc_setting_dcaV0daughters", 0.1f, "DCA between the V0 daughters"};
201203
Configurable<float> cascsetting_cosPA{"casc_setting_cosPA", 0.99f, "Cosine of the pointing angle of the V0"};
@@ -444,11 +446,14 @@ struct LfTreeCreatorClusterStudies {
444446
if ((std::abs(massAntiLambdaV0 - o2::constants::physics::MassLambda0) < v0setting_massWindowLambda) && (alphaAP < 0)) {
445447
SETBIT(v0Bitmask, AntiLambda);
446448
}
449+
return v0Bitmask;
447450

448451
}
449452

450-
bool selectPidV0Daughters(Candidate & candidatePos, Candidate& candidateNeg, const o2::aod::Track& posTrack,
451-
const o2::aod::Track& negTrack, const std::array<float, 3>& momMother, float qtAP, uint8_t v0Bitmask)
453+
template<typename T>
454+
bool selectPidV0Daughters(Candidate & candidatePos, Candidate& candidateNeg, const T& posTrack,
455+
const T& negTrack, const std::array<float, 3>& momMother, const std::array<float, 3>& decayVtx,
456+
float qtAP, float radiusV0, uint8_t v0Bitmask)
452457
{
453458
if (TESTBIT(v0Bitmask, Lambda)) {
454459
if (qtAP < lambdasetting_qtAPcut)
@@ -459,21 +464,21 @@ struct LfTreeCreatorClusterStudies {
459464
return false;
460465
candidatePos.partID = PartID::pr;
461466
candidateNeg.partID = PartID::pi;
462-
candidatePos.tpcNSigma = posTrack.tpcNSigmaPr();
463-
candidateNeg.tpcNSigma = negTrack.tpcNSigmaPi();
467+
candidatePos.nsigmaTPC = posTrack.tpcNSigmaPr();
468+
candidateNeg.nsigmaTPC = negTrack.tpcNSigmaPi();
464469
m_hAnalysis.fill(HIST("v0_type"), V0Type::Lambda);
465470

466471
} else if (TESTBIT(v0Bitmask, AntiLambda)) {
467472
if (qtAP < lambdasetting_qtAPcut)
468-
return;
473+
return false;
469474
if (std::abs(posTrack.tpcNSigmaPi()) > v0setting_nsigmatpcPr || std::abs(negTrack.tpcNSigmaPr()) > v0setting_nsigmatpcPi)
470475
return false;
471476
if (std::hypot(momMother[0], momMother[1], momMother[2]) < lambdasetting_pmin)
472477
return false;
473478
candidatePos.partID = PartID::pi;
474479
candidateNeg.partID = PartID::pr;
475-
candidatePos.tpcNSigma = posTrack.tpcNSigmaPi();
476-
candidateNeg.tpcNSigma = negTrack.tpcNSigmaPr();
480+
candidatePos.nsigmaTPC = posTrack.tpcNSigmaPi();
481+
candidateNeg.nsigmaTPC = negTrack.tpcNSigmaPr();
477482
m_hAnalysis.fill(HIST("v0_type"), V0Type::AntiLambda);
478483

479484
} else if (TESTBIT(v0Bitmask, K0s)) {
@@ -484,15 +489,15 @@ struct LfTreeCreatorClusterStudies {
484489
// require photon conversion to happen in one of the Inner Tracker layers (± 0.5 cm resolution)
485490
m_hAnalysis.fill(HIST("photon_conversion_position"), decayVtx[0], decayVtx[1]);
486491
m_hAnalysis.fill(HIST("photon_radiusV0"), radiusV0);
487-
if (!(radiusV0 > 1.76 && radiusV0 < 4.71))
492+
if (!(radiusV0 > electronsetting_conversion_rmin && radiusV0 < electronsetting_conversion_rmax))
488493
return false;
489494
if (std::abs(posTrack.tpcNSigmaEl()) > v0setting_nsigmatpcEl || std::abs(negTrack.tpcNSigmaEl()) > v0setting_nsigmatpcEl)
490495
return false;
491496
m_hAnalysis.fill(HIST("photon_conversion_position_layer"), decayVtx[0], decayVtx[1]);
492497
candidatePos.partID = PartID::el;
493498
candidateNeg.partID = PartID::el;
494-
candidatePos.tpcNSigma = posTrack.tpcNSigmaEl();
495-
candidateNeg.tpcNSigma = negTrack.tpcNSigmaEl();
499+
candidatePos.nsigmaTPC = posTrack.tpcNSigmaEl();
500+
candidateNeg.nsigmaTPC = negTrack.tpcNSigmaEl();
496501
m_hAnalysis.fill(HIST("v0_type"), V0Type::Photon);
497502

498503
} else {
@@ -506,7 +511,7 @@ struct LfTreeCreatorClusterStudies {
506511
* Fill the histograms for the V0 candidate and return the mass of the V0
507512
*/
508513
float fillHistogramsV0(float massLambdaV0, float massAntiLambdaV0,
509-
const std::array<float, 3>& momMother, const std::array<float, 3>& momPos, const std::array<float, 3>& momNeg,
514+
const std::array<float, 3>& momMother,
510515
const Candidate& candidatePos, const Candidate& candidateNeg, float alphaAP, float qtAP, float radiusV0, uint8_t v0Bitmask)
511516
{
512517
float massV0{0.f};
@@ -530,7 +535,7 @@ struct LfTreeCreatorClusterStudies {
530535
m_hAnalysis.fill(HIST("nSigmaTPCPi"), candidatePos.p, candidatePos.nsigmaTPC);
531536
m_hAnalysis.fill(HIST("nSigmaITSPi"), candidatePos.p, m_responseITS.nSigmaITS<o2::track::PID::Pion>(candidatePos.itsClusterSize, candidatePos.p, candidatePos.eta));
532537
m_hAnalysis.fill(HIST("nSigmaTPCPr"), candidateNeg.p, candidateNeg.nsigmaTPC);
533-
m_hAnalysis.fill(HIST("nSigmaITSPr"), candidateNeg.p, m_responseITS.nSigmaITS<o2::track::PID::Proton>(candidateNeg.itsClusterSize, candidateNeg.p, negTrack.eta));
538+
m_hAnalysis.fill(HIST("nSigmaITSPr"), candidateNeg.p, m_responseITS.nSigmaITS<o2::track::PID::Proton>(candidateNeg.itsClusterSize, candidateNeg.p, candidateNeg.eta));
534539
m_hAnalysis.fill(HIST("pmatchingPi"), candidatePos.pTPC, (candidatePos.pTPC - candidatePos.p) / candidatePos.pTPC);
535540
m_hAnalysis.fill(HIST("pmatchingPr"), -candidateNeg.pTPC, (candidateNeg.pTPC - candidateNeg.p) / candidateNeg.pTPC);
536541

@@ -563,8 +568,8 @@ struct LfTreeCreatorClusterStudies {
563568
m_ClusterStudiesTableExtra(
564569
candidate.pTPC, // pTPC
565570
candidate.pidInTrk, // pidInTrk
566-
candidate.tpcNSigma, // TpcNSigma
567-
candidate.tofNSigma, // TofNSigma
571+
candidate.nsigmaTPC, // TpcNSigma
572+
candidate.nsigmaTOF, // TofNSigma
568573
candidate.tofMass, // TofMass
569574
candidate.cosPAMother, // cosPA
570575
candidate.massMother); // massMother
@@ -799,7 +804,7 @@ struct LfTreeCreatorClusterStudies {
799804
0, negTrack.tpcInnerParam() * negTrack.sign(), negTrack.pidForTracking(),
800805
-999.f, -999.f, -999.f, cosPA, -999.f, 0);
801806

802-
if (!selectPidV0Daughters(candidatePos, candidateNeg, posTrack, negTrack, momMother, qtAP, v0Bitmask)) {
807+
if (!selectPidV0Daughters(candidatePos, candidateNeg, posTrack, negTrack, momMother, decayVtx, qtAP, radiusV0, v0Bitmask)) {
803808
return;
804809
}
805810

@@ -812,9 +817,9 @@ struct LfTreeCreatorClusterStudies {
812817
return;
813818
}
814819

815-
float massV0 = fillHistogramsV0(massLambdaV0, massAntiLambdaV0, momMother, momPos, momNeg, candidatePos, candidateNeg, alphaAP, qtAP, radiusV0, v0Bitmask);
816-
candidatePos.massV0 = massV0;
817-
candidateNeg.massV0 = massV0;
820+
float massV0 = fillHistogramsV0(massLambdaV0, massAntiLambdaV0, momMother, candidatePos, candidateNeg, alphaAP, qtAP, radiusV0, v0Bitmask);
821+
candidatePos.massMother = massV0;
822+
candidateNeg.massMother = massV0;
818823

819824
if (!setting_fillV0) {
820825
return;

0 commit comments

Comments
 (0)