Declaration of the operator that performs the reconstruction.
82 {
83
86
87 const double STANDARD_DEVIATIONS = 3.0;
88
90
94
95
98
100
102
103
106
107 copy(dataL1.begin(), dataL1.end(), back_inserter(dataL0));
108
110 for (buffer_type::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
111 if (find_if(dataL1.begin(), dataL1.end(), match_t(*i,
TMaxExtra_ns)) == dataL1.end()) {
112 dataL0.push_back(*i);
113 }
114 }
115 }
116 for (buffer_type::const_iterator
root = dataL1.begin();
root != dataL1.end(); ++
root) {
117
119
121
122 for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
123
124 if((
root->getModuleIdentifier() != i->getModuleIdentifier() ) && matching(*i)){
126 }
127 }
128
130
131
132 JEstimator_t fit;
134 double chi2 = numeric_limits<double>::max();
135 int NDF =
distance(
data.begin(), __end1) - JEstimator_t::NUMBER_OF_PARAMETERS;
137
138 if(NDF > 0){
140
141 double ymin = numeric_limits<double>::max();
142
143 buffer_type::iterator __end2 = __end1;
144
146 JEstimator_t::NUMBER_OF_PARAMETERS; ++
n, --__end2) {
147
149
150 do {
151 try {
152
153 fit(
data.begin(), __end2);
154
156
157 if (y < ymin) {
159 vx = fit;
160 chi2 = ymin;
161 NDF =
distance(
data.begin(), __end2) - JEstimator_t::NUMBER_OF_PARAMETERS;
163 }
164 }
166
168
169 ymin -= STANDARD_DEVIATIONS * STANDARD_DEVIATIONS;
170 }
171
172 } else {
173
174 const int number_of_outliers =
distance(
data.begin(), __end1) - JEstimator_t::NUMBER_OF_PARAMETERS - 1;
175
176 buffer_type::iterator __end2 = __end1;
177
178 for (
int n = 0;
n <= number_of_outliers; ++
n) {
179
180 try{
181
182 fit(
data.begin(), __end2);
183 vx = fit;
185 NDF =
distance(
data.begin(), __end2) - JEstimator_t::NUMBER_OF_PARAMETERS;
187
188 }
190
191 double ymax = 0;
192 buffer_type::iterator imax = __end2;
193
194 for (buffer_type::iterator i =
data.begin() + 1; i != __end2; ++i) {
195
197
198 if (y > ymax) {
200 imax = i;
201 }
202 }
203
204 if (ymax > STANDARD_DEVIATIONS * STANDARD_DEVIATIONS) {
205 --__end2;
206 swap(*imax, *__end2);
207 } else {
208 break;
209 }
210 }
211 }
212
214
215 }
216 }
217
219
220 size_t solutions = out.size();
221
222 for(size_t i=0; i < solutions; i++){
227 if (x != 0 || y != 0 || z != 0 || t != 0) {
228
231 0,
232 0));
233
234 }
235 }
236 }
237 }
238 }
239 }
240 return out;
241
242 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Template definition of linear fit.
Data structure for vertex fit.
Data structure for position in three dimensions.
Data structure for normalised vector in positive z-direction.
Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
static const struct JTRIGGER::JHitR1::compare compare
static const int JSHOWERPREFIT
void copy(const Head &from, JHead &to)
Copy header from from to to.
double getChi2(const double P)
Get chi2 corresponding to given probability.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
JPosition3D getPosition(const JFit &fit)
Get position.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
static const struct JTRIGGER::clusterizeWeight clusterizeWeight
double sigma_ns
time resolution [ns]
int factoryLimit
factory limit for combinatorics
int numberOfOutliers
maximum number of outliers
int time_grid_ns
edge [ns] of the time grid
int pos_step_m
step in [m] of position grid
int pos_grid_m
edge [m] of the position grid
double DMax_m
maximal distance to optical module [m]
double ctMin
minimal cosine space angle between PMT axes
size_t numberOfGrids
number of prefits to be used to build a grid around
double TMaxLocal_ns
time window for local coincidences [ns]
double TMaxExtra_ns
time window for extra coincidences [ns]
size_t numberOfL1
minimal number of L1
int time_step_ns
step in [ns] of time grid
Data structure for L2 parameters.