PWGCF: Added a Monte-Carlo process function for generated and reconstructed data#7940
Merged
victor-gonzalez merged 5 commits intoAliceO2Group:masterfrom Oct 10, 2024
Merged
PWGCF: Added a Monte-Carlo process function for generated and reconstructed data#7940victor-gonzalez merged 5 commits intoAliceO2Group:masterfrom
victor-gonzalez merged 5 commits intoAliceO2Group:masterfrom
Conversation
JStaa
added a commit
to JStaa/O2Physics
that referenced
this pull request
Oct 10, 2024
Please consider the following formatting changes to AliceO2Group#7940
…as processMCGen and processMCRec functions
Please consider the following formatting changes to AliceO2Group#7940
Comment on lines
+310
to
+325
| auto particle = track.mcParticle(); | ||
| if (particle.isPhysicalPrimary()) { | ||
|
|
||
| if (particle.pdgCode() == 211) { // Pos pions | ||
| MCRegistry.fill(HIST("hRecPionP"), particle.pt()); | ||
| } else if (particle.pdgCode() == -211) { // Neg pions | ||
| MCRegistry.fill(HIST("hRecPionN"), particle.pt()); | ||
| } else if (particle.pdgCode() == 310) { // Pos kaons | ||
| MCRegistry.fill(HIST("hRecKaonP"), particle.pt()); | ||
| } else if (particle.pdgCode() == -310) { // Neg kaons | ||
| MCRegistry.fill(HIST("hRecKaonN"), particle.pt()); | ||
| } else if (particle.pdgCode() == 2212) { // Pos protons | ||
| MCRegistry.fill(HIST("hRecProtonP"), particle.pt()); | ||
| } else if (particle.pdgCode() == -2212) { // Neg protons | ||
| MCRegistry.fill(HIST("hRecProtonN"), particle.pt()); | ||
| } |
Collaborator
There was a problem hiding this comment.
I would suggest the same processing as for data
For not replicating code, a single function with the common functionality called from both process when appropriate will do the magic
Comment on lines
+439
to
+462
| TLorentzVector Daughter, Associate; | ||
| if (TrackPID(Track)[0] == 1.0) { // Kaons | ||
| return kTRUE; | ||
| } else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 0.0 && Track.sign() == -1) { // Lambda - Pi_min | ||
| const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); | ||
| Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton); | ||
| Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged); | ||
| } else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 0.0 && Track.sign() == 1) { // Antilambda - Pi_plus | ||
| const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); | ||
| Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton); | ||
| Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged); | ||
| } else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 2.0 && Track.sign() == 1) { // Lambda - Proton | ||
| const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); | ||
| Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged); | ||
| Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton); | ||
| } else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 2.0 && Track.sign() == -1) { // Antilambda - Antiproton | ||
| const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); | ||
| Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged); | ||
| Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton); | ||
| } | ||
|
|
||
| if ((Daughter + Associate).M() >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M() <= massLambda + 4 * DGaussSigma) { | ||
| return kFALSE; | ||
| if ((Daughter + Associate).M() >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M() <= massLambda + 4 * DGaussSigma) { | ||
| return kFALSE; | ||
| } |
Collaborator
There was a problem hiding this comment.
Consider using the functionality on https://github.com/AliceO2Group/O2Physics/blob/master/Common/Core/RecoDecay.h
for extracting the invariant mass instead of using TLorentzVector. It will be much more efficient
victor-gonzalez
approved these changes
Oct 10, 2024
Collaborator
victor-gonzalez
left a comment
There was a problem hiding this comment.
I approve it for the time being but, please, have a look at my comments for the next iteration
Also, please, always prefix with PWGCF your commits in this functionality. I did it this time but the next one is on you
mfaggin
pushed a commit
to mfaggin/O2Physics
that referenced
this pull request
Oct 15, 2024
…ructed data (AliceO2Group#7940) * Added a configurable for enabling the FakeV0Filter function, as well as processMCGen and processMCRec functions * Added isPhysicalPrimary() check * Removed Counter variable and changed a comment * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
louisemillot
pushed a commit
to louisemillot/O2Physics
that referenced
this pull request
Nov 26, 2024
…ructed data (AliceO2Group#7940) * Added a configurable for enabling the FakeV0Filter function, as well as processMCGen and processMCRec functions * Added isPhysicalPrimary() check * Removed Counter variable and changed a comment * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.