Skip to content

Commit 7c764e5

Browse files
nstrangmNicolas Strangmann
andauthored
[PWGJE/EMCal,PWGEM/PhotonMeson] Add true pi0 from same gamma histogram and opening angle cut (#9815)
Co-authored-by: Nicolas Strangmann <nicolas.strangmann@.cern.ch>
1 parent 94f9a63 commit 7c764e5

File tree

5 files changed

+99
-1
lines changed

5 files changed

+99
-1
lines changed

PWGEM/Dilepton/Utils/MCUtilities.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ int FindCommonMotherFrom3Prongs(TMCParticle1 const& p1, TMCParticle2 const& p2,
222222
}
223223
//_______________________________________________________________________
224224
template <typename TMCParticle, typename TMCParticles>
225+
int getMotherPDGCode(TMCParticle const& p, TMCParticles const& mcparticles)
226+
{
227+
int motherid = p.mothersIds()[0];
228+
auto mother = mcparticles.iteratorAt(motherid);
229+
return (mother.pdgCode());
230+
}
231+
//_______________________________________________________________________
232+
template <typename TMCParticle, typename TMCParticles>
225233
int IsFromBeauty(TMCParticle const& p, TMCParticles const& mcparticles)
226234
{
227235
if (!p.has_mothers()) {

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,13 @@ struct Pi0EtaToGammaGamma {
639639
continue;
640640
}
641641

642+
if (pairtype == PairType::kEMCEMC) {
643+
float openingAngle = std::acos(v1.Vect().Dot(v2.Vect()) / (v1.P() * v2.P()));
644+
if (openingAngle < emccuts.minOpenAngle) {
645+
continue;
646+
}
647+
}
648+
642649
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), collision.weight());
643650

644651
if constexpr (pairtype == PairType::kEMCEMC) {

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ struct Pi0EtaToGammaGammaMC {
500500
pi0id = FindCommonMotherFrom2Prongs(g1mc, g2mc, 22, 22, 111, mcparticles);
501501
etaid = FindCommonMotherFrom2Prongs(g1mc, g2mc, 22, 22, 221, mcparticles);
502502

503-
if (pi0id < 0 && etaid < 0) {
503+
if (g1mc.globalIndex() != g2mc.globalIndex() && pi0id < 0 && etaid < 0) { // for same gamma no pi0/eta will be found, but we still want to fill the FromSameGamma hist
504504
continue;
505505
}
506506

@@ -511,6 +511,21 @@ struct Pi0EtaToGammaGammaMC {
511511
continue;
512512
}
513513

514+
if (pairtype == PairType::kEMCEMC) {
515+
float openingAngle = std::acos(v1.Vect().Dot(v2.Vect()) / (v1.P() * v2.P()));
516+
if (openingAngle < emccuts.minOpenAngle) {
517+
continue;
518+
}
519+
}
520+
521+
if (g1mc.globalIndex() == g2mc.globalIndex()) {
522+
if (getMotherPDGCode(g1mc, mcparticles) == 111)
523+
fRegistry.fill(HIST("Pair/Pi0/hs_FromSameGamma"), v12.M(), v12.Pt(), collision.weight());
524+
else if (getMotherPDGCode(g1mc, mcparticles) == 221)
525+
fRegistry.fill(HIST("Pair/Eta/hs_FromSameGamma"), v12.M(), v12.Pt(), collision.weight());
526+
continue;
527+
}
528+
514529
if (pi0id > 0) {
515530
auto pi0mc = mcparticles.iteratorAt(pi0id);
516531
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());

PWGEM/PhotonMeson/Utils/NMHistograms.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ void addNMHistograms(HistogramRegistry* fRegistry, bool isMC, const char* pairna
4848
fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", kTHnSparseD, {axis_mass, axis_pt}, true);
4949
fRegistry->add("Pair/Pi0/hs_FromWD", "rec. true pi0 from weak decay", kTHnSparseD, {axis_mass, axis_pt}, true);
5050
fRegistry->add("Pair/Pi0/hs_FromHS", "rec. true pi0 from hadronic shower in material", kTHnSparseD, {axis_mass, axis_pt}, true);
51+
fRegistry->add("Pair/Pi0/hs_FromSameGamma", "Two clusters from same gamma that is a pi0 daughter (conversion)", kTHnSparseD, {axis_mass, axis_pt}, true);
52+
fRegistry->add("Pair/Eta/hs_FromSameGamma", "Two clusters from same gamma that is a eta daughter (conversion)", kTHnSparseD, {axis_mass, axis_pt}, true);
5153
fRegistry->add("Pair/Eta/hs_Primary", "rec. true eta", kTHnSparseD, {axis_mass, axis_pt}, true);
5254

5355
const AxisSpec axis_rapidity{{0.0, +0.8, +0.9}, "rapidity |y|"};

PWGJE/Tasks/emcalGammaGammaBcWise.cxx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Framework/AnalysisTask.h"
2626
#include "Framework/HistogramRegistry.h"
2727
#include "Common/DataModel/EventSelection.h"
28+
#include "EMCALBase/Geometry.h"
2829
#include "PWGJE/DataModel/EMCALClusters.h"
2930

3031
using namespace o2;
@@ -49,6 +50,59 @@ struct Photon { // Struct to store photons (unique and ambiguous clusters that p
4950
float px, py, pz, pt;
5051
};
5152

53+
/// \brief returns if cluster is too close to edge of EMCal (using rotation background method only for EMCal!)
54+
bool IsTooCloseToEdge(const int cellID, const int DistanceToBorder = 1, emcal::Geometry* emcalGeom = nullptr)
55+
{
56+
if (DistanceToBorder <= 0) {
57+
return false;
58+
}
59+
if (cellID < 0) {
60+
return true;
61+
}
62+
63+
int iBadCell = -1;
64+
65+
// check distance to border in case the cell is okay
66+
auto [iSupMod, iMod, iPhi, iEta] = emcalGeom->GetCellIndex(cellID);
67+
auto [irow, icol] = emcalGeom->GetCellPhiEtaIndexInSModule(iSupMod, iMod, iPhi, iEta);
68+
69+
// Check rows/phi
70+
int iRowLast = 24;
71+
if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_HALF) {
72+
iRowLast /= 2; // 2/3 sm case
73+
} else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_THIRD) {
74+
iRowLast /= 3; // 1/3 sm case
75+
} else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::DCAL_EXT) {
76+
iRowLast /= 3; // 1/3 sm case
77+
}
78+
79+
if (irow < DistanceToBorder || (iRowLast - irow) <= DistanceToBorder) {
80+
iBadCell = 1;
81+
}
82+
83+
if (iBadCell > 0) {
84+
return true;
85+
}
86+
return false;
87+
}
88+
89+
bool isPhotonAccepted(Photon const& p, emcal::Geometry* emcalGeom = nullptr)
90+
{
91+
int cellID = 0;
92+
try {
93+
cellID = emcalGeom->GetAbsCellIdFromEtaPhi(p.eta, p.phi);
94+
if (IsTooCloseToEdge(cellID, 1, emcalGeom))
95+
cellID = -1;
96+
} catch (o2::emcal::InvalidPositionException& e) {
97+
cellID = -1;
98+
}
99+
100+
if (cellID == -1)
101+
return false;
102+
103+
return true;
104+
}
105+
52106
struct Meson {
53107
Meson(Photon p1, Photon p2) : p1(p1), p2(p2)
54108
{
@@ -65,20 +119,26 @@ struct Meson {
65119
struct EmcalGammaGammaBcWise {
66120
HistogramRegistry mHistManager{"EmcalGammaGammaBcWiseHistograms"};
67121

122+
Configurable<int> cfgClusterDefinition{"cfgClusterDefinition", 13, "Clusterizer to be selected, e.g. 13 for kV3MostSplitLowSeed"};
68123
Configurable<float> cfgMinClusterEnergy{"cfgMinClusterEnergy", 0.7, "Minimum energy of selected clusters (GeV)"};
69124
Configurable<float> cfgMinM02{"cfgMinM02", 0.1, "Minimum M02 of selected clusters"};
70125
Configurable<float> cfgMaxM02{"cfgMaxM02", 0.7, "Maximum M02 of selected clusters"};
71126
Configurable<float> cfgMinTime{"cfgMinTime", -15, "Minimum time of selected clusters (ns)"};
72127
Configurable<float> cfgMaxTime{"cfgMaxTime", 15, "Maximum time of selected clusters (ns)"};
128+
Configurable<float> cfgMinOpenAngle{"cfgMinOpenAngle", 0.0202, "Minimum opening angle between photons"};
73129

130+
Filter clusterDefinitionFilter = aod::emcalcluster::definition == cfgClusterDefinition;
74131
Filter energyFilter = aod::emcalcluster::energy > cfgMinClusterEnergy;
75132
Filter m02Filter = (aod::emcalcluster::nCells == 1 || (aod::emcalcluster::m02 > cfgMinM02 && aod::emcalcluster::m02 < cfgMaxM02));
76133
Filter timeFilter = (aod::emcalcluster::time > cfgMinTime && aod::emcalcluster::time < cfgMaxTime);
77134

78135
std::vector<Photon> mPhotons;
79136

137+
emcal::Geometry* emcalGeom;
138+
80139
void init(InitContext const&)
81140
{
141+
emcalGeom = emcal::Geometry::GetInstanceFromRunNumber(300000);
82142
mHistManager.add("nBCs", "Number of BCs (with (k)TVX);#bf{TVX triggered};#bf{#it{N}_{BCs}}", HistType::kTH1F, {{3, -0.5, 2.5}});
83143

84144
mHistManager.add("nCollisionsVsClusters", "Number of collisions vs number of clusters;N_{Collisions};N_{Clusters}", HistType::kTH2F, {{4, -0.5, 3.5}, {21, -0.5, 20.5}});
@@ -149,6 +209,8 @@ struct EmcalGammaGammaBcWise {
149209
for (unsigned int ig1 = 0; ig1 < mPhotons.size(); ++ig1) {
150210
for (unsigned int ig2 = ig1 + 1; ig2 < mPhotons.size(); ++ig2) {
151211
// build meson from photons
212+
if (mPhotons[ig1].photon.Angle(mPhotons[ig2].photon.Vect()) < cfgMinOpenAngle)
213+
continue;
152214
Meson meson(mPhotons[ig1], mPhotons[ig2]);
153215
mHistManager.fill(HIST("invMassVsPt"), meson.m(), meson.pT());
154216

@@ -171,6 +233,10 @@ struct EmcalGammaGammaBcWise {
171233
TLorentzVector lvRotationPhoton(mPhotons[ig].px, mPhotons[ig].py, mPhotons[ig].pz, mPhotons[ig].e);
172234
lvRotationPhoton.Rotate(constants::math::PIHalf, lvRotationPion);
173235
Photon rotPhoton(lvRotationPhoton.Eta(), lvRotationPhoton.Phi(), lvRotationPhoton.E());
236+
if (!isPhotonAccepted(rotPhoton, emcalGeom))
237+
continue;
238+
if (rotPhoton.photon.Angle(mPhotons[ig3].photon.Vect()) < cfgMinOpenAngle)
239+
continue;
174240
Meson mesonRotated(rotPhoton, mPhotons[ig3]);
175241
mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated.m(), mesonRotated.pT());
176242
}

0 commit comments

Comments
 (0)