![]() |
|
|||
File indexing completed on 2025-08-06 08:13:21
0001 /// --------------------------------------------------------------------------- 0002 /*! \file REvtTools.cc 0003 * \author Derek Anderson 0004 * \date 03.06.2024 0005 * 0006 * Collection of frequent event-level reconstruction methods utilized 0007 * in the sPHENIX Cold QCD Energy-Energy Correlator analysis. 0008 */ 0009 /// --------------------------------------------------------------------------- 0010 0011 #define SCORRELATORUTILITIES_REVTTOOLS_CC 0012 0013 // namespace definition 0014 #include "REvtTools.h" 0015 0016 // make common namespaces implicit 0017 using namespace std; 0018 0019 0020 0021 // event-level reconstructed methods ========================================== 0022 0023 namespace SColdQcdCorrelatorAnalysis { 0024 0025 // -------------------------------------------------------------------------- 0026 //! Get total number of tracks 0027 // -------------------------------------------------------------------------- 0028 int64_t Tools::GetNumTrks(PHCompositeNode* topNode) { 0029 0030 // grab size of track map 0031 SvtxTrackMap* mapTrks = Interfaces::GetTrackMap(topNode); 0032 return mapTrks -> size(); 0033 0034 } // end 'GetNumTrks(PHCompositeNode*)' 0035 0036 0037 0038 // -------------------------------------------------------------------------- 0039 //! Get sum of track momentum 0040 // -------------------------------------------------------------------------- 0041 double Tools::GetSumTrkMomentum(PHCompositeNode* topNode) { 0042 0043 // grab track map 0044 SvtxTrackMap* mapTrks = Interfaces::GetTrackMap(topNode); 0045 0046 // loop over tracks 0047 double pSum = 0.; 0048 for ( 0049 SvtxTrackMap::Iter itTrk = mapTrks -> begin(); 0050 itTrk != mapTrks -> end(); 0051 ++itTrk 0052 ) { 0053 0054 // grab track 0055 SvtxTrack* track = itTrk -> second; 0056 if (!track) continue; 0057 0058 // momentum to sum 0059 const double pTrk = std::hypot(track -> get_px(), track -> get_py(), track -> get_pz()); 0060 pSum += pTrk; 0061 } 0062 return pSum; 0063 0064 } // end 'GetSumTrkMomentum(PHCompositeNode*)' 0065 0066 0067 0068 // -------------------------------------------------------------------------- 0069 //! Get sum of energy from a calorimeter 0070 // -------------------------------------------------------------------------- 0071 double Tools::GetSumCaloEne(PHCompositeNode* topNode, const string store) { 0072 0073 // grab clusters 0074 RawClusterContainer::ConstRange clusters = Interfaces::GetClusters(topNode, store); 0075 0076 // loop over clusters 0077 double eSum = 0.; 0078 for ( 0079 RawClusterContainer::ConstIterator itClust = clusters.first; 0080 itClust != clusters.second; 0081 itClust++ 0082 ) { 0083 0084 // grab cluster and increment sum 0085 const RawCluster* cluster = itClust -> second; 0086 if (!cluster) { 0087 continue; 0088 } else { 0089 eSum += cluster -> get_energy(); 0090 } 0091 } // end cluster loop 0092 return eSum; 0093 0094 } // end 'GetSumCaloEne(PHCompositeNode*, string)' 0095 0096 } // end SColdQcdCorrelatorAnalysis namespace 0097 0098 // end ------------------------------------------------------------------------
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |