File indexing completed on 2025-08-06 08:13:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #define SCORRELATORUTILITIES_PARINTERFACES_CC
0011
0012
0013 #include "ParInterfaces.h"
0014
0015
0016 using namespace std;
0017 using namespace findNode;
0018
0019
0020
0021
0022
0023 namespace SColdQcdCorrelatorAnalysis {
0024
0025
0026
0027
0028 PHG4TruthInfoContainer* Interfaces::GetTruthContainer(PHCompositeNode* topNode) {
0029
0030 PHG4TruthInfoContainer* container = getClass<PHG4TruthInfoContainer>(topNode, "G4TruthInfo");
0031 if (!container) {
0032 cerr << PHWHERE
0033 << "PANIC: G4 truth info container node is missing!"
0034 << endl;
0035 assert(container);
0036 }
0037 return container;
0038
0039 }
0040
0041
0042
0043
0044
0045
0046 PHG4TruthInfoContainer::ConstRange Interfaces::GetPrimaries(PHCompositeNode* topNode) {
0047
0048 PHG4TruthInfoContainer* particles = GetTruthContainer(topNode);
0049 return particles -> GetPrimaryParticleRange();
0050
0051 }
0052
0053
0054
0055
0056
0057
0058 PHHepMCGenEventMap* Interfaces::GetMcEventMap(PHCompositeNode* topNode) {
0059
0060 PHHepMCGenEventMap* mapMcEvts = getClass<PHHepMCGenEventMap>(topNode, "PHHepMCGenEventMap");
0061 if (!mapMcEvts) {
0062 cerr << PHWHERE
0063 << "PANIC: HepMC event map node is missing!"
0064 << endl;
0065 assert(mapMcEvts);
0066 }
0067 return mapMcEvts;
0068
0069 }
0070
0071
0072
0073
0074
0075
0076 PHHepMCGenEvent* Interfaces::GetMcEvent(PHCompositeNode* topNode, const int iEvtToGrab) {
0077
0078 PHHepMCGenEventMap* mcEvtMap = GetMcEventMap(topNode);
0079 PHHepMCGenEvent* mcEvt = mcEvtMap -> get(iEvtToGrab);
0080 if (!mcEvt) {
0081 cerr << PHWHERE
0082 << "PANIC: Couldn't grab mc event!"
0083 << endl;
0084 assert(mcEvt);
0085 }
0086 return mcEvt;
0087
0088 }
0089
0090
0091
0092
0093
0094
0095 HepMC::GenEvent* Interfaces::GetGenEvent(PHCompositeNode* topNode, const int iEvtToGrab) {
0096
0097 PHHepMCGenEvent* mcEvt = GetMcEvent(topNode, iEvtToGrab);
0098 HepMC::GenEvent* genEvt = mcEvt -> getEvent();
0099 if (!genEvt) {
0100 cerr << PHWHERE
0101 << "PANIC: Couldn't grab HepMC event!"
0102 << endl;
0103 assert(mcEvt);
0104 }
0105 return genEvt;
0106
0107 }
0108
0109 }
0110
0111