Skip to content

Commit

Permalink
EventFiltering/PWGEM: reduce the number of triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat committed Jan 10, 2024
1 parent 0ad6254 commit d444ded
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 149 deletions.
126 changes: 63 additions & 63 deletions EventFiltering/PWGEM/EMPhotonFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,67 +132,67 @@ struct EMPhotonFilter {
}
} // end of single v0 photon loop

for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
if (g2.pt() < min_pt_tagging) { // this is only to increase rejection factor
continue;
}
if (g2.mass() > max_mee_pi0_dalitz) { // select only pi0 candidates
continue;
}
if (g2.mass() < slope * g2.phiv() + intercept) {
continue;
}
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

if (min_meeg_pi0 < v12.M() && v12.M() < max_meeg_pi0) {
keepEvent[kPCM_MatCalib] = true;
mHistManager.fill(HIST("hEventCounter"), 13);
break;
}

} // end of dielectron-photon pair loop

for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
if (g2.mass() > max_mee_eta_dalitz) { // select only eta candidates
continue;
}
if (g2.mass() < slope * g2.phiv() + intercept) {
continue;
}

ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

if (min_meeg_eta < v12.M() && v12.M() < max_meeg_eta) { // eta -> eeg
keepEvent[kPCM_EtaDalitz] = true;
mHistManager.fill(HIST("hEventCounter"), 14);
break;
}
} // end of dielectron-photon pair loop

for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_coll, photons1_per_coll))) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

if (min_meeg_eta < v12.M() && v12.M() < max_meeg_eta) { // eta -> gg
keepEvent[kPCM_EtaGG] = true;
mHistManager.fill(HIST("hEventCounter"), 15);
break;
}
} // end of photon-photon pair loop

for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
if (g2.mass() < slope * g2.phiv() + intercept) {
continue;
}
keepEvent[kPCM_EE] = true;
mHistManager.fill(HIST("hEventCounter"), 16);
break;
} // end of dielectron-photon pair loop
// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
// if (g2.pt() < min_pt_tagging) { // this is only to increase rejection factor
// continue;
// }
// if (g2.mass() > max_mee_pi0_dalitz) { // select only pi0 candidates
// continue;
// }
// if (g2.mass() < slope * g2.phiv() + intercept) {
// continue;
// }
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

// if (min_meeg_pi0 < v12.M() && v12.M() < max_meeg_pi0) {
// keepEvent[kPCM_MatCalib] = true;
// mHistManager.fill(HIST("hEventCounter"), 13);
// break;
// }

// } // end of dielectron-photon pair loop

// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
// if (g2.mass() > max_mee_eta_dalitz) { // select only eta candidates
// continue;
// }
// if (g2.mass() < slope * g2.phiv() + intercept) {
// continue;
// }

// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

// if (min_meeg_eta < v12.M() && v12.M() < max_meeg_eta) { // eta -> eeg
// keepEvent[kPCM_EtaDalitz] = true;
// mHistManager.fill(HIST("hEventCounter"), 14);
// break;
// }
// } // end of dielectron-photon pair loop

// for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_coll, photons1_per_coll))) {
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

// if (min_meeg_eta < v12.M() && v12.M() < max_meeg_eta) { // eta -> gg
// keepEvent[kPCM_EtaGG] = true;
// mHistManager.fill(HIST("hEventCounter"), 15);
// break;
// }
// } // end of photon-photon pair loop

// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
// if (g2.mass() < slope * g2.phiv() + intercept) {
// continue;
// }
// keepEvent[kPCM_EE] = true;
// mHistManager.fill(HIST("hEventCounter"), 16);
// break;
// } // end of dielectron-photon pair loop

} // end of PCM decision

Expand Down Expand Up @@ -264,7 +264,7 @@ struct EMPhotonFilter {
// if constexpr (static_cast<bool>(system & EM_Filter_PhotonType::kEMC)) {
// // so far, do nothing.
// }
tags(keepEvent[kPHOS_Photon], keepEvent[kPHOS_El], keepEvent[kPHOS_Pair], keepEvent[kPHOS_Nbar], keepEvent[kPCM_HighPtPhoton], keepEvent[kPCM_MatCalib], keepEvent[kPCM_EtaDalitz], keepEvent[kPCM_EtaGG], keepEvent[kPCM_EE]);
tags(keepEvent[kPHOS_Photon], keepEvent[kPHOS_Nbar], keepEvent[kPCM_HighPtPhoton]);
} // end of collision loop
}

Expand Down Expand Up @@ -297,7 +297,7 @@ struct EMPhotonFilter {
void processDummy(MyCollisions const& collisions)
{
for (int i = 0; i < collisions.size(); i++) {
tags(false, false, false, false, false, false, false, false, false);
tags(false, false, false);
}
}

Expand Down
118 changes: 59 additions & 59 deletions EventFiltering/PWGEM/EMPhotonFilterQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,65 +92,65 @@ struct EMPhotonFilterQC {
} // end of v0 photon loop
}

