File indexing completed on 2025-08-06 08:13:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #define SCORRELATORUTILITIES_CSTINTERFACES_CC
0011
0012
0013 #include "CstInterfaces.h"
0014
0015
0016 using namespace std;
0017 using namespace findNode;
0018
0019
0020
0021
0022
0023 namespace SColdQcdCorrelatorAnalysis {
0024
0025
0026
0027
0028 SvtxTrack* Interfaces::FindTrack(const uint32_t idToFind, PHCompositeNode* topNode) {
0029
0030
0031 SvtxTrackMap* map = Interfaces::GetTrackMap(topNode);
0032
0033
0034 SvtxTrack* trkToFind = nullptr;
0035 for (
0036 SvtxTrackMap::Iter itTrk = map -> begin();
0037 itTrk != map -> end();
0038 ++itTrk
0039 ) {
0040
0041
0042 SvtxTrack* track = itTrk -> second;
0043 if (!track) continue;
0044
0045
0046 if (idToFind == track -> get_id()) {
0047 trkToFind = track;
0048 break;
0049 }
0050 }
0051 return trkToFind;
0052
0053 }
0054
0055
0056
0057
0058
0059
0060 ParticleFlowElement* Interfaces::FindFlow(const uint32_t idToFind, PHCompositeNode* topNode) {
0061
0062
0063 ParticleFlowElementContainer* flows = Interfaces::GetFlowStore(topNode);
0064
0065
0066 ParticleFlowElement* pfoToFind = nullptr;
0067 for (
0068 ParticleFlowElementContainer::ConstIterator itFlow = flows -> getParticleFlowElements().first;
0069 itFlow != flows -> getParticleFlowElements().second;
0070 ++itFlow
0071 ) {
0072
0073
0074 ParticleFlowElement* flow = itFlow -> second;
0075 if (!flow) continue;
0076
0077
0078 if (idToFind == flow -> get_id()) {
0079 pfoToFind = flow;
0080 break;
0081 }
0082 }
0083 return pfoToFind;
0084
0085 }
0086
0087
0088
0089
0090
0091
0092 RawTower* Interfaces::FindRawTower(const uint32_t idToFind, const Jet::SRC source, PHCompositeNode* topNode) {
0093
0094
0095 RawTowerContainer::ConstRange towers = Interfaces::GetRawTowers(topNode, Const::MapSrcOntoNode()[source]);
0096
0097
0098 RawTower* twrToFind = nullptr;
0099 for (
0100 RawTowerContainer::ConstIterator itTwr = towers.first;
0101 itTwr != towers.second;
0102 ++itTwr
0103 ) {
0104
0105
0106 RawTower* tower = itTwr -> second;
0107 if (!tower) continue;
0108
0109
0110 if (idToFind == tower -> get_id()) {
0111 twrToFind = tower;
0112 break;
0113 }
0114 }
0115 return twrToFind;
0116
0117 }
0118
0119
0120
0121
0122
0123
0124 TowerInfo* Interfaces::FindTowerInfo(const uint32_t idToFind, const Jet::SRC source, PHCompositeNode* topNode) {
0125
0126
0127 TowerInfoContainer* towers = Interfaces::GetTowerInfoStore(topNode, Const::MapSrcOntoNode()[source]);
0128
0129
0130 TowerInfo* twrToFind = nullptr;
0131 for (uint32_t channel = 0; channel < towers -> size(); channel++) {
0132
0133
0134 TowerInfo* tower = towers -> get_tower_at_channel(channel);
0135 if (!tower) continue;
0136
0137
0138 if (idToFind == channel) {
0139 twrToFind = tower;
0140 break;
0141 }
0142 }
0143 return twrToFind;
0144
0145 }
0146
0147
0148
0149
0150
0151
0152 RawCluster* Interfaces::FindCluster(const uint32_t idToFind, const Jet::SRC source, PHCompositeNode* topNode) {
0153
0154
0155 RawClusterContainer::ConstRange clusters = Interfaces::GetClusters(topNode, Const::MapSrcOntoNode()[source]);
0156
0157
0158 RawCluster* clustToFind = nullptr;
0159 for (
0160 RawClusterContainer::ConstIterator itClust = clusters.first;
0161 itClust != clusters.second;
0162 ++itClust
0163 ) {
0164
0165
0166 RawCluster* cluster = itClust -> second;
0167 if (!cluster) continue;
0168
0169
0170 if (idToFind == cluster -> get_id()) {
0171 clustToFind = cluster;
0172 break;
0173 }
0174 }
0175 return clustToFind;
0176
0177 }
0178
0179
0180
0181
0182
0183
0184 PHG4Particle* Interfaces::FindParticle(const int32_t idToFind, PHCompositeNode* topNode) {
0185
0186
0187 PHG4TruthInfoContainer::ConstRange primaries = Interfaces::GetPrimaries(topNode);
0188
0189
0190 PHG4Particle* parToFind = nullptr;
0191 for (
0192 PHG4TruthInfoContainer::ConstIterator itPar = primaries.first;
0193 itPar != primaries.second;
0194 ++itPar
0195 ) {
0196
0197
0198 PHG4Particle* particle = itPar -> second;
0199 if (!particle) continue;
0200
0201
0202 if (idToFind == particle -> get_track_id()) {
0203 parToFind = particle;
0204 break;
0205 }
0206 }
0207 return parToFind;
0208
0209 }
0210
0211 }
0212
0213