Anp::AlgAdapt Class Reference

#include <AlgAdapt.h>

Inheritance diagram for Anp::AlgAdapt:
Anp::Base

List of all members.

Public Member Functions

 AlgAdapt ()
virtual ~AlgAdapt ()
virtual bool Init ()=0
virtual long double GetPT () const
virtual unsigned int GetNPar () const =0
virtual void InitReco (RecoNu &) const
virtual void InitTrue (TrueNu &) const
virtual double GetWeight (const TrueNu &) const
virtual void Vary (RecoNu &, const TrueNu &) const
virtual const std::vector
< double > & 
Get (const std::string &key) const
virtual void Set (const std::vector< double > &dvec, const std::string &key)
virtual const std::vector
< std::string > & 
GetParName () const
virtual void Config (const Registry &)=0
virtual void Print (std::ostream &os=std::cout) const
virtual void Read (const std::string &fname)
virtual void Save (const std::string &fname)

Protected Member Functions

void ReadVec (const std::string &prefix, const Registry &reg)
const std::vector< double > GetVec (const std::string &key, const Registry &reg) const
void PrintVec (std::ostream &o, int w=7, int p=5) const
void PrintVec (const std::vector< double > &v, std::ostream &o, int w=7, int p=5) const

Protected Attributes

std::vector< double > fCurErr
std::vector< double > fCurPar
std::vector< double > fDefErr
std::vector< double > fDefPar
std::vector< std::string > fParName

Detailed Description

Definition at line 36 of file AlgAdapt.h.


Constructor & Destructor Documentation

Anp::AlgAdapt::AlgAdapt (  ) 

Definition at line 20 of file AlgAdapt.cxx.

00021 {
00022 }

Anp::AlgAdapt::~AlgAdapt (  )  [virtual]

Definition at line 25 of file AlgAdapt.cxx.

00026 {
00027 }


Member Function Documentation

virtual void Anp::AlgAdapt::Config ( const Registry  )  [pure virtual]
virtual const std::vector<double>& Anp::AlgAdapt::Get ( const std::string &  key  )  const [virtual]
virtual unsigned int Anp::AlgAdapt::GetNPar (  )  const [pure virtual]
const std::vector< std::string > & Anp::AlgAdapt::GetParName (  )  const [inline, virtual]

Definition at line 101 of file AlgAdapt.h.

References fParName.

00102    {
00103       return fParName;
00104    }

long double Anp::AlgAdapt::GetPT (  )  const [virtual]

Definition at line 30 of file AlgAdapt.cxx.

References fCurPar, fDefErr, and fDefPar.

00031 {
00032    if(fCurPar.size() != fDefPar.size() || fCurPar.size() != fDefErr.size())
00033    {
00034       cerr << "AlgAdapt::GetPT - parameter and/or error vectors have different size" << endl;
00035       return 0.0;
00036    }
00037 
00038    long double pterm = 0.0;
00039 
00040    for(unsigned int ipar = 0; ipar < fCurPar.size(); ++ipar)
00041    {
00042       const double cur_par = fCurPar[ipar];
00043       const double def_par = fDefPar[ipar];
00044       const double def_err = fDefErr[ipar];
00045 
00046       if(def_err > 0.0)
00047       {
00048          pterm += (cur_par - def_par)*(cur_par - def_par)/(def_err*def_err);
00049       }
00050    }
00051 
00052    return pterm;
00053 }

const std::vector<double> Anp::AlgAdapt::GetVec ( const std::string &  key,
const Registry reg 
) const [protected]
double Anp::AlgAdapt::GetWeight ( const TrueNu  )  const [inline, virtual]

Definition at line 109 of file AlgAdapt.h.

00109 { return 1.0; }

virtual bool Anp::AlgAdapt::Init (  )  [pure virtual]
void Anp::AlgAdapt::InitReco ( RecoNu  )  const [inline, virtual]

Definition at line 106 of file AlgAdapt.h.

00106 {}

void Anp::AlgAdapt::InitTrue ( TrueNu  )  const [inline, virtual]

Definition at line 107 of file AlgAdapt.h.

00107 {}

void Anp::AlgAdapt::Print ( std::ostream &  os = std::cout  )  const [virtual]

Definition at line 259 of file AlgAdapt.cxx.

00260 {
00261    os << "AlgAdapt::Print - this function is not implemented for this class" << endl;
00262 }

void Anp::AlgAdapt::PrintVec ( const std::vector< double > &  v,
std::ostream &  o,
int  w = 7,
int  p = 5 
) const [protected]
void Anp::AlgAdapt::PrintVec ( std::ostream &  o,
int  w = 7,
int  p = 5 
) const [protected]

Definition at line 197 of file AlgAdapt.cxx.

References fCurErr, fCurPar, fDefErr, and fDefPar.

00198 {
00199    if(!fCurPar.empty())
00200    {
00201       o << "   CurPar = ";
00202       PrintVec(fCurPar, o, w, p);
00203    }
00204    
00205    if(!fCurErr.empty())
00206    {
00207       o << "   CurErr = ";
00208       PrintVec(fCurErr, o, w, p);
00209    }
00210    
00211    if(!fDefPar.empty())
00212    {
00213       o << "   DefPar = ";
00214       PrintVec(fDefPar, o, w, p);
00215    }
00216    
00217    if(!fDefErr.empty())
00218    {
00219       o << "   DefErr = ";
00220       PrintVec(fDefErr, o, w, p);
00221    }
00222 }

virtual void Anp::AlgAdapt::Read ( const std::string &  fname  )  [virtual]
void Anp::AlgAdapt::ReadVec ( const std::string &  prefix,
const Registry reg 
) [protected]
virtual void Anp::AlgAdapt::Save ( const std::string &  fname  )  [virtual]
virtual void Anp::AlgAdapt::Set ( const std::vector< double > &  dvec,
const std::string &  key 
) [virtual]
void Anp::AlgAdapt::Vary ( RecoNu ,
const TrueNu  
) const [inline, virtual]

Definition at line 110 of file AlgAdapt.h.

00110 {}


Member Data Documentation

std::vector<double> Anp::AlgAdapt::fCurErr [protected]

Definition at line 84 of file AlgAdapt.h.

Referenced by PrintVec().

std::vector<double> Anp::AlgAdapt::fCurPar [protected]

Definition at line 85 of file AlgAdapt.h.

Referenced by GetPT(), and PrintVec().

std::vector<double> Anp::AlgAdapt::fDefErr [protected]

Definition at line 86 of file AlgAdapt.h.

Referenced by GetPT(), and PrintVec().

std::vector<double> Anp::AlgAdapt::fDefPar [protected]

Definition at line 87 of file AlgAdapt.h.

Referenced by GetPT(), and PrintVec().

std::vector<std::string> Anp::AlgAdapt::fParName [protected]

Definition at line 89 of file AlgAdapt.h.

Referenced by GetParName().


The documentation for this class was generated from the following files:

Generated on 8 Nov 2018 for loon by  doxygen 1.6.1