Particle Identification and Tracking
accum_chi4_self.h
Go to the documentation of this file.
1 //Copyright 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 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with IPP (or a modified version of that library),
22 //containing parts covered by the terms of End User License Agreement
23 //for the Intel(R) Software Development Products, the licensors of
24 //this Program grant you additional permission to convey the resulting
25 //work.
26 //
27 //If you modify this Program, or any covered work, by linking or
28 //combining it with FreeImage (or a modified version of that library),
29 //containing parts covered by the terms of End User License Agreement
30 //for FreeImage Public License, the licensors of this Program grant
31 //you additional permission to convey the resulting work.
32 
33 #ifndef CORR_SOFQ
34 #define CORR_SOFQ
35 
36 #include <vector>
37 #include <string>
38 #include <complex>
39 #include "accumulator.h"
40 
41 
42 
43 
44 namespace tracking
45 {
49 #ifdef TRACKING_FLG
51 {
52 public:
53  // basic inherited stuff
54  void add_particle(const particle *) ;
56  const utilities::Md_store & md_store ) const ;
57 
58  // special stuff
59 
63  Accum_chi4_self(unsigned max_t,float min_l,float max_l,unsigned int l_steps,float (*w)(float,float));
64 
66 
70  void add_to_chi4(std::vector<float>& Q_accum,std::vector<float>& Q2_accum,const int time_steps)const;
71 
72 
73 private:
77  unsigned int max_step_;
78 
82  unsigned int l_steps_;
83 
88  float l_step_sz_;
89 
94  float l_min_;
95 
109  float (*w_)(float,float);
110 
114  std::vector<float> Q_;
115 
116 
120  std::vector<unsigned int> count_;
121 
125  inline unsigned int to_indx(unsigned int a, unsigned int b)
126  {
127  return a * l_steps_ + b;
128  }
129 
130 };
131 
132 inline float w_step(float x, float l)
133 {
134  if(x<l)
135 
136  return 1;
137  else
138  return 0;
139 }
140 
141 
142 #endif
143 }
144 
145 
146 
147 #endif