Skip to content

Commit 10add02

Browse files
committed
Fixes to jetCorrelationD0 task
1 parent 086e3ca commit 10add02

File tree

1 file changed

+19
-31
lines changed

1 file changed

+19
-31
lines changed

PWGJE/Tasks/jetCorrelationD0.cxx

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE",
5252
o2::soa::Index<>,
5353
d0collisionInfo::PosZ);
5454

55+
DECLARE_SOA_TABLE(MatchCollTables, "AOD", "MATCHCOLLTABLE",
56+
o2::soa::Index<>,
57+
d0collisionInfo::PosZ);
58+
5559
namespace collisionInfo
5660
{
5761
DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES");
5862
DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES");
63+
DECLARE_SOA_INDEX_COLUMN_CUSTOM(MatchCollTable, matchCollTable, "MATCHCOLLTABLES");
5964
} // namespace collisionInfo
6065
namespace d0Info
6166
{
@@ -134,21 +139,22 @@ DECLARE_SOA_TABLE_STAGED(JetMcPTables, "JETMCPTABLE",
134139

135140
DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE",
136141
o2::soa::Index<>,
137-
collisionInfo::CollisionTableId,
142+
collisionInfo::MatchCollTableId,
138143
jetInfo::JetPt,
139144
jetInfo::JetEta,
140145
jetInfo::JetPhi,
141146
jetInfo::PJetPt,
142147
jetInfo::PJetEta,
143148
jetInfo::PJetPhi,
144149
jetInfo::D0JetDeltaPhi,
145-
jetInfo::D0JetDeltaPhiP)
150+
jetInfo::D0JetDeltaPhiP);
146151

147152
} // namespace o2::aod
148153

149154
struct JetCorrelationD0 {
150155
// Define new table
151156
Produces<aod::CollisionTables> tableCollision;
157+
Produces<aod::MatchCollTables> tableMatchedCollision;
152158
Produces<aod::McCollisionTables> tableMcCollision;
153159
Produces<aod::D0DataTables> tableD0;
154160
Produces<aod::D0McPTables> tableD0McParticle;
@@ -162,6 +168,8 @@ struct JetCorrelationD0 {
162168
Configurable<bool> applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"};
163169
Configurable<float> jetPtCutMin{"jetPtCutMin", 5.0, "minimum value of jet pt"};
164170
Configurable<float> d0PtCutMin{"d0PtCutMin", 1.0, "minimum value of d0 pt"};
171+
Configurable<float> jetMcPtCutMin{"jetMcPtCutMin", 3.0, "minimum value of jet pt particle level"};
172+
Configurable<float> d0McPtCutMin{"d0McPtCutMin", 0.5, "minimum value of d0 pt particle level"};
165173
Configurable<float> vertexZCut{"vertexZCut", 10.0, "Accepted z-vertex range"};
166174
Configurable<float> pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"};
167175
Configurable<float> pTHatMaxMcD{"pTHatMaxMcD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"};
@@ -207,26 +215,6 @@ struct JetCorrelationD0 {
207215
registry.fill(HIST("hZvtxSelected"), collision.posZ());
208216
return true;
209217
}
210-
211-
template <typename T, typename U>
212-
// Jetbase is an McD jet. We then loop through jettagv(McP jets) to test if they match
213-
// void fillMatchedHistograms(T const& jetBase, float weight = 1.0) // float leadingTrackPtBase,
214-
void fillMatchedHistograms(T const& jetsBase, U const& jetsTag, float weight = 1.0, float rho = 0.0)
215-
{
216-
for (const auto& jetBase : jetsBase) {
217-
if (jetBase.has_matchedJetGeo()) { // geometric matching
218-
for (auto const& jetTag : jetBase.template matchedJetGeo_as<std::decay_t<U>>()) {
219-
registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight);
220-
registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight);
221-
registry.fill(HIST("hPhiMatched"), jetBase.phi(), jetTag.phi(), weight);
222-
registry.fill(HIST("hEtaMatched"), jetBase.eta(), jetTag.eta(), weight);
223-
registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight);
224-
registry.fill(HIST("hPhiResolution"), jetTag.pt(), jetTag.phi() - jetBase.phi(), weight);
225-
registry.fill(HIST("hEtaResolution"), jetTag.pt(), jetTag.eta() - jetBase.eta(), weight);
226-
}
227-
}
228-
}
229-
}
230218
void init(InitContext const&)
231219
{
232220
eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits(static_cast<std::string>(eventSelections));
@@ -355,7 +343,7 @@ struct JetCorrelationD0 {
355343
}
356344
}
357345
}
358-
PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged particle level jet analysis", false);
346+
PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged detector level jet analysis", false);
359347

360348
void processMcParticle(aod::JetMcCollision const& collision,
361349
aod::CandidatesD0MCP const& d0McPCandidates,
@@ -366,18 +354,18 @@ struct JetCorrelationD0 {
366354
}
367355
tableMcCollision(collision.posZ());
368356
for (const auto& d0McPCandidate : d0McPCandidates) {
369-
if (d0McPCandidate.pt() < d0PtCutMin) {
357+
if (d0McPCandidate.pt() < d0McPtCutMin) {
370358
continue;
371359
}
372-
tableD0McParticle(tableCollision.lastIndex(),
360+
tableD0McParticle(tableMcCollision.lastIndex(),
373361
d0McPCandidate.originMcGen(),
374362
d0McPCandidate.pt(),
375363
d0McPCandidate.eta(),
376364
d0McPCandidate.phi(),
377365
d0McPCandidate.y());
378366

379367
for (const auto& jet : jets) {
380-
if (jet.pt() < jetPtCutMin) {
368+
if (jet.pt() < jetMcPtCutMin) {
381369
continue;
382370
}
383371
float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi());
@@ -388,7 +376,7 @@ struct JetCorrelationD0 {
388376
continue;
389377
}
390378
fillJetHistograms(jet, dPhi);
391-
tableJetMcParticle(tableCollision.lastIndex(),
379+
tableJetMcParticle(tableMcCollision.lastIndex(),
392380
tableD0McParticle.lastIndex(),
393381
jet.pt(),
394382
jet.eta(),
@@ -397,7 +385,7 @@ struct JetCorrelationD0 {
397385
}
398386
}
399387
}
400-
PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "process MC Particle jets", false);
388+
PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "charged MC Particle jets", false);
401389

402390
void processMcMatched(soa::Filtered<aod::JetCollisions>::iterator const& collision,
403391
aod::CandidatesD0MCD const& d0Candidates,
@@ -409,7 +397,7 @@ struct JetCorrelationD0 {
409397
if (!applyCollisionSelections(collision)) {
410398
return;
411399
}
412-
tableCollision(collision.posZ());
400+
tableMatchedCollision(collision.posZ());
413401
for (const auto& d0Candidate : d0Candidates) {
414402
if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here
415403
continue;
@@ -439,7 +427,7 @@ struct JetCorrelationD0 {
439427
// if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) {
440428
// continue;
441429
// }
442-
tableJetMatched(tableCollision.lastIndex(),
430+
tableJetMatched(tableMatchedCollision.lastIndex(),
443431
McDJet.pt(),
444432
McDJet.eta(),
445433
McDJet.phi(),
@@ -453,7 +441,7 @@ struct JetCorrelationD0 {
453441
}
454442
}
455443
}
456-
PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of jets", false);
444+
PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false);
457445
};
458446

459447
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)