Skip to content

Commit 271ebea

Browse files
authored
[PWGHF] added a function to isolation e (#8786)
1 parent 7826dc6 commit 271ebea

File tree

1 file changed

+56
-10
lines changed

1 file changed

+56
-10
lines changed

PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ struct HfTaskElectronWeakBoson {
3939

4040
// configurable parameters
4141
Configurable<int> nBinsPt{"nBinsPt", 100, "N bins in pt registry"};
42-
Configurable<float> BinPtmax{"BinPtmax", 100.0, "maximum pt registry"};
42+
Configurable<float> binPtmax{"binPtmax", 100.0, "maximum pt registry"};
4343
Configurable<int> nBinsE{"nBinsE", 100, "N bins in E registry"};
44-
Configurable<float> BinEmax{"BinEmax", 100.0, "maximum E registry"};
44+
Configurable<float> binEmax{"binEmax", 100.0, "maximum E registry"};
4545

4646
Configurable<float> vtxZ{"vtxZ", 10.f, ""};
4747

@@ -64,7 +64,10 @@ struct HfTaskElectronWeakBoson {
6464
Configurable<float> timeEmcMax{"timeEmcMax", +20., "Maximum EMCcluster timing"};
6565
Configurable<float> m02Min{"m02Min", 0.1, "Minimum M02"};
6666
Configurable<float> m02Max{"m02Max", 0.9, "Maximum M02"};
67-
Configurable<float> rMatchMax{"rMatchMax", 0.1, "cluster - track matching cut"};
67+
Configurable<float> rMatchMax{"rMatchMax", 0.05, "cluster - track matching cut"};
68+
69+
Configurable<float> rIsolation{"rIsolation", 0.3, "cone radius for isolation cut"};
70+
Configurable<float> energyIsolationMax{"energyIsolationMax", 0.1, "isolation cut on energy"};
6871

6972
using SelectedClusters = o2::aod::EMCALClusters;
7073
// PbPb
@@ -79,7 +82,7 @@ struct HfTaskElectronWeakBoson {
7982

8083
Filter etafilter = (aod::track::eta < etaTrUp) && (aod::track::eta > etaTrLow);
8184
Filter dcaxyfilter = (nabs(aod::track::dcaXY) < dcaxyMax);
82-
Filter filter_globalTr = requireGlobalTrackInFilter();
85+
Filter filterGlobalTr = requireGlobalTrackInFilter();
8386

8487
Filter clusterDefinitionSelection = (o2::aod::emcalcluster::definition == clusterDefinition) && (o2::aod::emcalcluster::time >= timeEmcMin) && (o2::aod::emcalcluster::time <= timeEmcMax) && (o2::aod::emcalcluster::m02 > m02Min) && (o2::aod::emcalcluster::m02 < m02Max);
8588

@@ -98,9 +101,9 @@ struct HfTaskElectronWeakBoson {
98101
const AxisSpec axisZvtx{400, -20, 20, "Zvtx"};
99102
const AxisSpec axisCounter{1, 0, 1, "events"};
100103
const AxisSpec axisEta{200, -1.0, 1.0, "#eta"};
101-
const AxisSpec axisPt{nBinsPt, 0, BinPtmax, "p_{T}"};
104+
const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"};
102105
const AxisSpec axisNsigma{100, -5, 5, "N#sigma"};
103-
const AxisSpec axisE{nBinsE, 0, BinEmax, "Energy"};
106+
const AxisSpec axisE{nBinsE, 0, binEmax, "Energy"};
104107
const AxisSpec axisM02{100, 0, 1, "M02"};
105108
const AxisSpec axisdPhi{200, -1, 1, "dPhi"};
106109
const AxisSpec axisdEta{200, -1, 1, "dEta"};
@@ -110,6 +113,7 @@ struct HfTaskElectronWeakBoson {
110113
const AxisSpec axisCluster{100, 0.0, 200.0, "counts"};
111114
const AxisSpec axisITSNCls{20, 0.0, 20, "counts"};
112115
const AxisSpec axisEMCtime{200, -100.0, 100, "EMC time"};
116+
const AxisSpec axisIsoEnergy{100, 0, 1, "Isolation energy(GeV/C)"};
113117

114118
// create registrygrams
115119
registry.add("hZvtx", "Z vertex", kTH1F, {axisZvtx});
@@ -130,12 +134,47 @@ struct HfTaskElectronWeakBoson {
130134
registry.add("hMatchPhi", "Match in Phi", kTH2F, {{axisPhi}, {axisPhi}});
131135
registry.add("hMatchEta", "Match in Eta", kTH2F, {{axisEta}, {axisEta}});
132136
registry.add("hEop", "energy momentum match", kTH2F, {{axisPt}, {axisEop}});
137+
registry.add("hEopIsolation", "energy momentum match after isolation", kTH2F, {{axisPt}, {axisEop}});
133138
registry.add("hEopNsigTPC", "Eop vs. Nsigma", kTH2F, {{axisNsigma}, {axisEop}});
134139
registry.add("hEMCtime", "EMC timing", kTH1F, {axisEMCtime});
140+
registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}});
141+
}
142+
bool isIsolatedCluster(const o2::aod::EMCALCluster& cluster,
143+
const SelectedClusters& clusters)
144+
{
145+
float energySum = 0.0;
146+
float isoEnergy = 10.0;
147+
float etaAssCluster = cluster.eta();
148+
float phiAssCluster = cluster.phi();
149+
150+
for (const auto& associateCluster : clusters) {
151+
// Calculate angular distances
152+
double dEta = associateCluster.eta() - etaAssCluster;
153+
double dPhi = associateCluster.phi() - phiAssCluster;
154+
155+
// Normalize φ difference
156+
dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI);
157+
158+
// Calculate ΔR
159+
double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi);
160+
161+
// Sum energy within isolation cone
162+
if (deltaR < rIsolation) {
163+
energySum += associateCluster.energy();
164+
}
165+
}
166+
167+
if (energySum > 0) {
168+
isoEnergy = energySum / cluster.energy() - 1.0;
169+
}
170+
171+
registry.fill(HIST("hIsolationEnergy"), cluster.energy(), isoEnergy);
172+
173+
return (isoEnergy < energyIsolationMax);
135174
}
136175

137176
void process(soa::Filtered<aod::Collisions>::iterator const& collision,
138-
SelectedClusters const&,
177+
SelectedClusters const& emcClusters,
139178
TrackEle const& tracks,
140179
o2::aod::EMCALMatchedTracks const& matchedtracks)
141180
{
@@ -210,8 +249,8 @@ struct HfTaskElectronWeakBoson {
210249
double dPhi = match.track_as<TrackEle>().trackPhiEmcal() - phiEmc;
211250
dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI);
212251

213-
registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as<TrackEle>().phi());
214-
registry.fill(HIST("hMatchEta"), etaEmc, match.track_as<TrackEle>().eta());
252+
registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as<TrackEle>().trackPhiEmcal());
253+
registry.fill(HIST("hMatchEta"), etaEmc, match.track_as<TrackEle>().trackEtaEmcal());
215254

