Belle II Software  release-05-01-25
TRGGRL.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : TRGGRL.h
5 // Section : TRG GRL
6 // Owner : Yun-Tsung Lai
7 // Email : ytlai@hep1.phys.ntu.edu.tw
8 //-----------------------------------------------------------------------------
9 // Description : A class to represent GRL.
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifndef TRGGRL_FLAG_
15 #define TRGGRL_FLAG_
16 
17 #define TRGGRL_UNDEFINED 999999
18 
19 #include <vector>
20 #include "trg/trg/Clock.h"
21 #include "trg/grl/TRGGRLMatch.h"
22 #include <TFile.h>
23 #include <TTree.h>
24 
25 
26 namespace HepGeom {
27  template <class T> class Point3D;
28 }
29 
30 namespace Belle2 {
36  class TRGTime;
37  class TRGClock;
38  class TRGLink;
39  class TRGGRL;
40 
41 // The instance of TRGGRL is a singleton. 'TRGGRL::getTRGGRL()'
42 // gives you a pointer to access the TRGGRL. Geometrical information
43 // is initialized automatically. Before accessing hit information,
44 // user has to call 'update()' to initialize hit information event
45 // by event.
46 
48  class TRGGRL {
49 
50  public:
51 
53  static TRGGRL* getTRGGRL(const std::string& configFile,
54  unsigned simulationMode = 0,
55  unsigned fastSimulationMode = 0,
56  unsigned firmwareSimulationMode = 0);
57 
60  static TRGGRL* getTRGGRL(void);
61 
62  private:
63 
65  TRGGRL(const std::string& configFile,
66  unsigned simulationMode,
67  unsigned fastSimulationMode,
68  unsigned firmwareSimulationMode);
69 
71  virtual ~TRGGRL();
72 
74  void initialize(void);
75 
77  void configure(void);
78 
80  void simulate(void);
81 
83  void terminate(void);
84 
86  //bool barrel_matching_2D(TRGCDCTrack *, TRGECLCluster *);
87 
88  public:// Selectors
89 
91  std::string name(void) const;
92 
94  std::string version(void) const;
95 
97  std::string configFile(void) const;
98 
100  unsigned mode(void) const;
101 
103  unsigned mode(unsigned);
104 
106  unsigned firmwareSimulationMode(void) const;
107 
109  void dump(const std::string& message) const;
110 
112  int debugLevel(void) const;
113 
115  int debugLevel(int) const;
116 
117  public:// Event by event information.
118 
120  void clear(void);
121 
123  void fastClear(void);
124 
126  void update(bool mcAnalysis = true);
127 
128  public:// Utility functions
129 
130  public:// TRG information
131 
133  const TRGClock& systemClock(void) const;
134 
135  private:
136 
138  void fastSimulation(void);
139 
141  void firmwareSimulation(void);
142 
143  private:
144 
146  static TRGGRL* _grl;
147 
149  mutable int _debugLevel;
150 
152  std::string _configFilename;
153 
155  unsigned _simulationMode;
156 
159 
162 
164  const TRGClock& _clock;
165 
167  TFile* m_file;
168 
170  TTree* h1;
171 
173  double x0;
175  double x1;
177  double x2;
179  double x3;
181  double x4;
183  double x5;
185  double x6;
187  double x7;
189  double x8;
191  double x9;
193  std::vector<TRGGRLMatch* > matchList;
195  std::vector<TRGGRLMatch* > matchList3D;
196 
197  friend class TRGGRLModule;
198  };
199 
200 //-----------------------------------------------------------------------------
201 
202  inline
203  int
204  TRGGRL::debugLevel(void) const
205  {
206  return _debugLevel;
207  }
208 
209  inline
210  int
211  TRGGRL::debugLevel(int a) const
212  {
213  return _debugLevel = a;
214  }
215 
216  inline
217  const TRGClock&
219  {
220  return _clock;
221  }
222 
223  inline
224  unsigned
226  {
228  }
229 
230  inline
231  std::string
232  TRGGRL::configFile(void) const
233  {
234  return _configFilename;
235  }
236 
238 } // namespace Belle2
239 
240 #endif /* TRGGRL_FLAG_ */
Belle2::TRGGRL::TRGGRL
TRGGRL(const std::string &configFile, unsigned simulationMode, unsigned fastSimulationMode, unsigned firmwareSimulationMode)
Constructor.
Definition: TRGGRL.cc:87
Belle2::TRGGRL
a class for TRGGRL
Definition: TRGGRL.h:48
Belle2::TRGGRL::firmwareSimulationMode
unsigned firmwareSimulationMode(void) const
returns firmware simulation mode.
Definition: TRGGRL.h:225
Belle2::TRGGRL::h1
TTree * h1
root tree
Definition: TRGGRL.h:170
Belle2::TRGGRL::configFile
std::string configFile(void) const
returns configuration file name.
Definition: TRGGRL.h:232
Belle2::TRGGRL::matchList
std::vector< TRGGRLMatch * > matchList
Vector which stores list of TRGGRLMatch without 3D information.
Definition: TRGGRL.h:193
Belle2::TRGGRL::x6
double x6
Temporary variables to make tree in root files.
Definition: TRGGRL.h:185
Belle2::TRGGRL::firmwareSimulation
void firmwareSimulation(void)
Firmware simulation.
Definition: TRGGRL.cc:263
Belle2::TRGGRL::x5
double x5
Temporary variables to make tree in root files.
Definition: TRGGRL.h:183
Belle2::TRGGRL::dump
void dump(const std::string &message) const
dumps debug information.
Definition: TRGGRL.cc:132
Belle2::TRGGRL::simulate
void simulate(void)
fast trigger simulation.
Definition: TRGGRL.cc:169
Belle2::TRGGRL::fastClear
void fastClear(void)
clears TRGGRL information.
Definition: TRGGRL.cc:145
Belle2::TRGGRL::name
std::string name(void) const
matching function
Definition: TRGGRL.cc:44
Belle2::TRGGRL::m_file
TFile * m_file
root file
Definition: TRGGRL.h:167
Belle2::TRGGRL::x9
double x9
Temporary variables to make tree in root files.
Definition: TRGGRL.h:191
Belle2::TRGGRL::x3
double x3
Temporary variables to make tree in root files.
Definition: TRGGRL.h:179
Belle2::TRGGRL::_grl
static TRGGRL * _grl
GRL singleton.
Definition: TRGGRL.h:146
Belle2::TRGGRL::x2
double x2
Temporary variables to make tree in root files.
Definition: TRGGRL.h:177
Belle2::TRGGRL::x4
double x4
Temporary variables to make tree in root files.
Definition: TRGGRL.h:181
Belle2::TRGGRL::debugLevel
int debugLevel(void) const
returns debug level.
Definition: TRGGRL.h:204
Belle2::TRGGRL::mode
unsigned mode(void) const
returns simulation mode.
Belle2::TRGGRL::update
void update(bool mcAnalysis=true)
updates TRGGRL information.
Definition: TRGGRL.cc:150
Belle2::TRGGRL::_debugLevel
int _debugLevel
Debug level.
Definition: TRGGRL.h:149
Belle2::TRGGRL::getTRGGRL
static TRGGRL * getTRGGRL(void)
returns TRGGRL object.
Definition: TRGGRL.cc:80
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGGRL::systemClock
const TRGClock & systemClock(void) const
returns the system clock.
Definition: TRGGRL.h:218
Belle2::TRGGRL::_configFilename
std::string _configFilename
root file name.
Definition: TRGGRL.h:152
Belle2::TRGGRL::x1
double x1
Temporary variables to make tree in root files.
Definition: TRGGRL.h:175
Belle2::TRGGRL::_clock
const TRGClock & _clock
GRL trigger system clock.
Definition: TRGGRL.h:164
Belle2::TRGGRL::~TRGGRL
virtual ~TRGGRL()
Destructor.
Definition: TRGGRL.cc:160
Belle2::TRGGRL::matchList3D
std::vector< TRGGRLMatch * > matchList3D
Vector which stores list of TRGGRLMatch with 3D information.
Definition: TRGGRL.h:195
Belle2::TRGGRL::version
std::string version(void) const
returns version.
Definition: TRGGRL.cc:50
Belle2::TRGGRL::x8
double x8
Temporary variables to make tree in root files.
Definition: TRGGRL.h:189
Belle2::TRGGRLModule
A module to simulate the Global Decision Logic.
Definition: TRGGRLModule.h:34
Belle2::TRGGRL::x0
double x0
Temporary variables to make tree in root files.
Definition: TRGGRL.h:173
Belle2::TRGGRL::_firmwareSimulationMode
unsigned _firmwareSimulationMode
Firmware simulation mode.
Definition: TRGGRL.h:161
Belle2::TRGGRL::_fastSimulationMode
unsigned _fastSimulationMode
Fast simulation mode.
Definition: TRGGRL.h:158
Belle2::TRGGRL::clear
void clear(void)
clears all TRGGRL information.
Definition: TRGGRL.cc:140
Belle2::TRGGRL::_simulationMode
unsigned _simulationMode
Simulation mode.
Definition: TRGGRL.h:155
Belle2::TRGGRL::fastSimulation
void fastSimulation(void)
Fast simulation.
Definition: TRGGRL.cc:258
Belle2::TRGGRL::x7
double x7
Temporary variables to make tree in root files.
Definition: TRGGRL.h:187
Belle2::TRGGRL::terminate
void terminate(void)
terminates when run is finished
Definition: TRGGRL.cc:127
Belle2::TRGGRL::configure
void configure(void)
configures trigger modules for firmware simulation.
Definition: TRGGRL.cc:268
Belle2::Point3D
HepGeom::Point3D< double > Point3D
3D point
Definition: Cell.h:33
Belle2::TRGClock
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:43
Belle2::TRGGRL::initialize
void initialize(void)
initializes GRL.
Definition: TRGGRL.cc:108