Skip to content

Commit bc634c8

Browse files
author
Mriganka Mouli Mondal
committed
included comments from Nima
1 parent b7249d4 commit bc634c8

File tree

1 file changed

+43
-28
lines changed

1 file changed

+43
-28
lines changed

PWGJE/Tasks/jetChCorr.cxx

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343

4444
#include "PWGJE/Core/JetDerivedDataUtilities.h"
4545

46-
#include "PWGLF/DataModel/LFResonanceTables.h"
46+
// #include "PWGLF/DataModel/LFResonanceTables.h"
47+
48+
#include "Framework/runDataProcessing.h"
4749

4850
using namespace std;
4951
using namespace o2;
@@ -61,13 +63,11 @@ int ch_nl = 0; // charge next to leading
6163

6264
int ch_mult = 0; // charge next to leading
6365

64-
#include "Framework/runDataProcessing.h"
65-
6666
struct JetChCorr {
67-
Produces<aod::CJetSSs> jetSubstructureDataTable;
68-
Produces<aod::CMCDJetSSs> jetSubstructureMCDTable;
69-
Produces<aod::CMCPJetSSs> jetSubstructureMCPTable;
70-
Produces<aod::CEWSJetSSs> jetSubstructureDataSubTable;
67+
// Produces<aod::CJetSSs> jetSubstructureDataTable;
68+
// Produces<aod::CMCDJetSSs> jetSubstructureMCDTable;
69+
// Produces<aod::CMCPJetSSs> jetSubstructureMCPTable;
70+
// Produces<aod::CEWSJetSSs> jetSubstructureDataSubTable;
7171

7272
Configurable<float> zCut{"zCut", 0.05, "soft drop z cut"};
7373
Configurable<float> beta{"beta", 0.1, "soft drop beta"};
@@ -163,8 +163,10 @@ struct JetChCorr {
163163
}
164164

165165
// template <typename JetTable, typename JetTableMCP, typename SubstructureTable>
166-
template <bool isMCP, bool isSubtracted, typename T, typename U>
167-
void jetReclustering(T const& jet, U& outputTable)
166+
// template <bool isMCP, bool isSubtracted, typename T, typename U>
167+
// void jetReclustering(T const& jet, U& outputTable)
168+
template <bool isMCP, bool isSubtracted, typename T>
169+
void jetReclustering(T const& jet)
168170
{
169171
jetReclustered.clear();
170172
fastjet::ClusterSequenceArea clusterSeq(jetReclusterer.findJets(jetConstituents, jetReclustered));
@@ -191,19 +193,20 @@ struct JetChCorr {
191193
vector<fastjet::PseudoJet> constituents1 = parentSubJet1.constituents();
192194
vector<fastjet::PseudoJet> constituents2 = parentSubJet2.constituents();
193195
// cout<<"in subJET1 ********************************************* "<<endl;
194-
int found1 = 0;
195-
int found2 = 0;
196+
bool found1 = false;
197+
bool found2 = false;
198+
196199
for (unsigned int j = 0; j < constituents1.size(); j++) {
197200
// cout<<constituents1[j].user_index()-1<<", ";
198201
if ((n_trackL == (constituents1[j].user_index() - 1)) || (trackL == (constituents1[j].user_index() - 1)))
199-
found1++;
202+
found1 = true;
200203
}
201204
// cout<<endl;
202205
// cout<<"in subJET2 ********************************************* "<<endl;
203206
for (unsigned int j = 0; j < constituents2.size(); j++) {
204207
// cout<<constituents2[j].user_index()-1<<", ";
205208
if ((n_trackL == constituents2[j].user_index() - 1) || (trackL == constituents2[j].user_index() - 1))
206-
found2++;
209+
found2 = true;
207210
}
208211
// cout<<endl;
209212

@@ -215,7 +218,7 @@ struct JetChCorr {
215218
thetaVec.push_back(theta);
216219

217220
if (z >= zCut * TMath::Power(theta / (jet.r() / 100.f), beta)) {
218-
if (found1 > 0 && found2 > 0) { // found leading and next-to-leading in seperate prongs
221+
if (found1 == true && found2 == true) { // found leading and next-to-leading in seperate prongs
219222
if (!softDropped) {
220223
zg = z;
221224
rg = theta;
@@ -233,8 +236,6 @@ struct JetChCorr {
233236
}
234237
softDropped = true;
235238

236-
softDropped = true;
237-
238239
v1.SetXYZ(parentSubJet1.px(), parentSubJet1.py(), parentSubJet1.pz());
239240
v2.SetXYZ(parentSubJet2.px(), parentSubJet2.py(), parentSubJet2.pz());
240241

@@ -313,6 +314,7 @@ struct JetChCorr {
313314
}
314315
}
315316
}
317+
break;
316318
}
317319
nsd++;
318320
}
@@ -330,15 +332,24 @@ struct JetChCorr {
330332
// outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec);
331333
}
332334

333-
template <bool isSubtracted, typename T, typename U, typename V>
334-
void analyseCharged(T const& jet, U const& tracks, V& outputTable)
335+
// template <bool isSubtracted, typename T, typename U, typename V>
336+
// void analyseCharged(T const& jet, U const& tracks, V& outputTable)
337+
template <bool isSubtracted, typename T, typename U>
338+
void analyseCharged(T const& jet, U const& tracks)
335339
{
336340
jetConstituents.clear();
337341

338-
// int leadpt =0;
339-
// int n_leadpt =0;
340342
int nn = 0;
341-
ch_mult = 0; // jet.size();
343+
int iord[50];
344+
float ptc[50];
345+
for (auto& jetConstituent : jet.template tracks_as<aod::JTracks>()) {
346+
TVector3 p_leading(jetConstituent.px(), jetConstituent.py(), jetConstituent.pz());
347+
ptc[nn] = p_leading.Perp();
348+
nn++;
349+
}
350+
TMath::Sort(nn, ptc, iord);
351+
352+
nn = 0;
342353
ch_mult = jet.tracksIds().size();
343354
// for (auto& jetConstituent : jet.template tracks_as<U>()) {
344355
for (auto& jetConstituent : jet.template tracks_as<aod::JTracks>()) {
@@ -349,15 +360,15 @@ struct JetChCorr {
349360

350361
TVector3 p_leading(jetConstituent.px(), jetConstituent.py(), jetConstituent.pz());
351362

352-
if (nn == 0) {
363+
if (iord[nn] == 0) {
353364
// leadpt = p_leading.Perp();
354365
trackL = jetConstituent.globalIndex();
355366
// ch_l = trackSel.sign();
356367
ch_l = jetConstituent.sign(); // signed1Pt();//pt();
357368
v1.SetXYZ(jetConstituent.pt(), jetConstituent.py(), jetConstituent.pz());
358369
}
359370

360-
if (nn == 1) {
371+
if (iord[nn] == 1) {
361372
// n_leadpt = p_leading.Perp();
362373
n_trackL = jetConstituent.globalIndex();
363374
ch_nl = jetConstituent.sign(); // signed1Pt();//pt();
@@ -389,7 +400,7 @@ struct JetChCorr {
389400
nn++;
390401
}
391402
if (nn > 1)
392-
jetReclustering<false, isSubtracted>(jet, outputTable);
403+
jetReclustering<false, isSubtracted>(jet);
393404
}
394405

395406
void processDummy(JetTracks const& tracks)
@@ -401,21 +412,24 @@ struct JetChCorr {
401412
// void processChargedJetsData(soa::Join<aod::ChargedJets, aod::ChargedJetConstituents>::iterator const& jet, soa::Join<aod::JTracks, aod::JTrackPIs> const& tracks)
402413
{
403414
// cout<<"I am in CHarged Jet Data"<<endl;
404-
analyseCharged<false>(jet, tracks, jetSubstructureDataTable);
415+
// analyseCharged<false>(jet, tracks, jetSubstructureDataTable);
416+
analyseCharged<false>(jet, tracks);
405417
}
406418
PROCESS_SWITCH(JetChCorr, processChargedJetsData, "charged jet substructure", false);
407419

408420
void processChargedJetsEventWiseSubData(soa::Join<aod::ChargedEventWiseSubtractedJets, aod::ChargedEventWiseSubtractedJetConstituents>::iterator const& jet,
409421
JetTracksSub const& tracks)
410422
{
411-
analyseCharged<true>(jet, tracks, jetSubstructureDataSubTable);
423+
// analyseCharged<true>(jet, tracks, jetSubstructureDataSubTable);
424+
analyseCharged<true>(jet, tracks);
412425
}
413426
PROCESS_SWITCH(JetChCorr, processChargedJetsEventWiseSubData, "eventwise-constituent subtracted charged jet substructure", false);
414427

415428
void processChargedJetsMCD(typename soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>::iterator const& jet,
416429
JetTracks const& tracks)
417430
{
418-
analyseCharged<false>(jet, tracks, jetSubstructureMCDTable);
431+
// analyseCharged<false>(jet, tracks, jetSubstructureMCDTable);
432+
analyseCharged<false>(jet, tracks);
419433
}
420434
PROCESS_SWITCH(JetChCorr, processChargedJetsMCD, "charged jet substructure", false);
421435

@@ -426,7 +440,8 @@ struct JetChCorr {
426440
for (auto& jetConstituent : jet.template tracks_as<JetParticles>()) {
427441
fastjetutilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex(), static_cast<int>(JetConstituentStatus::track), pdg->Mass(jetConstituent.pdgCode()));
428442
}
429-
jetReclustering<true, false>(jet, jetSubstructureMCPTable);
443+
// jetReclustering<true, false>(jet, jetSubstructureMCPTable);
444+
jetReclustering<true, false>(jet);
430445
}
431446
PROCESS_SWITCH(JetChCorr, processChargedJetsMCP, "charged jet substructure on MC particle level", false);
432447
};

0 commit comments

Comments
 (0)