@@ -121,7 +121,7 @@ DECLARE_SOA_TABLE(TauFourTracks, "AOD", "TAUFOURTRACK",
121121 tau_tree::TotalFT0AmplitudeA, tau_tree::TotalFT0AmplitudeC, tau_tree::TotalFV0AmplitudeA,
122122 // tau_tree::TimeFT0A, tau_tree::TimeFT0C, tau_tree::TimeFV0A,
123123 tau_tree::TrkPx, tau_tree::TrkPy, tau_tree::TrkPz,
124- tau_tree::TrkSign,
124+ tau_tree::TrkSign,
125125 tau_tree::TrkDCAxy, tau_tree::TrkDCAz,
126126 tau_tree::TrkTPCcr,
127127 tau_tree::TrkTPCfind, tau_tree::TrkTPCchi2, tau_tree::TrkITSchi2, tau_tree::TrkITScl,
@@ -838,7 +838,7 @@ struct TauTau13topo {
838838 // CollisionMC histograms
839839 if (doprocessEfficiencyMCSG || doprocessSimpleMCSG) {
840840 registryMC.add (" globalMC/hMCZvertex" , " ;V_{Z}^{MC} (cm);events" , {HistType::kTH1F , {{100 , -25 ., 25 .}}});
841- registryMC.add (" globalMC/hMCefficiency" , " ;Cut Number;events" , {HistType::kTH1F , {{20 , 0 ., 20 .}}});
841+ registryMC.add (" globalMC/hMCefficiency" , " ;Cut Number;events" , {HistType::kTH1F , {{28 , - 8 ., 20 .}}});
842842
843843 // efficiency el
844844 registryMC.add (" efficiencyMCEl/effiEl" , " ;Efficiency e3#pi;events" , {HistType::kTH1F , {{70 , 0 ., 70 .}}});
@@ -857,6 +857,8 @@ struct TauTau13topo {
857857 registryMC.add (" globalMC/hMCptGen" , " ;p_{T}^{gen};N^{MC particles}" , {HistType::kTH1F , {{100 , 0 ., 4 .}}});
858858
859859 // tau
860+ registryMC.add (" tauMC/hNtaus" , " ;N^{#tau};N_events " , {HistType::kTH1F , {{6 , -1 ., 5 .}}});
861+
860862 registryMC.add (" tauMC/hMCeta" , " ;#eta^{#tau};N^{#tau} " , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
861863 registryMC.add (" tauMC/hMCy" , " ;y^{#tau};N^{#tau}" , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
862864 registryMC.add (" tauMC/hMCphi" , " ;#phi^{#tau};N^{#tau}" , {HistType::kTH1F , {{100 , 0 ., 6.4 }}});
@@ -871,6 +873,18 @@ struct TauTau13topo {
871873 registryMC.add (" electronMC/hMCphi" , " ;#phi^{e};N^{e}" , {HistType::kTH1F , {{100 , 0 ., 6.4 }}});
872874 registryMC.add (" electronMC/hMCpt" , " ;#it{p}_{T}^{e};N^{e}" , {HistType::kTH1F , {{400 , 0 ., 10 .}}});
873875
876+ // muon
877+ registryMC.add (" muonMC/hMCeta" , " ;#eta^{#mu};N^{#mu}" , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
878+ registryMC.add (" muonMC/hMCy" , " ;y^{#mu};N^{#mu}" , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
879+ registryMC.add (" muonMC/hMCphi" , " ;#phi^{#mu};N^{#mu}" , {HistType::kTH1F , {{100 , 0 ., 6.4 }}});
880+ registryMC.add (" muonMC/hMCpt" , " ;#it{p}_{T}^{#mu};N^{#mu}" , {HistType::kTH1F , {{400 , 0 ., 10 .}}});
881+
882+ // pion
883+ registryMC.add (" pionMC/hMCeta" , " ;#eta^{#pi};N^{#pi}" , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
884+ registryMC.add (" pionMC/hMCy" , " ;y^{#pi};N^{#pi}" , {HistType::kTH1F , {{100 , -5 ., 5 .}}});
885+ registryMC.add (" pionMC/hMCphi" , " ;#phi^{#pi};N^{#pi}" , {HistType::kTH1F , {{100 , 0 ., 6.4 }}});
886+ registryMC.add (" pionMC/hMCpt" , " ;#it{p}_{T}^{#pi};N^{#pi}" , {HistType::kTH1F , {{400 , 0 ., 10 .}}});
887+
874888 // efficiency mu
875889 registryMC.add (" efficiencyMCMu/hpTmuon" , " ;p_{T}^{#mu, gen} (GeV/c);events" , {HistType::kTH1F , {{200 , 0 ., 5 .}}});
876890
@@ -3303,19 +3317,22 @@ struct TauTau13topo {
33033317 void processSimpleMCSG (aod::McCollision const & mcCollision, aod::McParticles const & mcParticles)
33043318 {
33053319 registryMC.get <TH1>(HIST (" globalMC/hMCZvertex" ))->Fill (mcCollision.posZ ());
3306- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (0 ., 1 .);
3320+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (- 8 ., 1 .);
33073321 registryMC.get <TH1>(HIST (" efficiencyMCEl/effiEl" ))->Fill (0 ., 1 .);
33083322 registryMC.get <TH1>(HIST (" efficiencyMCMu/effiMu" ))->Fill (0 ., 1 .);
33093323 registryMC.get <TH1>(HIST (" efficiencyMCPi/effiPi" ))->Fill (0 ., 1 .);
33103324
33113325 // check how many physical primaries
3312- // int countPrim = 0;
3313- int countGen = 0 ;
3314- int countBoth = 0 ;
3315- int countCharged = 0 ;
3316- int countChargedFromTau = 0 ;
3326+ int countPrim = 0 ;
3327+ int countGen = 0 ; // generator
3328+ int countBoth = 0 ; // generator + primary
3329+ int countCharged = 0 ; // generator + primary + charged
3330+ int countChargedFromTau = 0 ; // generator + primary + charged + from tau
33173331 int countTau = 0 ;
33183332
3333+ int countChargedOnly = 0 ; // charged only
3334+ int countChargedOnlyFromTau = 0 ; // charged only and from tau
3335+
33193336 float etaTau[2 ];
33203337 float phiTau[2 ];
33213338
@@ -3346,19 +3363,19 @@ struct TauTau13topo {
33463363 // loop over MC particles
33473364 for (const auto & mcParticle : mcParticles) {
33483365 if (verbose) {
3349- LOGF (info, " <processSimpleMCSG> mcParticle pdg %d, gen %d, prim %d" , mcParticle.pdgCode (), mcParticle.producedByGenerator (), mcParticle.isPhysicalPrimary () );
3366+ LOGF (info, " <processSimpleMCSG> mcParticle pdg %d, gen %d, prim %d, bkg %d, process %d " , mcParticle.pdgCode (), mcParticle.producedByGenerator (), mcParticle.isPhysicalPrimary (), mcParticle. fromBackgroundEvent (), mcParticle. getProcess () );
33503367 }
33513368 // primaries
3352- // if (mcParticle.isPhysicalPrimary()) {
3353- // countPrim++;
3354- // }
3369+ if (mcParticle.isPhysicalPrimary ()) {
3370+ countPrim++;
3371+ }
33553372 //
33563373 // MC particles produced by generator only
33573374 //
33583375 if (mcParticle.producedByGenerator ()) {
33593376 countGen++;
33603377 if (mcParticle.isPhysicalPrimary ()) {
3361- countBoth++;
3378+ countBoth++;
33623379 // if (mcParticle.pdgCode() != 22 && std::abs(mcParticle.pdgCode()) != 12 && std::abs(mcParticle.pdgCode()) != 14 && std::abs(mcParticle.pdgCode()) != 16 && mcParticle.pdgCode() != 130 && mcParticle.pdgCode() != 111) {
33633380 if (mcParticle.pdgCode () != kGamma && std::abs (mcParticle.pdgCode ()) != kNuE && std::abs (mcParticle.pdgCode ()) != kNuMu && std::abs (mcParticle.pdgCode ()) != kNuTau && mcParticle.pdgCode () != kK0Long && mcParticle.pdgCode () != kPi0 ) {
33643381 countCharged++;
@@ -3376,9 +3393,30 @@ struct TauTau13topo {
33763393 } // mother is tau
33773394 } // mc particle has mother
33783395 } // veto neutral particles
3379- } // physics primary
3396+ } // physics primary
33803397 } // generator produced by
33813398
3399+ // special case only for UPCgen, charged but not taus
3400+ if (std::abs (mcParticle.pdgCode ()) != kTauMinus && mcParticle.pdgCode () != kGamma && std::abs (mcParticle.pdgCode ()) != kNuE && std::abs (mcParticle.pdgCode ()) != kNuMu && std::abs (mcParticle.pdgCode ()) != kNuTau && mcParticle.pdgCode () != kK0Long && mcParticle.pdgCode () != kPi0 ) {
3401+ countChargedOnly++;
3402+ // case for UPCgen when all particles are not pimaries
3403+ if (!mcParticle.isPhysicalPrimary ()) {
3404+ // all charged particles, not only from 1+3 topo
3405+ registryMC.get <TH1>(HIST (" globalMC/hMCetaGen" ))->Fill (mcParticle.eta ());
3406+ registryMC.get <TH1>(HIST (" globalMC/hMCphiGen" ))->Fill (mcParticle.phi ());
3407+ registryMC.get <TH1>(HIST (" globalMC/hMCyGen" ))->Fill (mcParticle.y ());
3408+ registryMC.get <TH1>(HIST (" globalMC/hMCptGen" ))->Fill (mcParticle.pt ());
3409+ } // end of UPCgen case
3410+
3411+ if (mcParticle.has_mothers ()) {
3412+ auto const & mother = mcParticle.mothers_first_as <aod::McParticles>();
3413+ if (std::abs (mother.pdgCode ()) == kTauMinus ) { // 15
3414+ countChargedOnlyFromTau++;
3415+ } // mother is tau
3416+ } // mc particle has mother
3417+ } // veto neutral particles
3418+ // end of special case only for UPCgen
3419+
33823420 //
33833421 // tau+/-
33843422 //
@@ -3406,10 +3444,12 @@ struct TauTau13topo {
34063444 if (std::abs (daughter.eta ()) > 0.9 )
34073445 partFromTauInEta = false ;
34083446 } // end of pion check
3447+
34093448 // electron from tau
34103449 if (std::abs (daughter.pdgCode ()) == kElectron ) { // 11 = electron
34113450 if (daughter.pdgCode () == kElectron )
34123451 flagElPlusElMinus = true ;
3452+
34133453 registryMC.get <TH1>(HIST (" electronMC/hMCeta" ))->Fill (daughter.eta ());
34143454 registryMC.get <TH1>(HIST (" electronMC/hMCphi" ))->Fill (daughter.phi ());
34153455 registryMC.get <TH1>(HIST (" electronMC/hMCy" ))->Fill (daughter.y ());
@@ -3422,17 +3462,25 @@ struct TauTau13topo {
34223462 if (std::abs (daughter.eta ()) > 0.9 )
34233463 partFromTauInEta = false ;
34243464 } // end of electron check
3465+
34253466 // muon from tau
34263467 if (std::abs (daughter.pdgCode ()) == kMuonMinus ) { // 13
34273468 if (daughter.pdgCode () == kMuonMinus ) // 13
34283469 flagMuPlusMuMinus = true ;
3470+
3471+ registryMC.get <TH1>(HIST (" muonMC/hMCeta" ))->Fill (daughter.eta ());
3472+ registryMC.get <TH1>(HIST (" muonMC/hMCphi" ))->Fill (daughter.phi ());
3473+ registryMC.get <TH1>(HIST (" muonMC/hMCy" ))->Fill (daughter.y ());
3474+ registryMC.get <TH1>(HIST (" muonMC/hMCpt" ))->Fill (daughter.pt ());
3475+
34293476 muonFound = !muonFound;
34303477 partPt = static_cast <float >(daughter.pt ());
34313478 // LOGF(info,"mu pt %f",daughter.pt());
34323479 if (std::abs (daughter.eta ()) > 0.9 )
34333480 partFromTauInEta = false ;
34343481 } // end of muon check
34353482 } // end of loop over daughters
3483+
34363484 if (pionCounter == 3 ) {
34373485 threePionsFound = true ;
34383486 } // end of 3pi check
@@ -3442,6 +3490,12 @@ struct TauTau13topo {
34423490 auto mcPartTmp = mcParticle.daughters_as <aod::McParticles>().begin () + singlePionIndex;
34433491 if (mcPartTmp.pdgCode () == kPiMinus ) // -211
34443492 flagPiPlusPiMinus = true ;
3493+
3494+ registryMC.get <TH1>(HIST (" pionMC/hMCeta" ))->Fill (mcPartTmp.eta ());
3495+ registryMC.get <TH1>(HIST (" pionMC/hMCphi" ))->Fill (mcPartTmp.phi ());
3496+ registryMC.get <TH1>(HIST (" pionMC/hMCy" ))->Fill (mcPartTmp.y ());
3497+ registryMC.get <TH1>(HIST (" pionMC/hMCpt" ))->Fill (mcPartTmp.pt ());
3498+
34453499 partPt = static_cast <float >(mcPartTmp.pt ());
34463500 // motherOfSinglePionIndex = mcParticle.index();
34473501 if (std::abs (mcPartTmp.eta ()) > 0.9 )
@@ -3454,6 +3508,7 @@ struct TauTau13topo {
34543508 // LOGF(info,"pt after %f",partPt);
34553509
34563510 // tau related things
3511+ registryMC.get <TH1>(HIST (" tauMC/hNtaus" ))->Fill (countTau);
34573512 if (countTau == 2 ) {
34583513 registryMC.get <TH1>(HIST (" tauMC/hMCdeltaeta" ))->Fill (etaTau[0 ] - etaTau[1 ]);
34593514 registryMC.get <TH1>(HIST (" tauMC/hMCdeltaphi" ))->Fill (calculateDeltaPhi (phiTau[0 ], phiTau[1 ]) * 180 . / o2::constants::math::PI);
@@ -3503,29 +3558,58 @@ struct TauTau13topo {
35033558 registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countBoth, 2 );
35043559 registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countCharged, 3 );
35053560 registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countChargedFromTau, 4 );
3506- if (countChargedFromTau != 4 )
3507- return ;
3508- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (1 ., 1 .);
3509- if (electronFound && flagElPlusElMinus)
3510- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (2 ., 1 .); // e-
3511- else if (electronFound && !flagElPlusElMinus)
3512- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (3 ., 1 .); // e+
3513- if (muonFound && flagMuPlusMuMinus)
3514- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (4 ., 1 .); // mu-
3515- else if (muonFound && !flagMuPlusMuMinus)
3516- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (5 ., 1 .); // mu+
3517- if (singlePionFound && flagPiPlusPiMinus)
3518- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (6 ., 1 .); // pi-
3519- else if (singlePionFound && !flagPiPlusPiMinus)
3520- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (7 ., 1 .); // pi+
3561+ registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countPrim, 5 );
3562+ registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countChargedOnly, 6 );
3563+ registryMC.get <TH2>(HIST (" globalMC/hMCnPart" ))->Fill (countChargedOnlyFromTau, 7 );
35213564
3522- if (!tauInRapidity)
3523- return ;
3524- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (8 ., 1 .);
3525- if (!partFromTauInEta)
3526- return ;
3527- registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (9 ., 1 .);
3565+ if (countChargedFromTau == 2 || countChargedOnlyFromTau == 2 ) {
3566+ // 2 tracks candidates
3567+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-7 ., 1 .);
3568+ }
3569+ if (countChargedFromTau == 6 || countChargedOnlyFromTau == 6 ) {
3570+ // 6 tracks candidates
3571+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-6 ., 1 .);
3572+ }
35283573
3574+ // if (countChargedFromTau != 4)
3575+ // return;
3576+ if (countChargedFromTau == 4 || countChargedOnlyFromTau == 4 ) {
3577+ // 4 tracks candidates
3578+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-5 ., 1 .); // 4 tracks
3579+ if (electronFound && flagElPlusElMinus)
3580+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-4 ., 1 .); // e-
3581+ else if (electronFound && !flagElPlusElMinus)
3582+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-3 ., 1 .); // e+
3583+ if (muonFound && flagMuPlusMuMinus)
3584+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-2 ., 1 .); // mu-
3585+ else if (muonFound && !flagMuPlusMuMinus)
3586+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (-1 ., 1 .); // mu+
3587+ if (singlePionFound && flagPiPlusPiMinus)
3588+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (0 ., 1 .); // pi-
3589+ else if (singlePionFound && !flagPiPlusPiMinus)
3590+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (1 ., 1 .); // pi+
3591+
3592+ if (!tauInRapidity)
3593+ return ;
3594+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (2 ., 1 .);
3595+ if (!partFromTauInEta)
3596+ return ;
3597+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (3 ., 1 .);
3598+
3599+ if (electronFound && flagElPlusElMinus)
3600+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (4 ., 1 .); // e-
3601+ else if (electronFound && !flagElPlusElMinus)
3602+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (5 ., 1 .); // e+
3603+ if (muonFound && flagMuPlusMuMinus)
3604+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (6 ., 1 .); // mu-
3605+ else if (muonFound && !flagMuPlusMuMinus)
3606+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (7 ., 1 .); // mu+
3607+ if (singlePionFound && flagPiPlusPiMinus)
3608+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (8 ., 1 .); // pi-
3609+ else if (singlePionFound && !flagPiPlusPiMinus)
3610+ registryMC.get <TH1>(HIST (" globalMC/hMCefficiency" ))->Fill (9 ., 1 .); // pi+
3611+
3612+ } // end of 4 tracks candidate events
35293613 } // end of processSimpleMCSG
35303614
35313615 // using LabeledTracks = soa::Join<aod::Tracks, aod::McTrackLabels, aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr>;
@@ -3550,7 +3634,7 @@ struct TauTau13topo {
35503634 // LOGF(info, "<tautau13topo_MC> Per DF: UDMcParticles size %d, UDMcCollisions size %d, FullMcUdCollisions size %d", mcParts.size(), mcCollisions.size(), collisionsFull.size());
35513635 // LOGF(info, "<tautau13topo_MC> Per DF: UDMcParticles size %d, UDMcCollisions size %d, FullMcUdCollisions size %d", mcParts.size(), mcCollisions.size(), collisions.size());
35523636 LOGF (info, " <tautau13topo_MCSG> UDMcCollision size %d, SmallGroups FullMcUdCollisions size %d, UDtracks %d, UDMcParticles %d" , mcCollision.size (), collisions.size (), tracks.size (), mcParticles.size ());
3553-
3637+
35543638 // loop over generated collisions
35553639 // for (const auto &mcCollision : mcCollisions) {
35563640 // LOGF(info, "<tautau13topo_MC> Per mcCollision not sliced: UDMcParticles size %d, FullMcUdCollisions size %d", mcParts.size(), collisionsFull.size());
0 commit comments