21 #include <calobase/RawCluster.h>
22 #include <calobase/RawClusterContainer.h>
23 #include <calobase/RawClusterUtility.h>
24 #include <calobase/TowerInfo.h>
25 #include <calobase/TowerInfoContainerv1.h>
26 #include <calobase/RawTowerGeomContainer.h>
27 #include <phgeom/PHGeomUtility.h>
35 return dphi - 2. * M_PI;
36 else if (dphi <= -M_PI)
37 return dphi + 2. * M_PI;
87 std::cout <<
"Processing calo layer "
103 std::cout <<
" has clusters associated to it : " << std::endl;
104 for (
auto cluster : clustervec)
132 const float statex = state->
get_x();
133 const float statey = state->
get_y();
134 const float statez = state->
get_z();
135 const float statephi = atan2(statey, statex);
136 const float stateeta = asinh(statez /
137 sqrt(statex * statex + statey * statey));
139 const int vertexid = track->get_vertex_id();
146 std::cout <<
"no cluster found, continuing to next track"
152 std::cout <<
"matching cluster " << cluster->get_id() <<
" to track " << track->get_id() << std::endl;
166 double minR = std::numeric_limits<double>::max();
172 vert(0) = vertex->
get_x();
173 vert(1) = vertex->
get_y();
174 vert(2) = vertex->
get_z();
177 for (
const auto& [key, cluster] : clusterMap)
181 CLHEP::Hep3Vector(vert(0), vert(1), vert(2)));
182 const auto dphi =
deltaPhi(phi - cluster->get_phi());
184 const auto r = sqrt(pow(dphi, 2) + pow(deta, 2));
189 returncluster = cluster;
193 return returncluster;
198 m_trackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
201 std::cout <<
PHWHERE <<
"No track map, can't continue" << std::endl;
205 m_vertexMap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
208 std::cout <<
PHWHERE <<
"No vertex map, can't continue" << std::endl;
222 m_towerGeomContainer = findNode::getClass<RawTowerGeomContainer>(topNode, towerGeoNodeName.c_str());
224 m_towerContainer = findNode::getClass<TowerInfoContainerv1>(topNode, towerNodeName.c_str());
226 m_clusterContainer = findNode::getClass<RawClusterContainer>(topNode, clusterNodeName.c_str());
232 m_clusterContainer = findNode::getClass<RawClusterContainer>(topNode, nodeName.c_str());
238 <<
"Calo geometry and/or cluster container not found on node tree. Track-Calo cluster map won't be filled."
255 std::cerr <<
"DST node is missing, quitting" << std::endl;
256 throw std::runtime_error(
"Failed to find DST node in PHActsSiliconSeeding::createNodes");
268 m_trackClusterMap = findNode::getClass<SvtxTrackCaloClusterMap>(topNode,
"TrackCaloClusterMap");