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

FastShower::C0EmEcalBar1 Class Reference

#include <C0EmEcalBar1.h>

Inheritance diagram for FastShower::C0EmEcalBar1:

Inheritance graph
[legend]
Collaboration diagram for FastShower::C0EmEcalBar1:

Collaboration graph
[legend]
List of all members.

Public Methods

 C0EmEcalBar1 (IUpdatingGaussian *, IProcessedDist *, IInTail *, IFn *)
 C0EmEcalBar1 (const IConfigurer *, const std::string &)
virtual ISamplerclone () const
 ISampler interface.

virtual void sample (const PolyArgs &, CoreSamples &) const
 sample and fill CoreSamples.

virtual double lastValue (const CoreSamples &) const
 read back last deposit - used by monitoring code.

virtual void components (IDebug::Cpts &) const

Private Methods

double evalTail (const PolyArgs &) const
double evalPeak (const PolyArgs &) const

Private Attributes

SP< IUpdatingGaussianm_peak
SP< IProcessedDistm_tail
SP< IInTailm_inTail
SP< IFnm_tailLowerBound

Static Private Attributes

const double s_nSigma1
const double s_nSigma2
const double s_tailFluctScale

Constructor & Destructor Documentation

FastShower::C0EmEcalBar1::C0EmEcalBar1 IUpdatingGaussian  ,
IProcessedDist  ,
IInTail  ,
IFn  
 

Definition at line 28 of file C0EmEcalBar1.cxx.

Referenced by clone().

00031                                      :
00032     ISampler(), ICell0(), DebugBase("C0EmEcalBar1"), 
00033     m_peak(g), m_tail(t), m_inTail(inTail), m_tailLowerBound(ts){}

FastShower::C0EmEcalBar1::C0EmEcalBar1 const IConfigurer  ,
const std::string &   
 

Definition at line 35 of file C0EmEcalBar1.cxx.

References FastShower::IConfigurer::findFn(), FastShower::IConfigurer::findIUG(), m_inTail, m_peak, m_tail, m_tailLowerBound, FastShower::IConfigurer::makeIInTail(), FastShower::IConfigurer::makeProcessedFlat(), and FastShower::DebugBase::text().

00037                               :
00038     DebugBase("C0"), m_peak(0), m_tail(0), m_inTail(0), m_tailLowerBound(0){
00039     m_peak           = configurer->findIUG( text()+"Peak" ) ;
00040     m_tail           = configurer->makeProcessedFlat( text() );
00041     m_inTail         = configurer->makeIInTail( text() );
00042     m_tailLowerBound = configurer->findFn( text()+"TailLowerBound");
00043     cout<<text()<<" finishing construction"<<endl;
00044   }

Member Function Documentation

ISampler * FastShower::C0EmEcalBar1::clone   const [virtual]
 

ISampler interface.

Implements FastShower::ISampler.

Definition at line 46 of file C0EmEcalBar1.cxx.

References C0EmEcalBar1().

00046 {return new C0EmEcalBar1(*this);}

void FastShower::C0EmEcalBar1::sample const PolyArgs  ,
CoreSamples  
const [virtual]
 

sample and fill CoreSamples.

Implements FastShower::ISampler.

Definition at line 49 of file C0EmEcalBar1.cxx.

00049                                                                    {
00050     
00051     if( m_inTail->operator()(pa) ){
00052       cs.fill(this, evalTail(pa) );
00053     }else{
00054       cs.fill(this, evalPeak(pa) );
00055     }
00056   }

double FastShower::C0EmEcalBar1::lastValue const CoreSamples   const [virtual]
 

read back last deposit - used by monitoring code.

Implements FastShower::ISampler.

Definition at line 117 of file C0EmEcalBar1.cxx.

References FastShower::CoreSamples::give().

00117                                                             {
00118     return cs.give(this);
00119   }

void FastShower::C0EmEcalBar1::components IDebug::Cpts   const [virtual]
 

Reimplemented from FastShower::DebugBase.

Definition at line 121 of file C0EmEcalBar1.cxx.

References m_inTail, m_peak, m_tail, and m_tailLowerBound.

00121                                                   {
00122     v.push_back(m_peak);
00123     v.push_back(m_tail);
00124     v.push_back(m_inTail);
00125     v.push_back(m_tailLowerBound);
00126   }

