ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ReconRandomiser.h
Go to the documentation of this file.
1 #ifndef ReconRandomiser_H
2 #define ReconRandomiser_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "TRandom3.h"
8 
9 #include "Tool.h"
10 #include "TMath.h"
11 #include "Stopwatch.h"
12 
14 
15 static std::string EnumAsString(Distribution_t dist) {
16  switch(dist) {
17  case (kUniform):
18  return "Uniform";
19  break;
20  case (kGauss):
21  return "Gauss";
22  break;
23  case (kFixed):
24  return "Fixed";
25  break;
26  default:
27  return "";
28  }
29  return "";
30 }
31 
32 class ReconRandomiser: public Tool {
33 
34 
35  public:
36 
38  bool Initialise(std::string configfile,DataModel &data);
39  bool Execute();
40  bool Finalise();
41 
42 
43  private:
44 
45  void CreateVertex(double * pos);
46  double GetRandomNumber(Distribution_t dist, double max, double mean, double width, const int maxcount);
47  Distribution_t GetDistributionType(double width, const char * axis);
48 
49  long int fCurrEvent;
50  long int fNEvents;
51 
53 
54  //vertex distribution
55  double fXMean;
56  double fXWidth;
57  double fYMean;
58  double fYWidth;
59  double fZMean;
60  double fZWidth;
61  double fMaxZPos;
62  double fMaxRPos;
63  bool fFlatR;
67 
68  //time distribution
69  double fTMin;
70  double fTMax;
71 
72  //direction distribution
74 
75  TRandom3 * fRand;
76 
80  std::string m_stopwatch_file;
81 
82  int m_verbose;
83 
84  std::stringstream ss;
85 
86  void StreamToLog(int level) {
87  Log(ss.str(), level, m_verbose);
88  ss.str("");
89  }
90 
91  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
92 
93 
94 };
95 
96 
97 #endif
enum EDistribution Distribution_t
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
EDistribution
Distribution_t fYDistribution
std::stringstream ss
Distribution_t fXDistribution
void StreamToLog(int level)
static std::string EnumAsString(Distribution_t dist)
Distribution_t GetDistributionType(double width, const char *axis)
void CreateVertex(double *pos)
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Distribution_t fZDistribution
bool Initialise(std::string configfile, DataModel &data)
TRandom3 * fRand
double GetRandomNumber(Distribution_t dist, double max, double mean, double width, const int maxcount)