Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   GEvtInfo.h
0003  *  \author Derek Anderson
0004  *  \date   03.06.2024
0005  *
0006  *  Utility class to hold event-level generator
0007  *  information.
0008  */
0009 /// ---------------------------------------------------------------------------
0010 
0011 #ifndef SCORRELATORUTILITIES_GEVTINFO_H
0012 #define SCORRELATORUTILITIES_GEVTINFO_H
0013 
0014 // c++ utilities
0015 #include <limits>
0016 #include <string>
0017 #include <vector>
0018 #include <utility>
0019 #include <optional>
0020 // root libraries
0021 #include <Rtypes.h>
0022 #include <Math/Vector3D.h>
0023 // analysis utilities
0024 #include "Tools.h"
0025 #include "ParInfo.h"
0026 #include "Constants.h"
0027 #include "Interfaces.h"
0028 
0029 // make common namespaces implicit
0030 using namespace std;
0031 
0032 
0033 
0034 namespace SColdQcdCorrelatorAnalysis {
0035   namespace Types {
0036 
0037     // ------------------------------------------------------------------------
0038     //! Event-level generator info
0039     // ------------------------------------------------------------------------
0040     /*! A class to consolidate event-level
0041      *  generator (truth) information. Can
0042      *  be built by pointing class to a
0043      *  F4A node and providing a list of
0044      *  subevents to process.
0045      */ 
0046     class GEvtInfo {
0047 
0048       private:
0049 
0050         // data members
0051         int                    nChrgPar = numeric_limits<int>::max();
0052         int                    nNeuPar  = numeric_limits<int>::max();
0053         bool                   isEmbed  = false;
0054         double                 eSumChrg = numeric_limits<double>::max();
0055         double                 eSumNeu  = numeric_limits<double>::max();
0056         pair<ParInfo, ParInfo> partons;
0057 
0058         // private methods
0059         void Minimize();
0060         void Maximize();
0061 
0062       public:
0063 
0064         // getters
0065         int                    GetNChrgPar() const {return nChrgPar;}
0066         int                    GetNNeuPar()  const {return nNeuPar;}
0067         bool                   GetIsEmbed()  const {return isEmbed;}
0068         double                 GetESumChrg() const {return eSumChrg;}
0069         double                 GetESumNeu()  const {return eSumNeu;}
0070         ParInfo                GetPartonA()  const {return partons.first;}
0071         ParInfo                GetPartonB()  const {return partons.second;}
0072         pair<ParInfo, ParInfo> GetPartons()  const {return partons;} 
0073 
0074         // setters
0075         void SetNChrgPar(const int arg_nChrgPar)                  {nChrgPar = arg_nChrgPar;}
0076         void SetNNeuPar(const int arg_nNeuPar)                    {nNeuPar  = arg_nNeuPar;}
0077         void SetIsEmbed(const bool arg_isEmbed)                   {isEmbed  = arg_isEmbed;}
0078         void SetESumChrg(const double arg_eSumChrg)               {eSumChrg = arg_eSumChrg;}
0079         void SetESumNeu(const double arg_eSumNeu)                 {eSumNeu  = arg_eSumNeu;}
0080         void SetPartons(const pair<ParInfo, ParInfo> arg_partons) {partons  = arg_partons;} 
0081 
0082         // public methods
0083         void Reset();
0084         void SetInfo(PHCompositeNode* topNode, const bool embed, const vector<int> evtsToGrab);
0085 
0086         // static methods
0087         static vector<string> GetListOfMembers();
0088 
0089         // default ctor/dtor
0090         GEvtInfo();
0091         ~GEvtInfo();
0092 
0093         // ctors accepting arguments
0094         GEvtInfo(const Const::Init init);
0095         GEvtInfo(PHCompositeNode* topNode, const bool embed, vector<int> evtsToGrab);
0096 
0097       // identify this class to ROOT
0098       ClassDefNV(GEvtInfo, 1);
0099 
0100     };  // end GEvtInfo definition
0101 
0102   }  // end Types namespace
0103 }  // end SColdQcdCorrelatorAnalysis namespace
0104 
0105 #endif
0106 
0107 // end ------------------------------------------------------------------------