1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef _SRC_MAP_MAPCPPTrackerIntegratedTrackFit_H_
19
#define _SRC_MAP_MAPCPPTrackerIntegratedTrackFit_H_
21
// #define KALMAN_TEST
25
#include <json/json.h>
26
#include <CLHEP/Units/PhysicalConstants.h>
35
#include "Utils/Exception.hh"
36
#include "Utils/Squeak.hh"
37
#include "Config/MiceModule.hh"
38
#include "src/common_cpp/Utils/CppErrorHandler.hh"
39
#include "src/common_cpp/Utils/JsonWrapper.hh"
40
#include "src/common_cpp/Utils/Globals.hh"
41
#include "src/common_cpp/Globals/GlobalsManager.hh"
42
#include "src/common_cpp/JsonCppProcessors/SpillProcessor.hh"
43
#include "src/common_cpp/DataStructure/ReconEvent.hh"
45
#include "src/common_cpp/DataStructure/SciFiEvent.hh"
46
#include "src/common_cpp/DataStructure/Spill.hh"
47
#include "src/common_cpp/DataStructure/SciFiSeed.hh"
48
#include "src/common_cpp/Recon/SciFi/PatternRecognition.hh"
49
#include "src/common_cpp/Recon/Kalman/KalmanTrackFit.hh"
50
#include "src/common_cpp/Recon/Kalman/KalmanTrack.hh"
51
#include "src/common_cpp/Recon/Kalman/MAUSSciFiIntegratedPropagator.hh"
52
#include "src/common_cpp/Recon/Kalman/MAUSSciFiPropagators.hh"
53
#include "src/common_cpp/Recon/Kalman/MAUSSciFiMeasurements.hh"
54
#include "src/common_cpp/API/MapBase.hh"
58
struct SciFiPlaneGeometry;
60
/** @class MapCppTrackerIntegratedTrackFit
61
* Perform the final tracker track fit using the Kalman filter
64
class MapCppTrackerIntegratedTrackFit : public MapBase<Data> {
67
/** Constructor - initialises pointers to NULL */
68
MapCppTrackerIntegratedTrackFit();
70
/** Constructor - deletes any allocated memory */
71
~MapCppTrackerIntegratedTrackFit();
74
/** Sets up the worker
76
* \param argJsonConfigDocument a JSON document with
79
void _birth(const std::string& argJsonConfigDocument);
81
/** Shutdowns the worker
83
* This takes no arguments and does nothing
87
/** Process MAUS data object
89
* Receive a data object with digits (either MC or real) and then call the higher level
90
* reconstruction algorithms
92
* \param document a line/spill from the JSON input
94
void _process(Data* data) const;
96
/** Performs the final track fit
98
* Track fit takes the spacepoints from Pattern Recognition and, going back to the clusters
99
* which formed the spacepoints, fits the tracks more acurately using a Kalman filter
101
* \param evt the current SciFiEvent
103
SciFiTrack* track_fit_helix(MAUS::SciFiSeed* seed) const;
105
SciFiTrack* track_fit_straight(MAUS::SciFiSeed* seed) const;
107
SciFiTrack* make_empty(SciFiSeed* seed) const;
109
* @brief Rates the track based on the outcome of the reconstruction
111
void calculate_track_rating(SciFiTrack* track) const;
115
void _set_field_values(SciFiEvent* event) const;
117
/// This will contain the configuration
118
Json::Value _configJSON;
120
// Various options and parameters
124
bool _use_patrec_seed;
126
int _excellent_num_trackpoints;
127
int _good_num_trackpoints;
128
int _poor_num_trackpoints;
129
double _excellent_p_value;
130
double _good_p_value;
131
double _poor_p_value;
132
int _excellent_num_spacepoints;
133
int _good_num_spacepoints;
134
int _poor_num_spacepoints;
137
/// Kalman Track Fitter Object
138
Kalman::TrackFit* _helical_track_fitter;
139
Kalman::TrackFit* _straight_track_fitter;
141
SciFiHelicalMeasurements* _helical_measurement;
142
SciFiStraightMeasurements* _straight_measurement;
145
}; // Don't forget this trailing colon!!!!