All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
flashana::FilterArray Class Reference

#include <FilterArray.h>

Inheritance diagram for flashana::FilterArray:

Public Member Functions

 FilterArray ()
 Default constructor. More...
 
 ~FilterArray ()
 Default destructor. More...
 
IDArray_t Filter (const QClusterArray_t &)
 Implementation of virtualfunction. More...
 
void AppendFilterAlgo (flashana::BaseTPCFilter *filter)
 append a filter algorithm to the array More...
 

Private Attributes

std::vector
< flashana::BaseTPCFilter * > 
_filter_v
 

Detailed Description

Implementation of flashana::BaseTPCFilter abstract algorithm class.
It applies a very simple filtering: excludes TPC objects (flashana::QCluster_t)
that contains less than specified number of points.

Definition at line 25 of file FilterArray.h.

Constructor & Destructor Documentation

flashana::FilterArray::FilterArray ( )

Default constructor.

Definition at line 8 of file FilterArray.cxx.

8  : BaseTPCFilter()
9  { }
flashana::FilterArray::~FilterArray ( )
inline

Default destructor.

Definition at line 33 of file FilterArray.h.

33 {}

Member Function Documentation

void flashana::FilterArray::AppendFilterAlgo ( flashana::BaseTPCFilter *  filter)
inline

append a filter algorithm to the array

Definition at line 41 of file FilterArray.h.

41 { _filter_v.push_back(filter); }
std::vector< flashana::BaseTPCFilter * > _filter_v
Definition: FilterArray.h:46
physics filters filter
IDArray_t flashana::FilterArray::Filter ( const QClusterArray_t &  tpc_obj_v)

Implementation of virtualfunction.

Definition at line 11 of file FilterArray.cxx.

11  {
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  }
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)...
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.

Member Data Documentation

std::vector<flashana::BaseTPCFilter*> flashana::FilterArray::_filter_v
private

Definition at line 46 of file FilterArray.h.


The documentation for this class was generated from the following files: