39 using namespace Acts::UnitLiterals;
44 std::vector<const SpacePoint*> readSP;
46 std::ifstream spFile(filename);
47 if (spFile.is_open()) {
48 while (!spFile.eof()) {
49 std::getline(spFile, line);
50 std::stringstream ss(line);
53 float x = 0,
y = 0,
z = 0,
r = 0, varianceR = 0, varianceZ = 0;
54 if (linetype ==
"lxyz") {
55 ss >> layer >> x >>
y >>
z >> varianceR >> varianceZ;
57 float f22 = varianceR;
58 float wid = varianceZ;
59 float cov = wid * wid * .08333;
63 if (std::abs(
z) > 450.) {
82 int main(
int argc,
char** argv) {
88 while ((opt = getopt(argc, argv,
"hf:q")) != -1) {
100 std::cerr <<
"Usage: " << argv[0] <<
" [-hq] [-f FILENAME]\n";
102 std::cout <<
" -h : this help" << std::endl;
104 <<
" -f FILE : read spacepoints from FILE. Default is \""
105 <<
file <<
"\"" << std::endl;
106 std::cout <<
" -q : don't print out all found seeds"
114 std::ifstream
f(
file);
116 std::cerr <<
"input file \"" <<
file <<
"\" does not exist\n";
120 auto start_read = std::chrono::system_clock::now();
122 auto end_read = std::chrono::system_clock::now();
123 std::chrono::duration<double> elapsed_read = end_read - start_read;
125 std::cout <<
"read " << spVec.size() <<
" SP from file " <<
file <<
" in "
126 << elapsed_read.count() <<
"s" << std::endl;
130 config.
rMax = 160._mm;
139 config.
zMin = -2800._mm;
140 config.
zMax = 2800._mm;
146 config.
minPt = 500._MeV;
153 options.
beamPos = {-.5_mm, -.5_mm};
156 int numPhiNeighbors = 1;
164 std::vector<std::pair<int, int>> zBinNeighborsTop;
165 std::vector<std::pair<int, int>> zBinNeighborsBottom;
167 auto bottomBinFinder = std::make_shared<Acts::BinFinder<SpacePoint>>(
169 auto topBinFinder = std::make_shared<Acts::BinFinder<SpacePoint>>(
173 config.
seedFilter = std::make_unique<Acts::SeedFilter<SpacePoint>>(
179 auto ct = [=](
const SpacePoint& sp, float, float,
180 float) -> std::pair<Acts::Vector3, Acts::Vector2> {
183 return std::make_pair(
position, covariance);
198 std::unique_ptr<Acts::SpacePointGrid<SpacePoint>>
grid =
199 Acts::SpacePointGridCreator::createGrid<SpacePoint>(gridConf, gridOpts);
201 spVec.begin(), spVec.end(), ct, bottomBinFinder, topBinFinder,
204 std::vector<std::vector<Acts::Seed<SpacePoint>>> seedVector;
205 decltype(a)::SeedingState
state;
206 auto start = std::chrono::system_clock::now();
207 for (
auto [bottom, middle, top] : spGroup) {
208 auto&
v = seedVector.emplace_back();
210 bottom, middle, top, rMiddleSPRange);
212 auto end = std::chrono::system_clock::now();
213 std::chrono::duration<double> elapsed_seconds =
end -
start;
214 std::cout <<
"time to create seeds: " << elapsed_seconds.count() << std::endl;
215 std::cout <<
"Number of regions: " << seedVector.
size() << std::endl;
217 for (
auto& outVec : seedVector) {
218 numSeeds += outVec.size();
220 std::cout <<
"Number of seeds generated: " << numSeeds << std::endl;
222 for (
auto& regionVec : seedVector) {
223 for (
size_t i = 0;
i < regionVec.size();
i++) {
226 std::cout <<
" (" << sp->
x() <<
", " << sp->
y() <<
", " << sp->
z()
229 std::cout << sp->
layer <<
" (" << sp->
x() <<
", " << sp->
y() <<
", "
232 std::cout << sp->
layer <<
" (" << sp->
x() <<
", " << sp->
y() <<
", "
234 std::cout << std::endl;