Skip to content

Commit 88aadee

Browse files
author
Stefanie Mrozinski
committed
add V0-photon track selection for photon pairs
1 parent 50b94c7 commit 88aadee

5 files changed

Lines changed: 297 additions & 38 deletions

File tree

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,36 @@ struct Pi0EtaToGammaGamma {
104104
o2::framework::Configurable<float> cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut (A * tanh(B*pT))"};
105105
o2::framework::Configurable<float> cfgAlphaMesonB{"cfgAlphaMesonB", 1.2, "photon energy asymmetry distribution parameter B for pT dependent cut (A * tanh(B*pT))"};
106106

107+
o2::framework::Configurable<bool> cfgDoPhotonClassPairCut{"cfgDoPhotonClassPairCut", false, "apply photon-class pair selection A x B (leg track composition, PCM-PCM only)"};
108+
109+
struct : o2::framework::ConfigurableGroup {
110+
std::string prefix = "photonclassA_group";
111+
o2::framework::Configurable<int> cfgMinNLegsITSTPC{"cfgMinNLegsITSTPC", 0, "min number of ITS-TPC legs (0-2)"};
112+
o2::framework::Configurable<int> cfgMaxNLegsITSTPC{"cfgMaxNLegsITSTPC", 2, "max number of ITS-TPC legs (0-2)"};
113+
o2::framework::Configurable<int> cfgMinNLegsITSOnly{"cfgMinNLegsITSOnly", 0, "min number of ITS-only legs (0-2)"};
114+
o2::framework::Configurable<int> cfgMaxNLegsITSOnly{"cfgMaxNLegsITSOnly", 2, "max number of ITS-only legs (0-2)"};
115+
o2::framework::Configurable<int> cfgMinNLegsTPCOnly{"cfgMinNLegsTPCOnly", 0, "min number of TPC-only legs (0-2)"};
116+
o2::framework::Configurable<int> cfgMaxNLegsTPCOnly{"cfgMaxNLegsTPCOnly", 2, "max number of TPC-only legs (0-2)"};
117+
o2::framework::Configurable<int> cfgMinNLegsTRD{"cfgMinNLegsTRD", 0, "min number of legs with TRD (0-2)"};
118+
o2::framework::Configurable<int> cfgMaxNLegsTRD{"cfgMaxNLegsTRD", 2, "max number of legs with TRD (0-2)"};
119+
o2::framework::Configurable<int> cfgMinNLegsTOF{"cfgMinNLegsTOF", 0, "min number of legs with TOF (0-2)"};
120+
o2::framework::Configurable<int> cfgMaxNLegsTOF{"cfgMaxNLegsTOF", 2, "max number of legs with TOF (0-2)"};
121+
} photonclassA;
122+
123+
struct : o2::framework::ConfigurableGroup {
124+
std::string prefix = "photonclassB_group";
125+
o2::framework::Configurable<int> cfgMinNLegsITSTPC{"cfgMinNLegsITSTPC", 0, "min number of ITS-TPC legs (0-2)"};
126+
o2::framework::Configurable<int> cfgMaxNLegsITSTPC{"cfgMaxNLegsITSTPC", 2, "max number of ITS-TPC legs (0-2)"};
127+
o2::framework::Configurable<int> cfgMinNLegsITSOnly{"cfgMinNLegsITSOnly", 0, "min number of ITS-only legs (0-2)"};
128+
o2::framework::Configurable<int> cfgMaxNLegsITSOnly{"cfgMaxNLegsITSOnly", 2, "max number of ITS-only legs (0-2)"};
129+
o2::framework::Configurable<int> cfgMinNLegsTPCOnly{"cfgMinNLegsTPCOnly", 0, "min number of TPC-only legs (0-2)"};
130+
o2::framework::Configurable<int> cfgMaxNLegsTPCOnly{"cfgMaxNLegsTPCOnly", 2, "max number of TPC-only legs (0-2)"};
131+
o2::framework::Configurable<int> cfgMinNLegsTRD{"cfgMinNLegsTRD", 0, "min number of legs with TRD (0-2)"};
132+
o2::framework::Configurable<int> cfgMaxNLegsTRD{"cfgMaxNLegsTRD", 2, "max number of legs with TRD (0-2)"};
133+
o2::framework::Configurable<int> cfgMinNLegsTOF{"cfgMinNLegsTOF", 0, "min number of legs with TOF (0-2)"};
134+
o2::framework::Configurable<int> cfgMaxNLegsTOF{"cfgMaxNLegsTOF", 2, "max number of legs with TOF (0-2)"};
135+
} photonclassB;
136+
107137
EMPhotonEventCut fEMEventCut;
108138
struct : o2::framework::ConfigurableGroup {
109139
std::string prefix = "eventcut_group";
@@ -371,6 +401,9 @@ struct Pi0EtaToGammaGamma {
371401
}
372402
};
373403

404+
o2::aod::pwgem::photonmeson::utils::pairutil::V0PhotonClassSelection mPhotonClassSelA{};
405+
o2::aod::pwgem::photonmeson::utils::pairutil::V0PhotonClassSelection mPhotonClassSelB{};
406+
374407
void init(o2::framework::InitContext&)
375408
{
376409
zvtx_bin_edges = std::vector<float>(ConfVtxBins.value.begin(), ConfVtxBins.value.end());
@@ -397,6 +430,9 @@ struct Pi0EtaToGammaGamma {
397430
}
398431
DefineEMEventCut();
399432
DefinePCMCut();
433+
434+
mPhotonClassSelA = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassA);
435+
mPhotonClassSelB = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassB);
400436
DefineDileptonCut();
401437
DefineEMCCut();
402438
DefinePHOSCut();
@@ -799,6 +835,7 @@ struct Pi0EtaToGammaGamma {
799835
continue;
800836
}
801837
}
838+
802839
auto pos1 = g1.template posTrack_as<TLegs>();
803840
auto ele1 = g1.template negTrack_as<TLegs>();
804841
ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.);
@@ -882,6 +919,20 @@ struct Pi0EtaToGammaGamma {
882919
}
883920
}
884921

