Particle Identification and Tracking
accum_case.h
Go to the documentation of this file.
1 //Copyright 2010,2012 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 
18 #include <vector>
19 #include "part_def.h"
20 #include "accumulator.h"
21 
22 
23 
24 namespace utilities
25 {
26 class Generic_wrapper;
27 
28 
29 
30 
37 {
38 public:
39 
40 
43  { } ;
44 
45  template <class T>
46  void fill(const T & base_obj,const unsigned int frame_count)
47  {
48  accum_vec_.resize(frame_count);
49  for(unsigned int j = 0; j<frame_count;j++)
50  accum_vec_[j] = new T(base_obj);
51  frame_count_ = accum_vec_.size();
52 
53  }
54 
55 
60  {
61  return accum_vec_.at(j);
62  }
67  {
68  return accum_vec_[j];
69  }
70 
71 
75  unsigned int size()const
76  {
77  return accum_vec_.size();
78  }
83  for(unsigned int j = 0; j<accum_vec_.size();j++)
84  {
85  if(accum_vec_[j])
86  delete accum_vec_[j];
87  accum_vec_[j] = NULL;
88  }
89  }
90 
91 
92 
93 private:
101  std::vector< tracking::Accumulator*> accum_vec_;
102 
103 
104 };
105 }
106 
107