/* 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 MapCppCutVector * Store the cuts when running over ReconEvent * */ #ifndef _MAP_MAPCPPCUTS_H_ #define _MAP_MAPCPPCUTS_H_ // C headers #include #include #include #include // C++ headers #include #include #include #include #include // Other headers #include "Utils/Exception.hh" #include "Utils/Squeak.hh" #include "Config/MiceModule.hh" #include "src/common_cpp/API/MapBase.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/DataStructure/ReconEvent.hh" #include "src/common_cpp/DataStructure/Cuts.hh" #include "src/common_cpp/DataStructure/Spill.hh" namespace MAUS { /** @class MappCppCuts * Sets the cut values */ class MapCppCuts : public MapBase { public: /** Constructor - initialises pointers to NULL */ MapCppCuts(); /** Destructor - deletes any allocated memory */ ~MapCppCuts(); private: /** @brief Sets up the worker * * @param argJsonConfigDocument a JSON document with * the configuration. */ void _birth(const std::string& argJsonConfigDocument); /** @brief Shutdowns the worker * This takes no arguments and does nothing */ void _death(); /** @brief process the MAUS data object * * Receive data from recon event for each detector * * @param */ void _process(MAUS::Data *data) const; private: /** * MAUS events * Parameters called in birth: max_tof, min_tof, min_mom, max_mom, min_mass, max_mass, * good_pval */ // JsonCpp setup Json::Value _configJSON; Json::Value _set_Cut_params; double _max_tof; double _min_tof; double _min_mom_loss; double _max_mom_loss; double _min_mom_us; double _max_mom_us; double _min_mom_ds; double _max_mom_ds; double _min_mass; double _max_mass; double _good_pval; // Cut check functions upstream bool Get_single_TOF0_hit_cut(MAUS::ReconEvent* event) const; bool Get_single_TOF1_hit_cut(MAUS::ReconEvent* event) const; bool GetTOF_hitTimes_cut(double tof, double min_t, double max_t) const; bool Get_single_track_cut(MAUS::ReconEvent* event) const; bool Get_station_hits_cut_US(MAUS::ReconEvent* event) const; bool Get_US_mom_cut(double mom, double min_mom, double max_mom) const; bool Get_momentum_loss_cut(double tof, double min_mom_loss, double max_mom_loss, double mom) const; bool Get_p_value_cut(MAUS::ReconEvent* event, double good_pval) const; bool Get_mass_cut(double tof, double min_mass, double max_mass, double mom) const; bool Get_good_particle_cut(bool single_tof0, bool single_tof1, bool good_tof, bool single_track, bool station_hits, bool good_mom, bool good_momLoss, bool good_pval, bool good_massval) const; // Cut check functions downstream bool Get_station_hits_cut_DS(MAUS::ReconEvent* event) const; bool Get_DS_mom_cut(double mom, double min_mom, double max_mom) const; // Process functions double Get_TimeOfFlight(MAUS::ReconEvent* event) const; double process_US_mom(MAUS::ReconEvent* event) const; double process_DS_mom(MAUS::ReconEvent* event) const; // std::vector Process_momentum(MAUS::ReconEvent* event) const; }; // class MapCppCuts } // namespace MAUS #endif // _MAP_CPPCUTS_H_