Skip to content

Commit

Permalink
PWGJE : introducing gamma-jet tree producer task (AliceO2Group#7367)
Browse files Browse the repository at this point in the history
* introducing gamma-jet tree producer task

* fix missing new line in gj tree producer

* update of software triggers for GJ tree

* delection of obsolete table subscription, map improvements

* Please consider the following formatting changes

---------

Co-authored-by: ALICE Action Bot <[email protected]>
  • Loading branch information
2 people authored and fchinu committed Sep 18, 2024
1 parent 50d82ac commit 60cb40a
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 2 deletions.
12 changes: 10 additions & 2 deletions PWGJE/Core/JetUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,20 @@ std::tuple<std::vector<std::vector<int>>, std::vector<std::vector<int>>> MatchCl
template <typename T, typename U>
float deltaR(T const& A, U const& B)
{
float dPhi = RecoDecay::constrainAngle(A.phi() - B.phi(), -M_PI);
float dPhi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(A.phi(), -M_PI) - RecoDecay::constrainAngle(B.phi(), -M_PI), -M_PI);
float dEta = A.eta() - B.eta();

return TMath::Sqrt(dEta * dEta + dPhi * dPhi);
return std::sqrt(dEta * dEta + dPhi * dPhi);
}
// same as deltaR but explicit specification of the eta and phi components
template <typename T, typename U, typename V, typename W>
float deltaR(T const& eta1, U const& phi1, V const& eta2, W const& phi2)
{
float dPhi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(phi1, -M_PI) - RecoDecay::constrainAngle(phi2, -M_PI), -M_PI);
float dEta = eta1 - eta2;

return std::sqrt(dEta * dEta + dPhi * dPhi);
}
}; // namespace jetutilities

#endif // PWGJE_CORE_JETUTILITIES_H_
75 changes: 75 additions & 0 deletions PWGJE/DataModel/GammaJetAnalysisTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \brief Table definitions for gamma-jet analyses
///
/// \author Florian Jonas <[email protected]>

#ifndef PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_
#define PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_

#include "Framework/AnalysisDataModel.h"
#include "PWGJE/DataModel/EMCALClusters.h"
#include "PWGJE/Core/JetDerivedDataUtilities.h"
#include "PWGJE/DataModel/Jet.h"

namespace o2::aod
{

namespace gjevent
{ // TODO add rho //! event index
DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float);
DECLARE_SOA_COLUMN(Centrality, centrality, float);
DECLARE_SOA_COLUMN(Rho, rho, float);
DECLARE_SOA_COLUMN(EventSel, eventSel, uint8_t);
DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32);
} // namespace gjevent
DECLARE_SOA_TABLE(GjEvents, "AOD", "GJEVENT", o2::soa::Index<>, gjevent::Multiplicity, gjevent::Centrality, gjevent::Rho, gjevent::EventSel, gjevent::Alias)

using GjEvent = GjEvents::iterator;

namespace gjgamma
{
DECLARE_SOA_INDEX_COLUMN(GjEvent, gjevent); //! event index
DECLARE_SOA_COLUMN(Energy, energy, float); //! cluster energy (GeV)
DECLARE_SOA_COLUMN(Eta, eta, float); //! cluster pseudorapidity (calculated using vertex)
DECLARE_SOA_COLUMN(Phi, phi, float); //! cluster azimuthal angle (calculated using vertex)
DECLARE_SOA_COLUMN(M02, m02, float); //! shower shape long axis
DECLARE_SOA_COLUMN(M20, m20, float); //! shower shape short axis
DECLARE_SOA_COLUMN(NCells, nCells, ushort); //! number of cells in cluster
DECLARE_SOA_COLUMN(Time, time, float); //! cluster time (ns)
DECLARE_SOA_COLUMN(IsExotic, isExotic, bool); //! flag to mark cluster as exotic
DECLARE_SOA_COLUMN(DistanceToBadChannel, distanceToBadChannel, float); //! distance to bad channel
DECLARE_SOA_COLUMN(NLM, nlm, ushort); //! number of local maxima
DECLARE_SOA_COLUMN(IsoRaw, isoraw, ushort); //! isolation in cone not corrected for Rho
DECLARE_SOA_COLUMN(PerpConeRho, perpconerho, float); //! rho in perpendicular cone
DECLARE_SOA_COLUMN(TMdeltaPhi, tmdeltaphi, float); //! delta phi between cluster and closest match
DECLARE_SOA_COLUMN(TMdeltaEta, tmdeltaeta, float); //! delta eta between cluster and closest match
DECLARE_SOA_COLUMN(TMtrackP, tmtrackp, float); //! track momentum of closest match, -1 if no match found
} // namespace gjgamma
DECLARE_SOA_TABLE(GjGammas, "AOD", "GJGAMMA",
gjgamma::GjEventId, gjgamma::Energy, gjgamma::Eta, gjgamma::Phi, gjgamma::M02, gjgamma::M20, gjgamma::NCells, gjgamma::Time, gjgamma::IsExotic, gjgamma::DistanceToBadChannel, gjgamma::NLM, gjgamma::IsoRaw, gjgamma::PerpConeRho, gjgamma::TMdeltaPhi, gjgamma::TMdeltaEta, gjgamma::TMtrackP)
namespace gjchjet
{
DECLARE_SOA_INDEX_COLUMN(GjEvent, gjevent);
DECLARE_SOA_COLUMN(Pt, pt, float);
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_COLUMN(Energy, energy, float);
DECLARE_SOA_COLUMN(Mass, mass, float);
DECLARE_SOA_COLUMN(Area, area, float);
DECLARE_SOA_COLUMN(NConstituents, nConstituents, ushort);
} // namespace gjchjet
DECLARE_SOA_TABLE(GjChargedJets, "AOD", "GJCHJET", gjchjet::GjEventId, gjchjet::Pt, gjchjet::Eta, gjchjet::Phi, gjchjet::Energy, gjchjet::Mass, gjchjet::Area, gjchjet::NConstituents)
} // namespace o2::aod

#endif // PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_
4 changes: 4 additions & 0 deletions PWGJE/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ if(FastJet_FOUND)
SOURCES fulljetspectrapp.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(gamma-jet-tree-producer
SOURCES gammajettreeproducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(bjet-tagging-ml
SOURCES bjetTaggingML.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::MLCore
Expand Down
Loading

0 comments on commit 60cb40a

Please sign in to comment.