All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FilterArray.cxx
Go to the documentation of this file.
1 #ifndef OPT0FINDER_FILTERARRAY_CXX
2 #define OPT0FINDER_FILTERARRAY_CXX
3 
4 #include "FilterArray.h"
5 
6 namespace flashana {
7 
8  FilterArray::FilterArray() : BaseTPCFilter()
9  { }
10 
12 
13  // list of indices to be kept
14  IDArray_t res;
15 
16  // temporary tpc_obj vector
17  QClusterArray_t tmp_tpc_obj_v;
18  for(ID_t id=0; id<tpc_obj_v.size(); ++id) {
19  tmp_tpc_obj_v.push_back( tpc_obj_v[id] );
20  res.push_back(id);
21  }
22 
23  // apply each algorithm sequentially
24  for (size_t i=0; i < _filter_v.size(); i++){
25 
26  auto indices = _filter_v[i]->Filter(tmp_tpc_obj_v);
27 
28  // make a copy of the result indices and the tpc_obj vector
29  auto res_cpy = res;
30  auto tpc_obj_cpy_v = tmp_tpc_obj_v;
31  res.clear();
32  tmp_tpc_obj_v.clear();
33 
34  for (auto& idx : indices){
35  res.push_back(res_cpy[idx]);
36  tmp_tpc_obj_v.push_back(tpc_obj_cpy_v[idx]);
37  }
38 
39  }// for all filter algorithms to apply
40 
41  return res;
42  }
43 
44 
45 }
46 
47 #endif
std::vector< flashmatch::QCluster_t > QClusterArray_t
Collection of 3D point clusters (one use case is TPC object representation for track(s) and shower(s)...
Class def header for a class FilterArray.
IDArray_t Filter(const QClusterArray_t &)
Implementation of virtualfunction.
Definition: FilterArray.cxx:11
std::vector< flashana::BaseTPCFilter * > _filter_v
Definition: FilterArray.h:46
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
std::vector< flashmatch::ID_t > IDArray_t
Index collection.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
FilterArray()
Default constructor.
Definition: FilterArray.cxx:8