@@ -39,9 +39,52 @@ using namespace o2::aod;
3939using namespace o2 ::framework;
4040using namespace o2 ::framework::expressions;
4141
42+ namespace o2 ::aod
43+ {
44+ namespace zero_charge_events
45+ {
46+
47+ DECLARE_SOA_COLUMN (Dcaxy, dcaxy, std::vector<double >);
48+ DECLARE_SOA_COLUMN (Dcaz, dcaz, std::vector<double >);
49+
50+ DECLARE_SOA_COLUMN (PionPt, pionPt, std::vector<double >);
51+ DECLARE_SOA_COLUMN (PionEta, pionEta, std::vector<double >);
52+ DECLARE_SOA_COLUMN (PionRapidity, pionRapidity, std::vector<double >);
53+
54+ DECLARE_SOA_COLUMN (FourPionPt, fourPionPt, double );
55+ DECLARE_SOA_COLUMN (FourPionEta, fourPionEta, double );
56+ DECLARE_SOA_COLUMN (FourPionRapidity, fourPionRapidity, double );
57+ DECLARE_SOA_COLUMN (FourPionMass, fourPionMass, double );
58+
59+ DECLARE_SOA_COLUMN (FourPionPhiPair1, fourPionPhiPair1, double );
60+ DECLARE_SOA_COLUMN (FourPionPhiPair2, fourPionPhiPair2, double );
61+ DECLARE_SOA_COLUMN (FourPionCosThetaPair1, fourPionCosThetaPair1, double );
62+ DECLARE_SOA_COLUMN (FourPionCosThetaPair2, fourPionCosThetaPair2, double );
63+ } // namespace zero_charge_events
64+ DECLARE_SOA_TABLE (TREE, " AOD" , " Tree" ,
65+
66+ zero_charge_events::Dcaxy,
67+ zero_charge_events::Dcaz,
68+
69+ zero_charge_events::PionPt,
70+ zero_charge_events::PionEta,
71+ zero_charge_events::PionRapidity,
72+
73+ zero_charge_events::FourPionPt,
74+ zero_charge_events::FourPionEta,
75+ zero_charge_events::FourPionRapidity,
76+ zero_charge_events::FourPionMass,
77+
78+ zero_charge_events::FourPionPhiPair1,
79+ zero_charge_events::FourPionPhiPair2,
80+ zero_charge_events::FourPionCosThetaPair1,
81+ zero_charge_events::FourPionCosThetaPair2);
82+ } // namespace o2::aod
83+
4284// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4385struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
4486 SGSelector sgSelector;
87+ Produces<aod::TREE> zeroChargeEvents;
4588
4689 HistogramRegistry histosData{" histosData" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
4790 HistogramRegistry histosMCgen{" histosMCgen" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
@@ -67,8 +110,6 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
67110 Configurable<float > nSigmaTPCcut{" nSigmaTPCcut" , 3 , " TPC cut" };
68111 Configurable<float > nSigmaTOFcut{" nSigmaTOFcut" , 3 , " TOF cut" };
69112 Configurable<bool > strictEventSelection{" strictEventSelection" , true , " Event Selection" };
70- // Configurable<bool> ifDataAnalysis{"ifDataAnalysis", true, "Data Analysis"};
71- // Configurable<bool> ifMCAnalysis{"ifMCAnalysis", false, "MC Analysis"};
72113
73114 Configurable<int > nBinsPt{" nBinsPt" , 1000 , " Number of bins for pT" };
74115 Configurable<int > nBinsInvariantMass{" nBinsInvariantMass" , 1000 , " Number of bins for Invariant Mass" };
@@ -88,6 +129,13 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
88129 histosData.add (" TrueGapSide" , " Gap Side; Events" , kTH1F , {{4 , -1.5 , 2.5 }});
89130 histosData.add (" EventCounts" , " Total Events; Events" , kTH1F , {{10 , 0 , 10 }});
90131
132+ histosData.add (" vertexZ" , " Vertex Z; Vertex Z [cm]; Counts" , kTH1F , {{1000 , -20 , 20 }});
133+ histosData.add (" dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{10000 , -5 , 5 }});
134+ histosData.add (" dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{10000 , -10 , 10 }});
135+ histosData.add (" tpcChi2NCl" , " TPC Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{200 , 0 , 200 }});
136+ histosData.add (" itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{200 , 0 , 200 }});
137+ histosData.add (" tpcNClsFindable" , " TPC N Cls Findable; N Cls Findable; Counts" , kTH1F , {{200 , 0 , 200 }});
138+
91139 // TPC nSigma
92140 histosData.add (" tpcNSigmaPi_WOTS" , " TPC nSigma Pion without track selection; Events" , kTH2F , {{1000 , -15 , 15 }, {nBinsPt, 0 , 10 }});
93141 histosData.add (" tpcNSigmaPi_WTS" , " TPC nSigma Pion with track selection; Events" , kTH2F , {{1000 , -15 , 15 }, {nBinsPt, 0 , 10 }});
@@ -163,8 +211,8 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
163211 histosData.add (" tofBeta_Pi" , " TOF beta vs p for pions; p [GeV/c]; #beta" , kTH2F , {{500 , 0 , 10 }, {500 , 0.0 , 1.0 }});
164212
165213 // Other signals
166- histosData.add (" FT0A" , " T0A amplitude" , kTH1F , {{200 , 0.0 , 500.0 }});
167- histosData.add (" FT0C" , " T0C amplitude" , kTH1F , {{200 , 0.0 , 500.0 }});
214+ histosData.add (" FT0A" , " T0A amplitude" , kTH1F , {{2000 , 0.0 , 500.0 }});
215+ histosData.add (" FT0C" , " T0C amplitude" , kTH1F , {{2000 , 0.0 , 500.0 }});
168216 histosData.add (" ZDC_A" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
169217 histosData.add (" ZDC_C" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
170218 histosData.add (" V0A" , " V0A amplitude" , kTH1F , {{1000 , 0.0 , 100 }});
@@ -210,6 +258,13 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
210258
211259 // MC Reco Stuff
212260
261+ histosMCreco.add (" vertexZ" , " Vertex Z; Vertex Z [cm]; Counts" , kTH1F , {{1000 , -20 , 20 }});
262+ histosMCreco.add (" dcaXY" , " dcaXY; dcaXY [cm]; Counts" , kTH1F , {{10000 , -5 , 5 }});
263+ histosMCreco.add (" dcaZ" , " dcaZ; dcaZ [cm]; Counts" , kTH1F , {{10000 , -10 , 10 }});
264+ histosMCreco.add (" tpcChi2NCl" , " TPC Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{200 , 0 , 200 }});
265+ histosMCreco.add (" itsChi2NCl" , " ITS Chi2/NCl; Chi2/NCl; Counts" , kTH1F , {{200 , 0 , 200 }});
266+ histosMCreco.add (" tpcNClsFindable" , " TPC N Cls Findable; N Cls Findable; Counts" , kTH1F , {{200 , 0 , 200 }});
267+
213268 histosMCreco.add (" GapSide" , " Gap Side; Events" , kTH1F , {{4 , -1.5 , 2.5 }});
214269 histosMCreco.add (" TrueGapSide" , " Gap Side; Events" , kTH1F , {{4 , -1.5 , 2.5 }});
215270 histosMCreco.add (" EventCounts" , " Total Events; Events" , kTH1F , {{10 , 0 , 10 }});
@@ -289,8 +344,8 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
289344 histosMCreco.add (" tofBeta_Pi" , " TOF beta vs p for pions; p [GeV/c]; #beta" , kTH2F , {{500 , 0 , 10 }, {500 , 0.0 , 1.0 }});
290345
291346 // Other signals
292- histosMCreco.add (" FT0A" , " T0A amplitude" , kTH1F , {{200 , 0.0 , 500.0 }});
293- histosMCreco.add (" FT0C" , " T0C amplitude" , kTH1F , {{200 , 0.0 , 500.0 }});
347+ histosMCreco.add (" FT0A" , " T0A amplitude" , kTH1F , {{2000 , 0.0 , 500.0 }});
348+ histosMCreco.add (" FT0C" , " T0C amplitude" , kTH1F , {{2000 , 0.0 , 500.0 }});
294349 histosMCreco.add (" ZDC_A" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
295350 histosMCreco.add (" ZDC_C" , " ZDC amplitude" , kTH1F , {{1000 , 0.0 , 15 }});
296351 histosMCreco.add (" V0A" , " V0A amplitude" , kTH1F , {{1000 , 0.0 , 100 }});
@@ -389,7 +444,7 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
389444 if ((gapSide != 2 )) {
390445 return ;
391446 }
392-
447+ histosData. fill ( HIST ( " vertexZ " ), collision. posZ ());
393448 histosData.fill (HIST (" V0A" ), collision.totalFV0AmplitudeA ());
394449 histosData.fill (HIST (" FT0A" ), collision.totalFT0AmplitudeA ());
395450 histosData.fill (HIST (" FT0C" ), collision.totalFT0AmplitudeC ());
@@ -457,6 +512,13 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
457512 histosData.fill (HIST (" tofNSigmaPi_WTS" ), WTS_tracks[i].tofNSigmaPi (), std::sqrt (WTS_tracks[i].px () * WTS_tracks[i].px () + WTS_tracks[i].py () * WTS_tracks[i].py ()));
458513 histosData.fill (HIST (" pT_track_WTS" ), std::sqrt (WTS_tracks[i].px () * WTS_tracks[i].px () + WTS_tracks[i].py () * WTS_tracks[i].py ()));
459514 histosData.fill (HIST (" rapidity_track_WTS" ), tempWTS.Rapidity ());
515+
516+ histosData.fill (HIST (" itsChi2NCl" ), WTS_tracks[i].itsChi2NCl ());
517+ histosData.fill (HIST (" tpcChi2NCl" ), WTS_tracks[i].tpcChi2NCl ());
518+ histosData.fill (HIST (" tpcNClsFindable" ), WTS_tracks[i].tpcNClsFindable ());
519+ histosData.fill (HIST (" dcaXY" ), WTS_tracks[i].dcaXY ());
520+ histosData.fill (HIST (" dcaZ" ), WTS_tracks[i].dcaZ ());
521+
460522 } // End of loop over tracks with selection only
461523
462524 TLorentzVector tempWTSPIDPi;
@@ -487,6 +549,18 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
487549 return ;
488550 }
489551
552+ std::vector<double > pidcaXY;
553+ std::vector<double > pidcaZ;
554+
555+ std::vector<double > piPt;
556+ std::vector<double > piEta;
557+ std::vector<double > piRapidity;
558+
559+ double fourPiPhiPair1 = 0 ;
560+ double fourPiPhiPair2 = 0 ;
561+ double fourPiCosThetaPair1 = 0 ;
562+ double fourPiCosThetaPair2 = 0 ;
563+
490564 // Selecting Events with net charge = 0
491565 if (numPionMinusTRacks == 2 && numPiPlusTracks == 2 ) {
492566
@@ -498,6 +572,31 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
498572 p3.SetXYZM (Pi_minus_tracks[0 ].px (), Pi_minus_tracks[0 ].py (), Pi_minus_tracks[0 ].pz (), o2::constants::physics::MassPionCharged);
499573 p4.SetXYZM (Pi_minus_tracks[1 ].px (), Pi_minus_tracks[1 ].py (), Pi_minus_tracks[1 ].pz (), o2::constants::physics::MassPionCharged);
500574
575+ pidcaXY.push_back (Pi_plus_tracks[0 ].dcaXY ());
576+ pidcaXY.push_back (Pi_plus_tracks[1 ].dcaXY ());
577+ pidcaXY.push_back (Pi_minus_tracks[0 ].dcaXY ());
578+ pidcaXY.push_back (Pi_minus_tracks[1 ].dcaXY ());
579+
580+ pidcaZ.push_back (Pi_plus_tracks[0 ].dcaZ ());
581+ pidcaZ.push_back (Pi_plus_tracks[1 ].dcaZ ());
582+ pidcaZ.push_back (Pi_minus_tracks[0 ].dcaZ ());
583+ pidcaZ.push_back (Pi_minus_tracks[1 ].dcaZ ());
584+
585+ piPt.push_back (p1.Pt ());
586+ piPt.push_back (p2.Pt ());
587+ piPt.push_back (p3.Pt ());
588+ piPt.push_back (p4.Pt ());
589+
590+ piEta.push_back (p1.Eta ());
591+ piEta.push_back (p2.Eta ());
592+ piEta.push_back (p3.Eta ());
593+ piEta.push_back (p4.Eta ());
594+
595+ piRapidity.push_back (p1.Rapidity ());
596+ piRapidity.push_back (p2.Rapidity ());
597+ piRapidity.push_back (p3.Rapidity ());
598+ piRapidity.push_back (p4.Rapidity ());
599+
501600 histosData.fill (HIST (" pT_track_WTS_PID_Pi_contributed" ), p1.Pt ());
502601 histosData.fill (HIST (" pT_track_WTS_PID_Pi_contributed" ), p2.Pt ());
503602 histosData.fill (HIST (" pT_track_WTS_PID_Pi_contributed" ), p3.Pt ());
@@ -521,6 +620,17 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
521620 k23 = k2 + k3;
522621 k24 = k2 + k4;
523622
623+ fourPiPhiPair1 = phiCollinsSoperFrame (k13, k24, k1234);
624+ fourPiPhiPair2 = phiCollinsSoperFrame (k14, k23, k1234);
625+ fourPiCosThetaPair1 = cosThetaCollinsSoperFrame (k13, k24, k1234);
626+ fourPiCosThetaPair2 = cosThetaCollinsSoperFrame (k14, k23, k1234);
627+
628+ zeroChargeEvents (
629+ pidcaXY, pidcaZ,
630+ piPt, piEta, piRapidity,
631+ p1234.Pt (), p1234.Eta (), p1234.Rapidity (), p1234.M (),
632+ fourPiPhiPair1, fourPiPhiPair2, fourPiCosThetaPair1, fourPiCosThetaPair2);
633+
524634 if (std::fabs (p1234.Rapidity ()) < 0.5 ) {
525635 histosData.fill (HIST (" pT_event_0charge_WTS_PID_Pi" ), p1234.Pt ());
526636 if (p1234.Pt () < 0.15 ) {
@@ -532,18 +642,13 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
532642 histosData.fill (HIST (" invMass_pair_3" ), (p2 + p3).M ());
533643 histosData.fill (HIST (" invMass_pair_4" ), (p2 + p4).M ());
534644
535- auto phiPair1 = phiCollinsSoperFrame (k13, k24, k1234);
536- auto phiPair2 = phiCollinsSoperFrame (k14, k23, k1234);
537- auto cosThetaPair1 = cosThetaCollinsSoperFrame (k13, k24, k1234);
538- auto cosThetaPair2 = cosThetaCollinsSoperFrame (k14, k23, k1234);
539-
540- histosData.fill (HIST (" CS_phi_pair_1" ), phiPair1);
541- histosData.fill (HIST (" CS_phi_pair_2" ), phiPair2);
542- histosData.fill (HIST (" CS_costheta_pair_1" ), cosThetaPair1);
543- histosData.fill (HIST (" CS_costheta_pair_2" ), cosThetaPair2);
645+ histosData.fill (HIST (" CS_phi_pair_1" ), fourPiPhiPair1);
646+ histosData.fill (HIST (" CS_phi_pair_2" ), fourPiPhiPair2);
647+ histosData.fill (HIST (" CS_costheta_pair_1" ), fourPiCosThetaPair1);
648+ histosData.fill (HIST (" CS_costheta_pair_2" ), fourPiCosThetaPair2);
544649
545- histosData.fill (HIST (" phi_cosTheta_pair_1" ), phiPair1, cosThetaPair1 );
546- histosData.fill (HIST (" phi_cosTheta_pair_2" ), phiPair2, cosThetaPair2 );
650+ histosData.fill (HIST (" phi_cosTheta_pair_1" ), fourPiPhiPair1, fourPiCosThetaPair1 );
651+ histosData.fill (HIST (" phi_cosTheta_pair_2" ), fourPiPhiPair2, fourPiCosThetaPair2 );
547652 }
548653 if (p1234.Pt () > 0.15 && p1234.Pt () < 0.80 ) {
549654 histosData.fill (HIST (" rapidity_event_0charge_WTS_PID_Pi_domainB" ), p1234.Rapidity ());
@@ -607,8 +712,9 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
607712 if (!particle.has_mothers ()) {
608713 continue ;
609714 }
610-
611715 for (const auto & mother : particle.mothers_as <aod::UDMcParticles>()) {
716+ // LOGF(info, "Mother ID: %d", mother.pdgCode());
717+
612718 if (mother.pdgCode () == 30113 ) {
613719 motherVector.SetXYZM (mother.px (), mother.py (), mother.pz (), o2::constants::physics::MassPionCharged);
614720 histosMCgen.fill (HIST (" MCgen_rhoPrime_pT" ), motherVector.Pt ());
@@ -620,16 +726,16 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
620726 if (particle.pdgCode () == 211 ) {
621727 histosMCgen.fill (HIST (" MCgen_particle_pT" ), tempVector.Pt ());
622728 histosMCgen.fill (HIST (" MCgen_particle_rapidity" ), tempVector.Rapidity ());
623- // if (std::abs(tempVector.Rapidity ()) < 0.9){
624- piPlusvectors.push_back (tempVector);
625- // }
729+ if (std::abs (tempVector.Eta ()) < 0.9 ) {
730+ piPlusvectors.push_back (tempVector);
731+ }
626732 }
627733 if (particle.pdgCode () == -211 ) {
628734 histosMCgen.fill (HIST (" MCgen_particle_pT" ), tempVector.Pt ());
629735 histosMCgen.fill (HIST (" MCgen_particle_rapidity" ), tempVector.Rapidity ());
630- // if (std::abs(tempVector.Rapidity ()) < 0.9){
631- piMinusvectors.push_back (tempVector);
632- // }
736+ if (std::abs (tempVector.Eta ()) < 0.9 ) {
737+ piMinusvectors.push_back (tempVector);
738+ }
633739 }
634740 } // End of Mother ID 30113 rho prime
635741 } // End of loop over mothers
@@ -717,11 +823,14 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
717823 return ;
718824 }
719825
826+ histosMCreco.fill (HIST (" vertexZ" ), collision.posZ ());
720827 histosMCreco.fill (HIST (" V0A" ), collision.totalFV0AmplitudeA ());
721828 histosMCreco.fill (HIST (" FT0A" ), collision.totalFT0AmplitudeA ());
722829 histosMCreco.fill (HIST (" FT0C" ), collision.totalFT0AmplitudeC ());
723830 histosMCreco.fill (HIST (" ZDC_A" ), collision.energyCommonZNA ());
831+ LOGF (info, " ZDC_A: %f" , collision.energyCommonZNA ());
724832 histosMCreco.fill (HIST (" ZDC_C" ), collision.energyCommonZNC ());
833+ LOGF (info, " ZDC_C: %f" , collision.energyCommonZNC ());
725834
726835 if (strictEventSelection) {
727836 if (collision.numContrib () != 4 ) {
@@ -773,6 +882,7 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
773882 histosMCreco.fill (HIST (" tofNSigmaPi_WOTS" ), WOTS_tracks[i].tofNSigmaPi (), std::sqrt (WOTS_tracks[i].px () * WOTS_tracks[i].px () + WOTS_tracks[i].py () * WOTS_tracks[i].py ()));
774883 histosMCreco.fill (HIST (" pT_track_WOTS" ), std::sqrt (WOTS_tracks[i].px () * WOTS_tracks[i].px () + WOTS_tracks[i].py () * WOTS_tracks[i].py ()));
775884 histosMCreco.fill (HIST (" rapidity_track_WOTS" ), tempWOTS.Rapidity ());
885+
776886 } // End of loop over tracks without selection
777887
778888 TLorentzVector tempWTS;
@@ -784,6 +894,12 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
784894 histosMCreco.fill (HIST (" tofNSigmaPi_WTS" ), WTS_tracks[i].tofNSigmaPi (), std::sqrt (WTS_tracks[i].px () * WTS_tracks[i].px () + WTS_tracks[i].py () * WTS_tracks[i].py ()));
785895 histosMCreco.fill (HIST (" pT_track_WTS" ), std::sqrt (WTS_tracks[i].px () * WTS_tracks[i].px () + WTS_tracks[i].py () * WTS_tracks[i].py ()));
786896 histosMCreco.fill (HIST (" rapidity_track_WTS" ), tempWTS.Rapidity ());
897+
898+ histosMCreco.fill (HIST (" itsChi2NCl" ), WTS_tracks[i].itsChi2NCl ());
899+ histosMCreco.fill (HIST (" tpcChi2NCl" ), WTS_tracks[i].tpcChi2NCl ());
900+ histosMCreco.fill (HIST (" tpcNClsFindable" ), WTS_tracks[i].tpcNClsFindable ());
901+ histosMCreco.fill (HIST (" dcaXY" ), WTS_tracks[i].dcaXY ());
902+ histosMCreco.fill (HIST (" dcaZ" ), WTS_tracks[i].dcaZ ());
787903 } // End of loop over tracks with selection only
788904
789905 TLorentzVector tempWTSPIDPi;
0 commit comments