EvtTimeFNALBeam.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file EvtTimeFNALBeam.h
3 /// \class evgb::EvtTimeFNALBeam
4 /// \brief configurable FNAL Beam 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: EvtTimeFNALBeam.h,v 1.1 2015/06/30 18:01:24 rhatcher Exp $
11 ////////////////////////////////////////////////////////////////////////
12 
13 #ifndef SIMB_EVTTIMEFNALBEAM_H
14 #define SIMB_EVTTIMEFNALBEAM_H
15 
16 #include "EvtTimeShiftI.h"
17 #include <string>
18 #include <vector>
19 
20 namespace evgb {
21 
23 
24  public:
25 
27  virtual ~EvtTimeFNALBeam();
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> bi);
43 
44  /// provide a means of printing the configuration
45  virtual void PrintConfig(bool verbose=true);
46 
47  /// specific methods for this variant
49  double GetTimeBetweenBuckets() const { return fTimeBetweenBuckets; }
51  double GetBucketTimeSigma() const { return fBucketTimeSigma; }
52  void SetNBucketsPerBatch(int ival) { fNBucketsPerBatch=ival; }
53  int GetNBucketsPerBatch() const { return fNBucketsPerBatch; }
56 
57  void SetBatchIntensities(std::vector<double> bi);
58  void SetDisallowedBatchMask(std::vector<int> disallow);
59 
61  double GetGlobalOffset() const { return fGlobalOffset; }
62 
63  private:
64 
65  void CalculateCPDF(std::vector<double> batchi);
66 
67  double fTimeBetweenBuckets; ///< time between buckets
68  double fBucketTimeSigma; ///< how wide is distribution in bucket
71  std::vector<double> fCummulativeBatchPDF; ///< summed prob for batches
72  std::vector<int> fDisallowedBatchMask; ///< disallow individual batches
73  double fGlobalOffset; ///< always displaced by this (in ns)
74 
75  };
76 
77 } // namespace evgb
78 
79 #endif //SIMB_EVTTIMEFNALBEAM_H
void SetBucketTimeSigma(double val)
std::string string
Definition: nybbler.cc:12
void SetBatchIntensities(std::vector< double > bi)
int GetNFilledBucketsPerBatch() const
double fGlobalOffset
always displaced by this (in ns)
double GetBucketTimeSigma() const
configurable FNAL Beam time distribution
EvtTimeFNALBeam(const std::string &config)
void SetNBucketsPerBatch(int ival)
double fBucketTimeSigma
how wide is distribution in bucket
interface for event time distribution
Definition: EvtTimeShiftI.h:29
void SetGlobalOffset(double val)
void SetNFilledBucketsPerBatch(int ival)
int GetNBucketsPerBatch() const
virtual void PrintConfig(bool verbose=true)
provide a means of printing the configuration
static Config * config
Definition: config.cpp:1054
void CalculateCPDF(std::vector< double > batchi)
virtual void Config(const std::string &config)
verbose
Definition: train.py:477
double GetTimeBetweenBuckets() const
virtual double TimeOffset()
double GetGlobalOffset() const
std::vector< int > fDisallowedBatchMask
disallow individual batches
double fTimeBetweenBuckets
time between buckets
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33
std::vector< double > fCummulativeBatchPDF
summed prob for batches
void SetDisallowedBatchMask(std::vector< int > disallow)
void SetTimeBetweenBuckets(double val)
specific methods for this variant