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

FastShower::C0EmEcalEc1 Class Reference

#include <C0EmEcalEc1.h>

Inheritance diagram for FastShower::C0EmEcalEc1:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 C0EmEcalEc1 (IUpdatingGaussian *, IProcessedDist *, IInTail *, IFn *)
 C0EmEcalEc1 (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::C0EmEcalEc1::C0EmEcalEc1 IUpdatingGaussian  ,
IProcessedDist  ,
IInTail  ,
IFn  
 

Definition at line 32 of file C0EmEcalEc1.cxx.

Referenced by clone().

00035                                    :
00036     ISampler(), ICell0(), DebugBase("C0EmEcalEc1"), 
00037     m_peak(g), m_tail(t), m_inTail(inTail), m_tailLowerBound(ts){}

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

Definition at line 39 of file C0EmEcalEc1.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().

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

Member Function Documentation

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

ISampler interface.

Implements FastShower::ISampler.

Definition at line 50 of file C0EmEcalEc1.cxx.

References C0EmEcalEc1().

00050 {return new C0EmEcalEc1(*this);}

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

sample and fill CoreSamples.

Implements FastShower::ISampler.

Definition at line 53 of file C0EmEcalEc1.cxx.

References evalPeak(), evalTail(), FastShower::CoreSamples::fill(), and m_inTail.

00053                                                                    {
00054 
00055     if( m_inTail->operator()(pa) ){
00056       cs.fill(this, evalTail(pa) );
00057     }else{
00058       cs.fill(this, evalPeak(pa) );
00059     }
00060   }

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

read back last deposit - used by monitoring code.

Implements FastShower::ISampler.

Definition at line 125 of file C0EmEcalEc1.cxx.

References FastShower::CoreSamples::give().

00125                                                            {
00126     return cs.give(this);
00127   }

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

Reimplemented from FastShower::DebugBase.

Definition at line 128 of file C0EmEcalEc1.cxx.

References m_inTail, m_peak, m_tail, and m_tailLowerBound.

00128                                                  {
00129     v.push_back(m_peak);
00130     v.push_back(m_tail);
00131     v.push_back(m_inTail);
00132     v.push_back(m_tailLowerBound);
00133   }

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

Definition at line 62 of file C0EmEcalEc1.cxx.

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

Referenced by sample().

00062                                                        {
00063 
00064     pair<double, double>  peakParams = m_peak->parameters(pa);
00065     double peakMean  = peakParams.first;
00066     double peakSigma = peakParams.second;
00067 
00068     double fracBelow01 = 0.0;
00069 
00070     // handle very low fraction deposits for low energies
00071     double energy = pa.pp()->energy();
00072     double aDelPhi = pa.pp()->delPhi();
00073 
00074     fracBelow01 = (0.7-0.03*energy)+(0.3*energy-3.0)*aDelPhi;
00075     fracBelow01 = max(fracBelow01, 0.0);
00076 
00077     SplitDecision below01(fracBelow01);
00078     if (below01.lower()) {
00079       double base = 0.1+RandFlat::shoot()*0.05;
00080       return (RandFlat::shoot())*base;
00081     } else {
00082       //calculate the upper and lower limits of the tails
00083       //
00084       // upper tail
00085       //double uLimit2 = peakMean + s_nSigma2*peakSigma;
00086       double uLimit2 = (aDelPhi<0.037)? 
00087         min(peakMean+s_nSigma2*peakSigma, 0.99) : 0.99;
00088       uLimit2 = min(uLimit2, 1.0);
00089       //
00090       double lLimit2 = peakMean + s_nSigma1*peakSigma;
00091       if(lLimit2>uLimit2){lLimit2 = uLimit2-peakSigma;}
00092       //
00093       // lower tail
00094       double uLimit1 = peakMean - s_nSigma1*peakSigma;
00095       //
00096       double lLimit1 = uLimit1 - ( m_tailLowerBound->value(pa) );
00097       //Add a little fluctuation on the lower tail
00098       lLimit1 -= s_tailFluctScale*( RandFlat::shoot() );
00099       if (fracBelow01>0.0) { lLimit1 = max(lLimit1, 0.1); } 
00100       
00101       lLimit1 = max(lLimit1,0.0);
00102       //
00103       if(uLimit1<lLimit1){ uLimit1=peakMean;}
00104       
00105       // Sample from the flat tail
00106       // decide which tail we are in?
00107       double base1 = uLimit1-lLimit1;
00108       double base2 = uLimit2-lLimit2;
00109 
00110       SplitDecision sp(0.422-0.002*energy);
00111       if ( sp.lower() ){
00112         LinearProcessor lp(base2,lLimit2);
00113         return m_tail->sample(&lp);
00114       }else{
00115         LinearProcessor lp(base1,lLimit1);
00116         return m_tail->sample(&lp);
00117       }
00118     }
00119   }

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

Definition at line 121 of file C0EmEcalEc1.cxx.

Referenced by sample().

00121                                                      {
00122     return m_peak->sample(0.0,s_nSigma1,1.0,s_nSigma1,pa);
00123   }

Member Data Documentation

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

Definition at line 69 of file C0EmEcalEc1.h.

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

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

Definition at line 70 of file C0EmEcalEc1.h.

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

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

Definition at line 71 of file C0EmEcalEc1.h.

Referenced by C0EmEcalEc1(), components(), and sample().

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

Definition at line 72 of file C0EmEcalEc1.h.

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

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

Referenced by evalTail().

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

Referenced by evalTail().

const double FastShower::C0EmEcalEc1::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