Skip to content

Commit f8e8b81

Browse files
[PWGUD] Added few more tables (AliceO2Group#10396)
1 parent df3f84d commit f8e8b81

File tree

1 file changed

+109
-43
lines changed

1 file changed

+109
-43
lines changed

PWGUD/Tasks/exclusiveRhoTo4Pi.cxx

Lines changed: 109 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,50 +41,72 @@ using namespace o2::framework::expressions;
4141

4242
namespace o2::aod
4343
{
44-
namespace zero_charge_events
44+
namespace branch
4545
{
46-
4746
DECLARE_SOA_COLUMN(Dcaxy, dcaxy, std::vector<double>);
4847
DECLARE_SOA_COLUMN(Dcaz, dcaz, std::vector<double>);
49-
5048
DECLARE_SOA_COLUMN(PionPt, pionPt, std::vector<double>);
5149
DECLARE_SOA_COLUMN(PionEta, pionEta, std::vector<double>);
5250
DECLARE_SOA_COLUMN(PionRapidity, pionRapidity, std::vector<double>);
53-
5451
DECLARE_SOA_COLUMN(FourPionPt, fourPionPt, double);
5552
DECLARE_SOA_COLUMN(FourPionEta, fourPionEta, double);
5653
DECLARE_SOA_COLUMN(FourPionRapidity, fourPionRapidity, double);
5754
DECLARE_SOA_COLUMN(FourPionMass, fourPionMass, double);
58-
5955
DECLARE_SOA_COLUMN(FourPionPhiPair1, fourPionPhiPair1, double);
6056
DECLARE_SOA_COLUMN(FourPionPhiPair2, fourPionPhiPair2, double);
6157
DECLARE_SOA_COLUMN(FourPionCosThetaPair1, fourPionCosThetaPair1, double);
6258
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);
59+
} // namespace branch
60+
DECLARE_SOA_TABLE(UDTree, "AOD", "UD0Charge",
61+
branch::Dcaxy,
62+
branch::Dcaz,
63+
branch::PionPt,
64+
branch::PionEta,
65+
branch::PionRapidity,
66+
branch::FourPionPt,
67+
branch::FourPionEta,
68+
branch::FourPionRapidity,
69+
branch::FourPionMass,
70+
branch::FourPionPhiPair1,
71+
branch::FourPionPhiPair2,
72+
branch::FourPionCosThetaPair1,
73+
branch::FourPionCosThetaPair2);
74+
75+
DECLARE_SOA_TABLE(MCTree, "AOD", "MC0Charge",
76+
branch::PionPt,
77+
branch::PionEta,
78+
branch::PionRapidity,
79+
branch::FourPionPt,
80+
branch::FourPionEta,
81+
branch::FourPionRapidity,
82+
branch::FourPionMass,
83+
branch::FourPionPhiPair1,
84+
branch::FourPionPhiPair2,
85+
branch::FourPionCosThetaPair1,
86+
branch::FourPionCosThetaPair2);
87+
88+
DECLARE_SOA_TABLE(MCUDTree, "AOD", "UDMC0Charge",
89+
branch::Dcaxy,
90+
branch::Dcaz,
91+
branch::PionPt,
92+
branch::PionEta,
93+
branch::PionRapidity,
94+
branch::FourPionPt,
95+
branch::FourPionEta,
96+
branch::FourPionRapidity,
97+
branch::FourPionMass,
98+
branch::FourPionPhiPair1,
99+
branch::FourPionPhiPair2,
100+
branch::FourPionCosThetaPair1,
101+
branch::FourPionCosThetaPair2);
82102
} // namespace o2::aod
83103

84104
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
85105
struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
86106
SGSelector sgSelector;
87-
Produces<aod::TREE> zeroChargeEvents;
107+
Produces<aod::UDTree> zeroChargeEventsData;
108+
Produces<aod::MCTree> zeroChargeEventsMCgen;
109+
Produces<aod::MCUDTree> zeroChargeEventsMCreco;
88110