if (collision.hasPCMMatCalib()) {
registry.fill(HIST("hEventCounter"), 5);
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
registry.fill(HIST("hEventCounter"), 6);
}
for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
registry.fill(HIST("PCM_MBCalib/hMeePt"), g2.mass(), g2.pt());
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
registry.fill(HIST("PCM_MBCalib/hMeegPt"), v12.M(), g1.pt());
} // end of dielectron-photon pair loop
}

if (collision.hasPCMEtaDalitz()) {
registry.fill(HIST("hEventCounter"), 7);
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
registry.fill(HIST("hEventCounter"), 8);
}
for (auto& dielectron : dielectrons_coll) {
registry.fill(HIST("PCM_EtaDalitz/hMeePt"), dielectron.mass(), dielectron.pt());
}
for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
registry.fill(HIST("PCM_EtaDalitz/hMeegPt"), v12.M(), v12.Pt());
} // end of dielectron-photon pair loop
}

if (collision.hasPCMEtaGG()) {
registry.fill(HIST("hEventCounter"), 9);
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
registry.fill(HIST("hEventCounter"), 10);
}
for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(v0photons_coll, v0photons_coll))) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
registry.fill(HIST("PCM_EtaGG/hMggPt"), v12.M(), v12.Pt());
} // end of dielectron-photon pair loop
}

if (collision.hasPCMandEE()) {
registry.fill(HIST("hEventCounter"), 11);
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
registry.fill(HIST("hEventCounter"), 12);
}

for (auto& dielectron : dielectrons_coll) {
registry.fill(HIST("PCM_EE/hMeePt"), dielectron.mass(), dielectron.pt());
}
for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
registry.fill(HIST("PCM_EE/hMeegPt"), v12.M(), v12.Pt());
} // end of dielectron-photon pair loop
}
// if (collision.hasPCMMatCalib()) {
// registry.fill(HIST("hEventCounter"), 5);
// if (collision.sel8() && abs(collision.posZ()) < 10.f) {
// registry.fill(HIST("hEventCounter"), 6);
// }
// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
// registry.fill(HIST("PCM_MBCalib/hMeePt"), g2.mass(), g2.pt());
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
// registry.fill(HIST("PCM_MBCalib/hMeegPt"), v12.M(), g1.pt());
// } // end of dielectron-photon pair loop
// }

// if (collision.hasPCMEtaDalitz()) {
// registry.fill(HIST("hEventCounter"), 7);
// if (collision.sel8() && abs(collision.posZ()) < 10.f) {
// registry.fill(HIST("hEventCounter"), 8);
// }
// for (auto& dielectron : dielectrons_coll) {
// registry.fill(HIST("PCM_EtaDalitz/hMeePt"), dielectron.mass(), dielectron.pt());
// }
// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
// registry.fill(HIST("PCM_EtaDalitz/hMeegPt"), v12.M(), v12.Pt());
// } // end of dielectron-photon pair loop
// }

// if (collision.hasPCMEtaGG()) {
// registry.fill(HIST("hEventCounter"), 9);
// if (collision.sel8() && abs(collision.posZ()) < 10.f) {
// registry.fill(HIST("hEventCounter"), 10);
// }
// for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(v0photons_coll, v0photons_coll))) {
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
// registry.fill(HIST("PCM_EtaGG/hMggPt"), v12.M(), v12.Pt());
// } // end of dielectron-photon pair loop
// }

// if (collision.hasPCMandEE()) {
// registry.fill(HIST("hEventCounter"), 11);
// if (collision.sel8() && abs(collision.posZ()) < 10.f) {
// registry.fill(HIST("hEventCounter"), 12);
// }

// for (auto& dielectron : dielectrons_coll) {
// registry.fill(HIST("PCM_EE/hMeePt"), dielectron.mass(), dielectron.pt());
// }
// for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(v0photons_coll, dielectrons_coll))) {
// ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
// ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), g2.mass());
// ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
// registry.fill(HIST("PCM_EE/hMeegPt"), v12.M(), v12.Pt());
// } // end of dielectron-photon pair loop
// }

} // end of collision loop
}
Expand Down
18 changes: 9 additions & 9 deletions EventFiltering/filterTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ DECLARE_SOA_COLUMN(HighFt0cFv0Flat, hasHighFt0cFv0Flat, bool); //! isotropic eve
DECLARE_SOA_COLUMN(LeadingPtTrack, hasLeadingPtTrack, bool); //! event contains leading track

