@@ -71,14 +71,9 @@ DECLARE_SOA_COLUMN(Rap, rap, float);
7171DECLARE_SOA_COLUMN (Mass, mass, float );
7272DECLARE_SOA_COLUMN (PosTrackId, posTrackId, int64_t );
7373DECLARE_SOA_COLUMN (NegTrackId, negTrackId, int64_t );
74- DECLARE_SOA_COLUMN (V0Type, v0Type, int8_t );
7574DECLARE_SOA_COLUMN (CosPA, cosPA, float );
7675DECLARE_SOA_COLUMN (DcaDau, dcaDau, float );
77- DECLARE_SOA_COLUMN (DcaPion, dcaPion, float );
78- DECLARE_SOA_COLUMN (DcaProton, dcaProton, float );
79- DECLARE_SOA_COLUMN (DcaLambda, dcaLambda, float );
80- DECLARE_SOA_COLUMN (DecayLength, decayLength, float );
81- DECLARE_SOA_COLUMN (RXY, rXY, float );
76+ DECLARE_SOA_COLUMN (V0Type, v0Type, int8_t );
8277DECLARE_SOA_COLUMN (V0PrmScd, v0PrmScd, int8_t );
8378DECLARE_SOA_COLUMN (CorrFact, corrFact, float );
8479} // namespace lambdatrack
@@ -94,14 +89,9 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>,
9489 lambdatrack::Mass,
9590 lambdatrack::PosTrackId,
9691 lambdatrack::NegTrackId,
97- lambdatrack::V0Type,
9892 lambdatrack::CosPA,
9993 lambdatrack::DcaDau,
100- lambdatrack::DcaPion,
101- lambdatrack::DcaProton,
102- lambdatrack::DcaLambda,
103- lambdatrack::DecayLength,
104- lambdatrack::RXY,
94+ lambdatrack::V0Type,
10595 lambdatrack::V0PrmScd,
10696 lambdatrack::CorrFact);
10797using LambdaTrack = LambdaTracks::iterator;
@@ -168,13 +158,11 @@ enum TrackLabels {
168158 kLambdaNotPrPiMinus ,
169159 kAntiLambdaNotAntiPrPiPlus ,
170160 kPassTrueLambdaSel ,
171- kEffCorrPt ,
172- kEffCorrPtRap ,
161+ kEffCorrPtCent ,
173162 kEffCorrPtRapCent ,
174163 kNoEffCorr ,
175- kPFCorrPt ,
176164 kPFCorrPtCent ,
177- kPFCorrPtCentPhi ,
165+ kPFCorrPtRapCent ,
178166 kNoPFCorr ,
179167 kCorrFact ,
180168 kErrCorrFact ,
@@ -298,11 +286,7 @@ struct LambdaTableProducer {
298286 Configurable<bool > cGenPrimaryLambda{" cGenPrimaryLambda" , true , " Primary Generated Lambda" };
299287 Configurable<bool > cGenSecondaryLambda{" cGenSecondaryLambda" , false , " Secondary Generated Lambda" };
300288 Configurable<bool > cGenDecayChannel{" cGenDecayChannel" , true , " Gen Level Decay Channel Flag" };
301-
302- // Mc Matching
303- Configurable<float > cSelMcMatchValue{" cSelMcMatchValue" , 0.4 , " Mc Matching Percentage" };
304- Configurable<bool > cDoEventMcMatching{" cDoEventMcMatching" , true , " Do Event Mc Matching Flag" };
305- Configurable<bool > cDoTrackMcMatching{" cDoTrackMcMatching" , false , " Do Track Mc Matching Flag" };
289+ Configurable<bool > cRecoMomResoFlag{" cRecoMomResoFlag" , false , " Check effect of momentum space smearing on balance function" };
306290
307291 // Efficiency Correction
308292 Configurable<bool > cCorrectionFlag{" cCorrectionFlag" , false , " Correction Flag" };
@@ -333,6 +317,7 @@ struct LambdaTableProducer {
333317
334318 // Initialize Global Variables
335319 float cent = 0 .;
320+ float pt = 0 ., eta = 0 ., rap = 0 ., phi = 0 .;
336321 bool bSecondaryLambdaFlag = false ;
337322
338323 void init (InitContext const &)
@@ -341,9 +326,6 @@ struct LambdaTableProducer {
341326 ccdb->setURL (cUrlCCDB.value );
342327 ccdb->setCaching (true );
343328
344- // Set ONNX Model
345- // network.initModel(cMLModelPathCCDB.value, true)
346-
347329 // initialize axis specifications
348330 const AxisSpec axisCols (5 , 0.5 , 5.5 , " " );
349331 const AxisSpec axisTrks (30 , 0.5 , 30.5 , " " );
@@ -397,11 +379,6 @@ struct LambdaTableProducer {
397379 histos.add (" QA/Lambda/h1f_V0_ctau" , " V_{0} c#tau" , kTH1F , {axisCTau});
398380 histos.add (" QA/Lambda/h1f_V0_gctau" , " V_{0} #gammac#tau" , kTH1F , {axisGCTau});
399381
400- histos.add (" QA/Lambda/h2f_V0_ptpt" , " Rec vs Truth p_{T}" , kTH2F , {axisV0Pt, axisV0Pt});
401- histos.add (" QA/Lambda/h2f_V0_etaeta" , " Rec vs Truth #eta" , kTH2F , {axisV0Eta, axisV0Eta});
402- histos.add (" QA/Lambda/h2f_V0_raprap" , " Rec vs Truth y" , kTH2F , {axisV0Rap, axisV0Rap});
403- histos.add (" QA/Lambda/h2f_V0_phiphi" , " Rec vs Truth #phi" , kTH2F , {axisV0Phi, axisV0Phi});
404-
405382 histos.add (" QA/Lambda/h1f_pos_prong_pt" , " Pos-Prong p_{T}" , kTH1F , {axisTrackPt});
406383 histos.add (" QA/Lambda/h1f_neg_prong_pt" , " Neg-Prong p_{T}" , kTH1F , {axisTrackPt});
407384 histos.add (" QA/Lambda/h1f_pos_prong_eta" , " Pos-Prong #eta-distribution" , kTH1F , {axisV0Eta});
@@ -485,13 +462,11 @@ struct LambdaTableProducer {
485462 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPassV0KinCuts , " kPassV0KinCuts" );
486463 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPassV0TopoSel , " kPassV0TopoSel" );
487464 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kAllSelPassed , " kAllSelPassed" );
488- histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kEffCorrPt , " kEffCorrPt" );
489- histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kEffCorrPtRap , " kEffCorrPtRap" );
465+ histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kEffCorrPtCent , " kEffCorrPtCent" );
490466 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kEffCorrPtRapCent , " kEffCorrPtRapCent" );
491467 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kNoEffCorr , " kNoEffCorr" );
492- histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPFCorrPt , " kPFCorrPt" );
493468 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPFCorrPtCent , " kPFCorrPtCent" );
494- histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPFCorrPtCentPhi , " kPFCorrPtCentPhi " );
469+ histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kPFCorrPtRapCent , " kPFCorrPtRapCent " );
495470 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kNoPFCorr , " kNoPFCorr" );
496471 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kCorrFact , " kCorrFact" );
497472 histos.get <TH1>(HIST (" Tracks/h1f_tracks_info" ))->GetXaxis ()->SetBinLabel (TrackLabels::kErrCorrFact , " kErrCorrFact" );
@@ -833,42 +808,6 @@ struct LambdaTableProducer {
833808 return true ;
834809 }
835810
836- template <typename T>
837- bool getMcMatch (T const & vrec, T const & vgen)
838- {
839- float v = std::abs (1 . - (vgen / vrec));
840-
841- if (v >= cSelMcMatchValue) {
842- return false ;
843- }
844-
845- return true ;
846- }
847-
848- template <typename V>
849- bool passMcMatching (V const & v0)
850- {
851- auto mcpart = v0.template mcParticle_as <aod::McParticles>();
852-
853- if (!getMcMatch (v0.pt (), mcpart.pt ())) {
854- return false ;
855- }
856-
857- if (!getMcMatch (v0.eta (), mcpart.eta ())) {
858- return false ;
859- }
860-
861- if (!getMcMatch (v0.yLambda (), mcpart.y ())) {
862- return false ;
863- }
864-
865- if (!getMcMatch (v0.phi (), mcpart.phi ())) {
866- return false ;
867- }
868-
869- return true ;
870- }
871-
872811 template <ParticleType part, typename V>
873812 float getCorrectionFactors (V const & v0)
874813 {
@@ -894,7 +833,10 @@ struct LambdaTableProducer {
894833 if (cGetEffFact) {
895834 TObject* objEff = reinterpret_cast <TObject*>(ccdbObj->FindObject (Form (" %s" , vCorrFactStrings[cCorrFactHist][part].c_str ())));
896835 TH1F* histEff = reinterpret_cast <TH1F*>(objEff->Clone ());
897- if (histEff->GetDimension () == ThreeDimCorr) {
836+ if (histEff->GetDimension () == TwoDimCorr) {
837+ histos.fill (HIST (" Tracks/h1f_tracks_info" ), kEffCorrPtCent );
838+ effFact = histEff->GetBinContent (histEff->FindBin (cent, v0.pt ()));
839+ } else if (histEff->GetDimension () == ThreeDimCorr) {
898840 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kEffCorrPtRapCent );
899841 effFact = histEff->GetBinContent (histEff->FindBin (cent, v0.pt (), rap));
900842 } else {
@@ -930,18 +872,6 @@ struct LambdaTableProducer {
930872 return 1 .;
931873 }
932874
933- template <ParticleType part, typename V>
934- void fillMCMatchingHistos (V const & v0)
935- {
936- static constexpr std::string_view SubDir[] = {" QA/Lambda/" , " QA/AntiLambda/" };
937- auto mcpart = v0.template mcParticle_as <aod::McParticles>();
938-
939- histos.fill (HIST (SubDir[part]) + HIST (" h2f_V0_ptpt" ), v0.pt (), mcpart.pt ());
940- histos.fill (HIST (SubDir[part]) + HIST (" h2f_V0_etaeta" ), v0.eta (), mcpart.eta ());
941- histos.fill (HIST (SubDir[part]) + HIST (" h2f_V0_raprap" ), v0.yLambda (), mcpart.y ());
942- histos.fill (HIST (SubDir[part]) + HIST (" h2f_V0_phiphi" ), v0.phi (), mcpart.phi ());
943- }
944-
945875 template <ParticleType part, typename C, typename V, typename T>
946876 void fillLambdaQAHistos (C const & col, V const & v0, T const &)
947877 {
@@ -1027,8 +957,7 @@ struct LambdaTableProducer {
1027957 // initialize v0track objects
1028958 ParticleType v0Type = kLambda ;
1029959 PrmScdType v0PrmScdType = kPrimary ;
1030- float mass = 0 ., ctau = 0 ., corr_fact = 1 .;
1031- float dcapiontopv = 0 ., dcaprotontopv = 0 .;
960+ float mass = 0 ., corr_fact = 1 .;
1032961
1033962 for (auto const & v0 : v0tracks) {
1034963 // check for corresponding MCGen Particle
@@ -1052,20 +981,16 @@ struct LambdaTableProducer {
1052981 continue ;
1053982 }
1054983
1055- // Get Lambda DcaDauToPV, decay length and mass
1056- if (v0Type == kLambda ) {
1057- dcapiontopv = v0.dcanegtopv ();
1058- dcaprotontopv = v0.dcapostopv ();
1059- } else {
1060- dcapiontopv = v0.dcapostopv ();
1061- dcaprotontopv = v0.dcanegtopv ();
1062- }
1063- ctau = v0.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * MassLambda0;
1064- mass = (v0Type == kLambda ) ? v0.mLambda () : v0.mAntiLambda ();
1065-
984+ // we have v0 as lambda
1066985 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kAllSelPassed );
1067986
1068- // we have v0 as lambda
987+ // Get Lambda mass and kinematic variables
988+ mass = (v0Type == kLambda ) ? v0.mLambda () : v0.mAntiLambda ();
989+ pt = v0.pt ();
990+ eta = v0.eta ();
991+ rap = v0.yLambda ();
992+ phi = v0.phi ();
993+
1069994 // do MC analysis
1070995 if constexpr (dmc == kMC ) {
1071996 histos.fill (HIST (" Tracks/h2f_tracks_pid_before_sel" ), v0.mcParticle ().pdgCode (), v0.pt ());
@@ -1076,19 +1001,22 @@ struct LambdaTableProducer {
10761001 if (cSelectTrueLambda && !selTrueMcRecLambda (v0, tracks)) { // check for true Lambda/Anti-Lambda
10771002 continue ;
10781003 }
1079- if (cDoTrackMcMatching && !passMcMatching (v0)) { // Do Mc Matching
1080- continue ;
1081- }
1082-
1083- // Fill MC Matching Histos (MC Matching Cuts to be implemented soon...)
1084- if (v0Type == kLambda ) {
1085- fillMCMatchingHistos<kLambda >(v0);
1086- } else {
1087- fillMCMatchingHistos<kAntiLambda >(v0);
1088- }
10891004
10901005 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kPassTrueLambdaSel );
10911006 histos.fill (HIST (" Tracks/h2f_tracks_pid_after_sel" ), v0.mcParticle ().pdgCode (), v0.pt ());
1007+
1008+ if (cRecoMomResoFlag) {
1009+ auto mc = v0.template mcParticle_as <aod::McParticles>();
1010+ pt = mc.pt ();
1011+ eta = mc.eta ();
1012+ rap = mc.y ();
1013+ phi = mc.phi ();
1014+ float y = (cDoEtaAnalysis) ? eta : rap;
1015+ // apply kinematic selection (On Truth)
1016+ if (!kinCutSelection (pt, std::abs (y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) {
1017+ continue ;
1018+ }
1019+ }
10921020 }
10931021
10941022 histos.fill (HIST (" Tracks/h2f_armpod_after_sel" ), v0.alpha (), v0.qtarm ());
@@ -1109,10 +1037,8 @@ struct LambdaTableProducer {
11091037
11101038 // Fill Lambda/AntiLambda Table
11111039 lambdaTrackTable (lambdaCollisionTable.lastIndex (), v0.px (), v0.py (), v0.pz (),
1112- v0.pt (), v0.eta (), v0.phi (), v0.yLambda (), mass,
1113- v0.template posTrack_as <T>().index (), v0.template negTrack_as <T>().index (),
1114- (int8_t )v0Type, v0.v0cosPA (), v0.dcaV0daughters (), dcapiontopv, dcaprotontopv, v0.dcav0topv (), ctau,
1115- v0.v0radius (), v0PrmScdType, corr_fact);
1040+ pt, eta, phi, rap, mass, v0.template posTrack_as <T>().index (), v0.template negTrack_as <T>().index (),
1041+ v0.v0cosPA (), v0.dcaV0daughters (), (int8_t )v0Type, v0PrmScdType, corr_fact);
11161042 }
11171043 }
11181044
@@ -1241,13 +1167,6 @@ struct LambdaTableProducer {
12411167 if (!collisions.begin ().has_mcCollision () || !selCollision<run>(collisions.begin ()) || collisions.begin ().mcCollisionId () != mcCollision.globalIndex ()) {
12421168 return ;
12431169 }
1244- // MC Matching
1245- if (cDoEventMcMatching) {
1246- // Vz Matching
1247- if (!getMcMatch (collisions.begin ().posZ (), mcCollision.posZ ())) {
1248- return ;
1249- }
1250- }
12511170 histos.fill (HIST (" McGen/h1f_collisions_info" ), kPassSelCol );
12521171 histos.fill (HIST (" McGen/h2f_collision_posZ" ), mcCollision.posZ (), collisions.begin ().posZ ());
12531172 auto v0Tracks = V0s.sliceBy (perCollision, collisions.begin ().globalIndex ());
0 commit comments