BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
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 18 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

◆ ~MucIdTransform() [1/2]

MucIdTransform::~MucIdTransform ( )

◆ MucIdTransform() [2/2]

MucIdTransform::MucIdTransform ( )

◆ ~MucIdTransform() [2/2]

MucIdTransform::~MucIdTransform ( )

Member Function Documentation

◆ GetBoxId() [1/2]

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

Definition at line 51 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

Referenced by MucCalibMgr::FillCluster(), MucCalibMgr::FillDigi(), MucCalibMgr::FillEffHit(), MucCalibMgr::FillExpHit(), MucCalibMgr::FillNosHit(), GetStripId(), MucCalibMgr::Init2DEffHisto(), and MucCalibMgr::InitArea().

◆ GetBoxId() [2/2]

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

◆ GetId() [1/2]

int MucIdTransform::GetId ( )

Definition at line 31 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

31{ return m_Id; }

◆ GetId() [2/2]

int MucIdTransform::GetId ( )

◆ GetLayer() [1/2]

int MucIdTransform::GetLayer ( )

Definition at line 34 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

34{ return m_Layer; }

◆ GetLayer() [2/2]

int MucIdTransform::GetLayer ( )

◆ GetPart() [1/2]

int MucIdTransform::GetPart ( )

Definition at line 32 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

32{ return m_Part; }

◆ GetPart() [2/2]

int MucIdTransform::GetPart ( )

◆ GetSegment() [1/2]

int MucIdTransform::GetSegment ( )

Definition at line 33 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

33{ return m_Segment; }

◆ GetSegment() [2/2]

int MucIdTransform::GetSegment ( )

◆ GetStrip() [1/2]

int MucIdTransform::GetStrip ( )

Definition at line 35 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

35{ return m_Strip; }

◆ GetStrip() [2/2]

int MucIdTransform::GetStrip ( )

◆ GetStripId() [1/2]

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

Definition at line 67 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

Referenced by MucCalibMgr::EffAndNoiseLV2(), MucCalibMgr::FillDigi(), MucCalibMgr::FillEffHit(), MucCalibMgr::FillExpHit(), MucCalibMgr::FillNosHit(), and MucCalibMgr::InitArea().

◆ GetStripId() [2/2]

int 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 38 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

Referenced by MucCalibMgr::EffAndNoiseLV0(), MucCalibMgr::EffAndNoiseLV1(), MucCalibMgr::EffAndNoiseLV2(), DQA_MUC::execute(), MucCalibMgr::InitArea(), MucCalibMgr::InitClusterHisto(), MucCalibMgr::InitHistoLV2(), BesMucNoise::NoiseByCnt(), MucCalibMgr::ReadEvent(), and MucCalibMgr::SaveConst().

◆ GetStripMax() [2/2]

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

◆ Print() [1/2]

void MucIdTransform::Print ( int  mode)

Definition at line 198 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

199{
200 if( mode == 0 ) // position to id
201 {
202 cout << "prt: " << m_Part
203 << "\tseg: " << m_Segment
204 << "\tlay: " << m_Layer
205 << "\tstr: " << m_Strip
206 << "\tid: " << m_Id << endl;
207 }
208 else // id to position
209 {
210 cout << "id: " << m_Id
211 << "\tprt: " << m_Part
212 << "\tseg: " << m_Segment
213 << "\tlay: " << m_Layer
214 << "\tstr: " << m_Strip << endl;
215 }
216}

◆ Print() [2/2]

void MucIdTransform::Print ( int  )

◆ SetBoxPos() [1/2]

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

Definition at line 100 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

Referenced by MucCalibMgr::EffAndNoiseLV1(), MucCalibMgr::EffAndNoiseLV2(), MucCalibMgr::InitClusterHisto(), MucCalibMgr::InitHistoLV2(), and MucGeoMgr::InitOffset().

◆ SetBoxPos() [2/2]

bool 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 130 of file Muc/MucCalibAlg/MucCalibAlg-00-02-16/src/MucIdTransform.cxx.

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

Referenced by BesMucNoise::NoiseByNosRatio().

◆ SetStripPos() [2/2]

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

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