/* 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 ReduceCppGlobalPID * @author Celeste Pidcott, University of Warwick * Produce PDFs from MC data for use in global PID * */ #ifndef _REDUCECPPGLOBALPID_H #define _REDUCECPPGLOBALPID_H #include #include #include #include "TH2.h" #include "TFile.h" #include "json/json.h" #include "src/common_cpp/DataStructure/Data.hh" #include "src/common_cpp/DataStructure/Spill.hh" #include "src/common_cpp/DataStructure/MCEvent.hh" #include "src/common_cpp/Recon/Global/PIDBase.hh" #include "src/common_cpp/Recon/Global/PIDBase1D.hh" #include "src/common_cpp/Recon/Global/PIDBase2D.hh" #include "src/common_cpp/Recon/Global/PIDVarA.hh" #include "src/common_cpp/Recon/Global/PIDVarB.hh" #include "src/common_cpp/Recon/Global/PIDVarC.hh" #include "src/common_cpp/Recon/Global/PIDVarD.hh" #include "src/common_cpp/Recon/Global/PIDVarE.hh" #include "src/common_cpp/Recon/Global/PIDVarF.hh" #include "src/common_cpp/Recon/Global/PIDVarG.hh" #include "src/common_cpp/Recon/Global/PIDVarH.hh" #include "src/common_cpp/Recon/Global/PIDVarI.hh" #include "src/common_cpp/Recon/Global/PIDVarJ.hh" #include "src/common_cpp/Recon/Global/ComPIDVarA.hh" #include "src/common_cpp/Recon/Global/ComPIDVarB.hh" #include "src/common_cpp/Recon/Global/ComPIDVarC.hh" #include "src/common_cpp/Recon/Global/ComPIDVarD.hh" #include "src/common_cpp/Recon/Global/ComPIDVarE.hh" #include "src/common_cpp/Recon/Global/ComPIDVarF.hh" #include "src/common_cpp/Recon/Global/ComPIDVarG.hh" #include "src/common_cpp/Recon/Global/ComPIDVarH.hh" #include "src/common_cpp/Recon/Global/ComPIDVarI.hh" #include "src/common_cpp/API/ReduceBase.hh" #include "src/common_cpp/API/PyWrapReduceBase.hh" namespace MAUS { class Data; class ImageData; class ReduceCppGlobalPID : public ReduceBase { public: ReduceCppGlobalPID() : ReduceBase("ReduceCppGlobalPID"), _configCheck(false) {} ~ReduceCppGlobalPID(); 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. */ void _death(); /** @brief process Data object * * * * @param document Receive a document with spill data * */ void _process(MAUS::Data* data); /** @brief find pid of MC particle at segment tracker ref. plane * @param mc_event MC event * @param tracker_number 0 or 1 to designate upstream or downstream tracker */ int _mc_pid_tracker_ref(MAUS::MCEvent* mc_event, int tracker_number); void _fill_pid_histograms(MAUS::DataStructure::Global::Track* track, int pid); /// Check that a valid configuration is passed to the process bool _configCheck; /// Hypotheses to create PDFs for std::vector _hypotheses; /// MICE configuration for PID std::string _pid_config; /// PID beamline polarity- set in ConfigurationDefaults to select /// positive or negative particles std::string _pid_beamline_polarity; /// PID beam setting- set in ConfigurationDefaults to select /// beam setting, i.e. emittance and momentum std::string _pid_beam_setting; /// Mapper name, useful for tracking results... std::string _classname; /// Unique identifier for naming root files holding PDFs when reducer is run std::string _unique_identifier; /// PIDs to perform std::vector _mu_pid_vars; /// PIDs to perform std::vector _e_pid_vars; /// PIDs to perform std::vector _pi_pid_vars; /// The current spill const MAUS::Spill* _spill; }; } // ~namespace MAUS #endif