922+
o2::aod::pwgem::photonmeson::utils::pairutil::V0PhotonLegCounts legCounts1{}, legCounts2{};
923+
if constexpr (std::is_same_v<TDetectorTag1, PCMTag> && std::is_same_v<TDetectorTag2, PCMTag>) {
924+
auto pos1 = g1.template posTrack_as<TLegs>();
925+
auto neg1 = g1.template negTrack_as<TLegs>();
926+
auto pos2 = g2.template posTrack_as<TLegs>();
927+
auto neg2 = g2.template negTrack_as<TLegs>();
928+
legCounts1 = o2::aod::pwgem::photonmeson::utils::pairutil::getV0PhotonLegCounts(pos1, neg1);
929+
legCounts2 = o2::aod::pwgem::photonmeson::utils::pairutil::getV0PhotonLegCounts(pos2, neg2);
930+
if (cfgDoPhotonClassPairCut.value &&
931+
!o2::aod::pwgem::photonmeson::utils::pairutil::isPairPhotonClassSelected(legCounts1, legCounts2, mPhotonClassSelA, mPhotonClassSelB)) {
932+
continue;
933+
}
934+
}
935+
885936
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
886937
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
887938
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
@@ -920,11 +971,19 @@ struct Pi0EtaToGammaGamma {
920971
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), wpair);
921972

