Skip to content

Conversation

@Archita-Dash
Copy link
Contributor

Hadronic Correction in the EMCAL framework is implemented to avoid the double counting of the charged particles' contribution in jets.

@github-actions github-actions bot changed the title Implementation of Hadronic Correction task [PWGJE] Implementation of Hadronic Correction task Dec 20, 2024
Archita-Dash added a commit to Archita-Dash/O2Physics that referenced this pull request Dec 20, 2024
[PWGJE] Please consider the following formatting changes to AliceO2Group#9084
@nzardosh
Copy link
Collaborator

Hi Archita, thanks for the PR. Just to understand, this would mean that for jet finding the corrected cluster energy would be used instead of the standard cluster energy? otherwise it is all the same?

@Archita-Dash
Copy link
Contributor Author

Hi Nima. yes, that's right. The jet finder needs to use the corrected energy values (we have 4 corrected energy columns- depends on what the analyser wants). everything else remains the same.

@Archita-Dash
Copy link
Contributor Author

BTW Nima, I think the more efficient way to achieve this would be somehow to set up 4 different jet-finders for each corrected energy value such that the user can use whichever jet finder they want corresponding to the desired corrected energy.

@nzardosh
Copy link
Collaborator

BTW Nima, I think the more efficient way to achieve this would be somehow to set up 4 different jet-finders for each corrected energy value such that the user can use whichever jet finder they want corresponding to the desired corrected energy.

This would be good if the user needs to run all 4 jet finders at the same time for some reason. If they would instead each only be needed independently then i would make it a configurable in the jet finder to select which is used but only have it happen once. Let me know which is best

using namespace o2::framework;
using namespace o2::framework::expressions;
using collisionEvSelIt = o2::soa::Join<o2::aod::Collisions, o2::aod::EvSels>::iterator;
using selectedClusters = o2::soa::Filtered<o2::aod::EMCALClusters>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing i would recommend here is not performing this on filtered clusters, otherwise this table would not be joinable with the original cluster table, unless exactly the same filters are used everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Archita-Dash
Copy link
Contributor Author

BTW Nima, I think the more efficient way to achieve this would be somehow to set up 4 different jet-finders for each corrected energy value such that the user can use whichever jet finder they want corresponding to the desired corrected energy.

This would be good if the user needs to run all 4 jet finders at the same time for some reason. If they would instead each only be needed independently then i would make it a configurable in the jet finder to select which is used but only have it happen once. Let me know which is best

Okay, you are right. Since each would be needed independently by the user, it makes more sense to define a configurable in the jet finder instead.

// c) If you want to do systematic studies -> perform the above two checks a) and b), and then subtract 70% energy instead of 100%

// Perform dEta/dPhi matching
double dEta = match.track_as<myTracks>().eta() - cluster.eta();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use eta on the emcal surface instead of eta at vertex


// Perform dEta/dPhi matching
double dEta = match.track_as<myTracks>().eta() - cluster.eta();
double dPhi = TVector2::Phi_mpi_pi(match.track_as<myTracks>().phi() - cluster.phi());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise this should use phi propagated to emcal surface and not at vertex

auto trackPhiLow = -funcPtDepPhi.Eval(mom);

