BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibData::MucIdTransform Class Reference

#include <MucIdTransform.h>

Public Member Functions

 MucIdTransform ()
 
 ~MucIdTransform ()
 
int GetId ()
 
int GetPart ()
 
int GetSegment ()
 
int GetLayer ()
 
int GetStrip ()
 
int GetStripMax (int part, int segment, int layer)
 
int GetBoxId (int part, int segment, int layer)
 
int GetStripId (int part, int segment, int layer, int subid)
 
bool SetBoxPos (int boxid, int *part, int *segment, int *layer)
 
bool SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid)
 
void Print (int)
 
 MucIdTransform ()
 
 ~MucIdTransform ()
 
int GetId ()
 
int GetPart ()
 
int GetSegment ()
 
int GetLayer ()
 
int GetStrip ()
 
int GetStripMax (int part, int segment, int layer)
 
int GetBoxId (int part, int segment, int layer)
 
int GetStripId (int part, int segment, int layer, int subid)
 
bool SetBoxPos (int boxid, int *part, int *segment, int *layer)
 
bool SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid)
 
void Print (int)
 

Detailed Description

Constructor & Destructor Documentation

◆ MucIdTransform() [1/2]

MucIdTransform::MucIdTransform ( )

Definition at line 19 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

20{
21 m_Id = 0;
22 m_Part = 0;
23 m_Segment = 0;
24 m_Layer = 0;
25 m_Strip = 0;
26}

◆ ~MucIdTransform() [1/2]

MucIdTransform::~MucIdTransform ( )

◆ MucIdTransform() [2/2]

CalibData::MucIdTransform::MucIdTransform ( )

◆ ~MucIdTransform() [2/2]

CalibData::MucIdTransform::~MucIdTransform ( )

Member Function Documentation

◆ GetBoxId() [1/2]

int MucIdTransform::GetBoxId ( int  part,
int  segment,
int  layer 
)

Definition at line 52 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

53{
54 int boxId = 0;
55 for(int i=0; i<part; i++) {
56 boxId += BOX_PER_PART[i];
57 }
58
59 if( segment == 0 )
60 boxId += layer;
61 else
62 boxId += ( segment * BOX_PER_SEG[part] + layer );
63
64 return boxId;
65}

Referenced by GetStripId().

◆ GetBoxId() [2/2]

int CalibData::MucIdTransform::GetBoxId ( int  part,
int  segment,
int  layer 
)

◆ GetId() [1/2]

int MucIdTransform::GetId ( )

Definition at line 32 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

32{ return m_Id; }

◆ GetId() [2/2]

int CalibData::MucIdTransform::GetId ( )

◆ GetLayer() [1/2]

int MucIdTransform::GetLayer ( )

Definition at line 35 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

35{ return m_Layer; }

◆ GetLayer() [2/2]

int CalibData::MucIdTransform::GetLayer ( )

◆ GetPart() [1/2]

int MucIdTransform::GetPart ( )

Definition at line 33 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

33{ return m_Part; }

◆ GetPart() [2/2]

int CalibData::MucIdTransform::GetPart ( )

◆ GetSegment() [1/2]

int MucIdTransform::GetSegment ( )

Definition at line 34 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

34{ return m_Segment; }

◆ GetSegment() [2/2]

int CalibData::MucIdTransform::GetSegment ( )

◆ GetStrip() [1/2]

int MucIdTransform::GetStrip ( )

Definition at line 36 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

36{ return m_Strip; }

◆ GetStrip() [2/2]

int CalibData::MucIdTransform::GetStrip ( )

◆ GetStripId() [1/2]

int MucIdTransform::GetStripId ( int  part,
int  segment,
int  layer,
int  subid 
)

Definition at line 68 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

69{
70 int strId = 0;
71 int boxId = 0;
72
73 boxId = GetBoxId( part, segment, layer );
74
75 if( part == EEID )
76 {
77 strId = boxId*E_STR_NUM + strSubId;
78 }
79 else if( part == BRID )
80 {
81 strId = STR_PER_PART[0];
82
83 if( segment > B_TOP )
84 strId += segment * B_STR_PER_SEG[0] + E_STR_NUM;
85 else
86 strId += segment * B_STR_PER_SEG[0];
87
88 strId += ((1+layer)/2) * B_ZSTR_NUM;
89 strId += (layer/2) * ( (segment == B_TOP)?B_TOPSTR_NUM:B_PHISTR_NUM );
90
91 strId += strSubId;
92 }
93 else
94 {
95 strId = STR_PER_PART[0] + STR_PER_PART[1];
96 strId += (boxId - BOX_SUM[1])*E_STR_NUM + strSubId;
97 }
98
99 return strId;
100}

◆ GetStripId() [2/2]

int CalibData::MucIdTransform::GetStripId ( int  part,
int  segment,
int  layer,
int  subid 
)

◆ GetStripMax() [1/2]

int MucIdTransform::GetStripMax ( int  part,
int  segment,
int  layer 
)

Definition at line 39 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

40{
41 int max = 0;
42
43 if( part != BRID ) max = E_STR_NUM;
44 else if( (layer+1)%2 == 1 ) max = B_ZSTR_NUM;
45 else if( segment == B_TOP ) max = B_TOPSTR_NUM;
46 else max = B_PHISTR_NUM;
47
48 return max;
49}

