Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   ParTools.h
0003  *  \author Derek Anderson
0004  *  \date   03.06.2024
0005  *
0006  *  Collection of frequent particle-related methods utilized in
0007  *  the sPHENIX Cold QCD Energy-Energy Correlator analysis.
0008  */
0009 /// ---------------------------------------------------------------------------
0010 
0011 #ifndef SCORRELATORUTILITIES_PARTOOLS_H
0012 #define SCORRELATORUTILITIES_PARTOOLS_H
0013 
0014 #pragma GCC diagnostic push
0015 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0016 
0017 // c++ utilities
0018 #include <cmath>
0019 #include <vector>
0020 #include <optional>
0021 // phool libraries
0022 #include <phool/PHCompositeNode.h>
0023 // PHG4 libraries
0024 #include <g4main/PHG4Particle.h>
0025 #include <g4main/PHG4TruthInfoContainer.h>
0026 // hepmc libraries
0027 #include <HepMC/GenEvent.h>
0028 #include <HepMC/GenVertex.h>
0029 #include <HepMC/GenParticle.h>
0030 #include <HepMC/GenParticle.h>
0031 #include <phhepmc/PHHepMCGenEvent.h>
0032 #include <phhepmc/PHHepMCGenEventMap.h>
0033 // PHG4 libraries
0034 #include <g4main/PHG4Particle.h>
0035 #include <g4main/PHG4TruthInfoContainer.h>
0036 // analysis utilities
0037 #include "Constants.h"
0038 #include "Interfaces.h"
0039 
0040 #pragma GCC diagnostic pop
0041 
0042 // make common namespaces implicit
0043 using namespace std;
0044 
0045 
0046 
0047 namespace SColdQcdCorrelatorAnalysis {
0048   namespace Tools {
0049 
0050     // particle methods -------------------------------------------------------
0051 
0052     int                 GetSignal(const bool isEmbed);
0053     int                 GetEmbedID(PHCompositeNode* topNode, const int iEvtToGrab);
0054     int                 GetEmbedIDFromBarcode(const int barcode, PHCompositeNode* topNode);
0055     int                 GetEmbedIDFromTrackID(const int idTrack, PHCompositeNode* topNode);
0056     bool                IsFinalState(const int status);
0057     bool                IsSubEvtGood(const int embedID, const int option, const bool isEmbed);
0058     bool                IsSubEvtGood(const int embedID, vector<int> subEvtsToUse);
0059     float               GetParticleCharge(const int pid);
0060     vector<int>         GrabSubevents(PHCompositeNode* topNode, vector<int> subEvtsToUse);
0061     vector<int>         GrabSubevents(PHCompositeNode* topNode, const int option = Const::SubEvtOpt::Everything, const bool isEmbed = false);
0062     PHG4Particle*       GetPHG4ParticleFromBarcode(const int barcode, PHCompositeNode* topNode);
0063     PHG4Particle*       GetPHG4ParticleFromTrackID(const int id, PHCompositeNode* topNode);
0064     HepMC::GenParticle* GetHepMCGenParticleFromBarcode(const int barcode, PHCompositeNode* topNode);
0065 
0066   }  // end Tools namespace
0067 }  // end SColdQcdCorrealtorAnalysis namespace
0068 
0069 #endif
0070 
0071 // end ------------------------------------------------------------------------