// photons
DECLARE_SOA_COLUMN(PHOSPhoton, hasPHOSPhoton, bool); //! PHOS single photons
DECLARE_SOA_COLUMN(PHOSElectron, hasPHOSElectron, bool); //! PHOS single electron
DECLARE_SOA_COLUMN(PHOSPair, hasPHOSpair, bool); //! PHOS photon pair
DECLARE_SOA_COLUMN(PHOSnbar, hasPHOSnbar, bool); //! PHOS antineutrons
DECLARE_SOA_COLUMN(PHOSPhoton, hasPHOSPhoton, bool); //! PHOS single photons
DECLARE_SOA_COLUMN(PHOSnbar, hasPHOSnbar, bool); //! PHOS antineutrons
// DECLARE_SOA_COLUMN(PHOSElectron, hasPHOSElectron, bool); //! PHOS single electron
// DECLARE_SOA_COLUMN(PHOSPair, hasPHOSpair, bool); //! PHOS photon pair
DECLARE_SOA_COLUMN(PCMHighPtPhoton, hasPCMHighPtPhoton, bool); //! PCM high pT photon
DECLARE_SOA_COLUMN(PCMMatCalib, hasPCMMatCalib, bool); //! PCM material budget calibration
DECLARE_SOA_COLUMN(PCMEtaDalitz, hasPCMEtaDalitz, bool); //! PCM eta -> ee gamma
DECLARE_SOA_COLUMN(PCMEtaGG, hasPCMEtaGG, bool); //! PCM eta -> ee gamma
DECLARE_SOA_COLUMN(PCMandEE, hasPCMandEE, bool); //! PCM and ee
// DECLARE_SOA_COLUMN(PCMMatCalib, hasPCMMatCalib, bool); //! PCM material budget calibration
// DECLARE_SOA_COLUMN(PCMEtaDalitz, hasPCMEtaDalitz, bool); //! PCM eta -> ee gamma
// DECLARE_SOA_COLUMN(PCMEtaGG, hasPCMEtaGG, bool); //! PCM eta -> ee gamma
// DECLARE_SOA_COLUMN(PCMandEE, hasPCMandEE, bool); //! PCM and ee
} // namespace filtering

namespace decision
Expand Down Expand Up @@ -196,7 +196,7 @@ using MultFilter = MultFilters::iterator;

// photons
DECLARE_SOA_TABLE(PhotonFilters, "AOD", "PhotonFilters", //!
filtering::PHOSPhoton, filtering::PHOSElectron, filtering::PHOSPair, filtering::PHOSnbar, filtering::PCMHighPtPhoton, filtering::PCMMatCalib, filtering::PCMEtaDalitz, filtering::PCMEtaGG, filtering::PCMandEE);
filtering::PHOSPhoton, filtering::PHOSnbar, filtering::PCMHighPtPhoton);

using PhotonFilter = PhotonFilters::iterator;

Expand Down
36 changes: 18 additions & 18 deletions PWGEM/Tasks/phosTrigQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,18 @@ struct phosTrigQA {
mHistManager.fill(HIST("elSpTr"), clu.e(), 6.5);
}
}
if (clu.collision_as<SelCollisions>().hasPHOSElectron()) {
mHistManager.fill(HIST("cluSpTr"), clu.e(), 7.5);
if (clu.trackdist() < 2.) { // 2: Distance to CPV cluster in sigmas
mHistManager.fill(HIST("elSpTr"), clu.e(), 7.5);
}
}
if (clu.collision_as<SelCollisions>().hasPHOSpair()) {
mHistManager.fill(HIST("cluSpTr"), clu.e(), 8.5);
if (clu.trackdist() < 2.) { // 2: Distance to CPV cluster in sigmas
mHistManager.fill(HIST("elSpTr"), clu.e(), 8.5);
}
}
// if (clu.collision_as<SelCollisions>().hasPHOSElectron()) {
// mHistManager.fill(HIST("cluSpTr"), clu.e(), 7.5);
// if (clu.trackdist() < 2.) { // 2: Distance to CPV cluster in sigmas
// mHistManager.fill(HIST("elSpTr"), clu.e(), 7.5);
// }
// }
// if (clu.collision_as<SelCollisions>().hasPHOSpair()) {
// mHistManager.fill(HIST("cluSpTr"), clu.e(), 8.5);
// if (clu.trackdist() < 2.) { // 2: Distance to CPV cluster in sigmas
// mHistManager.fill(HIST("elSpTr"), clu.e(), 8.5);
// }
// }
if (clu.collision_as<SelCollisions>().hasPHOSnbar()) {
mHistManager.fill(HIST("cluSpTr"), clu.e(), 9.5);
if (clu.trackdist() < 2.) { // 2: Distance to CPV cluster in sigmas
Expand Down Expand Up @@ -503,12 +503,12 @@ struct phosTrigQA {
if (clu1.collision_as<SelCollisions>().hasPHOSPhoton()) {
selections |= 1 << 6;
}
if (clu1.collision_as<SelCollisions>().hasPHOSElectron()) {
selections |= 1 << 7;
}
if (clu1.collision_as<SelCollisions>().hasPHOSpair()) {
selections |= 1 << 8;
}
// if (clu1.collision_as<SelCollisions>().hasPHOSElectron()) {
// selections |= 1 << 7;
// }
// if (clu1.collision_as<SelCollisions>().hasPHOSpair()) {
// selections |= 1 << 8;
// }
if (clu1.collision_as<SelCollisions>().hasPHOSnbar()) {
selections |= 1 << 9;
}
Expand Down

0 comments on commit d444ded

Please sign in to comment.