simb::EvtTimeDistI Class Reference

interface for event time distribution More...

#include <EvtTimeDistI.h>

Inheritance diagram for simb::EvtTimeDistI:
simb::EvtTimeFlat simb::EvtTimeFNALBeam

List of all members.

Public Member Functions

 EvtTimeDistI (const std::string &config)
virtual ~EvtTimeDistI ()
virtual void Config (const std::string &config)=0
virtual double TimeOffset ()=0
virtual double TimeOffset (std::vector< double > v)=0
virtual void PrintConfig (bool verbose=true)=0
 provide a means of printing the configuration
TRandom * GetRandomGenerator () const
bool IsRandomGeneratorOwned () const
void SetRandomGenerator (TRandom *gen, bool isOwned)

Protected Attributes

TRandom * fRndmGen
bool fIsOwned

Detailed Description

interface for event time distribution

Specific implementations of this class when are used to generate appropriate times relative to the t0 of a 'record' (spill/snarl/trigger...).

Concrete instances of this interface must be configurable from a string.

Robert Hatcher <rhatcher> Fermi National Accelerator Laboratory


EvtTimeDistI.h,v 1.1 2015/06/30 18:01:24 rhatcher Exp

Definition at line 29 of file EvtTimeDistI.h.

Constructor & Destructor Documentation

simb::EvtTimeDistI::EvtTimeDistI ( const std::string &  config  ) 

Definition at line 17 of file EvtTimeDistI.cxx.

00018     : fRndmGen(new TRandom3), fIsOwned(true)
00019   { 
00020     // user should call Config(config) in their constructor
00021   }

simb::EvtTimeDistI::~EvtTimeDistI (  )  [virtual]

Definition at line 23 of file EvtTimeDistI.cxx.

References fIsOwned, and fRndmGen.

00024   {
00025     if (fIsOwned) delete fRndmGen;
00026     fRndmGen = 0;
00027   }

Member Function Documentation

virtual void simb::EvtTimeDistI::Config ( const std::string &  config  )  [pure virtual]

each schema must take a string that configures it it is up to the individual model to parse said string and extract parameters

Implemented in simb::EvtTimeFlat, and simb::EvtTimeFNALBeam.

TRandom* simb::EvtTimeDistI::GetRandomGenerator (  )  const [inline]

Allow users some control over random # sequences An "owned" object is expected to be deleted by the EvtTimeDist obj

Definition at line 61 of file EvtTimeDistI.h.

References fRndmGen.

00061 { return fRndmGen; }

bool simb::EvtTimeDistI::IsRandomGeneratorOwned (  )  const [inline]

Definition at line 62 of file EvtTimeDistI.h.

References fIsOwned.

00062 { return fIsOwned; }

virtual void simb::EvtTimeDistI::PrintConfig ( bool  verbose = true  )  [pure virtual]

provide a means of printing the configuration

Implemented in simb::EvtTimeFlat, and simb::EvtTimeFNALBeam.

void simb::EvtTimeDistI::SetRandomGenerator ( TRandom *  gen,
bool  isOwned 

Definition at line 28 of file EvtTimeDistI.cxx.

References fIsOwned, and fRndmGen.

00029   {
00030     // deal with what we might already have
00031     if ( fIsOwned ) { delete fRndmGen; fRndmGen = 0; fIsOwned = false; }
00033     fRndmGen = gen;
00034     fIsOwned = isOwned;
00035   }

virtual double simb::EvtTimeDistI::TimeOffset ( std::vector< double >  v  )  [pure virtual]
virtual double simb::EvtTimeDistI::TimeOffset (  )  [pure virtual]

return time (in nanoseconds) for an interaction/event within a record/spill/snarl

version taking array might be used for relative batch fractions that vary on a record-by-record basis

Implemented in simb::EvtTimeFlat, and simb::EvtTimeFNALBeam.

Member Data Documentation

bool simb::EvtTimeDistI::fIsOwned [protected]

Definition at line 69 of file EvtTimeDistI.h.

Referenced by IsRandomGeneratorOwned(), SetRandomGenerator(), and ~EvtTimeDistI().

TRandom* simb::EvtTimeDistI::fRndmGen [protected]

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

Generated on 8 Jul 2019 for loon by  doxygen 1.6.1