LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evgb::EvtTimeShiftI Class Referenceabstract

interface for event time distribution More...

#include "EvtTimeShiftI.h"

Inheritance diagram for evgb::EvtTimeShiftI:
evgb::EvtTimeFlat evgb::EvtTimeFNALBeam evgb::EvtTimeNone

Public Member Functions

 EvtTimeShiftI (const std::string &config)
 
virtual ~EvtTimeShiftI ()
 
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 More...
 
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.

Author
Robert Hatcher <rhatcher fnal.gov> Fermi National Accelerator Laboratory

2015-06-22

Version
Id
EvtTimeShiftI.h,v 1.1 2015/06/30 18:01:24 rhatcher Exp

Definition at line 29 of file EvtTimeShiftI.h.

Constructor & Destructor Documentation

evgb::EvtTimeShiftI::EvtTimeShiftI ( const std::string &  config)

Definition at line 17 of file EvtTimeShiftI.cxx.

18  : fRndmGen(new TRandom3), fIsOwned(true)
19  {
20  // user should call Config(config) in their constructor
21  }
evgb::EvtTimeShiftI::~EvtTimeShiftI ( )
virtual

Definition at line 23 of file EvtTimeShiftI.cxx.

References fIsOwned, and fRndmGen.

24  {
25  if (fIsOwned) delete fRndmGen;
26  fRndmGen = 0;
27  }

Member Function Documentation

virtual void evgb::EvtTimeShiftI::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 evgb::EvtTimeFlat, evgb::EvtTimeFNALBeam, and evgb::EvtTimeNone.

TRandom* evgb::EvtTimeShiftI::GetRandomGenerator ( ) const
inline

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

Definition at line 61 of file EvtTimeShiftI.h.

References fRndmGen.

61 { return fRndmGen; }
bool evgb::EvtTimeShiftI::IsRandomGeneratorOwned ( ) const
inline

Definition at line 62 of file EvtTimeShiftI.h.

References fIsOwned, and SetRandomGenerator().

62 { return fIsOwned; }
virtual void evgb::EvtTimeShiftI::PrintConfig ( bool  verbose = true)
pure virtual

provide a means of printing the configuration

Implemented in evgb::EvtTimeFlat, evgb::EvtTimeFNALBeam, and evgb::EvtTimeNone.

Referenced by evgb::GENIEHelper::GENIEHelper().

void evgb::EvtTimeShiftI::SetRandomGenerator ( TRandom *  gen,
bool  isOwned 
)

Definition at line 28 of file EvtTimeShiftI.cxx.

References fIsOwned, and fRndmGen.

Referenced by IsRandomGeneratorOwned().

29  {
30  // deal with what we might already have
31  if ( fIsOwned ) { delete fRndmGen; fRndmGen = 0; fIsOwned = false; }
32 
33  fRndmGen = gen;
34  fIsOwned = isOwned;
35  }
virtual double evgb::EvtTimeShiftI::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 evgb::EvtTimeFlat, evgb::EvtTimeFNALBeam, and evgb::EvtTimeNone.

Referenced by evgb::GENIEHelper::Sample().

virtual double evgb::EvtTimeShiftI::TimeOffset ( std::vector< double >  v)
pure virtual

Member Data Documentation

bool evgb::EvtTimeShiftI::fIsOwned
protected

Definition at line 69 of file EvtTimeShiftI.h.

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

TRandom* evgb::EvtTimeShiftI::fRndmGen
protected

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