Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   FlowInfo.h
0003  *  \author Derek Anderson
0004  *  \date   03.06.2024
0005  *
0006  *   Utility class to hold information from
0007  *   particle flow elements.
0008  */
0009 /// ---------------------------------------------------------------------------
0010 
0011 #ifndef SCORRELATORUTILITIES_FLOWINFO_H
0012 #define SCORRELATORUTILITIES_FLOWINFO_H
0013 
0014 // c++ utilities
0015 #include <limits>
0016 #include <vector>
0017 #include <string>
0018 #include <utility>
0019 // root libraries
0020 #include <Rtypes.h>
0021 // particle flow libraries
0022 #include <particleflowreco/ParticleFlowElement.h>
0023 #include <particleflowreco/ParticleFlowElementContainer.h>
0024 // analysis utilites
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     //! Particle flow info
0037     // ------------------------------------------------------------------------
0038     /*! A class to consolidate information
0039      *  about particle flow objects (PFOs).
0040      *  Can be built from F4A ParticleFlow-
0041      *  Elements.
0042      */
0043     class FlowInfo {
0044 
0045       private:
0046 
0047         // data members
0048         int    id   = numeric_limits<int>::max();
0049         int    type = numeric_limits<int>::max();
0050         double mass = numeric_limits<double>::max();
0051         double eta  = numeric_limits<double>::max();
0052         double phi  = numeric_limits<double>::max();
0053         double ene  = numeric_limits<double>::max();
0054         double px   = numeric_limits<double>::max();
0055         double py   = numeric_limits<double>::max();
0056         double pz   = numeric_limits<double>::max();
0057         double pt   = numeric_limits<double>::max();
0058 
0059         // private methods
0060         void Minimize();
0061         void Maximize();
0062 
0063       public:
0064 
0065         // getters
0066         int    GetID()   const {return id;}
0067         int    GetType() const {return type;}
0068         double GetMass() const {return mass;}
0069         double GetEta()  const {return eta;}
0070         double GetPhi()  const {return phi;}
0071         double GetEne()  const {return ene;}
0072         double GetPX()   const {return px;}
0073         double GetPY()   const {return py;}
0074         double GetPZ()   const {return pz;}
0075         double GetPT()   const {return pt;}
0076 
0077         // setters
0078         void SetID(const int arg_id)        {id   = arg_id;}
0079         void SetType(const int arg_type)    {type = arg_type;}
0080         void SetMass(const double arg_mass) {mass = arg_mass;}
0081         void SetEta(const double arg_eta)   {eta  = arg_eta;}
0082         void SetPhi(const double arg_phi)   {phi  = arg_phi;}
0083         void SetEne(const double arg_ene)   {ene  = arg_ene;}
0084         void SetPX(const double arg_px)     {px   = arg_px;}
0085         void SetPY(const double arg_py)     {py   = arg_py;}
0086         void SetPZ(const double arg_pz)     {pz   = arg_pz;}
0087         void SetPT(const double arg_pt)     {pt   = arg_pt;}
0088 
0089         // public methods
0090         void Reset();
0091         void SetInfo(const ParticleFlowElement* flow);
0092         bool IsInAcceptance(const FlowInfo& minimum, const FlowInfo& maximum) const;
0093         bool IsInAcceptance(const pair<FlowInfo, FlowInfo>& range) const;
0094 
0095         // static methods
0096         static vector<string> GetListOfMembers();
0097 
0098         // overloaded operators
0099         friend bool operator <(const FlowInfo& lhs, const FlowInfo& rhs);
0100         friend bool operator >(const FlowInfo& lhs, const FlowInfo& rhs);
0101         friend bool operator <=(const FlowInfo& lhs, const FlowInfo& rhs);
0102         friend bool operator >=(const FlowInfo& lhs, const FlowInfo& rhs);
0103 
0104         // default ctor/dtor
0105         FlowInfo();
0106         ~FlowInfo();
0107 
0108         // ctors accepting arguments
0109         FlowInfo(const Const::Init init);
0110         FlowInfo(const ParticleFlowElement* flow);
0111 
0112       // identify this class to ROOT
0113       ClassDefNV(FlowInfo, 1);
0114 
0115     };  // end FlowInfo definition
0116 
0117 
0118 
0119     // comparison operator definitions ----------------------------------------
0120 
0121     bool operator <(const FlowInfo& lhs, const FlowInfo& rhs);
0122     bool operator >(const FlowInfo& lhs, const FlowInfo& rhs);
0123     bool operator <=(const FlowInfo& lhs, const FlowInfo& rhs);
0124     bool operator >=(const FlowInfo& lhs, const FlowInfo& rhs);
0125 
0126   }  // end Types namespace
0127 }  // end SColdQcdCorrelatorAnalysis namespace
0128 
0129 #endif
0130 
0131 // end ------------------------------------------------------------------------