BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MucMark Class Reference

#include <MucMark.h>

Public Member Functions

 MucMark ()
 
 MucMark (int part, int segment, int layer, int strip)
 
 ~MucMark ()
 
bool operator== (MucMark &other)
 
bool SetPart (int part)
 
bool SetSegment (int segment)
 
bool SetLayer (int layer)
 
bool SetStrip (int strip)
 
int Part ()
 
int Segment ()
 
int Layer ()
 
int Strip ()
 
int NumInCol (mark_col &aCol)
 
int IsInCol (int part, int segment, int layer, int strip, mark_col &aCol)
 
int IsInCol (mark_col &aCol)
 
int IsInCol (vector< mark_col > &aClusterCol)
 
bool IsInSegWith (MucMark &other)
 
bool IsInBoxWith (MucMark &other)
 
bool IsNeighborWith (MucMark &other)
 
bool IsNeighborWith (mark_col &aCol)
 
vector< mark_colCreateClusterCol (int buildMode, mark_col &aMarkCol)
 
vector< mark_colCreateClusterCol_A (mark_col &aMarkCol)
 
vector< mark_colCreateClusterCol_B (mark_col &aMarkCol)
 
vector< mark_colCreateClusterCol_C (mark_col &aMarkCol)
 
vector< mark_colCreateClusterCol_D (mark_col &aMarkCol)
 
void Print ()
 
void Print (mark_col &aMarkCol)
 
void Print (vector< mark_col > &aClusterCol)
 

Detailed Description

Definition at line 19 of file MucMark.h.

Constructor & Destructor Documentation

◆ MucMark() [1/2]

MucMark::MucMark ( )
inline

Definition at line 21 of file MucMark.h.

21{};

◆ MucMark() [2/2]

MucMark::MucMark ( int part,
int segment,
int layer,
int strip )

Definition at line 19 of file MucMark.cxx.

20{
21 m_Part = part;
22 m_Segment = segment;
23 m_Layer = layer;
24 m_Strip = strip;
25}

◆ ~MucMark()

MucMark::~MucMark ( )

Definition at line 28 of file MucMark.cxx.

28{ ; }

Member Function Documentation

◆ CreateClusterCol()

vector< mark_col > MucMark::CreateClusterCol ( int buildMode,
mark_col & aMarkCol )

Definition at line 355 of file MucMark.cxx.

356{
357 vector< mark_col > aClusterCol;
358 switch( buildMode )
359 {
360 case 1: return CreateClusterCol_A( aMarkCol );
361 break;
362 case 2: return CreateClusterCol_B( aMarkCol );
363 break;
364 case 3: return CreateClusterCol_C( aMarkCol );
365 break;
366 case 4: return CreateClusterCol_D( aMarkCol );
367 break;
368 default: return (aClusterCol);
369 }
370}
vector< mark_col > CreateClusterCol_A(mark_col &aMarkCol)
Definition MucMark.cxx:188
vector< mark_col > CreateClusterCol_C(mark_col &aMarkCol)
Definition MucMark.cxx:267
vector< mark_col > CreateClusterCol_D(mark_col &aMarkCol)
Definition MucMark.cxx:308
vector< mark_col > CreateClusterCol_B(mark_col &aMarkCol)
Definition MucMark.cxx:235

◆ CreateClusterCol_A()

vector< mark_col > MucMark::CreateClusterCol_A ( mark_col & aMarkCol)

Definition at line 188 of file MucMark.cxx.

