BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAlignAlg/share/distAlign/src/include/MdcCosWire.h
Go to the documentation of this file.
1/* Class MdcCosWire describes the sense wire property */
2/* Created by Wu Linghui, 2006/05/26 */
3
4#ifndef MDCCOSWIRE_H
5#define MDCCOSWIRE_H
6
7#include <cstdio>
8#include <cstring>
9
10#include "MdcCosLayer.h"
11
13public:
14 /* /\* constructor *\/ */
15 /* MdcCosWire(); */
16
17 /* /\* destructor *\/ */
18 /* ~MdcCosWire(); */
19
20 /* get wire index, 0 ~ 6796 */
21 int getWireId() const { return m_iWire; }
22
23 /* get layer index, 0 ~ 42 */
24 int getLayerId() const { return m_iLay; }
25
26 /* get cell index in the layer */
27 int getCellId() const { return m_iCell; }
28
29 /* get pre-amplifier index */
30 int getPreAmpId() const { return m_iAmp; }
31
32 int getChannel() const { return m_ch; }
33 int getFanId() const { return m_iFan; }
34 int getEndId() const { return m_iEnd; }
35
36 /* get wire label, e.g. "1S01-1" */
37 const char* getWireLabel() const { return m_label; }
38
39 /* get wire tag, "layerid_cellid_wireid_preampid" */
40 /* layer, cell, wire begin from 0, preamp begins from 1 */
41 const char* getWireTag() const { return m_tag; }
42
43 /* get coordinate of the wire of each endplate */
44 /* 0-2: xf, yf, zf; 3-5: xb, yb, zb */
45 void getWirePos( double wpos[] ) const;
46
47 /* get coordinate of the center of the wire */
48 void getWireCenPos( double wcenpos[] ) const;
49
50 /* get coordinate of the wire at the forward(east, z>0) endplate, [mm] */
51 double getXf() const { return m_wpos[0]; }
52 double getYf() const { return m_wpos[1]; }
53 double getZf() const { return m_wpos[2]; }
54
55 /* get coordinate of the wire at the backward(west, z<0) endplate, [mm] */
56 double getXb() const { return m_wpos[3]; }
57 double getYb() const { return m_wpos[4]; }
58 double getZb() const { return m_wpos[5]; }
59
60 /* get phi of the wire at the forward endpoint */
61 double getPhiForward() const { return m_phif; }
62
63 double getPhi( double z ) const;
64
65 /* get tension of the wire, [g] */
66 double getTension() const { return m_ten; }
67
68 /* get sag of the wire, [mm] */
69 double getSag() const { return m_sag; }
70
71 /* get pointer to the layer which the wire belongs to */
72 const MdcCosLayer* getLayerPtr() const { return m_play; }
73
74 /* get wire type, 0 for axial, 1 for stereo-, 2 for stereo+ */
75 int getWireType() const { return m_play->getLayerType(); }
76
77 /* get radius at the endplate */
78 double getRad() const { return m_play->getLayerRad(); }
79
80 /* get length of the wire in z direction, [mm] */
81 double getLength() const { return m_play->getLength(); }
82
83 /* get number of twist cells */
84 double getTwistCell() const { return m_play->getTwistCell(); }
85
86 /* get slant angle */
87 double getSlant() const { return m_play->getSlant(); }
88
89 /* get flag of inner chamber, true for inner, false for outer */
90 bool isInner() const { return m_play->isInner(); }
91
92 /* print function */
93 void print( FILE* fout = stdout ) const;
94
95 /* set wire properties */
96 void setWireId( int iWire ) { m_iWire = iWire; }
97 void setLayerId( int iLay ) { m_iLay = iLay; }
98 void setCellId( int iCell ) { m_iCell = iCell; }
99 void setPreAmpId( int iPreamp ) { m_iAmp = iPreamp; }
100
101 void setChannel( int ch ) { m_ch = ch; }
102 void setFanId( int iFan ) { m_iFan = iFan; }
103 void setEndId( int iEnd ) { m_iEnd = iEnd; }
104
105 void setWireLabel( char* label ) { strcpy( m_label, label ); }
106 void setWireTag( char* tag ) { strcpy( m_tag, tag ); }
107
108 /* set coordinate of the wire of each endplate */
109 /* 0-2: xf, yf, zf; 3-5: xb, yb, zb */
110 void setWirePos( double wpos[] );
111
112 /* set coordinate of the wire at the forward(east, z>0) endplate, [mm] */
113 void setXf( double xf ) { m_wpos[0] = xf; }
114 void setYf( double yf ) { m_wpos[1] = yf; }
115 void setZf( double zf ) { m_wpos[2] = zf; }
116
117 /* set coordinate of the wire at the backward(west, z<0) endplate, [mm] */
118 void setXb( double xb ) { m_wpos[3] = xb; }
119 void setYb( double yb ) { m_wpos[4] = yb; }
120 void setZb( double zb ) { m_wpos[5] = zb; }
121
122 /* set layer radius and phi of the forward endpoint */
123 void setPhiForward( double phi ) { m_phif = phi; }
124
125 void setTension( double tension ) { m_ten = tension; }
126 void setSag( double sag ) { m_sag = sag; }
127
128 /* set pointer to the layer which the wire belongs */
129 void setLayerPtr( MdcCosLayer* layerptr ) { m_play = layerptr; }
130
131private:
132 /* wire id of the wire, 0 ~ 6796 */
133 int m_iWire;
134
135 /* layer id of the wire, 0 ~ 42 */
136 int m_iLay;
137
138 /* cell id of the wire in the layer */
139 int m_iCell;
140
141 /* index of pre-amplifier, beginning from 1 */
142 int m_iAmp;
143
144 int m_ch;
145 int m_iFan;
146 int m_iEnd; /* 1 for east, 0 for west */
147
148 /* label of the wire, e.g. "1S01-1" */
149 char m_label[100];
150
151 /* tag of the wire, "layid_cellid_wireid_ampid" */
152 /* layid, cellid, wireid begin from 0; ampid begins from 1 */
153 char m_tag[100];
154
155 /* coordinate of the wire at each endplate, [mm] */
156 /* 0-2: xf, yf, zf; 3-5: xb, yb, zb */
157 double m_wpos[6];
158
159 /* phi of the wire at the forward endpoint */
160 double m_phif;
161
162 /* tension of the wire, [g] */
163 double m_ten;
164
165 /* sag of the wire, [mm] */
166 double m_sag;
167
168 /* pointer to the layer which the wire belongs */
169 const MdcCosLayer* m_play;
170};
171
172inline void MdcCosWire::getWirePos( double wpos[] ) const {
173 for ( int i = 0; i < 6; i++ ) { wpos[i] = m_wpos[i]; }
174}
175
176inline void MdcCosWire::getWireCenPos( double wcenpos[] ) const {
177 wcenpos[0] = 0.5 * ( m_wpos[0] + m_wpos[3] );
178 wcenpos[1] = 0.5 * ( m_wpos[1] + m_wpos[4] );
179 wcenpos[2] = 0.5 * ( m_wpos[2] + m_wpos[5] );
180}
181
182#endif /* MDCCOSWIRE_H */
void setWirePos(double wpos[])
void print(FILE *fout=stdout) const