[PWGJE] Adding file jetHadronsPID.cxx and it's workflow#16012
[PWGJE] Adding file jetHadronsPID.cxx and it's workflow#16012llorenc-11 wants to merge 15 commits into
Conversation
|
O2 linter results: ❌ 3 errors, |
|
@MyFavoriteGitHub your username does not really identify you well in the collaboration. |
| #include "Framework/AnalysisTask.h" | ||
| #include "Framework/HistogramRegistry.h" | ||
| #include "Framework/Logger.h" | ||
| #include "Framework/runDataProcessing.h" | ||
| #include "ReconstructionDataFormats/DCA.h" | ||
| #include "ReconstructionDataFormats/PID.h" | ||
| #include "ReconstructionDataFormats/Track.h" |
| double px2 = px * px, py2 = py * py, pz2 = pz * pz; | ||
| double pz4 = pz2 * pz2; | ||
|
|
||
| if (px == 0 && py == 0) { |
There was a problem hiding this comment.
You should not compare double to 0.
| registryData.add("mc_sec_proton_pt", "Reconstructed Proton Secondaries", HistType::kTH1F, {{120, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}}); | ||
| } | ||
|
|
||
| void getPerpendicularDirections(const TVector3& p, TVector3& u1, TVector3& u2) |
There was a problem hiding this comment.
Please put some documentation concerning the purpose of this function and the math involved.
| u2.SetXYZ(u2x, (-pz2 - px * u2x) / py, pz); | ||
| } | ||
|
|
||
| double getDeltaPhi(double a1, double a2) |
There was a problem hiding this comment.
Don't reinvent the wheel. Use RecoDecay::constrainAngle.
| } | ||
|
|
||
| template <typename TrackIts> | ||
| bool hasITSHit(const TrackIts& track, int layer) |
| bool hasITSHit(const TrackIts& track, int layer) | ||
| { | ||
| int ibit = layer - 1; | ||
| return (track.itsClusterMap() & (1 << ibit)); |
There was a problem hiding this comment.
This is not a bool expression.
| } | ||
|
|
||
| template <typename JetTrack> | ||
| bool passedTrackSelectionForJetReconstruction(const JetTrack& track) |
There was a problem hiding this comment.
Why don't you use the central track selection?
| bool passTpcPi = (std::abs(track.tpcNSigmaPi()) <= 3.0); | ||
| bool passTofPi = track.hasTOF() && (std::abs(track.tofNSigmaPi()) <= 3.0); | ||
|
|
||
| bool passTpcKa = (std::abs(track.tpcNSigmaKa()) <= 3.0); | ||
| bool passTofKa = track.hasTOF() && (std::abs(track.tofNSigmaKa()) <= 3.0); | ||
|
|
||
| bool passTpcPr = (std::abs(track.tpcNSigmaPr()) <= 3.0); | ||
| bool passTofPr = track.hasTOF() && (std::abs(track.tofNSigmaPr()) <= 3.0); |
There was a problem hiding this comment.
Avoid hard-coded and duplicated constants.
| /// \author Małgorzata Janik malgorzata.janik@cern.ch | ||
| /// \author Daniela Ruggiano daniela.ruggiano@cern.ch | ||
|
|
||
| #include "PWGJE/Core/JetBkgSubUtils.h" |
| continue; | ||
|
|
||
| fastjet::PseudoJet fourMomentum(track.px(), track.py(), track.pz(), track.energy(MassPionCharged)); | ||
| fourMomentum.set_user_index(id); |
There was a problem hiding this comment.
this is probably fine but is it the same as using globalIndex()? Probably globalIndex is safer in case at some point you accidentally add a cut before idx++
| continue; | ||
|
|
||
| double normalizedJetArea = jet.area() / (PI * rJet * rJet); | ||
| if (applyAreaCut && (!isppRefAnalysis) && normalizedJetArea > maxNormalizedJetArea) |
There was a problem hiding this comment.
you apply a maximum cut instead of minimum?
| if (fjParticles.empty()) | ||
| return; | ||
|
|
||
| fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet); |
There was a problem hiding this comment.
why do you not use the common jet finder?
| static constexpr double DcaxyMaxTrackPar0 = 0.0105; | ||
| static constexpr double DcaxyMaxTrackPar1 = 0.035; | ||
| static constexpr double DcaxyMaxTrackPar2 = 1.1; | ||
| static constexpr double DcazMaxTrack = 2.0; |
There was a problem hiding this comment.
the dca cuts for kets and PID are very different, is this safe?
| if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) | ||
| return; | ||
|
|
||
| for (auto const& mcpart : mcParticles) { |
There was a problem hiding this comment.
this loops over every mc particle in the dataframe, not just the ones associated to the mcCollision matched to that particular collision
| continue; | ||
|
|
||
| double deltaEtaUe1 = track.eta() - ueAxis1.Eta(); | ||
| double deltaPhiUe1 = std::abs(RecoDecay::constrainAngle(track.phi() - ueAxis1.Phi())); |
There was a problem hiding this comment.
This gives you angle in the range [0, 2 pi).
| continue; | ||
|
|
||
| double deltaEtaUe1 = track.eta() - ueAxis1.Eta(); | ||
| double deltaPhiUe1 = std::abs(RecoDecay::constrainAngle(track.phi() - ueAxis1.Phi())); |
The reason for this pull request is to create a new analysis of PID in jets as a student's team with the collaboration of Warsaw University of Technology Physics department .
This is the first pull request from this account, I hope all the technical requirements are met.
If you have any questions, please contact me on leonard.lorenc@cern.ch