EvtTimeShiftI.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file EvtTimeShiftI.cxx
3 /// \brief interface for event time distribution
4 ///
5 /// \version $Id: EvtTimeShiftI.cxx,v 1.1 2015/06/30 18:01:24 rhatcher Exp $
6 /// \author Robert Hatcher <rhatcher \at fnal.gov>
7 /// Fermi National Accelerator Laboratory
8 ///
9 /// \update 2015-06-22 initial version
10 ////////////////////////////////////////////////////////////////////////
11 
12 #include "EvtTimeShiftI.h"
13 #include "TRandom3.h"
14 
15 namespace evgb {
16 
18  : fRndmGen(new TRandom3), fIsOwned(true)
19  {
20  // user should call Config(config) in their constructor
21  }
22 
24  {
25  if (fIsOwned) delete fRndmGen;
26  fRndmGen = 0;
27  }
28  void EvtTimeShiftI::SetRandomGenerator(TRandom* gen, bool isOwned)
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  }
36 
37 } // namespace evgb
void SetRandomGenerator(TRandom *gen, bool isOwned)
std::string string
Definition: nybbler.cc:12
static Config * config
Definition: config.cpp:1054
EvtTimeShiftI(const std::string &config)
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33