@@ -195,6 +195,12 @@ enum DMCType {
195195 kMC
196196};
197197
198+ enum CorrHistDim {
199+ kOneDimCorr = 1 ,
200+ kTwoDimCorr ,
201+ kThreeDimCorr
202+ };
203+
198204struct LambdaTableProducer {
199205
200206 Produces<aod::LambdaCollisions> lambdaCollisionTable;
@@ -256,6 +262,7 @@ struct LambdaTableProducer {
256262 Configurable<bool > cSelectPrimaryV0{" cSelectPrimaryV0" , true , " Select Primary V0" };
257263 Configurable<bool > cRecPrimaryLambda{" cRecPrimaryLambda" , true , " Primary Reconstructed Lambda" };
258264 Configurable<bool > cRecSecondaryLambda{" cRecSecondaryLambda" , false , " Secondary Reconstructed Lambda" };
265+ Configurable<bool > cCheckRecoDauFlag{" cCheckRecoDauFlag" , false , " Check for reco daughter PID" };
259266 Configurable<bool > cGenPrimaryLambda{" cGenPrimaryLambda" , true , " Primary Generated Lambda" };
260267 Configurable<bool > cGenSecondaryLambda{" cGenSecondaryLambda" , false , " Secondary Generated Lambda" };
261268 Configurable<bool > cGenDecayChannel{" cGenDecayChannel" , true , " Gen Level Decay Channel Flag" };
@@ -381,7 +388,7 @@ struct LambdaTableProducer {
381388 histos.addClone (" McRec/Lambda/" , " McRec/AntiLambda/" );
382389
383390 // MC Generated Histograms
384- if (doprocessMCRun3 || doprocessMCRun2) {
391+ if (doprocessMCRun3 || doprocessMCRun2 || doprocessMCRecoRun3 ) {
385392 // McReco Histos
386393 histos.add (" Tracks/h2f_tracks_pid_before_sel" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
387394 histos.add (" Tracks/h2f_tracks_pid_after_sel" , " PIDs" , kTH2F , {axisPID, axisV0Pt});
@@ -733,31 +740,35 @@ struct LambdaTableProducer {
733740 {
734741 auto mcpart = v0.template mcParticle_as <aod::McParticles>();
735742
743+ // check if Lambda/AntiLambda
736744 if (std::abs (mcpart.pdgCode ()) != kLambda0 ) {
737745 return false ;
738746 }
739747
740- auto postrack = v0.template posTrack_as <T>();
741- auto negtrack = v0.template negTrack_as <T>();
742-
743- // check if the daughters have corresponding mcparticle
744- if (!postrack.has_mcParticle () || !negtrack.has_mcParticle ()) {
745- histos.fill (HIST (" Tracks/h1f_tracks_info" ), kLambdaDauNotMcParticle );
746- return false ;
747- }
748-
749- auto mcpostrack = postrack.template mcParticle_as <aod::McParticles>();
750- auto mcnegtrack = negtrack.template mcParticle_as <aod::McParticles>();
748+ // Check for daughters
749+ if (cCheckRecoDauFlag) {
750+ auto postrack = v0.template posTrack_as <T>();
751+ auto negtrack = v0.template negTrack_as <T>();
751752
752- if (mcpart. pdgCode () == kLambda0 ) {
753- if (mcpostrack. pdgCode () != kProton || mcnegtrack. pdgCode () != kPiMinus ) {
754- histos.fill (HIST (" Tracks/h1f_tracks_info" ), kLambdaNotPrPiMinus );
753+ // check if the daughters have corresponding mcparticle
754+ if (!postrack. has_mcParticle () || !negtrack. has_mcParticle () ) {
755+ histos.fill (HIST (" Tracks/h1f_tracks_info" ), kLambdaDauNotMcParticle );
755756 return false ;
756757 }
757- } else if (mcpart.pdgCode () == kLambda0Bar ) {
758- if (mcpostrack.pdgCode () != kPiPlus || mcnegtrack.pdgCode () != kProtonBar ) {
759- histos.fill (HIST (" Tracks/h1f_tracks_info" ), kAntiLambdaNotAntiPrPiPlus );
760- return false ;
758+
759+ auto mcpostrack = postrack.template mcParticle_as <aod::McParticles>();
760+ auto mcnegtrack = negtrack.template mcParticle_as <aod::McParticles>();
761+
762+ if (mcpart.pdgCode () == kLambda0 ) {
763+ if (mcpostrack.pdgCode () != kProton || mcnegtrack.pdgCode () != kPiMinus ) {
764+ histos.fill (HIST (" Tracks/h1f_tracks_info" ), kLambdaNotPrPiMinus );
765+ return false ;
766+ }
767+ } else if (mcpart.pdgCode () == kLambda0Bar ) {
768+ if (mcpostrack.pdgCode () != kPiPlus || mcnegtrack.pdgCode () != kProtonBar ) {
769+ histos.fill (HIST (" Tracks/h1f_tracks_info" ), kAntiLambdaNotAntiPrPiPlus );
770+ return false ;
771+ }
761772 }
762773 }
763774
@@ -835,13 +846,13 @@ struct LambdaTableProducer {
835846 float retVal = 0 .;
836847 float rap = (cDoEtaCorr) ? v0.eta () : v0.yLambda ();
837848
838- if (hist->GetDimension () == 1 ) {
849+ if (hist->GetDimension () == kOneDimCorr ) {
839850 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kEffCorrPt );
840851 retVal = hist->GetBinContent (hist->FindBin (v0.pt ()));
841- } else if (hist->GetDimension () == 2 ) {
852+ } else if (hist->GetDimension () == kTwoDimCorr ) {
842853 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kEffCorrPtRap );
843854 retVal = hist->GetBinContent (hist->FindBin (v0.pt (), rap));
844- } else if (hist->GetDimension () == 3 ) {
855+ } else if (hist->GetDimension () == kThreeDimCorr ) {
845856 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kEffCorrPtRapPhi );
846857 retVal = hist->GetBinContent (hist->FindBin (v0.pt (), rap, v0.phi ()));
847858 } else {
@@ -1189,7 +1200,7 @@ struct LambdaTableProducer {
11891200 analyzeMcRecoGen<kRun3 , kMC >(mcCollision, collisions, V0s, tracks, mcParticles);
11901201 }
11911202
1192- PROCESS_SWITCH (LambdaTableProducer, processMCRun3, " Process for Run3 MC Generated " , false );
1203+ PROCESS_SWITCH (LambdaTableProducer, processMCRun3, " Process for Run3 MC RecoGen " , false );
11931204
11941205 void processMCRun2 (soa::Join<aod::McCollisions, aod::McCentFT0Ms>::iterator const & mcCollision,
11951206 soa::SmallGroups<soa::Join<CollisionsRun2, aod::McCollisionLabels>> const & collisions,
@@ -1199,7 +1210,72 @@ struct LambdaTableProducer {
11991210 analyzeMcRecoGen<kRun2 , kMC >(mcCollision, collisions, V0s, tracks, mcParticles);
12001211 }
12011212
1202- PROCESS_SWITCH (LambdaTableProducer, processMCRun2, " Process for Run2 MC Generated" , false );
1213+ PROCESS_SWITCH (LambdaTableProducer, processMCRun2, " Process for Run2 MC RecoGen" , false );
1214+
1215+ // Temperory process function to check differences in way of computations (Will be deleted in future !!!)
1216+ void processMCRecoRun3 (soa::Join<CollisionsRun3, aod::McCollisionLabels>::iterator const & collision,
1217+ soa::Join<aod::McCollisions, aod::McCentFT0Ms> const &,
1218+ McV0Tracks const & V0s, TracksMC const & tracks,
1219+ aod::McParticles const & mcParticles)
1220+ {
1221+ // see if reco collison pass event selection
1222+ if (!collision.has_mcCollision () || !selCollision<kRun3 >(collision)) {
1223+ return ;
1224+ }
1225+
1226+ // Now we have reco event
1227+ // Fill V0 Lambda Table
1228+ fillLambdaRecoTables<kRun3 , kMC >(collision, V0s, tracks);
1229+
1230+ // Get the mcCollision and mcParticles associated to this reco event
1231+ auto mccol = collision.mcCollision_as <soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1232+ auto mcparticles = mcParticles.sliceByCached (aod::mcparticle::mcCollisionId, mccol.globalIndex (), cache);
1233+
1234+ // Fill McGen Collision Table
1235+ lambdaMCGenCollisionTable (mccol.centFT0M (), mccol.posX (), mccol.posY (), mccol.posZ ());
1236+
1237+ // initialize track objects
1238+ ParticleType v0Type = kLambda ;
1239+ float rap = 0 .;
1240+ for (auto const & mcpart : mcparticles) {
1241+ // check for Lambda first
1242+ if (mcpart.pdgCode () == kLambda0 ) {
1243+ v0Type = kLambda ;
1244+ } else if (mcpart.pdgCode () == kLambda0Bar ) {
1245+ v0Type = kAntiLambda ;
1246+ } else {
1247+ continue ;
1248+ }
1249+
1250+ // check for Primary Lambda/AntiLambda
1251+ if (cGenPrimaryLambda && !mcpart.isPhysicalPrimary ()) {
1252+ continue ;
1253+ } else if (cGenSecondaryLambda && mcpart.isPhysicalPrimary ()) {
1254+ continue ;
1255+ }
1256+
1257+ // Decide Eta/Rap
1258+ if (!cDoEtaAnalysis) {
1259+ rap = mcpart.y ();
1260+ } else {
1261+ rap = mcpart.eta ();
1262+ }
1263+
1264+ // Apply Kinematic Acceptance
1265+ if (!kinCutSelection (mcpart.pt (), std::abs (rap), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) {
1266+ continue ;
1267+ }
1268+
1269+ histos.fill (HIST (" Tracks/h1f_tracks_info" ), kGenTotAccLambda );
1270+
1271+ // Fill Lambda McGen Table
1272+ lambdaMCGenTrackTable (lambdaMCGenCollisionTable.lastIndex (), mcpart.px (), mcpart.py (), mcpart.pz (),
1273+ mcpart.pt (), mcpart.eta (), mcpart.phi (), mcpart.y (), RecoDecay::m (mcpart.p (), mcpart.e ()),
1274+ -999 ., 999 ., (int8_t )v0Type, -999 ., -999 ., 1 .);
1275+ }
1276+ }
1277+
1278+ PROCESS_SWITCH (LambdaTableProducer, processMCRecoRun3, " Process for Run3 MC Reconstructed" , false );
12031279};
12041280
12051281struct LambdaTracksExtProducer {
@@ -1370,10 +1446,6 @@ struct LambdaR2Correlation {
13701446 // Eta/Rap Analysis
13711447 Configurable<bool > cDoEtaAnalysis{" cDoEtaAnalysis" , false , " Eta/Rap Analysis Flag" };
13721448
1373- // Generator Level Particles
1374- Configurable<bool > cGenParticleFlag{" cGenParticleFlag" , true , " Generator Number Flag" };
1375- Configurable<int > cGenParticles{" cGenParticles" , 3 , " Number of Truth Lambda to construct correlation" };
1376-
13771449 // Histogram Registry.
13781450 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
13791451
0 commit comments