LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evgb::EvtTimeNone Class Reference

time distribution that is delta of 0 (no shift) More...

#include "EvtTimeNone.h"

Inheritance diagram for evgb::EvtTimeNone:
evgb::EvtTimeShiftI

Public Member Functions

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

Protected Member Functions

std::vector< std::string > GetConfigTokens (const std::string &config)
 

Protected Attributes

TRandom * fRndmGen
 
bool fIsOwned
 
bool fIsSeeded
 

Detailed Description

time distribution that is delta of 0 (no shift)

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

2015-06-22

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

Definition at line 22 of file EvtTimeNone.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file EvtTimeNone.cxx.

References Config().

21  : EvtTimeShiftI(config)
22  { Config(config); }
EvtTimeShiftI(const std::string &config)
virtual void Config(const std::string &config)
Definition: EvtTimeNone.cxx:26
evgb::EvtTimeNone::~EvtTimeNone ( )
virtual

Definition at line 24 of file EvtTimeNone.cxx.

24 { ; }

Member Function Documentation

void evgb::EvtTimeNone::Config ( const std::string &  config)
virtual

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

Implements evgb::EvtTimeShiftI.

Definition at line 26 of file EvtTimeNone.cxx.

Referenced by EvtTimeNone().

27  {
28  }
std::vector< std::string > evgb::EvtTimeShiftI::GetConfigTokens ( const std::string &  config)
protectedinherited

Definition at line 69 of file EvtTimeShiftI.cxx.

References x.

Referenced by evgb::EvtTimeFNALBeam::Config(), evgb::EvtTimeShiftI::EvtTimeShiftI(), and evgb::EvtTimeShiftI::IsRandomGeneratorSeeded().

70  {
71 
72  std::vector<std::string> strs;
73  if ( config == "" ) return strs;
74 
75  std::string configLocal = config;
76 
77  // blindly reduced UPPER -> lower case above to make this easier
78  // convert string to lowercase
79  std::transform(configLocal.begin(),configLocal.end(),
80  configLocal.begin(),::tolower);
81 
82  // for now make use of GENIE utilities
83  strs = genie::utils::str::Split(configLocal,"\t\n ,;=(){}[]");
84 
85  // weed out blank ones
86  strs.erase(std::remove_if(strs.begin(), strs.end(),
87  [](const std::string& x) {
88  return ( x == "") ; // put your condition here
89  }), strs.end());
90 
91  // debugging info
92  std::ostringstream msgx;
93  msgx << "Config elements:" << std::endl;
94  for (size_t j=0; j<strs.size(); ++j) {
95  msgx << " [" << std::setw(3) << j << "] -->" << strs[j] << "<--\n";
96  }
97  // this should end up as LogDebug
98  mf::LogDebug("EvtTime") << msgx.str() << std::flush;
99 
100  return strs;
101  }
Float_t x
Definition: compare.C:6
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
TRandom* evgb::EvtTimeShiftI::GetRandomGenerator ( ) const
inlineinherited

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 evgb::EvtTimeShiftI::fRndmGen.

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

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

Definition at line 62 of file EvtTimeShiftI.h.

References evgb::EvtTimeShiftI::fIsOwned.

62 { return fIsOwned; }
bool evgb::EvtTimeShiftI::IsRandomGeneratorSeeded ( ) const
inlineinherited
void evgb::EvtTimeNone::PrintConfig ( bool  verbose = true)
virtual

provide a means of printing the configuration

Implements evgb::EvtTimeShiftI.

Definition at line 40 of file EvtTimeNone.cxx.

41  {
42  }
void evgb::EvtTimeShiftI::SetRandomGenerator ( TRandom *  gen,
bool  isOwned 
)
inherited

Definition at line 60 of file EvtTimeShiftI.cxx.

References evgb::EvtTimeShiftI::fIsOwned, and evgb::EvtTimeShiftI::fRndmGen.

Referenced by evgb::EvtTimeShiftI::IsRandomGeneratorSeeded().

61  {
62  // deal with what we might already have
63  if ( fIsOwned ) { delete fRndmGen; fRndmGen = 0; fIsOwned = false; }
64 
65  fRndmGen = gen;
66  fIsOwned = isOwned;
67  }
double evgb::EvtTimeNone::TimeOffset ( )
virtual

return time within a 'record' in nanoseconds version taking array might be used for relative batch fractions that vary on a record-by-record basis

Implements evgb::EvtTimeShiftI.

Definition at line 30 of file EvtTimeNone.cxx.

Referenced by TimeOffset().

31  {
32  return 0;
33  }
double evgb::EvtTimeNone::TimeOffset ( std::vector< double >  v)
virtual

Implements evgb::EvtTimeShiftI.

Definition at line 35 of file EvtTimeNone.cxx.

References TimeOffset().

36  {
37  return TimeOffset();
38  }
virtual double TimeOffset()
Definition: EvtTimeNone.cxx:30

Member Data Documentation

bool evgb::EvtTimeShiftI::fIsOwned
protectedinherited
bool evgb::EvtTimeShiftI::fIsSeeded
protectedinherited

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