LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
EvtTimeShiftI.cxx
Go to the documentation of this file.
1 
12 #include "EvtTimeShiftI.h"
13 #include "TRandom3.h"
14 
15 namespace evgb {
16 
17  EvtTimeShiftI::EvtTimeShiftI(const std::string& config)
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)
EvtTimeShiftI(const std::string &config)
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33