189{
190 vector< mark_col > aClusterCol;
191 mark_col checkedMarkCol;
192
193 int recordFlag = 0;
194 unsigned int circle = 0;
195
196 for( unsigned int i=0; i<aMarkCol.size(); i++ )
197 {
198 recordFlag = 0;
199 for( unsigned int j=0; j< aClusterCol.size(); j++ )
200 {
201 if( (*aMarkCol[i]).IsInCol(aClusterCol[j]) !=-1 ) {
202 recordFlag = 1;
203 break;
204 }
205 else if( (*aMarkCol[i]).IsNeighborWith(aClusterCol[j]) )
206 {
207 aClusterCol[j].push_back( aMarkCol[i] );
208 recordFlag = 1;
209 break;
210 }
211 }
212
213 if( recordFlag == 0 )
214 {
215 mark_col aCluster;
216 aCluster.push_back( aMarkCol[i] );
217 aClusterCol.push_back( aCluster );
218
219 circle =0;
220 do {
221 circle ++;
222 for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
223 {
224 if( (*aMarkCol[j]).IsInCol(aClusterCol.back()) !=-1 ) continue;
225 else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back()) )
226 aClusterCol.back().push_back( aMarkCol[j] );
227 }
228 } while( circle < aMarkCol.size()-i-1);
229 }
230 }
231
232 return aClusterCol;
233}
vector< MucMark * > mark_col
Definition MucMark.h:17
bool IsNeighborWith(MucMark &other)
Definition MucMark.cxx:165
int IsInCol(int part, int segment, int layer, int strip, mark_col &aCol)
Definition MucMark.cxx:100

Referenced by CreateClusterCol().

◆ CreateClusterCol_B()

vector< mark_col > MucMark::CreateClusterCol_B ( mark_col & aMarkCol)

Definition at line 235 of file MucMark.cxx.

236{
237 vector< mark_col > aClusterCol;
238 mark_col checkedMarkCol;
239
240 unsigned int circle = 0;
241 for( unsigned int i=0; i<aMarkCol.size(); i++ )
242 {
243 if( (*aMarkCol[i]).IsInCol(checkedMarkCol) !=-1 ) continue;
244
245 mark_col aCluster;
246 aCluster.push_back( aMarkCol[i] );
247 aClusterCol.push_back( aCluster );
248 checkedMarkCol.push_back( aMarkCol[i] );
249
250 circle = 0;
251 do {
252 for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
253 {
254 if( (*aMarkCol[j]).IsInCol(checkedMarkCol) != -1) continue;
255 else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back() ) ) {
256 aClusterCol.back().push_back( aMarkCol[j] );
257 checkedMarkCol.push_back( aMarkCol[j] );
258 }
259 }
260 circle ++;
261 } while(circle < aMarkCol.size()-i-1);
262 }
263
264 return aClusterCol;
265}

Referenced by CreateClusterCol().

◆ CreateClusterCol_C()

vector< mark_col > MucMark::CreateClusterCol_C ( mark_col & aMarkCol)

Definition at line 267 of file MucMark.cxx.

268{
269 MucMark tmpMark;
270 vector< mark_col > aClusterCol;
271 mark_col copyMarkCol;
272 copyMarkCol = aMarkCol;
273
274 mark_col::iterator it1;
275 while( copyMarkCol.size() !=0 ) // while 1
276 {
277 it1 = copyMarkCol.begin();
278 mark_col aCluster;
279 aCluster.push_back( copyMarkCol[0] );
280 aClusterCol.push_back( aCluster );
281
282 copyMarkCol.erase( it1 );
283 unsigned int circle = 0;
284 unsigned int size = 0;
285 unsigned int beginsize = copyMarkCol.size();
286 while( circle < beginsize ) // while 2
287 {
288 mark_col::iterator it2;
289 size = copyMarkCol.size();
290 for( unsigned int j=0, headNum=0; j < size; j++ )
291 {
292 it2 = copyMarkCol.begin() + headNum;
293 if( (copyMarkCol[headNum])->IsNeighborWith( aClusterCol.back() ) ) {
294 aClusterCol.back().push_back( (copyMarkCol[headNum]) );
295 copyMarkCol.erase(it2);
296 }
297 else headNum ++;
298 } // end for
299
300 circle ++;
301 }; // End while 2
302
303 }; // End while 1
304
305 return aClusterCol;
306}

Referenced by CreateClusterCol().

◆ CreateClusterCol_D()

vector< mark_col > MucMark::CreateClusterCol_D ( mark_col & aMarkCol)

Definition at line 308 of file MucMark.cxx.

