Belle II Software  release-05-02-19
Layer.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : Layer.h
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to represent a cell layer.
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifndef TRGCDCLayer_FLAG_
15 #define TRGCDCLayer_FLAG_
16 
17 #include <string>
18 #include <vector>
19 
20 #ifdef TRGCDC_SHORT_NAMES
21 #define TCLayer TRGCDCLayer
22 #endif
23 
24 namespace Belle2 {
30  class TRGCDC;
31  class TRGCDCCell;
32 
34  class TRGCDCLayer : public std::vector<TRGCDCCell*> {
35 
36  public:
37 
39  TRGCDCLayer(unsigned id,
40  unsigned superLayerId,
41  unsigned localLayerId,
42  unsigned axialStereoLayerId,
43  unsigned axialStereoSuperLayerId,
44  float offset,
45  int nShifts,
46  float cellSize,
47  unsigned nCells,
48  float innerRadius,
49  float outerRadius);
50 
52  TRGCDCLayer(unsigned id, const TRGCDCCell& w);
53 
55  virtual ~TRGCDCLayer();
56 
57  public:// Selectors
58 
60  const std::string& name(void) const;
61 
63  unsigned id(void) const;
64 
66  unsigned superLayerId(void) const;
67 
69  unsigned localLayerId(void) const;
70 
72  unsigned axialStereoLayerId(void) const;
73 
75  unsigned axialStereoSuperLayerId(void) const;
76 
78  unsigned nCells(void) const;
79 
81  const TRGCDCCell& cell(int id) const;
82 
84  bool axial(void) const;
85 
87  bool stereo(void) const;
88 
90  float offset(void) const;
91 
93  int nShifts(void) const;
94 
96  float cellSize(void) const;
97 
99  float innerRadius(void) const;
100 
102  float outerRadius(void) const;
103 
105  void dump(const std::string& message = std::string(""),
106  const std::string& prefix = std::string("")) const;
107 
109  const std::string stereoType(void) const;
110 
111  private:
112 
114  const std::string _name;
115 
117  const unsigned _id;
118 
120  const unsigned _superLayerId;
121 
123  const unsigned _localLayerId;
124 
126  const unsigned _axialStereoLayerId;
127 
129  const unsigned _axialStereoSuperLayerId;
130 
132  const float _offset;
133 
135  const int _nShifts;
136 
138  const float _cellSize;
139 
141  const unsigned _nCells;
142 
145 
148 
150  friend class TRGCDC;
151  };
152 
153 //-----------------------------------------------------------------------------
154 
155  inline
156  unsigned
157  TRGCDCLayer::id(void) const
158  {
159  return _id;
160  }
161 
162  inline
163  unsigned
165  {
166  return _superLayerId;
167  }
168 
169  inline
170  unsigned
172  {
173  return _localLayerId;
174  }
175 
176  inline
177  float
179  {
180  return _offset;
181  }
182 
183  inline
184  int
186  {
187  return _nShifts;
188  }
189 
190  inline
191  unsigned
193  {
194  return _nCells;
195  }
196 
197  inline
198  bool
199  TRGCDCLayer::axial(void) const
200  {
201  if (! _nShifts) return true;
202  return false;
203  }
204 
205  inline
206  bool
208  {
209  if (_nShifts) return true;
210  return false;
211  }
212 
213  inline
214  unsigned
216  {
217  return _axialStereoLayerId;
218  }
219 
220  inline
221  unsigned
223  {
225  }
226 
227  inline
228  float
230  {
231  return _cellSize;
232  }
233 
234  inline
235  const std::string
237  {
238  if (axial())
239  return "A";
240  else if (nShifts() > 0)
241  return "U";
242  else
243  return "V";
244  }
245 
246  inline
247  float
249  {
250  return _innerRadius;
251  }
252 
253  inline
254  float
256  {
257  return _outerRadius;
258  }
259 
260  inline
261  const std::string&
262  TRGCDCLayer::name(void) const
263  {
264  return _name;
265  }
266 
268 } // namespace Belle2
269 
270 #endif /* TRGCDCLayer_FLAG_ */
Belle2::TRGCDCLayer::_nShifts
const int _nShifts
Stereo angle in cell unit.
Definition: Layer.h:135
Belle2::TRGCDCLayer::dump
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: Layer.cc:89
Belle2::TRGCDCLayer::nCells
unsigned nCells(void) const
returns # of cells.
Definition: Layer.h:192
Belle2::TRGCDCLayer::_axialStereoLayerId
const unsigned _axialStereoLayerId
ID in whole CDC counting only axial or stereo.
Definition: Layer.h:126
Belle2::TRGCDCLayer::cell
const TRGCDCCell & cell(int id) const
returns a pointer to a cell. 'id' can be negative or 'id' can be greater than 'nCells()'.
Definition: Layer.cc:108
Belle2::TRGCDCLayer::_nCells
const unsigned _nCells
# of cells
Definition: Layer.h:141
Belle2::TRGCDCLayer::_offset
const float _offset
Cell position offset from X axis in cell unit.
Definition: Layer.h:132
Belle2::TRGCDCLayer::axialStereoSuperLayerId
unsigned axialStereoSuperLayerId(void) const
returns id of axial or stereo super layer id.
Definition: Layer.h:222
Belle2::TRGCDCLayer::outerRadius
float outerRadius(void) const
sets and returns outer radius.
Definition: Layer.h:255
Belle2::TRGCDCLayer::localLayerId
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition: Layer.h:171
Belle2::TRGCDCLayer::_localLayerId
const unsigned _localLayerId
ID in a super layer.
Definition: Layer.h:123
Belle2::TRGCDCLayer::_innerRadius
float _innerRadius
Inner radius.
Definition: Layer.h:144
Belle2::TRGCDCLayer::offset
float offset(void) const
returns offset.
Definition: Layer.h:178
Belle2::TRGCDCLayer::name
const std::string & name(void) const
return name.
Definition: Layer.h:262
Belle2::TRGCDCLayer::_superLayerId
const unsigned _superLayerId
Super layer ID.
Definition: Layer.h:120
Belle2::TRGCDCLayer
A class to represent a cell layer.
Definition: Layer.h:34
Belle2::TRGCDCLayer::nShifts
int nShifts(void) const
returns shifts. (non-zero for stereo layers)
Definition: Layer.h:185
Belle2::TRGCDCCell
A class to represent a wire in CDC.
Definition: Cell.h:41
Belle2::TRGCDCLayer::innerRadius
float innerRadius(void) const
sets and returns inner radius.
Definition: Layer.h:248
Belle2::TRGCDCLayer::axial
bool axial(void) const
returns true if this is an axial layer.
Definition: Layer.h:199
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGCDCLayer::_name
const std::string _name
Layer name.
Definition: Layer.h:114
Belle2::TRGCDCLayer::cellSize
float cellSize(void) const
returns cell size.
Definition: Layer.h:229
Belle2::TRGCDCLayer::superLayerId
unsigned superLayerId(void) const
returns super layer id.
Definition: Layer.h:164
Belle2::TRGCDCLayer::_cellSize
const float _cellSize
Cell size.
Definition: Layer.h:138
Belle2::TRGCDCLayer::axialStereoLayerId
unsigned axialStereoLayerId(void) const
returns id of axial or stereo id.
Definition: Layer.h:215
Belle2::TRGCDCLayer::id
unsigned id(void) const
returns id.
Definition: Layer.h:157
Belle2::TRGCDC
The instance of TRGCDC is a singleton.
Definition: TRGCDC.h:70
Belle2::TRGCDCLayer::stereo
bool stereo(void) const
returns true if this is a stereo layer.
Definition: Layer.h:207
Belle2::TRGCDCLayer::~TRGCDCLayer
virtual ~TRGCDCLayer()
Destructor.
Definition: Layer.cc:84
Belle2::TRGCDCLayer::_axialStereoSuperLayerId
const unsigned _axialStereoSuperLayerId
Super layer ID counting only axial or stereo.
Definition: Layer.h:129
Belle2::TRGCDCLayer::_id
const unsigned _id
ID in whole CDC.
Definition: Layer.h:117
Belle2::TRGCDCLayer::_outerRadius
float _outerRadius
Outer radius.
Definition: Layer.h:147
Belle2::TRGCDCLayer::stereoType
const std::string stereoType(void) const
returns "A" or "U" or "V" depending on stereo type.
Definition: Layer.h:236
Belle2::TRGCDCLayer::TRGCDCLayer
TRGCDCLayer(unsigned id, unsigned superLayerId, unsigned localLayerId, unsigned axialStereoLayerId, unsigned axialStereoSuperLayerId, float offset, int nShifts, float cellSize, unsigned nCells, float innerRadius, float outerRadius)
Constructor.
Definition: Layer.cc:42