89111
HistogramRegistry histosData{"histosData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
90112
HistogramRegistry histosMCgen{"histosMCgen", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
@@ -96,7 +118,7 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
96118
Configurable<float> ft0cCut{"ft0cCut", 50., "FT0C threshold"};
97119
Configurable<float> fddaCut{"fddaCut", 10000., "FDDA threshold"};
98120
Configurable<float> fddcCut{"fddcCut", 10000., "FDDC threshold"};
99-
Configurable<float> zdcCut{"zdcCut", 10., "ZDC threshold"};
121+
Configurable<float> zdcCut{"zdcCut", 1., "ZDC threshold"};
100122

101123
Configurable<float> pvCut{"pvCut", 1.0, "Use Only PV tracks"};
102124
Configurable<float> dcaZcut{"dcaZcut", 2, "dcaZ cut"};
@@ -625,7 +647,7 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
625647
fourPiCosThetaPair1 = cosThetaCollinsSoperFrame(k13, k24, k1234);
626648
fourPiCosThetaPair2 = cosThetaCollinsSoperFrame(k14, k23, k1234);
627649

628-
zeroChargeEvents(
650+
zeroChargeEventsData(
629651
pidcaXY, pidcaZ,
630652
piPt, piEta, piRapidity,
631653
p1234.Pt(), p1234.Eta(), p1234.Rapidity(), p1234.M(),
@@ -704,6 +726,10 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
704726
TLorentzVector motherVector, tempVector, p1, p2, p3, p4;
705727
TLorentzVector p1234;
706728

729+
std::vector<double> piPt;
730+
std::vector<double> piEta;
731+
std::vector<double> piRapidity;
732+
707733
bool flag = false;
708734

709735
for (const auto& particle : mcParts) {
@@ -712,30 +738,31 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
712738
if (!particle.has_mothers()) {
713739
continue;
714740
}
715-
for (const auto& mother : particle.mothers_as<aod::UDMcParticles>()) {
716-
// LOGF(info, "Mother ID: %d", mother.pdgCode());
717741

742+
for (const auto& mother : particle.mothers_as<aod::UDMcParticles>()) {
718743
if (mother.pdgCode() == 30113) {
719744
motherVector.SetXYZM(mother.px(), mother.py(), mother.pz(), o2::constants::physics::MassPionCharged);
720745
histosMCgen.fill(HIST("MCgen_rhoPrime_pT"), motherVector.Pt());
746+
721747
if (flag == false) {
722748
histosMCgen.fill(HIST("rhoPrimeCounts"), 5);
723749
}
724750
flag = true;
725-
726751
if (particle.pdgCode() == 211) {
727752
histosMCgen.fill(HIST("MCgen_particle_pT"), tempVector.Pt());
728753
histosMCgen.fill(HIST("MCgen_particle_rapidity"), tempVector.Rapidity());
729-
if (std::abs(tempVector.Eta()) < 0.9) {
730-
piPlusvectors.push_back(tempVector);
731-
}
754+
piPlusvectors.push_back(tempVector);
755+
piPt.push_back(tempVector.Pt());
756+
piEta.push_back(tempVector.Eta());
757+
piRapidity.push_back(tempVector.Rapidity());
732758
}
733759
if (particle.pdgCode() == -211) {
734760
histosMCgen.fill(HIST("MCgen_particle_pT"), tempVector.Pt());
735761
histosMCgen.fill(HIST("MCgen_particle_rapidity"), tempVector.Rapidity());
736-
if (std::abs(tempVector.Eta()) < 0.9) {
737-
piMinusvectors.push_back(tempVector);
738-
}
762+
piMinusvectors.push_back(tempVector);
763+
piPt.push_back(tempVector.Pt());
764+
piEta.push_back(tempVector.Eta());
765+
piRapidity.push_back(tempVector.Rapidity());
739766
}
740767
} // End of Mother ID 30113 rho prime
741768
} // End of loop over mothers
@@ -792,6 +819,10 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
792819
histosMCgen.fill(HIST("MCgen_phi_cosTheta_pair_1"), phiPair1, cosThetaPair1);
793820
histosMCgen.fill(HIST("MCgen_phi_cosTheta_pair_2"), phiPair2, cosThetaPair2);
794821

822+
zeroChargeEventsMCgen(piPt, piEta, piRapidity,
823+
p1234.Pt(), p1234.Eta(), p1234.Rapidity(), p1234.M(),
824+
phiPair1, phiPair2, cosThetaPair1, cosThetaPair2);
825+
795826
} // End of 4 Pion MC Generation Process function
796827
PROCESS_SWITCH(exclusiveRhoTo4Pi, processMCgen, "The Process for 4 Pion Analysis from MC Generation", false);
797828

@@ -828,9 +859,7 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
828859
histosMCreco.fill(HIST("FT0A"), collision.totalFT0AmplitudeA());
829860
histosMCreco.fill(HIST("FT0C"), collision.totalFT0AmplitudeC());
830861
histosMCreco.fill(HIST("ZDC_A"), collision.energyCommonZNA());
831-
LOGF(info, "ZDC_A: %f", collision.energyCommonZNA());
832862
histosMCreco.fill(HIST("ZDC_C"), collision.energyCommonZNC());
833-
LOGF(info, "ZDC_C: %f", collision.energyCommonZNC());
834863

835864
if (strictEventSelection) {
836865
if (collision.numContrib() != 4) {
@@ -964,6 +993,48 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
964993
k23 = k2 + k3;
965994
k24 = k2 + k4;
966995

996+
auto phiPair1 = phiCollinsSoperFrame(k13, k24, k1234);
997+
auto phiPair2 = phiCollinsSoperFrame(k14, k23, k1234);
998+
auto cosThetaPair1 = cosThetaCollinsSoperFrame(k13, k24, k1234);
999+
auto cosThetaPair2 = cosThetaCollinsSoperFrame(k14, k23, k1234);
1000+
1001+
std::vector<double> dcaxy;
1002+
std::vector<double> dcaz;
1003+
1004+
std::vector<double> piPt;
1005+
std::vector<double> piEta;
1006+
std::vector<double> piRapidity;
1007+
1008+
dcaxy.push_back(Pi_plus_tracks[0].dcaXY());
1009+
dcaxy.push_back(Pi_plus_tracks[1].dcaXY());
1010+
dcaxy.push_back(Pi_minus_tracks[0].dcaXY());
1011+
dcaxy.push_back(Pi_minus_tracks[1].dcaXY());
1012+
1013+
dcaz.push_back(Pi_plus_tracks[0].dcaZ());
1014+
dcaz.push_back(Pi_plus_tracks[1].dcaZ());
1015+
dcaz.push_back(Pi_minus_tracks[0].dcaZ());
1016+
dcaz.push_back(Pi_minus_tracks[1].dcaZ());
1017+
1018+
piPt.push_back(p1.Pt());
1019+
piPt.push_back(p2.Pt());
1020+
piPt.push_back(p3.Pt());
1021+
piPt.push_back(p4.Pt());
1022+
1023+
piEta.push_back(p1.Eta());
1024+
piEta.push_back(p2.Eta());
1025+
piEta.push_back(p3.Eta());
1026+
piEta.push_back(p4.Eta());
1027+
1028+
piRapidity.push_back(p1.Rapidity());
1029+
piRapidity.push_back(p2.Rapidity());
1030+
piRapidity.push_back(p3.Rapidity());
1031+
piRapidity.push_back(p4.Rapidity());
1032+
1033+
zeroChargeEventsMCreco(dcaxy, dcaz,
1034+
piPt, piEta, piRapidity,
1035+
p1234.Pt(), p1234.Eta(), p1234.Rapidity(), p1234.M(),
1036+
phiPair1, phiPair2, cosThetaPair1, cosThetaPair2);
1037+
9671038
if (std::fabs(p1234.Rapidity()) < 0.5) {
9681039
histosMCreco.fill(HIST("pT_event_0charge_WTS_PID_Pi"), p1234.Pt());
9691040
if (p1234.Pt() < 0.15) {
@@ -975,11 +1046,6 @@ struct exclusiveRhoTo4Pi { // o2-linter: disable=name/workflow-file,name/struct
9751046
histosMCreco.fill(HIST("invMass_pair_3"), (p2 + p3).M());
9761047
histosMCreco.fill(HIST("invMass_pair_4"), (p2 + p4).M());
9771048

978-
auto phiPair1 = phiCollinsSoperFrame(k13, k24, k1234);
979-
auto phiPair2 = phiCollinsSoperFrame(k14, k23, k1234);
980-
auto cosThetaPair1 = cosThetaCollinsSoperFrame(k13, k24, k1234);
981-
auto cosThetaPair2 = cosThetaCollinsSoperFrame(k14, k23, k1234);
982-
9831049
histosMCreco.fill(HIST("CS_phi_pair_1"), phiPair1);
9841050
histosMCreco.fill(HIST("CS_phi_pair_2"), phiPair2);
9851051
histosMCreco.fill(HIST("CS_costheta_pair_1"), cosThetaPair1);

0 commit comments

Comments
 (0)