309{
310 vector< mark_col > aClusterCol;
311
312 bool recordFlag = false;
313 unsigned int circle = 0;
314
315 for( unsigned int i=0; i<aMarkCol.size(); i++ )
316 {
317 recordFlag = false;
318 for( int j= aClusterCol.size()-1; j>-1; j-- )
319 {
320 if( (*aMarkCol[i]).IsInCol(aClusterCol[j]) !=-1 ) {
321 recordFlag = true;
322 break;
323 }
324 else if( (*aMarkCol[i]).IsNeighborWith(aClusterCol[j]) )
325 {
326 aClusterCol[j].push_back( aMarkCol[i] );
327 recordFlag = true;
328 break;
329 }
330 }
331
332 if( recordFlag == false )
333 {
334 mark_col aCluster;
335 aCluster.push_back( aMarkCol[i] );
336 aClusterCol.push_back( aCluster );
337
338 circle =0;
339 do {
340 circle ++;
341 for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
342 {
343 if( (*aMarkCol[j]).IsInCol(aClusterCol.back()) !=-1 ) continue;
344 else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back()) )
345 aClusterCol.back().push_back( aMarkCol[j] );
346 }
347 } while( circle < aMarkCol.size()-i-1);
348 } // End if recordflag
349 } // End fist for
350
351 return aClusterCol;
352}

Referenced by CreateClusterCol().

◆ IsInBoxWith()

bool MucMark::IsInBoxWith ( MucMark & other)

Definition at line 154 of file MucMark.cxx.

155{
156 if( (*this).Part() == other.Part() &&
157 (*this).Segment() == other.Segment() &&
158 (*this).Layer() == other.Layer() )
159 return true;
160 else
161 return false;
162}
Index other(Index i, Index j)

◆ IsInCol() [1/3]

int MucMark::IsInCol ( int part,
int segment,
int layer,
int strip,
mark_col & aCol )

Definition at line 100 of file MucMark.cxx.

101{
102 for( unsigned int i=0; i<aCol.size(); i++ ) {
103 if( part == aCol[i]->Part() &&
104 segment == aCol[i]->Segment() &&
105 layer == aCol[i]->Layer() &&
106 strip == aCol[i]->Strip() )
107 return i;
108 }
109
110 return -1;
111}
int Part()
Definition MucMark.cxx:94
int Segment()
Definition MucMark.cxx:95
int Strip()
Definition MucMark.cxx:97
int Layer()
Definition MucMark.cxx:96

Referenced by CreateClusterCol_A(), CreateClusterCol_B(), CreateClusterCol_D(), DQA_MUC::execute(), and MucCalibMgr::ReadEvent().

◆ IsInCol() [2/3]

int MucMark::IsInCol ( mark_col & aCol)

Definition at line 113 of file MucMark.cxx.

114{
115 for( unsigned int i=0; i<aCol.size(); i++ ) {
116 if( (*this) == (*aCol[i]) ) return i;
117 }
118
119 return -1;
120}

◆ IsInCol() [3/3]

int MucMark::IsInCol ( vector< mark_col > & aClusterCol)

Definition at line 122 of file MucMark.cxx.

123{
124 for( unsigned int i=0; i<aClusterCol.size(); i++ ) {
125 if( (*this).IsInCol ( aClusterCol[i] ) ) return i;
126 }
127
128 return -1;
129}

◆ IsInSegWith()

bool MucMark::IsInSegWith ( MucMark & other)

Definition at line 144 of file MucMark.cxx.

145{
146 if( (*this).Part() == other.Part() &&
147 (*this).Segment() == other.Segment() )
148 return true;
149 else
150 return false;
151}

Referenced by MucCalibMgr::ReadEvent().

◆ IsNeighborWith() [1/2]

bool MucMark::IsNeighborWith ( mark_col & aCol)

Definition at line 177 of file MucMark.cxx.

178{
179 for( unsigned int i=0; i<aCluster.size(); i++ ) {
180 if( (*this).IsNeighborWith((*aCluster[i])) )
181 return true;
182 }
183
184 return false;
185}

◆ IsNeighborWith() [2/2]

bool MucMark::IsNeighborWith ( MucMark & other)

Definition at line 165 of file MucMark.cxx.

166{
167 if( (*this).Part() == other.Part() &&
168 (*this).Segment() == other.Segment() &&
169 (*this).Layer() == other.Layer() &&
170 fabs( (*this).Strip() - other.Strip() ) == 1 )
171 return true;
172 else
173 return false;
174}

