/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus * * MAUS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MAUS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MAUS. If not, see . * */ #ifndef _SRC_MAP_MAPCPPTrackerTOFReFit_H_ #define _SRC_MAP_MAPCPPTrackerTOFReFit_H_ // #define KALMAN_TEST // C headers #include #include #include // C++ headers #include #include #include #include // Other headers #include "Utils/Exception.hh" #include "Utils/Squeak.hh" #include "Config/MiceModule.hh" #include "src/common_cpp/Utils/CppErrorHandler.hh" #include "src/common_cpp/Utils/JsonWrapper.hh" #include "src/common_cpp/Utils/Globals.hh" #include "src/common_cpp/Globals/GlobalsManager.hh" #include "src/common_cpp/JsonCppProcessors/SpillProcessor.hh" #include "src/common_cpp/DataStructure/ReconEvent.hh" #include "src/common_cpp/DataStructure/SciFiEvent.hh" #include "src/common_cpp/DataStructure/TOFEvent.hh" #include "src/common_cpp/DataStructure/Spill.hh" #include "src/common_cpp/DataStructure/SciFiSeed.hh" #include "src/common_cpp/Recon/SciFi/PatternRecognition.hh" #include "src/common_cpp/Recon/Kalman/KalmanTrackFit.hh" #include "src/common_cpp/Recon/Kalman/KalmanTrack.hh" #include "src/common_cpp/Recon/Kalman/MAUSSciFiPropagators.hh" #include "src/common_cpp/Recon/Kalman/MAUSSciFiMeasurements.hh" #include "src/common_cpp/API/MapBase.hh" namespace MAUS { struct SciFiPlaneGeometry; /** @class MapCppTrackerTOFReFit * Perform the final tracker track fit using the Kalman filter * */ class MapCppTrackerTOFReFit : public MapBase { public: /** Constructor - initialises pointers to NULL */ MapCppTrackerTOFReFit(); /** Constructor - deletes any allocated memory */ ~MapCppTrackerTOFReFit(); private: /** Sets up the worker * * \param argJsonConfigDocument a JSON document with * the configuration. */ void _birth(const std::string& argJsonConfigDocument); /** Shutdowns the worker * * This takes no arguments and does nothing */ void _death(); /** Process MAUS data object * * Receive a data object with digits (either MC or real) and then call the higher level * reconstruction algorithms * * \param document a line/spill from the JSON input */ void _process(Data* data) const; /** Performs the final track fit * * Track fit takes the spacepoints from Pattern Recognition and, going back to the clusters * which formed the spacepoints, fits the tracks more acurately using a Kalman filter * * \param evt the current SciFiEvent */ SciFiTrack* track_fit_helix(MAUS::SciFiSeed* seed) const; bool needs_refitting(MAUS::SciFiSeed* seed) const; bool calculate_pz_seed(MAUS::SciFiSeed* seed, TOFEvent* tof_event) const; bool calculate_straight_pz_seed(MAUS::SciFiSeed* seed, TOFEvent* tof_event) const; double calculate_new_pz(double pz) const; private: /// This will contain the configuration Json::Value _configJSON; // Various options and parameters double _radius_cut; bool _has_tof; double _tof1_z; double _tracker_z; /// Kalman Track Fitter Object Kalman::TrackFit* _helical_track_fitter; SciFiHelicalMeasurements* _helical_measurement; int SciFiRunRecon; }; // Don't forget this trailing colon!!!! } // ~namespace MAUS #endif