00001 // Dear emacs, this is -*- c++ -*- 00002 // $Id: SystematicsTool.h 638687 2015-01-10 20:31:47Z sfarrell $ 00003 #ifndef PATINTERFACES_SYSTEMATICS_TOOL_H 00004 #define PATINTERFACES_SYSTEMATICS_TOOL_H 00005 00006 // Copyright Iowa State University 2014. 00007 // Author: Nils Krumnack 00008 // Distributed under the Boost Software License, Version 1.0. 00009 // (See accompanying file LICENSE_1_0.txt or copy at 00010 // http://www.boost.org/LICENSE_1_0.txt) 00011 00012 // System include(s): 00013 #include <boost/unordered_map.hpp> 00014 00015 // Local include(s): 00016 #include "PATInterfaces/ISystematicsTool.h" 00017 #include "PATInterfaces/SystematicVariation.h" 00018 #include "PATInterfaces/SystematicCode.h" 00019 #include "PATInterfaces/SystematicSet.h" 00020 00021 namespace CP { 00022 00049 class SystematicsTool : virtual public ISystematicsTool { 00050 00051 public: 00055 SystematicsTool (); 00056 00059 virtual bool 00060 isAffectedBySystematic( const SystematicVariation& systematic ) const; 00061 00066 virtual SystematicSet 00067 affectingSystematics() const; 00068 00073 virtual SystematicSet 00074 recommendedSystematics() const; 00075 00080 const SystematicSet& appliedSystematics() const; 00081 00088 std::string appliedSystematicsString () const; 00089 00104 virtual SystematicCode applySystematicVariation 00105 ( const SystematicSet& systConfig ); 00106 00107 protected: 00114 SystematicCode addAffectingSystematic 00115 ( const SystematicVariation& systematic, bool recommended ); 00116 00119 SystematicCode addRecommendedSystematic 00120 ( const SystematicVariation& systematic ); 00121 00123 void addAffectingSystematics 00124 ( const SystematicSet& systematics ); 00125 00127 SystematicCode addRecommendedSystematics 00128 ( const SystematicSet& systematics ); 00129 00137 virtual SystematicCode sysApplySystematicVariation 00138 ( const SystematicSet& systConfig ) = 0; 00139 00140 public: 00143 void testInvariant() const; 00144 00145 protected: 00147 SystematicSet m_affectingSystematics; 00148 SystematicSet m_recommendedSystematics; 00149 00150 private: 00152 SystematicSet* m_appliedSystematics; 00153 00155 boost::unordered_map<SystematicSet, SystematicSet> m_systFilterMap; 00156 00157 }; // class SystematicsTool 00158 00159 } // namespace CP 00160 00161 #endif // PATINTERFACES_SYSTEMATICS_TOOL_H