Referenced by CreateClusterCol_A(), CreateClusterCol_B(), CreateClusterCol_C(), and CreateClusterCol_D().

◆ Layer()

int MucMark::Layer ( )

Definition at line 96 of file MucMark.cxx.

96{ return m_Layer; }

Referenced by IsInCol().

◆ NumInCol()

int MucMark::NumInCol ( mark_col & aCol)

Definition at line 132 of file MucMark.cxx.

133{
134 int num = 0;
135
136 for( unsigned int i=0; i<aCol.size(); i++ ) {
137 if( (*this) == (*aCol[i]) ) num ++;
138 }
139
140 return num;
141}

◆ operator==()

bool MucMark::operator== ( MucMark & other)

Definition at line 31 of file MucMark.cxx.

32{
33 if( this == &other ) return true;
34
35 if( (*this).Part() == other.Part() &&
36 (*this).Segment() == other.Segment() &&
37 (*this).Layer() == other.Layer() &&
38 (*this).Strip() == other.Strip() )
39 return true;
40 else
41 return false;
42}

◆ Part()

int MucMark::Part ( )

Definition at line 94 of file MucMark.cxx.

94{ return m_Part; }

Referenced by IsInCol().

◆ Print() [1/3]

void MucMark::Print ( )

Definition at line 373 of file MucMark.cxx.

374{
375 cout << "prt: " << m_Part
376 << "\tseg: " << m_Segment
377 << "\tlay: " << m_Layer
378 << "\tstr: " << m_Strip << endl;
379}

Referenced by Print().

◆ Print() [2/3]

void MucMark::Print ( mark_col & aMarkCol)

Definition at line 381 of file MucMark.cxx.

382{
383 for( unsigned int i=0; i< aMarkCol.size(); i++ ) aMarkCol[i]->Print();
384}
void Print()
Definition MucMark.cxx:373

◆ Print() [3/3]

void MucMark::Print ( vector< mark_col > & aClusterCol)

Definition at line 386 of file MucMark.cxx.

387{
388 for( unsigned int i=0; i< aClusterCol.size(); i++ )
389 for( unsigned int j=0; j< aClusterCol[i].size(); j++ ) {
390 aClusterCol[i][j]->Print();
391 }
392}

◆ Segment()

int MucMark::Segment ( )

Definition at line 95 of file MucMark.cxx.

95{ return m_Segment; }

Referenced by IsInCol().

◆ SetLayer()

bool MucMark::SetLayer ( int layer)

Definition at line 69 of file MucMark.cxx.

70{
71 if( layer > ((m_Part == BRID)?B_LAY_NUM:E_LAY_NUM) || layer < 0 ) {
72 cout << "layer overflow:\t" << layer << endl;
73 return false;
74 }
75 else {
76 m_Layer = layer;
77 return true;
78 }
79}

◆ SetPart()

bool MucMark::SetPart ( int part)

Definition at line 45 of file MucMark.cxx.

46{
47 if( part > PART_MAX || part < 0 ) {
48 cout << "part overflow:\t" << part << endl;
49 return false;
50 }
51 else {
52 m_Part = part;
53 return true;
54 }
55}

◆ SetSegment()

bool MucMark::SetSegment ( int segment)

Definition at line 57 of file MucMark.cxx.

58{
59 if( segment > ((m_Part == BRID)?B_SEG_NUM:E_SEG_NUM) || segment < 0 ) {
60 cout << "segment overflow:\t" << segment << endl;
61 return false;
62 }
63 else {
64 m_Segment = segment;
65 return true;
66 }
67}

◆ SetStrip()

bool MucMark::SetStrip ( int strip)

Definition at line 81 of file MucMark.cxx.

82{
83 if( strip > STRIP_INBOX_MAX || strip < 0 ) {
84 cout << "strip overflow:\t" << strip << endl;
85 return false;
86 }
87 else {
88 m_Strip = strip;
89 return true;
90 }
91}

◆ Strip()

int MucMark::Strip ( )

Definition at line 97 of file MucMark.cxx.

97{ return m_Strip; }

Referenced by IsInCol().


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