/* 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 . * */ /** @class MapCppTrackerRecon * Digitize events by running Tracker electronics simulation. * */ #ifndef _SRC_MAP_MAPCPPTrackerRecon_H_ #define _SRC_MAP_MAPCPPTrackerRecon_H_ // #define KALMAN_TEST // C headers #include #include #include // C++ headers #include #include #include #include // Other headers #include "Utils/Exception.hh" #include "Interface/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/Spill.hh" #include "src/common_cpp/Recon/SciFi/RealDataDigitization.hh" #include "src/common_cpp/Recon/SciFi/SciFiClusterRec.hh" #include "src/common_cpp/Recon/SciFi/SciFiSpacePointRec.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 MapCppTrackerRecon : public MapBase { public: /** Constructor - initialises pointers to NULL */ MapCppTrackerRecon(); /** Constructor - deletes any allocated memory */ ~MapCppTrackerRecon(); 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 */ void track_fit(MAUS::SciFiEvent &evt) const; /** Deduce and fill the reference plane position and momentum for * helical tracks */ void extrapolate_helical_reference(SciFiEvent& event) const; /** Deduce and fill the reference plane position and momentum for * straight tracks */ void extrapolate_straight_reference(SciFiEvent& event) const; void print_event_info(MAUS::SciFiEvent &event) const; private: /// This will contain the configuration Json::Value _configJSON; /// Cut value for npe. double _min_npe; /// Value above which reconstruction is aborted. int _size_exception; /// Pattern recognition flags bool _straight_pr_on; bool _helical_pr_on; bool _kalman_on; bool _patrec_on; bool _use_mcs; bool _use_eloss; bool _use_patrec_seed; bool _correct_pz; double _seed_value; /// Reconstruction Classes SciFiClusterRec _cluster_recon; SciFiSpacePointRec _spacepoint_recon; /// Pattern Recognitin Class PatternRecognition _pattern_recognition; /// Kalman Track Fitter Object #ifdef KALMAN_TEST Kalman::TrackFit* _spacepoint_helical_track_fitter; Kalman::TrackFit* _spacepoint_straight_track_fitter; int _spacepoint_recon_plane; #else Kalman::TrackFit* _helical_track_fitter; Kalman::TrackFit* _straight_track_fitter; SciFiHelicalMeasurements* _helical_measurement; SciFiStraightMeasurements* _straight_measurement; #endif /// Map of the planes geometry. SciFiGeometryHelper _geometry_helper; int SciFiRunRecon; }; // Don't forget this trailing colon!!!! } // ~namespace MAUS #endif