EvtTimeFlat.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file EvtTimeFlat.h
3 /// \class evgb::EvtTimeFlat
4 /// \brief Flat time distribution
5 ///
6 /// \author Robert Hatcher <rhatcher \at fnal.gov>
7 /// Fermi National Accelerator Laboratory
8 ///
9 /// \created 2015-06-22
10 /// \version $Id: EvtTimeFlat.h,v 1.1 2015/06/30 18:01:24 rhatcher Exp $
11 ////////////////////////////////////////////////////////////////////////
12 
13 #ifndef SIMB_EVTTIMEFLAT_H
14 #define SIMB_EVTTIMEFLAT_H
15 
16 #include "EvtTimeShiftI.h"
17 #include <string>
18 #include <vector>
19 
20 namespace evgb {
21 
23 
24  public:
25 
27  virtual ~EvtTimeFlat();
28 
29  //
30  // complete the EvtTimeShiftI interface:
31  //
32 
33  /// each schema must take a string that configures it
34  /// it is up to the individual model to parse said string
35  /// and extract parameters
36  virtual void Config(const std::string& config );
37 
38  /// return time within a 'record' in nanoseconds
39  /// version taking array might be used for relative batch fractions
40  /// that vary on a record-by-record basis
41  virtual double TimeOffset();
42  virtual double TimeOffset(std::vector<double> v);
43 
44  /// provide a means of printing the configuration
45  virtual void PrintConfig(bool verbose=true);
46 
47  /// specific methods for this variant
48  void SetDuration(double val) { fDuration=val; }
49  double GetDuration() const { return fDuration; }
51  double GetGlobalOffset() const { return fGlobalOffset; }
52 
53  private:
54 
55  double fDuration; ///< duration (in ns)
56  double fGlobalOffset; ///< always displaced by this (in ns)
57 
58  };
59 
60 } // namespace evgb
61 
62 #endif //SIMB_EVTTIMEFLAT_H
double GetGlobalOffset() const
Definition: EvtTimeFlat.h:51
std::string string
Definition: nybbler.cc:12
Flat time distribution.
Definition: EvtTimeFlat.h:22
virtual void Config(const std::string &config)
Definition: EvtTimeFlat.cxx:28
interface for event time distribution
Definition: EvtTimeShiftI.h:29
double GetDuration() const
Definition: EvtTimeFlat.h:49
virtual void PrintConfig(bool verbose=true)
provide a means of printing the configuration
Definition: EvtTimeFlat.cxx:52
virtual ~EvtTimeFlat()
Definition: EvtTimeFlat.cxx:26
double fDuration
duration (in ns)
Definition: EvtTimeFlat.h:55
static Config * config
Definition: config.cpp:1054
virtual double TimeOffset()
Definition: EvtTimeFlat.cxx:41
verbose
Definition: train.py:477
double fGlobalOffset
always displaced by this (in ns)
Definition: EvtTimeFlat.h:56
EvtTimeFlat(const std::string &config)
Definition: EvtTimeFlat.cxx:20
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33
void SetDuration(double val)
specific methods for this variant
Definition: EvtTimeFlat.h:48
void SetGlobalOffset(double val)
Definition: EvtTimeFlat.h:50