15 #include <boost/type_erasure/any_cast.hpp>
32 std::vector<const SpacePoint*> readSP;
34 std::ifstream spFile(filename);
35 if (spFile.is_open()) {
36 while (!spFile.eof()) {
37 std::getline(spFile, line);
38 std::stringstream ss(line);
41 float x,
y,
z,
r, varianceR, varianceZ;
42 if (linetype ==
"lxyz") {
43 ss >> layer >> x >> y >> z >> varianceR >> varianceZ;
44 r = std::sqrt(x * x + y * y);
45 float f22 = varianceR;
46 float wid = varianceZ;
47 float cov = wid * wid * .08333;
69 int main(
int argc,
char** argv) {
70 std::string
file{
"sp.txt"};
75 while ((opt = getopt(argc, argv,
"hf:q")) != -1) {
87 std::cerr <<
"Usage: " << argv[0] <<
" [-hq] [-f FILENAME]\n";
89 std::cout <<
" -h : this help" << std::endl;
91 <<
" -f FILE : read spacepoints from FILE. Default is \""
92 <<
file <<
"\"" << std::endl;
93 std::cout <<
" -q : don't print out all found seeds"
101 std::ifstream
f(
file);
103 std::cerr <<
"input file \"" <<
file <<
"\" does not exist\n";
107 auto start_read = std::chrono::system_clock::now();
109 auto end_read = std::chrono::system_clock::now();
110 std::chrono::duration<double> elapsed_read = end_read - start_read;
112 std::cout <<
"read " << spVec.size() <<
" SP from file " <<
file <<
" in "
113 << elapsed_read.count() <<
"s" << std::endl;
122 config.
zMin = -2800.;
135 auto bottomBinFinder = std::make_shared<Acts::BinFinder<SpacePoint>>(
137 auto topBinFinder = std::make_shared<Acts::BinFinder<SpacePoint>>(
141 config.
seedFilter = std::make_unique<Acts::SeedFilter<SpacePoint>>(
160 std::unique_ptr<Acts::SpacePointGrid<SpacePoint>> grid =
161 Acts::SpacePointGridCreator::createGrid<SpacePoint>(gridConf);
163 bottomBinFinder, topBinFinder,
166 std::vector<std::vector<Acts::Seed<SpacePoint>>> seedVector;
167 auto start = std::chrono::system_clock::now();
168 auto groupIt = spGroup.begin();
169 auto endOfGroups = spGroup.end();
170 for (; !(groupIt == endOfGroups); ++groupIt) {
172 groupIt.bottom(), groupIt.middle(), groupIt.top()));
174 auto end = std::chrono::system_clock::now();
175 std::chrono::duration<double> elapsed_seconds = end -
start;
176 std::cout <<
"time to create seeds: " << elapsed_seconds.count() << std::endl;
177 std::cout <<
"Number of regions: " << seedVector.
size() << std::endl;
179 for (
auto& outVec : seedVector) {
180 numSeeds += outVec.size();
182 std::cout <<
"Number of seeds generated: " << numSeeds << std::endl;
184 for (
auto& regionVec : seedVector) {
185 for (
size_t i = 0; i < regionVec.size(); i++) {
188 std::cout <<
" (" << sp->
x() <<
", " << sp->
y() <<
", " << sp->
z()
191 std::cout << sp->
surface <<
" (" << sp->
x() <<
", " << sp->
y() <<
", "
194 std::cout << sp->
surface <<
" (" << sp->
x() <<
", " << sp->
y() <<
", "
196 std::cout << std::endl;