Belle II Software development
Layer.cc
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 wire layer.
11//-----------------------------------------------------------------------------
12
13#define TRG_SHORT_NAMES
14#define TRGCDC_SHORT_NAMES
15
16#include <iostream>
17#include "trg/cdc/Cell.h"
18#include "trg/cdc/Layer.h"
19
20using namespace std;
21
22namespace Belle2 {
27
30 9999,
31 9999,
32 9999,
33 9999,
34 0,
35 0,
36 9999,
37 9999,
38 0,
39 0);
40
66
68 const TRGCDCCell& w)
69 : _id(id),
74 _offset(w.layer().offset()),
75 _nShifts(w.layer().nShifts()),
77 _nCells(w.layer().nCells()),
78 _innerRadius(), // 2019/07/31 by ytlai
80 {
81 }
82
84 : _id(0),
89 _offset(0),
90 _nShifts(0),
91 _cellSize(0),
92 _nCells(0),
93 _innerRadius(0),
95 {
96 }
97
101
102 void
103 TRGCDCLayer::dump(const string&, const string& pre) const
104 {
105 cout << pre;
106 cout << "layer " << _id;
107 cout << ", " << stereoType();
108 cout << ", super layer " << _superLayerId;
109 cout << ", local layer " << _localLayerId;
110 if (axial()) cout << ", axial ";
111 else cout << ", stereo ";
112 cout << _axialStereoLayerId;
113 if (axial()) cout << ", axial super ";
114 else cout << ", stereo super ";
116 cout << ", " << _nCells << " wires";
117 cout << endl;
118 // for (int i=0;i<_nCells;++i) wire(i)->dump(pre);
119 }
120
121 const TRGCDCCell&
122 TRGCDCLayer::cell(int id) const
123 {
124 if (_nCells == 0) {
125 cout << "TRGCDCLayer !!! This has no cell member : " << name() << endl;
126 return * dynamic_cast<const TRGCDCCell*>(TRGCDCUndefinedLayer);
127 }
128
129 if (id < 0)
130 while (id < 0)
131 id += _nCells;
132
133 if (id >= (int) _nCells)
134 id %= (int) _nCells;
135
136 return * (* this)[id];
137 }
138
140} // namespace Belle2
141
A class to represent a wire in CDC.
Definition Cell.h:40
A class to represent a cell layer.
Definition Layer.h:33
const std::string _name
Layer name.
Definition Layer.h:116
const unsigned _id
ID in whole CDC.
Definition Layer.h:119
const unsigned _axialStereoLayerId
ID in whole CDC counting only axial or stereo.
Definition Layer.h:128
const float _offset
Cell position offset from X axis in cell unit.
Definition Layer.h:134
const unsigned _nCells
# of cells
Definition Layer.h:143
const unsigned _superLayerId
Super layer ID.
Definition Layer.h:122
const int _nShifts
Stereo angle in cell unit.
Definition Layer.h:137
const unsigned _localLayerId
ID in a super layer.
Definition Layer.h:125
float _innerRadius
Inner radius.
Definition Layer.h:146
float _outerRadius
Outer radius.
Definition Layer.h:149
const unsigned _axialStereoSuperLayerId
Super layer ID counting only axial or stereo.
Definition Layer.h:131
const float _cellSize
Cell size.
Definition Layer.h:140
virtual ~TRGCDCLayer()
Destructor.
Definition Layer.cc:98
float innerRadius(void) const
sets and returns inner radius.
Definition Layer.h:250
float cellSize(void) const
returns cell size.
Definition Layer.h:231
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition Layer.cc:103
unsigned id(void) const
returns id.
Definition Layer.h:159
const TRGCDCLayer * TRGCDCUndefinedLayer
TRGCDCUndefinedLayer declaration.
Definition Layer.cc:29
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition Layer.h:173
const std::string & name(void) const
return name.
Definition Layer.h:264
unsigned superLayerId(void) const
returns super layer id.
Definition Layer.h:166
const std::string stereoType(void) const
returns "A" or "U" or "V" depending on stereo type.
Definition Layer.h:238
TRGCDCLayer()
Empty constructor for reduced CDC.
Definition Layer.cc:83
unsigned axialStereoSuperLayerId(void) const
returns id of axial or stereo super layer id.
Definition Layer.h:224
float offset(void) const
returns offset.
Definition Layer.h:180
unsigned axialStereoLayerId(void) const
returns id of axial or stereo id.
Definition Layer.h:217
int nShifts(void) const
returns shifts. (non-zero for stereo layers)
Definition Layer.h:187
unsigned nCells(void) const
returns # of cells.
Definition Layer.h:194
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:122
bool axial(void) const
returns true if this is an axial layer.
Definition Layer.h:201
float outerRadius(void) const
sets and returns outer radius.
Definition Layer.h:257
Abstract base class for different kinds of events.
STL namespace.