if ((dPhi < trackPhiHigh && dPhi > trackPhiLow) && fabs(dEta) < trackEtaMax) {
if (Nmatches == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while the list is indeed sorted to contain the closest track first, for safety reasons I would explicitly check that it is the closest of the ones you looped over

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you think it go resorted? Because if she's doing a subselection of the already matched tracks if at all (which are in order of distance to the cluster). Skipping those which don't match her criteria should in principle not change the order.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a big point. I just meant that if the list would be unsorted, the Nmatches number would be wrong

EclusterAll1 = subtractClusterEnergy(EclusterAll1, totalTrkP, fHadCorralltrks1, Nmatches, UseFraction1);
}

if (UseM02SubtractionScheme2) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the M02 subtraction scheme and what is the difference bewteen one and two?

registry.fill(HIST("h2_ClsEvsEclusterAll2"), cluster.energy(), EclusterAll2);

// Fill the table with all four corrected energies
hadroniccorrectedclusters(Ecluster1, Ecluster2, EclusterAll1, EclusterAll2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does one match this table to the cluster table? What is the index? collision id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why would you want to have the collision ID or index accessed here? the main motive is to correct the cluster energies and then join them with the original cluster table. so as long as I am not looping over filtered clusters/selected clusters, I think they should be joinable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they should become not joinable if you apply cuts here that do not get applied to the other table. This is why I suggested to remove all cuts in the hadronic correction task and apply cuts later (e.g. in full jet finder)

registry.add("h_matchedtracks", "Total matched tracks; track status;entries", {HistType::kTH1F, {{1, 0.5, 1.5}}});
}

Filter clusterDefinitionSelection = (o2::aod::emcalcluster::definition == mClusterDefinition) && (o2::aod::emcalcluster::time >= minTime) && (o2::aod::emcalcluster::time <= maxTime) && (o2::aod::emcalcluster::m02 > minM02) && (o2::aod::emcalcluster::m02 < maxM02);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing any cluster cuts here? I think then the resulting table will no longer be joinable to the existing cluster table. I think this task should simply provide the values for all clusters. Cluster selection should then be done in the full jet finder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These I have defined for the cluster filter but in the main process function, I am now looping over all the EMCAL clusters and only only the selectedclusters. So, no cuts are applied anymore in this case on the clusters.

// For M02 in the single photon region, the signal is primarily: Single photons, single electrons, single MIPs
if (m02 > 0.1 && m02 < 0.4) { //circular clusters(electron/photon)
Ecorr = Ecluster; // Single electron, single MIP
} else if (m02 > 0.4) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally (I think) if M02 is bigger than 0.4 and the number of matches is >1, there should be nothing subtracted. Could you explain why you changed the logic from the function we had in Run2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well if this comment is made after comparing the present version of the code with that of the existing one in Run 2 then one also needs to recall that in Run 2 the M02 correction scheme was never correctly implemented or atleast not most likely used in analyses for the same reason I guess. Because if the value is 0.4 and then it could also be an electron in this case where if you don't subtract any energy, your correction is incorrect. That's why this has been taken care of here. But how this needs to be implemented for heavy-flavour jet analyses is something needs to be discussed and followed up later on.

Archita-Dash added a commit to Archita-Dash/O2Physics that referenced this pull request Dec 20, 2024
[PWGJE] Please consider the following formatting changes to AliceO2Group#9084
@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for e83d9c9 at 2024-12-23 16:10:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/9084-slc9_x86-64/0/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx:196:50: error: 'struct o2::soa::Table<o2::aod::Hash<519320931>, o2::aod::Hash<1837103245>, o2::aod::Hash<519320931>, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > >::TableIteratorBase<o2::soa::DefaultIndexPolicy, o2::soa::Filtered<o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > > >, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > >' has no member named 'etaEmcal'
/sw/SOURCES/O2Physics/9084-slc9_x86-64/0/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx:197:71: error: 'struct o2::soa::Table<o2::aod::Hash<519320931>, o2::aod::Hash<1837103245>, o2::aod::Hash<519320931>, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > >::TableIteratorBase<o2::soa::DefaultIndexPolicy, o2::soa::Filtered<o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > > >, o2::soa::Table<o2::aod::Hash<2994056566>, o2::aod::Hash<2753472878>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<4121608173>, o2::aod::Hash<3306343464>, o2::aod::Hash<2286545062> >, o2::soa::JoinFull<o2::aod::Hash<1837103245>, o2::soa::JoinFull<o2::aod::Hash<3324719623>, o2::soa::Table<o2::aod::Hash<599863064>, o2::aod::Hash<2944948204>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<3243953376>, o2::aod::Hash<3324719623>, o2::aod::Hash<1926198916> > >, o2::soa::JoinFull<o2::aod::Hash<1274903626>, o2::soa::Table<o2::aod::Hash<184273500>, o2::aod::Hash<1996537442>, o2::aod::Hash<2286545062> >, o2::soa::Table<o2::aod::Hash<518516411>, o2::aod::Hash<1274903626>, o2::aod::Hash<1926198916> > > >, o2::soa::Table<o2::aod::Hash<2486124941>, o2::aod::Hash<2977027599>, o2::aod::Hash<2286545062> > >' has no member named 'phiEmcal'
ninja: build stopped: subcommand failed.

Full log here.

Archita-Dash added a commit to Archita-Dash/O2Physics that referenced this pull request Dec 23, 2024
[PWGJE] Please consider the following formatting changes to AliceO2Group#9084
[PWGJE] Please consider the following formatting changes to AliceO2Group#9084
@fjonasALICE
Copy link
Collaborator

HI @Archita-Dash, just checking in with the status of this PR. Are you still working on the suggested changes or fighting with the mega linter and o2 linter? Can we help?

@Archita-Dash
Copy link
Contributor Author

Hi @fjonasALICE . Your suggested changes have been taken care of. Kindly ignore the above repeatedly triggered o2-linter and mega-linter stuffs. This was because I was making some remote changes to my task and constantly updated the master branch and since this PR was still open, it kept on triggering these checks every time.

HI @nzardosh . I would need some help here. I wanted to create another PR to push some changes to my exisitng fuljet analysis task; however yesterday when I did so, unknowingly I kind of pushed those changes in this PR as I made them from the same branch itself. Could this be accepted here? I simply added event selection to reject MB events and added some more QA histos for the JJ MC checks. If this PR gets approved then it would be fairly easily for me to go ahead with the JJ MC QA checks.

@nzardosh
Copy link
Collaborator

Hi @Archita-Dash for me its fine but i am adding a central cut on the event weight soon so you will then need to convert your task to use that

@nzardosh nzardosh self-requested a review January 22, 2025 09:05
nzardosh
nzardosh previously approved these changes Jan 22, 2025
@Archita-Dash
Copy link
Contributor Author

Hi @Archita-Dash for me its fine but i am adding a central cut on the event weight soon so you will then need to convert your task to use that

Thank you, Nima!

@Archita-Dash
Copy link
Contributor Author

@fjonasALICE this now only awaits your approval. Once done, I should be able to go ahead with JJ MC checks with more statistics on hyperloop.

@fjonasALICE fjonasALICE merged commit 2b8976b into AliceO2Group:master Jan 24, 2025
10 of 12 checks passed
smaff92 pushed a commit to smaff92/O2Physics that referenced this pull request Feb 17, 2025
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants