Skip to content

Commit f1cffe2

Browse files
authored
[PWGJE] Making hadronic corrections a part of the JE derived data and adding … (#9671)
1 parent 51ce500 commit f1cffe2

15 files changed

+353
-297
lines changed

PWGJE/Core/FastJetUtilities.h

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,27 @@ void fillTracks(const T& constituent, std::vector<fastjet::PseudoJet>& constitue
103103
*/
104104

105105
template <typename T>
106-
void fillClusters(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = -99999999, int status = static_cast<int>(JetConstituentStatus::cluster))
106+
void fillClusters(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = -99999999, int hadronicCorrectionType = 0, int status = static_cast<int>(JetConstituentStatus::cluster))
107107
{
108108
if (status == static_cast<int>(JetConstituentStatus::cluster)) {
109-
double clusterpt = constituent.energy() / std::cosh(constituent.eta());
110-
constituents.emplace_back(clusterpt * std::cos(constituent.phi()), clusterpt * std::sin(constituent.phi()), clusterpt * std::sinh(constituent.eta()), constituent.energy());
109+
float constituentEnergy = 0.0;
110+
if (hadronicCorrectionType == 0) {
111+
constituentEnergy = constituent.energy();
112+
}
113+
if (hadronicCorrectionType == 1) {
114+
constituentEnergy = constituent.energyCorrectedOneTrack1();
115+
}
116+
if (hadronicCorrectionType == 2) {
117+
constituentEnergy = constituent.energyCorrectedOneTrack2();
118+
}
119+
if (hadronicCorrectionType == 3) {
120+
constituentEnergy = constituent.energyCorrectedAllTracks1();
121+
}
122+
if (hadronicCorrectionType == 4) {
123+
constituentEnergy = constituent.energyCorrectedAllTracks2();
124+
}
125+
float constituentPt = constituentEnergy / std::cosh(constituent.eta());
126+
constituents.emplace_back(constituentPt * std::cos(constituent.phi()), constituentPt * std::sin(constituent.phi()), constituentPt * std::sinh(constituent.eta()), constituentEnergy);
111127
}
112128
setFastJetUserInfo(constituents, index, status);
113129
}

PWGJE/Core/JetFindingUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ void analyseTracksMultipleCandidates(std::vector<fastjet::PseudoJet>& inputParti
159159
* @param clusters track table to be added
160160
*/
161161
template <typename T>
162-
void analyseClusters(std::vector<fastjet::PseudoJet>& inputParticles, T const& clusters)
162+
void analyseClusters(std::vector<fastjet::PseudoJet>& inputParticles, T const& clusters, int hadronicCorrectionType = 0)
163163
{
164164
for (auto& cluster : *clusters) {
165165
// add cluster selections
166-
fastjetutilities::fillClusters(cluster, inputParticles, cluster.globalIndex());
166+
fastjetutilities::fillClusters(cluster, inputParticles, cluster.globalIndex(), hadronicCorrectionType);
167167
}
168168
}
169169

PWGJE/Core/JetMatchingUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ float getPtSum(T const& tracksBase, U const& clustersBase, V const& tracksTag, O
427427
if constexpr (isEMCAL) {
428428
if constexpr (jetsTagIsMc) {
429429
for (const auto& clusterBase : clustersBase) {
430-
for (const auto& clusterBaseParticleId : clusterBase.mcParticleIds()) {
430+
for (const auto& clusterBaseParticleId : clusterBase.mcParticlesIds()) {
431431
bool isClusterMatched = false;
432432
for (const auto& trackTag : tracksTag) {
433433
if (clusterBaseParticleId != -1 && clusterBaseParticleId == trackTag.globalIndex()) {
@@ -450,7 +450,7 @@ float getPtSum(T const& tracksBase, U const& clustersBase, V const& tracksTag, O
450450
auto trackBaseId = trackBase.globalIndex();
451451
for (const auto& clusterTag : clustersTag) {
452452
bool isClusterMatched = false;
453-
for (const auto& clusterTagParticleId : clusterTag.mcParticleIds()) {
453+
for (const auto& clusterTagParticleId : clusterTag.mcParticlesIds()) {
454454
if (trackBaseId != -1 && trackBaseId == clusterTagParticleId) {
455455
ptSum += trackBase.pt();
456456
isClusterMatched = true;

PWGJE/Core/JetSubstructureUtilities.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ namespace jetsubstructureutilities
5353
* @param pseudoJet converted pseudoJet object which is passed by reference
5454
*/
5555
template <typename T, typename U, typename V, typename O>
56-
fastjet::ClusterSequenceArea jetToPseudoJet(T const& jet, U const& /*tracks*/, V const& /*clusters*/, O const& /*candidates*/, fastjet::PseudoJet& pseudoJet)
56+
fastjet::ClusterSequenceArea jetToPseudoJet(T const& jet, U const& /*tracks*/, V const& /*clusters*/, O const& /*candidates*/, fastjet::PseudoJet& pseudoJet, int hadronicCorrectionType = 0)
5757
{
5858
std::vector<fastjet::PseudoJet> jetConstituents;
5959
for (auto& jetConstituent : jet.template tracks_as<U>()) {
6060
fastjetutilities::fillTracks(jetConstituent, jetConstituents, jetConstituent.globalIndex());
6161
}
6262
if constexpr (std::is_same_v<std::decay_t<typename V::iterator>, o2::aod::JetClusters::iterator> || std::is_same_v<std::decay_t<typename V::iterator>, o2::aod::JetClusters::filtered_iterator>) {
6363
for (auto& jetClusterConstituent : jet.template clusters_as<V>()) {
64-
fastjetutilities::fillClusters(jetClusterConstituent, jetConstituents, jetClusterConstituent.globalIndex());
64+
fastjetutilities::fillClusters(jetClusterConstituent, jetConstituents, jetClusterConstituent.globalIndex(), hadronicCorrectionType);
6565
}
6666
}
6767
if constexpr (jetcandidateutilities::isCandidateTable<O>() || jetcandidateutilities::isCandidateMcTable<O>()) {
@@ -96,11 +96,11 @@ fastjet::ClusterSequenceArea jetToPseudoJet(T const& jet, U const& /*tracks*/, V
9696

9797
// function that returns the N-subjettiness ratio and the distance betewwen the two axes considered for tau2, in the form of a vector
9898
template <typename T, typename U, typename V, typename O, typename M>
99-
std::vector<float> getNSubjettiness(T const& jet, U const& tracks, V const& clusters, O const& candidates, std::vector<fastjet::PseudoJet>::size_type nMax, M const& reclusteringAlgorithm, bool doSoftDrop = false, float zCut = 0.1, float beta = 0.0)
99+
std::vector<float> getNSubjettiness(T const& jet, U const& tracks, V const& clusters, O const& candidates, std::vector<fastjet::PseudoJet>::size_type nMax, M const& reclusteringAlgorithm, bool doSoftDrop = false, float zCut = 0.1, float beta = 0.0, int hadronicCorrectionType = 0)
100100
{
101101
std::vector<float> result;
102102
fastjet::PseudoJet pseudoJet;
103-
fastjet::ClusterSequenceArea clusterSeq(jetToPseudoJet(jet, tracks, clusters, candidates, pseudoJet));
103+
fastjet::ClusterSequenceArea clusterSeq(jetToPseudoJet(jet, tracks, clusters, candidates, pseudoJet, hadronicCorrectionType));
104104
if (doSoftDrop) {
105105
fastjet::contrib::SoftDrop softDrop(beta, zCut);
106106
pseudoJet = softDrop(pseudoJet);

PWGJE/DataModel/Jet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ using JetCollisionMCD = o2::soa::Join<JetCollisions, JMcCollisionLbs>::iterator;
203203
using JetTracks = JTracks;
204204
using JetTracksMCD = o2::soa::Join<JetTracks, JMcTrackLbs>;
205205
using JetTracksSub = JTrackSubs;
206-
using JetClusters = JClusters;
207-
using JetClustersMCD = o2::soa::Join<JClusters, JMcClusterLbs>;
206+
using JetClusters = o2::soa::Join<JClusters, JClustersCorrectedEnergies, JClusterTracks>;
207+
using JetClustersMCD = o2::soa::Join<JClusters, JClustersCorrectedEnergies, JClusterTracks, JMcClusterLbs>;
208208

209209
using JetMcCollisions = JMcCollisions;
210210
using JetMcCollision = JetMcCollisions::iterator;

PWGJE/DataModel/JetReducedData.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,23 @@ DECLARE_SOA_TABLE_STAGED(JClusterPIs, "JCLUSTERPI",
358358
DECLARE_SOA_TABLE_STAGED(JClusterTracks, "JCLUSTERTRACK", //!
359359
jcluster::JTrackIds);
360360

361+
namespace jclusterhadroniccorrection
362+
{
363+
DECLARE_SOA_COLUMN(EnergyCorrectedOneTrack1, energyCorrectedOneTrack1, float); //! with hadronic correction fraction (100%) for one matched track
364+
DECLARE_SOA_COLUMN(EnergyCorrectedOneTrack2, energyCorrectedOneTrack2, float); //! with hadronic correction fraction (70%) for one matched track - systematic studies
365+
DECLARE_SOA_COLUMN(EnergyCorrectedAllTracks1, energyCorrectedAllTracks1, float); //! with hadronic correction fraction (100%) for all matched tracks
366+
DECLARE_SOA_COLUMN(EnergyCorrectedAllTracks2, energyCorrectedAllTracks2, float); //! with hadronic correction fraction (70%) for all matched tracks - for systematic studies
367+
} // namespace jclusterhadroniccorrection
368+
369+
DECLARE_SOA_TABLE_STAGED(JClustersCorrectedEnergies, "JCLUSTERCORRE", //! if this table changes it needs to be reflected in FastJetUtilities.h!!
370+
jclusterhadroniccorrection::EnergyCorrectedOneTrack1, // corrected cluster energy for 1 matched track (f = 100%)
371+
jclusterhadroniccorrection::EnergyCorrectedOneTrack2, // corrected cluster energy for 1 matched track (f = 70%)
372+
jclusterhadroniccorrection::EnergyCorrectedAllTracks1, // corrected cluster energy for all matched tracks (f = 100%)
373+
jclusterhadroniccorrection::EnergyCorrectedAllTracks2); // corrected cluster energy for all matched tracks (f = 70%)
374+
361375
namespace jmcclusterlb
362376
{
363-
DECLARE_SOA_ARRAY_INDEX_COLUMN(JMcParticle, mcParticle);
377+
DECLARE_SOA_ARRAY_INDEX_COLUMN(JMcParticle, mcParticles);
364378
DECLARE_SOA_COLUMN(AmplitudeA, amplitudeA, std::vector<float>);
365379
} // namespace jmcclusterlb
366380

PWGJE/DataModel/emcalClusterHadronicCorrectionTask.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

PWGJE/JetFinders/jetFinder.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct JetFinderTask {
6565
Configurable<float> clusterTimeMin{"clusterTimeMin", -25., "minimum Cluster time (ns)"};
6666
Configurable<float> clusterTimeMax{"clusterTimeMax", 25., "maximum Cluster time (ns)"};
6767
Configurable<bool> clusterRejectExotics{"clusterRejectExotics", true, "Reject exotic clusters"};
68+
Configurable<int> hadronicCorrectionType{"hadronicCorrectionType", 0, "0 = no correction, 1 = CorrectedOneTrack1, 2 = CorrectedOneTrack2, 3 = CorrectedAllTracks1, 4 = CorrectedAllTracks2"};
6869
Configurable<bool> doEMCALEventSelection{"doEMCALEventSelection", true, "apply the selection to the event alias_bit for full and neutral jets"};
6970
Configurable<bool> doEMCALEventSelectionChargedJets{"doEMCALEventSelectionChargedJets", false, "apply the selection to the event alias_bit for charged jets"};
7071

@@ -195,7 +196,7 @@ struct JetFinderTask {
195196
}
196197
inputParticles.clear();
197198
jetfindingutilities::analyseTracks<soa::Filtered<aod::JetTracks>, soa::Filtered<aod::JetTracks>::iterator>(inputParticles, tracks, trackSelection, trackingEfficiency);
198-
jetfindingutilities::analyseClusters(inputParticles, &clusters);
199+
jetfindingutilities::analyseClusters(inputParticles, &clusters, hadronicCorrectionType);
199200
jetfindingutilities::findJets(jetFinder, inputParticles, jetPtMin, jetPtMax, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, fillTHnSparse ? registry.get<THn>(HIST("hJet")) : std::shared_ptr<THn>(nullptr), fillTHnSparse);
200201
}
201202
PROCESS_SWITCH(JetFinderTask, processFullJets, "Data and reco level jet finding for full and neutral jets", false);

PWGJE/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy
2828
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
2929
COMPONENT_NAME Analysis)
3030

31+
o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-charged
32+
SOURCES derivedDataProducerDummyCharged.cxx
33+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
34+
COMPONENT_NAME Analysis)
35+
3136
o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-d0
3237
SOURCES derivedDataProducerDummyD0.cxx
3338
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore

0 commit comments

Comments
 (0)