BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAlignAlg/MdcAlignAlg-00-01-04/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
96 /* set wire properties */
97 void setWireId(int iWire) { m_iWire = iWire; }
98 void setLayerId(int iLay) { m_iLay = iLay; }
99 void setCellId(int iCell) { m_iCell = iCell; }
100 void setPreAmpId(int iPreamp) { m_iAmp = iPreamp; }
101
102 void setChannel(int ch) { m_ch = ch; }
103 void setFanId(int iFan) { m_iFan = iFan; }
104 void setEndId(int iEnd) { m_iEnd = iEnd; }
105
106 void setWireLabel(char* label) { strcpy(m_label, label); }
107 void setWireTag(char* tag) { strcpy(m_tag, tag); }
108
109 /* set coordinate of the wire of each endplate */
110 /* 0-2: xf, yf, zf; 3-5: xb, yb, zb */
111 void setWirePos(double wpos[]);
112
113 /* set coordinate of the wire at the forward(east, z>0) endplate, [mm] */
114 void setXf(double xf) { m_wpos[0] = xf; }
115 void setYf(double yf) { m_wpos[1] = yf; }
116 void setZf(double zf) { m_wpos[2] = zf; }
117
118 /* set coordinate of the wire at the backward(west, z<0) endplate, [mm] */
119 void setXb(double xb) { m_wpos[3] = xb; }
120 void setYb(double yb) { m_wpos[4] = yb; }
121 void setZb(double zb) { m_wpos[5] = zb; }
122
123 /* set layer radius and phi of the forward endpoint */
124 void setPhiForward(double phi) { m_phif = phi; }
125
126 void setTension(double tension) { m_ten = tension; }
127 void setSag(double sag) { m_sag = sag; }
128
129 /* set pointer to the layer which the wire belongs */
130 void setLayerPtr(MdcCosLayer* layerptr) { m_play = layerptr; }
131
132private:
133 /* wire id of the wire, 0 ~ 6796 */
134 int m_iWire;
135
136 /* layer id of the wire, 0 ~ 42 */
137 int m_iLay;
138
139 /* cell id of the wire in the layer */
140 int m_iCell;
141
142 /* index of pre-amplifier, beginning from 1 */
143 int m_iAmp;
144
145 int m_ch;
146 int m_iFan;
147 int m_iEnd; /* 1 for east, 0 for west */
148
149 /* label of the wire, e.g. "1S01-1" */
150 char m_label[100];
151
152 /* tag of the wire, "layid_cellid_wireid_ampid" */
153 /* layid, cellid, wireid begin from 0; ampid begins from 1 */
154 char m_tag[100];
155
156 /* coordinate of the wire at each endplate, [mm] */
157 /* 0-2: xf, yf, zf; 3-5: xb, yb, zb */
158 double m_wpos[6];
159
160 /* phi of the wire at the forward endpoint */
161 double m_phif;
162
163 /* tension of the wire, [g] */
164 double m_ten;
165
166 /* sag of the wire, [mm] */
167 double m_sag;
168
169 /* pointer to the layer which the wire belongs */
170 const MdcCosLayer* m_play;
171
172};
173
174inline void MdcCosWire::getWirePos(double wpos[]) const {
175 for(int i=0; i<6; i++){
176 wpos[i] = m_wpos[i];
177 }
178}
179
180inline void MdcCosWire::getWireCenPos(double wcenpos[]) const{
181 wcenpos[0] = 0.5 * (m_wpos[0] + m_wpos[3]);
182 wcenpos[1] = 0.5 * (m_wpos[1] + m_wpos[4]);
183 wcenpos[2] = 0.5 * (m_wpos[2] + m_wpos[5]);
184}
185
186#endif /* MDCCOSWIRE_H */
void setWirePos(double wpos[])