Belle II Software  release-08-01-10
Tracker2D.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 //-----------------------------------------------------------------------------
10 // Description : A class to represent a CDC front-end board
11 //-----------------------------------------------------------------------------
12 
13 #pragma once
14 
15 #include <float.h>
16 #include <string>
17 #include "trg/trg/Board.h"
18 #include "trg/trg/SignalVector.h"
19 #include "trg/trg/SignalBundle.h"
20 
21 #ifdef TRGCDC_SHORT_NAMES
22 #define TCTracker2D TRGCDCTracker2D
23 #endif
24 
25 namespace Belle2 {
31  class TRGState;
32  class TRGCDCTrackSegmentFinder;
33 
36  : public TRGBoard,
37  public std::vector<const TRGCDCTrackSegmentFinder*> {
38 
39  public:
41  TRGCDCTracker2D(const std::string& name,
42  const TRGClock& systemClock,
43  const TRGClock& dataClock,
44  const TRGClock& userClockInput,
45  const TRGClock& userClockOutput);
46 
48  virtual ~TRGCDCTracker2D();
49 
50  public:// Selectors.
51 
53  static std::string version(void);
54 
55  public:// Modifiers
56 
58  void simulate(void);
59 
60  public:// VHDL utilities
61 
63  static unsigned nTSF(void);
64 
66  static unsigned nTSF(unsigned i);
67 
69  static void unpacker(const TRGState& input, TRGState& output);
70 
72  static TRGState packer(const TRGState& input,
73  TRGState& registers,
74  bool& logicStillActive);
75 
77  static void HoughMappingPlus(void);
79  static void HoughMappingMinus(void);
80 
81  public:// Configuration
82 
85 
88  void dump(const std::string& message = "",
89  const std::string& pre = "") const;
90 
91  private:
92 
94  void setConstants(void);
95 
97  static void hitInformation(const TRGState& registers);
98 
99  private:
100 
102  static unsigned _nTSF;
103 
105  static std::vector<unsigned> _n;
106 
108  static TRGState _ts;
109  };
110 
111 //-----------------------------------------------------------------------------
112 
113  inline
114  unsigned
116  {
117  return 160 + 192 + 256 + 320 + 384;
118  }
119 
120  inline
121  unsigned
123  {
124  if (i == 0)
125  return 160;
126  else if (i == 1)
127  return 192;
128  else if (i == 2)
129  return 256;
130  else if (i == 3)
131  return 320;
132  else if (i == 4)
133  return 384;
134  else
135  return 0;
136  }
137 
139 } // namespace Belle2
140 
A class to represent a trigger board.
Definition: Board.h:25
a class of TrackSegmentFinder in TRGCDC
A class to represent a CDC 2D tracker board.
Definition: Tracker2D.h:37
static void HoughMappingPlus(void)
Do core logic simulation for positive charge.
static void HoughMappingMinus(void)
Do core logic simulation for negative charge.
A class to represent a digitized signal. Unit is nano second.
Definition: Clock.h:38
A class to represent a state of multi bits.
Definition: State.h:24
TRGCDCTracker2D(const std::string &name, const TRGClock &systemClock, const TRGClock &dataClock, const TRGClock &userClockInput, const TRGClock &userClockOutput)
Constructor.
Definition: Tracker2D.cc:38
static TRGState packer(const TRGState &input, TRGState &registers, bool &logicStillActive)
Packer for 3D tracker.
Definition: Tracker2D.cc:118
static void unpacker(const TRGState &input, TRGState &output)
Unpack TSF output.
Definition: Tracker2D.cc:157
void push_back(const TRGCDCTrackSegmentFinder *)
Appends a TSF board.
Definition: Tracker2D.cc:58
virtual ~TRGCDCTracker2D()
Destructor.
Definition: Tracker2D.cc:47
const std::string & name(void) const
returns name.
Definition: Board.h:109
static std::vector< unsigned > _n
# of TSFs in super layer i.
Definition: Tracker2D.h:105
static unsigned nTSF(void)
returns # of TSF.
Definition: Tracker2D.h:115
static unsigned _nTSF
# of TSFs.
Definition: Tracker2D.h:102
static std::string version(void)
returns version.
Definition: Tracker2D.cc:52
void simulate(void)
simulates firmware.
Definition: Tracker2D.cc:70
static void hitInformation(const TRGState &registers)
Gets TSF hit information for one certin clock from the registers.
Definition: Tracker2D.cc:204
static TRGState _ts
Keeps TS hit info.
Definition: Tracker2D.h:108
void dump(const std::string &message="", const std::string &pre="") const
dumps contents.
Definition: Tracker2D.cc:64
void setConstants(void)
Sets constants.
Definition: Tracker2D.cc:219
Abstract base class for different kinds of events.