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

FastShower::SamplerRouter Class Reference

#include <SamplerRouter.h>

Inheritance diagram for FastShower::SamplerRouter:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 SamplerRouter (const std::vector< std::pair< double, ISampler * > > &, double floor=0.0, std::string label="")
 constructor gives the mininum value of indexable quantity, defaults to zero.

 SamplerRouter (const SamplerRouter &)
 ~SamplerRouter ()
virtual void sample (const PolyArgs &, CoreSamples &) const
virtual double lastValue (const CoreSamples &) const
 read back last deposit - used by monitoring code.

virtual double indexQ (const ParticleParameters &, const CoreSamples &) const=0
void components (std::vector< const IDebug * > &v) const
 IDebug interface.


Private Types

typedef std::map< double,
ISampler * > 
SamplerTable
 the map acts as a histogram - it puts different ISampler pointers in bins of some quantity expressed as double


Private Attributes

double m_floor
 minimum level for indexed quantity. max level is obtained from the map.

SamplerTable m_samplers

Member Typedef Documentation

typedef std::map<double, ISampler* > FastShower::SamplerRouter::SamplerTable [private]
 

the map acts as a histogram - it puts different ISampler pointers in bins of some quantity expressed as double

Definition at line 64 of file SamplerRouter.h.


Constructor & Destructor Documentation

FastShower::SamplerRouter::SamplerRouter const std::vector< std::pair< double, ISampler * > > &   ,
double    floor = 0.0,
std::string    label = ""
 

constructor gives the mininum value of indexable quantity, defaults to zero.

Definition at line 11 of file SamplerRouter.cxx.

References m_samplers.

00013                                                          :
00014     DebugBase(label), m_floor(x){
00015     m_samplers.insert(v.begin(), v.end());
00016     cout<<"Sampler router finishing construction"<<endl;
00017   }
  //

FastShower::SamplerRouter::SamplerRouter const SamplerRouter &   
 

Definition at line 19 of file SamplerRouter.cxx.

References m_floor, and m_samplers.

00019                                                     :ISampler(), DebugBase(){
00020     SamplerTable::const_iterator iter = c.m_samplers.begin();
00021     SamplerTable::const_iterator end  = c.m_samplers.end();
00022     
00023     for(; iter!=end; ++iter){
00024       m_samplers[(*iter).first]=(*iter).second->clone();
00025     }
00026     m_floor = c.m_floor;
00027     cout<<"CopyConstructed SamplersRouter, size "<<m_samplers.size()<<endl;
00028   }

FastShower::SamplerRouter::~SamplerRouter   [inline]
 

Definition at line 49 of file SamplerRouter.h.

00049 {}

Member Function Documentation

void FastShower::SamplerRouter::sample const PolyArgs   pa,
CoreSamples   cs
const [virtual]
 

assert we are in range (user requested lower range, in map upper range)

Implements FastShower::ISampler.

Definition at line 30 of file SamplerRouter.cxx.

References indexQ(), m_floor, m_samplers, FastShower::PolyArgs::pp(), and FastShower::ISampler::sample().

00030                                                                      {
00031 
00032     ParticleParameters pp = *pa.pp();
00033     double indQ = indexQ(pp, cs);
00035     assert ( indQ >= m_floor); 
00036     assert ( m_samplers.upper_bound(indQ) != m_samplers.end());
00037 
00038     ISampler* sampler = m_samplers.upper_bound(indQ)->second;
00039     sampler->sample(pa, cs);
00040   }

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

read back last deposit - used by monitoring code.

Implements FastShower::ISampler.

Reimplemented in FastShower::ANSamplerRouterSNSample, FastShower::C0SamplerRouterADPhiSample, FastShower::C0SamplerRouterEnergySample, FastShower::C0SamplerRouterRandomSample, FastShower::S0SamplerRouterEnergySample, and FastShower::SNSamplerRouterC0Sample.

Definition at line 42 of file SamplerRouter.cxx.

00042 {return 0;}

virtual double FastShower::SamplerRouter::indexQ const ParticleParameters  ,
const CoreSamples  
const [pure virtual]
 

Implemented in FastShower::ANSamplerRouterSNSample, FastShower::C0SamplerRouterADPhiSample, FastShower::C0SamplerRouterEnergySample, FastShower::C0SamplerRouterRandomSample, FastShower::S0SamplerRouterEnergySample, and FastShower::SNSamplerRouterC0Sample.

Referenced by sample().

void FastShower::SamplerRouter::components std::vector< const IDebug * > &    v const
 

IDebug interface.

Definition at line 44 of file SamplerRouter.cxx.

References m_samplers.

00044                                                                  {
00045     v.clear();
00046     std::map<double, ISampler*>::const_iterator iter = m_samplers.begin();
00047     std::map<double, ISampler*>::const_iterator end = m_samplers.end();
00048     for(;iter!=end;++iter){ v.push_back( (*iter).second ); }
00049    }

Member Data Documentation

double FastShower::SamplerRouter::m_floor [private]
 

minimum level for indexed quantity. max level is obtained from the map.

Definition at line 61 of file SamplerRouter.h.

Referenced by sample(), and SamplerRouter().

SamplerTable FastShower::SamplerRouter::m_samplers [private]
 

Definition at line 65 of file SamplerRouter.h.

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


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