00001 #include "FastShowerUtils/UpdatingGaussian0LP.h"
00002 #include "FastShowerUtils/IConfigurer.h"
00003 #include "FastShowerUtils/ProcessedNormal.h"
00004 namespace FastShower{
00005 UpdatingGaussian0LP::UpdatingGaussian0LP(const std::string& label,
00006 const IConfigurer& c):
00007 UpdatingGaussianBase(label, c){
00008 }
00009
00010 std::pair<double, double> UpdatingGaussian0LP::getLims(double physicalLow,
00011 double nSigmaLow,
00012 double physicalUp,
00013 double nSigmaUp,
00014 const PolyArgs& pa
00015 ) const{
00016 std::pair<double, double> params = this->parameters(pa);
00017 double mean = params.first;
00018 double sigma = params.second;
00019
00020 double lowLim = mean-(nSigmaLow*sigma);
00021 if(lowLim<physicalLow){ lowLim=physicalLow;}
00022
00023 double upLim = mean+(nSigmaUp*sigma);
00024 if(upLim>physicalUp){ upLim=physicalUp;}
00025
00026 return std::pair<double, double>(lowLim, upLim);
00027 }
00028 IDistProcessor*
00029 UpdatingGaussian0LP::makeIDistProcessor(const PolyArgs& pa) const{
00030 std::pair<double, double> params = this->parameters(pa);
00031
00032 return new LinearProcessor(params.second, params.first);
00033 }
00034 IUpdatingGaussian* UpdatingGaussian0LP::clone() const{
00035 IUpdatingGaussian* nug= new UpdatingGaussian0LP(*this);
00036 return nug;
00037 }
00038 }
00039
00040
00041
00042
00043