99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111// /
12- // / \file alice3-strangeness .cxx
12+ // / \file alice3Strangeness .cxx
1313// /
1414// / \brief This task produces invariant mass distributions for strange hadrons
1515// /
4646
4747#include < TGenPhaseSpace.h>
4848#include < TGeoGlobalMagField.h>
49- #include < TLorentzVector.h>
5049#include < TPDGCode.h>
5150#include < TRandom3.h>
5251
@@ -59,11 +58,11 @@ using namespace o2;
5958using namespace o2 ::framework;
6059using namespace o2 ::constants::math;
6160
62- using alice3tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3>;
63- using fullV0Candidates = soa::Join<aod::V0CandidateIndices, aod::V0CandidateCores>;
64- using fullCollisions = soa::Join<aod::OTFLUTConfigId, aod::Collisions>;
61+ using Alice3tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3>;
62+ using FullV0Candidates = soa::Join<aod::V0CandidateIndices, aod::V0CandidateCores>;
63+ using FullCollisions = soa::Join<aod::OTFLUTConfigId, aod::Collisions>;
6564
66- struct alice3strangeness {
65+ struct Alice3Strangeness {
6766 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
6867
6968 Configurable<int > idGeometry{" idGeometry" , 0 , " geometry ID used for propagation" };
@@ -109,12 +108,15 @@ struct alice3strangeness {
109108 Configurable<float > lifetimecutambda{" lifetimecutambda" , 30 , " lifetime cut for Lambda in cm" };
110109 Configurable<float > lifetimecutak0{" lifetimecutak0" , 20 , " lifetime cut for K0 in cm" };
111110 Configurable<float > etaDaughterSelection{" etaDaughterSelection" , 0 .8f , " eta daughter selection" };
111+ Configurable<float > acceptedLambdaMassWindow{" acceptedLambdaMassWindow" , 0 .2f , " accepted Lambda mass window around PDG mass" };
112+ Configurable<float > acceptedK0MassWindow{" acceptedK0MassWindow" , 0 .3f , " accepted K0 mass window around PDG mass" };
112113 } selectionValues;
113114
114- uint16_t AppliedSelectionCheckMask ;
115+ uint16_t appliedSelectionCheckMask ;
115116 double selectionCheck;
116117 double selectionCheckPos;
117- static constexpr std::string_view kSelectionNames [] = {" DCAV0Daughters" , " PointingAngle" , " DCAtoPVNegDaughter" , " DCAtoPVPosDaughter" , " V0Radius" , " ProperLifeTime" };
118+ const int posDaugDCAselIDx = 3 ;
119+ static constexpr std::string_view KSelectionNames[] = {" DCAV0Daughters" , " PointingAngle" , " DCAtoPVNegDaughter" , " DCAtoPVPosDaughter" , " V0Radius" , " ProperLifeTime" };
118120
119121 void init (InitContext&)
120122 {
@@ -158,22 +160,22 @@ struct alice3strangeness {
158160 }
159161 histos.addClone (" reconstructedCandidates/Lambda/" , " reconstructedCandidates/AntiLambda/" );
160162
161- AppliedSelectionCheckMask = 0 ;
163+ appliedSelectionCheckMask = 0 ;
162164 if (!selectionFlags.applyDCAdaughterSelection )
163- SETBIT (AppliedSelectionCheckMask , 0 );
165+ SETBIT (appliedSelectionCheckMask , 0 );
164166 if (!selectionFlags.applyCosOfPAngleSelection )
165- SETBIT (AppliedSelectionCheckMask , 1 );
167+ SETBIT (appliedSelectionCheckMask , 1 );
166168 if (!selectionFlags.applyDCADaughtersToPVSelection ) {
167- SETBIT (AppliedSelectionCheckMask , 2 );
168- SETBIT (AppliedSelectionCheckMask , 3 );
169+ SETBIT (appliedSelectionCheckMask , 2 );
170+ SETBIT (appliedSelectionCheckMask , 3 );
169171 }
170172 if (!selectionFlags.applyV0RadiusSelection )
171- SETBIT (AppliedSelectionCheckMask , 4 );
173+ SETBIT (appliedSelectionCheckMask , 4 );
172174 if (!selectionFlags.applyLifetimeSelection )
173- SETBIT (AppliedSelectionCheckMask , 5 );
175+ SETBIT (appliedSelectionCheckMask , 5 );
174176 }
175177 long int nEvents = 0 ;
176- void processAllFindableCandidates (aod::Collisions const & collisions, aod::McCollisions const & mcCollisions, aod::UpgradeV0s const & v0Recos, alice3tracks const &)
178+ void processAllFindableCandidates (aod::Collisions const & collisions, aod::McCollisions const & mcCollisions, aod::UpgradeV0s const & v0Recos, Alice3tracks const &)
177179 {
178180 LOG (info) << " Event processed " << nEvents++ << " :" << collisions.size () << " " << mcCollisions.size ();
179181 for (const auto & collision : collisions) {
@@ -182,43 +184,43 @@ struct alice3strangeness {
182184 histos.fill (HIST (" hPVz" ), collisionZ);
183185 for (const auto & v0Cand : v0Recos) {
184186
185- auto negV0Daughter = v0Cand.negTrack_as <alice3tracks >(); // de-reference neg track
186- auto posV0Daughter = v0Cand.posTrack_as <alice3tracks >(); // de-reference pos track
187+ auto negV0Daughter = v0Cand.negTrack_as <Alice3tracks >(); // de-reference neg track
188+ auto posV0Daughter = v0Cand.posTrack_as <Alice3tracks >(); // de-reference pos track
187189
188190 bool isK0 = v0Cand.mK0 () > 0 ;
189191 if (isK0) {
190192 histos.fill (HIST (" K0/hMassAllCandidates" ), v0Cand.mK0 (), v0Cand.pt ());
191193 histos.fill (HIST (" K0/hSelections" ), 0 ); // all candidates
192194 histos.fill (HIST (" K0/hDCANegDaughter" ), negV0Daughter.dcaXY ());
193195 histos.fill (HIST (" K0/hDCAPosDaughter" ), posV0Daughter.dcaXY ());
194- if (std::abs (negV0Daughter.dcaXY ()) < 0.05 )
196+ if (std::abs (negV0Daughter.dcaXY ()) < selectionValues. dcaDaughtersToPVSelection )
195197 continue ;
196198 histos.fill (HIST (" K0/hSelections" ), 1 ); // dcaXY cut
197- if (std::abs (posV0Daughter.dcaXY ()) < 0.05 )
199+ if (std::abs (posV0Daughter.dcaXY ()) < selectionValues. dcaDaughtersToPVSelection )
198200 continue ;
199201 histos.fill (HIST (" K0/hSelections" ), 2 ); // dcaXY cut
200- if (v0Cand.dcaV0Daughters () > 1.0 )
202+ if (v0Cand.dcaV0Daughters () > selectionValues. dcaDaughterSelection )
201203 continue ;
202204 histos.fill (HIST (" K0/hSelections" ), 3 ); // dca between daughters
203- if (v0Cand.v0Radius () < 0.5 )
205+ if (v0Cand.v0Radius () < selectionValues. v0RadiusSelection )
204206 continue ;
205207 histos.fill (HIST (" K0/hSelections" ), 4 ); // radius cut
206- if (std::abs (negV0Daughter.eta ()) > 0.8 || std::abs (posV0Daughter.eta ()) > 0.8 )
208+ if (std::abs (negV0Daughter.eta ()) > selectionValues. etaDaughterSelection || std::abs (posV0Daughter.eta ()) > selectionValues. etaDaughterSelection )
207209 continue ;
208210 histos.fill (HIST (" K0/hSelections" ), 5 ); // eta cut
209211 histos.fill (HIST (" K0/hMassSelected" ), v0Cand.mK0 (), v0Cand.pt ());
210212 }
211213 }
212214 }
213215 }
214- void processFoundV0Candidates (aod::Collision const & collision, fullV0Candidates const & v0Candidates, alice3tracks const &, aod::McParticles const &)
216+ void processFoundV0Candidates (aod::Collision const & collision, FullV0Candidates const & v0Candidates, Alice3tracks const &, aod::McParticles const &)
215217 {
216218 // if(collision.lutConfigId()!=idGeometry)
217219 // return;
218220 for (auto const & v0 : v0Candidates) {
219- bool isK0 = (v0.mK0Short () - o2::constants::physics::MassK0Short) < 0.3 ;
220- bool isLambda = (v0.mLambda () - o2::constants::physics::MassLambda0) < 0.2 ;
221- bool isAntiLambda = (v0.mAntiLambda () - o2::constants::physics::MassLambda0) < 0.2 ;
221+ bool isK0 = (v0.mK0Short () - o2::constants::physics::MassK0Short) < selectionValues. acceptedK0MassWindow ;
222+ bool isLambda = (v0.mLambda () - o2::constants::physics::MassLambda0) < selectionValues. acceptedLambdaMassWindow ;
223+ bool isAntiLambda = (v0.mAntiLambda () - o2::constants::physics::MassLambda0) < selectionValues. acceptedLambdaMassWindow ;
222224
223225 histos.fill (HIST (" reconstructedCandidates/hArmeterosBeforeAllSelections" ), v0.alpha (), v0.qtarm ());
224226 histos.fill (HIST (" hV0CandidateCounter" ), 0.5 );
@@ -289,8 +291,8 @@ struct alice3strangeness {
289291 selectionCheck = v0.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * o2::constants::physics::MassLambda0;
290292 }
291293 histos.fill (HIST (" hV0CandidateCounter" ), 8.5 );
292- auto posTrack = v0.template posTrack_as <alice3tracks >();
293- auto negTrack = v0.template negTrack_as <alice3tracks >();
294+ auto posTrack = v0.template posTrack_as <Alice3tracks >();
295+ auto negTrack = v0.template negTrack_as <Alice3tracks >();
294296 if (selectionFlags.applyEtaDaughterSelection ) {
295297 if (std::abs (posTrack.eta ()) > selectionValues.etaDaughterSelection || std::abs (negTrack.eta ()) > selectionValues.etaDaughterSelection )
296298 continue ;
@@ -303,15 +305,15 @@ struct alice3strangeness {
303305 if (selectionFlags.doQAforSelectionVariables ) {
304306 static_for<0 , 5 >([&](auto i) {
305307 constexpr int In = i.value ;
306- if (TESTBIT (AppliedSelectionCheckMask , In)) {
307- if (In == 3 )
308+ if (TESTBIT (appliedSelectionCheckMask , In)) {
309+ if (In == posDaugDCAselIDx )
308310 selectionCheck = selectionCheckPos;
309311 if (isK0)
310- histos.fill (HIST (" reconstructedCandidates/K0/h" ) + HIST (kSelectionNames [In]), v0.mK0Short (), v0.pt (), selectionCheck);
312+ histos.fill (HIST (" reconstructedCandidates/K0/h" ) + HIST (KSelectionNames [In]), v0.mK0Short (), v0.pt (), selectionCheck);
311313 if (isLambda)
312- histos.fill (HIST (" reconstructedCandidates/Lambda/h" ) + HIST (kSelectionNames [In]), v0.mLambda (), v0.pt (), selectionCheck);
314+ histos.fill (HIST (" reconstructedCandidates/Lambda/h" ) + HIST (KSelectionNames [In]), v0.mLambda (), v0.pt (), selectionCheck);
313315 if (isAntiLambda)
314- histos.fill (HIST (" reconstructedCandidates/AntiLambda/h" ) + HIST (kSelectionNames [In]), v0.mAntiLambda (), v0.pt (), selectionCheck);
316+ histos.fill (HIST (" reconstructedCandidates/AntiLambda/h" ) + HIST (KSelectionNames [In]), v0.mAntiLambda (), v0.pt (), selectionCheck);
315317 }
316318 });
317319 }
@@ -329,12 +331,12 @@ struct alice3strangeness {
329331 }
330332 }
331333 }
332- PROCESS_SWITCH (alice3strangeness , processAllFindableCandidates, " " , false );
333- PROCESS_SWITCH (alice3strangeness , processFoundV0Candidates, " " , true );
334+ PROCESS_SWITCH (Alice3Strangeness , processAllFindableCandidates, " " , false );
335+ PROCESS_SWITCH (Alice3Strangeness , processFoundV0Candidates, " " , true );
334336};
335337
336338WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
337339{
338340 return WorkflowSpec{
339- adaptAnalysisTask<alice3strangeness >(cfgc)};
341+ adaptAnalysisTask<Alice3Strangeness >(cfgc)};
340342}
0 commit comments