double FastShower::C0EmEcalBar1::evalTail const PolyArgs   const [private]
 

Definition at line 58 of file C0EmEcalBar1.cxx.

References FastShower::ParticleParameters::energy(), FastShower::SplitDecision::lower(), m_peak, m_tail, m_tailLowerBound, FastShower::PolyArgs::pp(), s_nSigma1, s_nSigma2, s_tailFluctScale, and FastShower::ProcessedNormal::sample().

00058                                                         {
00059 
00060     pair<double, double>  peakParams = m_peak->parameters(pa);
00061     double peakMean  = peakParams.first;
00062     double peakSigma = peakParams.second;
00063     //calculate ther upper and lower limits of the tails
00064     //
00065     // upper tail
00066     double energy = pa.pp()->energy();
00067     double uLimit2 = (energy<30.) ? 1.0 : peakMean + s_nSigma2*peakSigma;
00068     if(uLimit2>1.){ uLimit2=1.;}
00069     //
00070     double lLimit2 = peakMean + s_nSigma1*peakSigma;
00071     if(lLimit2>uLimit2){lLimit2 = uLimit2-peakSigma;}
00072     //
00073     // lower tail
00074     double uLimit1 = peakMean - s_nSigma1*peakSigma;
00075     //
00076     double lLimit1 = uLimit1 - ( m_tailLowerBound->value(pa) );
00077     //Add a little fluctuation in the lower base length
00078     ProcessedNormal temp;
00079     lLimit1 -= s_tailFluctScale*( abs( temp.sample() ) );
00080     if(lLimit1<0.){lLimit1=0.;}
00081     //
00082     if(uLimit1<0.){ uLimit1=peakMean;}
00083     
00084     double base1 = uLimit1-lLimit1;
00085     double base2 = uLimit2-lLimit2;
00086     double narrowBase;
00087     double narrowBaseStart;
00088     double wideBase;
00089     double wideBaseStart;
00090     
00091     if( base1>base2 ){
00092       wideBase = base1;
00093       wideBaseStart = lLimit1;
00094       narrowBase = base2;
00095       narrowBaseStart = lLimit2;
00096     }else{
00097       wideBase = base2;
00098       wideBaseStart = lLimit2;
00099       narrowBase = base1;
00100       narrowBaseStart = lLimit1;
00101     }   
00102     
00103     SplitDecision sp(narrowBase/wideBase);
00104     if ( sp.lower() ){
00105       LinearProcessor lp(narrowBase,narrowBaseStart);
00106       return m_tail->sample(&lp);
00107     }else{
00108       LinearProcessor lp(wideBase,wideBaseStart);
00109       return m_tail->sample(&lp);
00110     }
00111   }

double FastShower::C0EmEcalBar1::evalPeak const PolyArgs   const [private]
 

Definition at line 113 of file C0EmEcalBar1.cxx.

00113                                                       {
00114     return m_peak->sample(0.0,s_nSigma1,1.0,s_nSigma1,pa);
00115   }

Member Data Documentation

SP< IUpdatingGaussian > FastShower::C0EmEcalBar1::m_peak [private]
 

Definition at line 75 of file C0EmEcalBar1.h.

Referenced by C0EmEcalBar1(), components(), and evalTail().

SP< IProcessedDist > FastShower::C0EmEcalBar1::m_tail [private]
 

Definition at line 76 of file C0EmEcalBar1.h.

Referenced by C0EmEcalBar1(), components(), and evalTail().

SP< IInTail > FastShower::C0EmEcalBar1::m_inTail [private]
 

Definition at line 77 of file C0EmEcalBar1.h.

Referenced by C0EmEcalBar1(), and components().

SP< IFn> FastShower::C0EmEcalBar1::m_tailLowerBound [private]
 

Definition at line 78 of file C0EmEcalBar1.h.

Referenced by C0EmEcalBar1(), components(), and evalTail().

const double FastShower::C0EmEcalBar1::s_nSigma1 [static, private]
 

Referenced by evalTail().

const double FastShower::C0EmEcalBar1::s_nSigma2 [static, private]
 

Referenced by evalTail().

const double FastShower::C0EmEcalBar1::s_tailFluctScale [static, private]
 

Referenced by evalTail().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:57:13 2003 for FastShowerUtils by doxygen1.3-rc1