@@ -157,6 +157,15 @@ struct lambdakzeroBuilder {
157157 Configurable<std::string> lutPath{" lutPath" , " GLO/Param/MatLUT" , " Path of the Lut parametrization" };
158158 Configurable<std::string> geoPath{" geoPath" , " GLO/Config/GeometryAligned" , " Path of the geometry file" };
159159
160+ // generate and fill extra QA histograms is requested
161+ Configurable<bool > d_doQA{" d_doQA" , false , " Do basic QA" };
162+ Configurable<int > dQANBinsRadius{" dQANBinsRadius" , 500 , " Number of radius bins in QA histo" };
163+ Configurable<int > dQANBinsPtCoarse{" dQANBinsPtCoarse" , 10 , " Number of pT bins in QA histo" };
164+ Configurable<int > dQANBinsMass{" dQANBinsMass" , 400 , " Number of mass bins for QA histograms" };
165+ Configurable<float > dQAMaxPt{" dQAMaxPt" , 5 , " max pT in QA histo" };
166+ Configurable<float > dQAK0ShortMassWindow{" dQAK0ShortMassWindow" , 0.005 , " K0 mass window for ITS cluster map QA" };
167+ Configurable<float > dQALambdaMassWindow{" dQALambdaMassWindow" , 0.005 , " Lambda/AntiLambda mass window for ITS cluster map QA" };
168+
160169 int mRunNumber ;
161170 float d_bz;
162171 float maxSnp; // max sine phi for propagation
@@ -245,6 +254,35 @@ struct lambdakzeroBuilder {
245254 {
246255 resetHistos ();
247256
257+ // Optionally, add extra QA histograms to processing chain
258+ if (d_doQA) {
259+ // Basic histograms containing invariant masses of all built candidates
260+ const AxisSpec axisVsPtCoarse{(int )dQANBinsPtCoarse, 0 , dQAMaxPt, " #it{p}_{T} (GeV/c)" };
261+ const AxisSpec axisGammaMass{(int )dQANBinsMass, 0 .000f , 0 .400f , " Inv. Mass (GeV/c^{2})" };
262+ const AxisSpec axisK0ShortMass{(int )dQANBinsMass, 0 .400f , 0 .600f , " Inv. Mass (GeV/c^{2})" };
263+ const AxisSpec axisLambdaMass{(int )dQANBinsMass, 1 .01f , 1 .21f , " Inv. Mass (GeV/c^{2})" };
264+ const AxisSpec axisHypertritonMass{(int )dQANBinsMass, 2 .900f , 3 .300f , " Inv. Mass (GeV/c^{2})" };
265+
266+ registry.add (" h2dGammaMass" , " h2dGammaMass" , kTH2F , {axisVsPtCoarse, axisGammaMass});
267+ registry.add (" h2dK0ShortMass" , " h2dK0ShortMass" , kTH2F , {axisVsPtCoarse, axisK0ShortMass});
268+ registry.add (" h2dLambdaMass" , " h2dLambdaMass" , kTH2F , {axisVsPtCoarse, axisLambdaMass});
269+ registry.add (" h2dAntiLambdaMass" , " h2dAntiLambdaMass" , kTH2F , {axisVsPtCoarse, axisLambdaMass});
270+ registry.add (" h2dHypertritonMass" , " h2dHypertritonMass" , kTH2F , {axisVsPtCoarse, axisHypertritonMass});
271+ registry.add (" h2dAntiHypertritonMass" , " h2dAntiHypertritonMass" , kTH2F , {axisVsPtCoarse, axisHypertritonMass});
272+
273+ // bit packed ITS cluster map
274+ const AxisSpec axisITSCluMap{(int )128 , -0 .5f , +127 .5f , " Packed ITS map" };
275+ const AxisSpec axisRadius{(int )dQANBinsRadius, 0 .0f , +50 .0f , " Radius (cm)" };
276+
277+ // Histogram to bookkeep cluster maps
278+ registry.add (" h2dITSCluMap_K0ShortPositive" , " h2dITSCluMap_K0ShortPositive" , kTH2D , {axisITSCluMap, axisRadius});
279+ registry.add (" h2dITSCluMap_K0ShortNegative" , " h2dITSCluMap_K0ShortNegative" , kTH2D , {axisITSCluMap, axisRadius});
280+ registry.add (" h2dITSCluMap_LambdaPositive" , " h2dITSCluMap_LambdaPositive" , kTH2D , {axisITSCluMap, axisRadius});
281+ registry.add (" h2dITSCluMap_LambdaNegative" , " h2dITSCluMap_LambdaNegative" , kTH2D , {axisITSCluMap, axisRadius});
282+ registry.add (" h2dITSCluMap_AntiLambdaPositive" , " h2dITSCluMap_AntiLambdaPositive" , kTH2D , {axisITSCluMap, axisRadius});
283+ registry.add (" h2dITSCluMap_AntiLambdaNegative" , " h2dITSCluMap_AntiLambdaNegative" , kTH2D , {axisITSCluMap, axisRadius});
284+ }
285+
248286 mRunNumber = 0 ;
249287 d_bz = 0 ;
250288 maxSnp = 0 .85f ; // could be changed later
@@ -541,6 +579,50 @@ struct lambdakzeroBuilder {
541579 if (negTrack.itsNCls () < 10 )
542580 statisticsRegistry.negITSclu [negTrack.itsNCls ()]++;
543581 }
582+
583+ if (d_doQA) {
584+ // Calculate masses
585+ auto lGammaMass = RecoDecay::m (array{array{v0candidate.posP [0 ], v0candidate.posP [1 ], v0candidate.posP [2 ]}, array{v0candidate.negP [0 ], v0candidate.negP [1 ], v0candidate.negP [2 ]}}, array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
586+ auto lK0ShortMass = RecoDecay::m (array{array{v0candidate.posP [0 ], v0candidate.posP [1 ], v0candidate.posP [2 ]}, array{v0candidate.negP [0 ], v0candidate.negP [1 ], v0candidate.negP [2 ]}}, array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged});
587+ auto lLambdaMass = RecoDecay::m (array{array{v0candidate.posP [0 ], v0candidate.posP [1 ], v0candidate.posP [2 ]}, array{v0candidate.negP [0 ], v0candidate.negP [1 ], v0candidate.negP [2 ]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
588+ auto lAntiLambdaMass = RecoDecay::m (array{array{v0candidate.posP [0 ], v0candidate.posP [1 ], v0candidate.posP [2 ]}, array{v0candidate.negP [0 ], v0candidate.negP [1 ], v0candidate.negP [2 ]}}, array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton});
589+ auto lHypertritonMass = RecoDecay::m (array{array{2 .0f * v0candidate.posP [0 ], 2 .0f * v0candidate.posP [1 ], 2 .0f * v0candidate.posP [2 ]}, array{v0candidate.negP [0 ], v0candidate.negP [1 ], v0candidate.negP [2 ]}}, array{o2::constants::physics::MassHelium3, o2::constants::physics::MassPionCharged});
590+ auto lAntiHypertritonMass = RecoDecay::m (array{array{v0candidate.posP [0 ], v0candidate.posP [1 ], v0candidate.posP [2 ]}, array{2 .0f * v0candidate.negP [0 ], 2 .0f * v0candidate.negP [1 ], 2 .0f * v0candidate.negP [2 ]}}, array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassHelium3});
591+
592+ auto lPt = RecoDecay::sqrtSumOfSquares (v0candidate.posP [0 ] + v0candidate.negP [0 ], v0candidate.posP [1 ] + v0candidate.negP [1 ]);
593+ auto lPtHy = RecoDecay::sqrtSumOfSquares (2 .0f * (v0candidate.posP [0 ] + v0candidate.negP [0 ]), v0candidate.posP [1 ] + v0candidate.negP [1 ]);
594+ auto lPtAnHy = RecoDecay::sqrtSumOfSquares (v0candidate.posP [0 ] + v0candidate.negP [0 ], 2 .0f * (v0candidate.posP [1 ] + v0candidate.negP [1 ]));
595+
596+ // Fill basic mass histograms
597+ // Note: all presel bools are true if unchecked
598+ if (V0.isGammaCandidate () && V0.isTrueGamma ())
599+ registry.fill (HIST (" h2dGammaMass" ), lPt, lGammaMass);
600+ if (V0.isK0ShortCandidate () && V0.isTrueK0Short ())
601+ registry.fill (HIST (" h2dK0ShortMass" ), lPt, lK0ShortMass);
602+ if (V0.isLambdaCandidate () && V0.isTrueLambda ())
603+ registry.fill (HIST (" h2dLambdaMass" ), lPt, lLambdaMass);
604+ if (V0.isAntiLambdaCandidate () && V0.isTrueAntiLambda ())
605+ registry.fill (HIST (" h2dAntiLambdaMass" ), lPt, lAntiLambdaMass);
606+ if (V0.isHypertritonCandidate () && V0.isTrueHypertriton ())
607+ registry.fill (HIST (" h2dHypertritonMass" ), lPtHy, lHypertritonMass);
608+ if (V0.isAntiHypertritonCandidate () && V0.isTrueAntiHypertriton ())
609+ registry.fill (HIST (" h2dAntiHypertritonMass" ), lPtAnHy, lAntiHypertritonMass);
610+
611+ // Fill ITS cluster maps with specific mass cuts
612+ if (TMath::Abs (lK0ShortMass - 0.497 ) < dQAK0ShortMassWindow && V0.isK0ShortCandidate () && V0.isTrueK0Short ()) {
613+ registry.fill (HIST (" h2dITSCluMap_K0ShortPositive" ), (float )posTrack.itsClusterMap (), v0candidate.V0radius );
614+ registry.fill (HIST (" h2dITSCluMap_K0ShortNegative" ), (float )negTrack.itsClusterMap (), v0candidate.V0radius );
615+ }
616+ if (TMath::Abs (lLambdaMass - 1.116 ) < dQALambdaMassWindow && V0.isLambdaCandidate () && V0.isTrueLambda ()) {
617+ registry.fill (HIST (" h2dITSCluMap_LambdaPositive" ), (float )posTrack.itsClusterMap (), v0candidate.V0radius );
618+ registry.fill (HIST (" h2dITSCluMap_LambdaNegative" ), (float )negTrack.itsClusterMap (), v0candidate.V0radius );
619+ }
620+ if (TMath::Abs (lAntiLambdaMass - 1.116 ) < dQALambdaMassWindow && V0.isAntiLambdaCandidate () && V0.isTrueAntiLambda ()) {
621+ registry.fill (HIST (" h2dITSCluMap_AntiLambdaPositive" ), (float )posTrack.itsClusterMap (), v0candidate.V0radius );
622+ registry.fill (HIST (" h2dITSCluMap_AntiLambdaNegative" ), (float )negTrack.itsClusterMap (), v0candidate.V0radius );
623+ }
624+ }
625+
544626 return true ;
545627 }
546628
@@ -658,8 +740,6 @@ struct lambdakzeroPreselector {
658740 // context-aware selections
659741 Configurable<bool > dPreselectOnlyBaryons{" dPreselectOnlyBaryons" , false , " apply TPC dE/dx and quality only to baryon daughters" };
660742
661- void init (InitContext const &) {}
662-
663743 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
664744 // / function to check track quality
665745 template <class TTrackTo , typename TV0Object>
0 commit comments