◆ GetStripMax() [2/2]

int CalibData::MucIdTransform::GetStripMax ( int  part,
int  segment,
int  layer 
)

◆ Print() [1/2]

void MucIdTransform::Print ( int  mode)

Definition at line 204 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

205{
206 if( mode == 0 ) // position to id
207 {
208 cout << "prt: " << m_Part
209 << "\tseg: " << m_Segment
210 << "\tlay: " << m_Layer
211 << "\tstr: " << m_Strip
212 << "\tid: " << m_Id << endl;
213 }
214 else // id to position
215 {
216 cout << "id: " << m_Id
217 << "\tprt: " << m_Part
218 << "\tseg: " << m_Segment
219 << "\tlay: " << m_Layer
220 << "\tstr: " << m_Strip << endl;
221 }
222}

◆ Print() [2/2]

void CalibData::MucIdTransform::Print ( int  )

◆ SetBoxPos() [1/2]

bool MucIdTransform::SetBoxPos ( int  boxid,
int *  part,
int *  segment,
int *  layer 
)

Definition at line 103 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

104{
105
106 if( (boxId < 0) || (boxId > BOX_MAX-1) )
107 {
108 *part = 0;
109 *segment = 0;
110 *layer = 0;
111 cout << "box id out range:\t" << boxId << "!" << endl;
112 return false;
113 }
114
115 // get part
116 if( boxId < BOX_SUM[0] ) { *part = 0; }
117 else if( boxId < BOX_SUM[1] ) { *part = 1; boxId -= BOX_SUM[0]; }
118 else { *part = 2; boxId -= BOX_SUM[1]; }
119
120 // get segment and layer
121 if( *part == BRID )
122 {
123 *segment = boxId / B_LAY_NUM;
124 *layer = boxId % B_LAY_NUM;
125 }
126 else
127 {
128 *segment = boxId / E_LAY_NUM;
129 *layer = boxId % E_LAY_NUM;
130 }
131
132 return true;
133}

Referenced by RootMucCalibDataCnv::i_createObj(), and TreeMucCalibDataCnv::i_createObj().

◆ SetBoxPos() [2/2]

bool CalibData::MucIdTransform::SetBoxPos ( int  boxid,
int *  part,
int *  segment,
int *  layer 
)

◆ SetStripPos() [1/2]

bool MucIdTransform::SetStripPos ( int  stripid,
int *  part,
int *  segment,
int *  layer,
int *  subid 
)

Definition at line 136 of file Calibration/CalibData/CalibData-00-01-22/src/Muc/MucIdTransform.cxx.

137{
138 if( (stripId < 0) || (stripId > STRIP_MAX-1) )
139 {
140 *part = 0;
141 *segment = 0;
142 *layer = 0;
143 *strSubId = 0;
144 cout << "strip id out range:\t" << stripId << "!" << endl;
145 return false;
146 }
147
148 // get part
149 if( stripId < STR_SUM[0] ) { *part = 0; }
150 else if ( stripId < STR_SUM[1] ) { *part = 1; stripId -= STR_SUM[0]; }
151 else { *part = 2; stripId -= STR_SUM[1]; }
152
153 // get segment and layer
154 if( *part == BRID )
155 {
156 int temp = 0;
157 if ( stripId >= 2*B_STR_PER_SEG[0] && stripId < 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] )
158 {
159 // get segment
160 *segment = B_TOP;
161
162 stripId -= 2*B_STR_PER_SEG[0];
163 temp = stripId % ( B_ZSTR_NUM + B_TOPSTR_NUM );
164
165 // get layer
166 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) );
167 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) ) + 1;
168
169 // get strip
170 if( temp < B_ZSTR_NUM ) *strSubId = temp;
171 else *strSubId = temp - B_ZSTR_NUM;
172
173 } // top segment
174 else
175 {
176 if (stripId >= 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] ) stripId -= E_STR_NUM;
177
178 // get segment
179 *segment = stripId / B_STR_PER_SEG[0];
180
181 stripId %= B_STR_PER_SEG[0];
182 temp = stripId % ( B_ZSTR_NUM + B_PHISTR_NUM );
183
184 // get layer
185 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) );
186 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) ) + 1;
187
188 // get strip
189 if( temp < B_ZSTR_NUM ) *strSubId = temp;
190 else *strSubId = temp - B_ZSTR_NUM;
191 }
192 } // barrel
193 else
194 {
195 *strSubId = stripId % E_STR_NUM;
196 *layer = ( stripId / E_STR_NUM ) % E_LAY_NUM ;
197 *segment = ( stripId / E_STR_NUM ) / E_LAY_NUM ;
198 }
199
200 return true;
201}

Referenced by RootMucCalibDataCnv::i_createObj(), and TreeMucCalibDataCnv::i_createObj().

◆ SetStripPos() [2/2]

bool CalibData::MucIdTransform::SetStripPos ( int  stripid,
int *  part,
int *  segment,
int *  layer,
int *  subid 
)

The documentation for this class was generated from the following files: