Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:20

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   JetInfo.h
0003  *  \author Derek Anderson
0004  *  \date   03.04.2024
0005  *
0006  *  Utility class to hold information from jets.
0007  */
0008 /// ---------------------------------------------------------------------------
0009 
0010 #ifndef SCORRELATORUTILITIES_JETINFO_H
0011 #define SCORRELATORUTILITIES_JETINFO_H
0012 
0013 // c++ utilities
0014 #include <limits>
0015 #include <string>
0016 #include <vector>
0017 #include <utility>
0018 // root libraries
0019 #include <Rtypes.h>
0020 // fastjet libraries
0021 #include <fastjet/PseudoJet.hh>
0022 // fun4all types
0023 #include <jetbase/Jet.h>
0024 // analysis utilities
0025 #include "Constants.h"
0026 
0027 // make common namespaces implicit
0028 using namespace std;
0029 
0030 
0031 
0032 namespace SColdQcdCorrelatorAnalysis {
0033   namespace Types {
0034 
0035     // ------------------------------------------------------------------------
0036     //! Jet info
0037     // ------------------------------------------------------------------------
0038     /*! A class to consolidate information
0039      *  about jets. Can be built from either
0040      *  fastjet pseudojets or F4A Jet objects.
0041      */
0042     class JetInfo {
0043 
0044       private:
0045 
0046         // data members
0047         uint32_t jetID = numeric_limits<uint32_t>::max();
0048         uint64_t nCsts = numeric_limits<uint64_t>::max();
0049         double   ene   = numeric_limits<double>::max();
0050         double   px    = numeric_limits<double>::max();
0051         double   py    = numeric_limits<double>::max();
0052         double   pz    = numeric_limits<double>::max();
0053         double   pt    = numeric_limits<double>::max();
0054         double   eta   = numeric_limits<double>::max();
0055         double   phi   = numeric_limits<double>::max();
0056         double   area  = numeric_limits<double>::max();
0057 
0058         // private methods
0059         void Minimize();
0060         void Maximize();
0061 
0062       public:
0063 
0064         // getters
0065         uint32_t GetJetID() const {return jetID;}
0066         uint64_t GetNCsts() const {return nCsts;}
0067         double   GetEne()   const {return ene;}
0068         double   GetPX()    const {return px;}
0069         double   GetPY()    const {return py;}
0070         double   GetPZ()    const {return pz;}
0071         double   GetPT()    const {return pt;}
0072         double   GetEta()   const {return eta;}
0073         double   GetPhi()   const {return phi;}
0074         double   GetArea()  const {return area;}
0075 
0076         // setters
0077         void SetJetID(uint32_t arg_jetID) {jetID = arg_jetID;}
0078         void SetNCsts(uint64_t arg_nCsts) {nCsts = arg_nCsts;}
0079         void SetEne(double arg_ene)       {ene   = arg_ene;}
0080         void SetPX(double arg_px)         {px    = arg_px;}
0081         void SetPY(double arg_py)         {py    = arg_py;}
0082         void SetPZ(double arg_pz)         {pz    = arg_pz;}
0083         void SetPT(double arg_pt)         {pt    = arg_pt;}
0084         void SetEta(double arg_eta)       {eta   = arg_eta;}
0085         void SetPhi(double arg_phi)       {phi   = arg_phi;}
0086         void SetArea(double arg_area)     {area  = arg_area;}
0087 
0088         // public methods
0089         void Reset();
0090         void SetInfo(fastjet::PseudoJet& pseudojet);
0091         void SetInfo(Jet& jet);
0092         bool IsInAcceptance(const JetInfo& minimum, const JetInfo& maximum) const;
0093         bool IsInAcceptance(const pair<JetInfo, JetInfo>& range) const;
0094 
0095         // static methods
0096         static vector<string> GetListOfMembers();
0097 
0098         // overloaded operators
0099         friend bool operator <(const JetInfo& lhs, const JetInfo& rhs);
0100         friend bool operator >(const JetInfo& lhs, const JetInfo& rhs);
0101         friend bool operator <=(const JetInfo& lhs, const JetInfo& rhs);
0102         friend bool operator >=(const JetInfo& lhs, const JetInfo& rhs);
0103 
0104         // default ctor/dtor
0105         JetInfo();
0106         ~JetInfo();
0107 
0108         // ctors accepting arguments
0109         JetInfo(const Const::Init init);
0110         JetInfo(fastjet::PseudoJet& pseudojet);
0111         JetInfo(Jet& jet);
0112 
0113       // identify this class to ROOT
0114       ClassDefNV(JetInfo, 1)
0115 
0116     };  // end JetInfo def
0117 
0118 
0119 
0120     // comparison operator definitions ----------------------------------------
0121 
0122     bool operator <(const JetInfo& lhs, const JetInfo& rhs);
0123     bool operator >(const JetInfo& lhs, const JetInfo& rhs);
0124     bool operator <=(const JetInfo& lhs, const JetInfo& rhs);
0125     bool operator >=(const JetInfo& lhs, const JetInfo& rhs);
0126 
0127   }  // end Types namespace
0128 }  // end SColdQcdCorrelatorAnalysis namespace
0129 
0130 #endif
0131 
0132 // end ------------------------------------------------------------------------