Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

UpGnPtr.h

Go to the documentation of this file.
00001 #ifndef FASTSHOWER_UPGNPTR_H
00002 #define FASTSHOWER_UPGNPTR_H
00003 
00004 #ifndef FASTSHOWER_DEBUGBASE_H
00005 #include "FastShowerUtils/DebugBase.h"
00006 #endif
00007 
00008 #ifndef FASTSHOWER_IUPDATINGGAUSSIAN_H
00009 #include "FastShowerUtils/IUpdatingGaussian.h"
00010 #endif
00011 
00012 #ifndef FASTSHOWER_SP_H
00013 #include "FastShowerUtils/SP.h"
00014 #endif
00015 
00016 #ifndef FASTSHOWER_FUNCTIONSTATS_H
00017 #include "FastShowerUtils/FunctionStats.h"
00018 #endif
00019 
00020 #ifndef FASTSHOWER_POLYARGS_H
00021 #include "FastShowerUtils/PolyArgs.h"
00022 #endif
00023 
00024 #ifndef STD_STRING_H
00025 #define STD_STRING_H
00026 #include <string>
00027 #endif
00028 
00029 namespace FastShower{
00034 
00035   class UpGnPtr: public IUpdatingGaussian, private DebugBase{
00036   public:
00037     //
00038     UpGnPtr(IUpdatingGaussian* f, std::string s="");
00039     UpGnPtr(const UpGnPtr& f);
00040     UpGnPtr& operator=(const UpGnPtr& f);
00041     ~UpGnPtr(){};
00043     
00044     double sample(double physicalLow,
00045                   double nSigmaLow,
00046                   double physicalUp,
00047                   double nSigmaUp,
00048                   const PolyArgs&
00049                   ) const;
00050     
00051     std::pair<double, double> parameters(const PolyArgs&) const;
00053     void components(IDebug::Cpts&)                        const;    
00055     virtual IUpdatingGaussian* clone()                    const;
00056     private:
00057     SP<IUpdatingGaussian > m_pointee;
00058     FunctionStats* m_meanStats;
00059     FunctionStats* m_sigmaStats;
00060   };
00061   //
00062   inline
00063     UpGnPtr::UpGnPtr(IUpdatingGaussian* f, std::string s):
00064     DebugBase(s),m_pointee(f), m_meanStats(new FunctionStats),
00065     m_sigmaStats(new FunctionStats){}
00066   //
00067   inline
00068     UpGnPtr::UpGnPtr(const UpGnPtr& rhs):
00069     IUpdatingGaussian(rhs), DebugBase(rhs),
00070     m_pointee(rhs.m_pointee){
00071     m_meanStats   = new FunctionStats(*rhs.m_meanStats);
00072     m_sigmaStats  = new FunctionStats(*rhs.m_sigmaStats);
00073   }
00074   //
00075   inline
00076     UpGnPtr& UpGnPtr::operator=(const UpGnPtr& rhs){
00077     if(&rhs == this) return *this;
00078 
00079     IUpdatingGaussian::operator=(rhs);
00080     DebugBase::operator=(rhs);
00081     m_pointee     =  rhs.m_pointee;
00082     m_meanStats   = new FunctionStats(*rhs.m_meanStats);
00083     m_sigmaStats  = new FunctionStats(*rhs.m_sigmaStats);
00084     return *this;
00085   }
00086   
00087   //
00088   inline
00089     double UpGnPtr::sample(double pl,
00090                            double nsl,
00091                            double pu,
00092                                 double nsu,
00093                            const PolyArgs& pa) const{
00094 
00095     double x = m_pointee->sample(pl, nsl, pu, nsu, pa);
00096     this->bumpStats(x, pa.pp() );
00097     return x;
00098   }
00099   //  
00100   inline
00101     std::pair<double, double> 
00102     UpGnPtr::parameters( const PolyArgs& pa) const{
00103     
00104     std::pair<double, double> p = m_pointee->parameters(pa);
00105     return p;
00106   }
00107   //IDebug Interface
00108   inline
00109     void UpGnPtr::components(IDebug::Cpts& v) const{
00110     m_pointee->components(v);
00111   }
00112   //
00113   inline
00114     IUpdatingGaussian* UpGnPtr::clone() const{
00115     IUpdatingGaussian* nptr = new  UpGnPtr(*this);
00116     return nptr;
00117   }   
00118 }
00119 #endif
00120 
00121   
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 

Generated on Tue Mar 18 11:50:07 2003 for FastShowerUtils by doxygen1.3-rc1