216255
double r = RecoDecay::sqrtSumOfSquares(dPhi, dEta);
217256
if (r < rMin) {
@@ -223,16 +262,23 @@ struct HfTaskElectronWeakBoson {
223262
registry.fill(HIST("hEMCtime"), timeEmc);
224263
registry.fill(HIST("hEnergy"), energyEmc);
225264

226-
if (r < rMatchMax)
265+
if (r > rMatchMax)
227266
continue;
228267

268+
const auto& cluster = match.emcalcluster_as<SelectedClusters>();
269+
bool isIsolated = isIsolatedCluster(cluster, emcClusters);
270+
229271
double eop = energyEmc / match.track_as<TrackEle>().p();
230272
// LOG(info) << "E/p" << eop;
231273
registry.fill(HIST("hEopNsigTPC"), match.track_as<TrackEle>().tpcNSigmaEl(), eop);
232274
registry.fill(HIST("hM02"), match.track_as<TrackEle>().tpcNSigmaEl(), m02Emc);
233275
registry.fill(HIST("hM20"), match.track_as<TrackEle>().tpcNSigmaEl(), m20Emc);
234276
if (match.track_as<TrackEle>().tpcNSigmaEl() > nsigTpcMin && match.track_as<TrackEle>().tpcNSigmaEl() < nsigTpcMax) {
235277
registry.fill(HIST("hEop"), match.track_as<TrackEle>().pt(), eop);
278+
279+
if (isIsolated) {
280+
registry.fill(HIST("hEopIsolation"), match.track_as<TrackEle>().pt(), eop);
281+
}
236282
}
237283
}
238284

0 commit comments

Comments
 (0)