13 template <
typename T>
int sgn(
const T&
x)
31 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
34 std::cerr <<
PHWHERE <<
" ERROR: Can't find node TRKR_CLUSTER" << std::endl;
37 _cluster_crossing_map = findNode::getClass<TrkrClusterCrossingAssoc>(topNode,
"TRKR_CLUSTERCROSSINGASSOC");
40 std::cerr <<
PHWHERE <<
" ERROR: Can't find TRKR_CLUSTERCROSSINGASSOC " << std::endl;
43 _tgeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
46 std::cout <<
"No Acts tracking geometry, exiting." << std::endl;
49 _tpc_seeds = findNode::getClass<TrackSeedContainer>(topNode,
"TpcTrackSeedContainer");
52 std::cout <<
"No TpcTrackSeedContainer, exiting." << std::endl;
55 _si_seeds = findNode::getClass<TrackSeedContainer>(topNode,
"SiliconTrackSeedContainer");
58 std::cout <<
"No SiliconTrackSeedContainer, creating..." << std::endl;
61 std::cout <<
"Cannot create, exiting." << std::endl;
68 std::cout <<
"No " <<
_track_map_name <<
" found, creating..." << std::endl;
71 std::cout <<
"Cannot create, exiting." << std::endl;
86 std::cerr <<
"DST node is missing, quitting" << std::endl;
87 throw std::runtime_error(
"Failed to find DST node in PHSiliconHelicalPropagator::createNodes");
99 container = findNode::getClass<TrackSeedContainer>(topNode, container_name);
112 for (
unsigned int seedID = 0; seedID <
_tpc_seeds->
size(); ++seedID)
115 if (!tpcseed)
continue;
117 std::vector<Acts::Vector3> clusterPositions;
118 std::vector<TrkrDefs::cluskey> clusterKeys;
122 clusterKeys.push_back(*iter);
127 if (fitparams.size() == 0)
131 std::vector<TrkrDefs::cluskey> si_clusterKeys;
132 std::vector<Acts::Vector3> si_clusterPositions;
139 std::unique_ptr<TrackSeed_v1> si_seed = std::make_unique<TrackSeed_v1>();
140 std::map<short, int> crossing_frequency;
144 for (
auto clusterkey : si_clusterKeys)
158 for (
auto iter = hit_crossings.first; iter != hit_crossings.second; ++iter)
160 short crossing = iter->second;
161 if (crossing_frequency.count(crossing) == 0)
162 crossing_frequency.insert({crossing, 1});
164 crossing_frequency[crossing]++;
170 if(sgn(global.x()) == sgn(layer0global.x()) && sgn(global.y()) == sgn(layer0global.y()))
178 if (crossing_frequency.size() > 0)
180 short most_common_crossing = (std::max_element(crossing_frequency.begin(), crossing_frequency.end(),
181 [](
auto entry1,
auto entry2)
182 {
return entry1.second > entry2.second; }))
184 si_seed->set_crossing(most_common_crossing);
191 std::unique_ptr<SvtxTrackSeed_v1> full_seed = std::make_unique<SvtxTrackSeed_v1>();
196 std::cout <<
"inserted " << nSiClusters <<
" silicon clusters for tpc seed " << tpc_seed_index << std::endl;
197 std::cout <<
"new silicon seed index: " << si_seed_index << std::endl;
206 std::unique_ptr<SvtxTrackSeed_v1> partial_seed = std::make_unique<SvtxTrackSeed_v1>();
213 std::cout <<
"svtx seed map size is " << _svtx_seeds->size() << std::endl;