922973
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
923-
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0));
974+
auto emphoton1 = o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0);
975+
if constexpr (std::is_same_v<TDetectorTag1, PCMTag> && std::is_same_v<TDetectorTag2, PCMTag>) {
976+
emphoton1.setLegCounts(legCounts1);
977+
}
978+
emh1->AddTrackToEventPool(key_df_collision, emphoton1);
924979
used_photonIds_per_col.emplace_back(g1.globalIndex());
925980
}
926981
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g2.globalIndex()) == used_photonIds_per_col.end()) {
927-
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g2.pt(), g2.eta(), g2.phi(), 0));
982+
auto emphoton2 = o2::aod::pwgem::photonmeson::utils::EMPhoton(g2.pt(), g2.eta(), g2.phi(), 0);
983+
if constexpr (std::is_same_v<TDetectorTag1, PCMTag> && std::is_same_v<TDetectorTag2, PCMTag>) {
984+
emphoton2.setLegCounts(legCounts1);
985+
}
986+
emh2->AddTrackToEventPool(key_df_collision, emphoton2);
928987
used_photonIds_per_col.emplace_back(g2.globalIndex());
929988
}
930989
ndiphoton++;
@@ -969,6 +1028,14 @@ struct Pi0EtaToGammaGamma {
9691028

9701029
for (const auto& g1 : selected_photons1_in_this_event) {
9711030
for (const auto& g2 : photons1_from_event_pool) {
1031+
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM) {
1032+
if (cfgDoPhotonClassPairCut.value) {
1033+
if (!g1.hasLegCounts() || !g2.hasLegCounts() ||
1034+
!o2::aod::pwgem::photonmeson::utils::pairutil::isPairPhotonClassSelected(g1.legCounts(), g2.legCounts(), mPhotonClassSelA, mPhotonClassSelB)) {
1035+
continue;
1036+
}
1037+
}
1038+
}
9721039
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
9731040
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
9741041
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,36 @@ struct Pi0EtaToGammaGammaMC {
9595
o2::framework::Configurable<float> cfgAlphaMesonB{"cfgAlphaMesonB", 1.2, "photon energy asymmetry distribution parameter B for pT dependent cut (A * tanh(B*pT))"};
9696
o2::framework::Configurable<bool> cfgGGContaCheck{"cfgGGContaCheck", false, "check gamma gamma contamination of dalitz"};
9797

98+
o2::framework::Configurable<bool> cfgDoPhotonClassPairCut{"cfgDoPhotonClassPairCut", false, "apply photon-class pair selection A x B (leg track composition, PCM-PCM only)"};
99+
100+
struct : o2::framework::ConfigurableGroup {
101+
std::string prefix = "photonclassA_group";
102+
o2::framework::Configurable<int> cfgMinNLegsITSTPC{"cfgMinNLegsITSTPC", 0, "min number of ITS-TPC legs (0-2)"};
103+
o2::framework::Configurable<int> cfgMaxNLegsITSTPC{"cfgMaxNLegsITSTPC", 2, "max number of ITS-TPC legs (0-2)"};
104+
o2::framework::Configurable<int> cfgMinNLegsITSOnly{"cfgMinNLegsITSOnly", 0, "min number of ITS-only legs (0-2)"};
105+
o2::framework::Configurable<int> cfgMaxNLegsITSOnly{"cfgMaxNLegsITSOnly", 2, "max number of ITS-only legs (0-2)"};
106+
o2::framework::Configurable<int> cfgMinNLegsTPCOnly{"cfgMinNLegsTPCOnly", 0, "min number of TPC-only legs (0-2)"};
107+
o2::framework::Configurable<int> cfgMaxNLegsTPCOnly{"cfgMaxNLegsTPCOnly", 2, "max number of TPC-only legs (0-2)"};
108+
o2::framework::Configurable<int> cfgMinNLegsTRD{"cfgMinNLegsTRD", 0, "min number of legs with TRD (0-2)"};
109+
o2::framework::Configurable<int> cfgMaxNLegsTRD{"cfgMaxNLegsTRD", 2, "max number of legs with TRD (0-2)"};
110+
o2::framework::Configurable<int> cfgMinNLegsTOF{"cfgMinNLegsTOF", 0, "min number of legs with TOF (0-2)"};
111+
o2::framework::Configurable<int> cfgMaxNLegsTOF{"cfgMaxNLegsTOF", 2, "max number of legs with TOF (0-2)"};
112+
} photonclassA;
113+
114+
struct : o2::framework::ConfigurableGroup {
115+
std::string prefix = "photonclassB_group";
116+
o2::framework::Configurable<int> cfgMinNLegsITSTPC{"cfgMinNLegsITSTPC", 0, "min number of ITS-TPC legs (0-2)"};
117+
o2::framework::Configurable<int> cfgMaxNLegsITSTPC{"cfgMaxNLegsITSTPC", 2, "max number of ITS-TPC legs (0-2)"};
118+
o2::framework::Configurable<int> cfgMinNLegsITSOnly{"cfgMinNLegsITSOnly", 0, "min number of ITS-only legs (0-2)"};
119+
o2::framework::Configurable<int> cfgMaxNLegsITSOnly{"cfgMaxNLegsITSOnly", 2, "max number of ITS-only legs (0-2)"};
120+
o2::framework::Configurable<int> cfgMinNLegsTPCOnly{"cfgMinNLegsTPCOnly", 0, "min number of TPC-only legs (0-2)"};
121+
o2::framework::Configurable<int> cfgMaxNLegsTPCOnly{"cfgMaxNLegsTPCOnly", 2, "max number of TPC-only legs (0-2)"};
122+
o2::framework::Configurable<int> cfgMinNLegsTRD{"cfgMinNLegsTRD", 0, "min number of legs with TRD (0-2)"};
123+
o2::framework::Configurable<int> cfgMaxNLegsTRD{"cfgMaxNLegsTRD", 2, "max number of legs with TRD (0-2)"};
124+
o2::framework::Configurable<int> cfgMinNLegsTOF{"cfgMinNLegsTOF", 0, "min number of legs with TOF (0-2)"};
125+
o2::framework::Configurable<int> cfgMaxNLegsTOF{"cfgMaxNLegsTOF", 2, "max number of legs with TOF (0-2)"};
126+
} photonclassB;
127+
98128
EMPhotonEventCut fEMEventCut;
99129
struct : o2::framework::ConfigurableGroup {
100130
std::string prefix = "eventcut_group";
@@ -116,6 +146,9 @@ struct Pi0EtaToGammaGammaMC {
116146
o2::framework::Configurable<bool> onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"};
117147
} eventcuts;
118148

149+
o2::aod::pwgem::photonmeson::utils::pairutil::V0PhotonClassSelection mPhotonClassSelA{};
150+
o2::aod::pwgem::photonmeson::utils::pairutil::V0PhotonClassSelection mPhotonClassSelB{};
151+
119152
V0PhotonCut fV0PhotonCut;
120153
struct : o2::framework::ConfigurableGroup {
121154
std::string prefix = "pcmcut_group";
@@ -249,6 +282,8 @@ struct Pi0EtaToGammaGammaMC {
249282
}
250283
DefineEMEventCut();
251284
DefinePCMCut();
285+
mPhotonClassSelA = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassA);
286+
mPhotonClassSelB = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassB);
252287
DefineDileptonCut();
253288
DefineEMCCut();
254289
DefinePHOSCut();
@@ -650,6 +685,14 @@ struct Pi0EtaToGammaGammaMC {
650685
auto pos2 = g2.template posTrack_as<TLegs>();
651686
auto ele2 = g2.template negTrack_as<TLegs>();
652687

688+
if (cfgDoPhotonClassPairCut.value &&
689+
!o2::aod::pwgem::photonmeson::utils::pairutil::isPairPhotonClassSelected(
690+
o2::aod::pwgem::photonmeson::utils::pairutil::getV0PhotonLegCounts(pos1, ele1),
691+
o2::aod::pwgem::photonmeson::utils::pairutil::getV0PhotonLegCounts(pos2, ele2),
692+
mPhotonClassSelA, mPhotonClassSelB)) {
693+
continue;
694+
}
695+
653696
auto pos1mc = pos1.template emmcparticle_as<TMCParticles>();
654697
auto ele1mc = ele1.template emmcparticle_as<TMCParticles>();
655698
auto pos2mc = pos2.template emmcparticle_as<TMCParticles>();

0 commit comments

Comments
 (0)