MucMark Class Reference

#include <MucMark.h>

List of all members.

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)

Private Attributes

int m_Part
int m_Segment
int m_Layer
int m_Strip


Detailed Description

Definition at line 19 of file MucMark.h.


Constructor & Destructor Documentation

MucMark::MucMark (  )  [inline]

Definition at line 21 of file MucMark.h.

00021 {};

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

Definition at line 19 of file MucMark.cxx.

References m_Layer, m_Part, m_Segment, and m_Strip.

00020 {
00021   m_Part    = part;
00022   m_Segment = segment;
00023   m_Layer   = layer;
00024   m_Strip   = strip;
00025 }

MucMark::~MucMark (  ) 

Definition at line 28 of file MucMark.cxx.

00028 { ; }


Member Function Documentation

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

Definition at line 355 of file MucMark.cxx.

References CreateClusterCol_A(), CreateClusterCol_B(), CreateClusterCol_C(), and CreateClusterCol_D().

00356 {
00357   vector< mark_col > aClusterCol;
00358   switch( buildMode ) 
00359   {
00360     case 1: return CreateClusterCol_A( aMarkCol );
00361             break;
00362     case 2: return CreateClusterCol_B( aMarkCol );
00363             break;
00364     case 3: return CreateClusterCol_C( aMarkCol );
00365             break;
00366     case 4: return CreateClusterCol_D( aMarkCol );
00367             break;
00368     default: return (aClusterCol);
00369   }
00370 }

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

Definition at line 188 of file MucMark.cxx.

References genRecEmupikp::i, IsInCol(), IsNeighborWith(), and ganga-rec::j.

Referenced by CreateClusterCol().

00189 {
00190   vector< mark_col > aClusterCol;
00191   mark_col      checkedMarkCol;
00192   
00193   int recordFlag      = 0;
00194   unsigned int circle = 0;
00195   
00196   for( unsigned int i=0; i<aMarkCol.size(); i++ )
00197   {
00198     recordFlag = 0;
00199     for( unsigned int j=0; j< aClusterCol.size(); j++ )
00200     {
00201       if( (*aMarkCol[i]).IsInCol(aClusterCol[j]) !=-1 ) {
00202         recordFlag = 1;
00203         break;
00204       }
00205       else if( (*aMarkCol[i]).IsNeighborWith(aClusterCol[j]) )
00206       {
00207         aClusterCol[j].push_back( aMarkCol[i] );
00208         recordFlag = 1;
00209         break;
00210       }
00211     }
00212     
00213     if( recordFlag == 0 )
00214     {
00215       mark_col aCluster;
00216       aCluster.push_back( aMarkCol[i] );
00217       aClusterCol.push_back( aCluster );
00218       
00219       circle =0;
00220       do {
00221         circle ++;
00222         for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
00223         {
00224           if( (*aMarkCol[j]).IsInCol(aClusterCol.back()) !=-1 ) continue;
00225           else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back()) )
00226           aClusterCol.back().push_back( aMarkCol[j] );
00227         }
00228       } while( circle < aMarkCol.size()-i-1);
00229     }
00230   }
00231   
00232   return aClusterCol;
00233 }

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

Definition at line 235 of file MucMark.cxx.

References genRecEmupikp::i, IsInCol(), IsNeighborWith(), and ganga-rec::j.

Referenced by CreateClusterCol().

00236 {
00237   vector< mark_col > aClusterCol;
00238   mark_col  checkedMarkCol;
00239   
00240   unsigned int circle = 0;
00241   for( unsigned int i=0; i<aMarkCol.size(); i++ )
00242   {
00243     if( (*aMarkCol[i]).IsInCol(checkedMarkCol) !=-1 ) continue;
00244     
00245     mark_col aCluster;
00246     aCluster.push_back( aMarkCol[i] );
00247     aClusterCol.push_back( aCluster );
00248     checkedMarkCol.push_back( aMarkCol[i] );
00249     
00250     circle = 0;
00251     do {
00252       for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
00253       {
00254         if( (*aMarkCol[j]).IsInCol(checkedMarkCol) != -1) continue;
00255         else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back() ) ) {
00256           aClusterCol.back().push_back( aMarkCol[j] );
00257           checkedMarkCol.push_back( aMarkCol[j] );
00258         }
00259       }
00260       circle ++;
00261     } while(circle < aMarkCol.size()-i-1);
00262   }
00263   
00264   return aClusterCol;
00265 }

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

Definition at line 267 of file MucMark.cxx.

References IsNeighborWith(), ganga-rec::j, and delete_small_size::size.

Referenced by CreateClusterCol().

00268 {
00269   MucMark tmpMark;
00270   vector< mark_col > aClusterCol;
00271   mark_col  copyMarkCol;
00272   copyMarkCol = aMarkCol;
00273   
00274   mark_col::iterator it1;
00275   while( copyMarkCol.size() !=0 ) // while 1
00276   {
00277     it1 = copyMarkCol.begin();
00278     mark_col aCluster;
00279     aCluster.push_back( copyMarkCol[0] );
00280     aClusterCol.push_back( aCluster );
00281   
00282     copyMarkCol.erase( it1 );
00283     unsigned int circle = 0;
00284     unsigned int size   = 0;
00285     unsigned int beginsize = copyMarkCol.size();
00286     while( circle < beginsize ) // while 2
00287     {
00288       mark_col::iterator it2;
00289       size = copyMarkCol.size();
00290       for( unsigned int j=0, headNum=0; j < size; j++ )
00291       {
00292         it2 = copyMarkCol.begin() + headNum;
00293         if( (copyMarkCol[headNum])->IsNeighborWith( aClusterCol.back() ) ) {
00294           aClusterCol.back().push_back( (copyMarkCol[headNum]) );
00295           copyMarkCol.erase(it2);
00296         }
00297         else headNum ++;
00298       } // end for
00299   
00300       circle ++;
00301     }; // End while 2
00302   
00303   }; // End while 1
00304   
00305   return aClusterCol;
00306 }

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

Definition at line 308 of file MucMark.cxx.

References genRecEmupikp::i, IsInCol(), IsNeighborWith(), and ganga-rec::j.

Referenced by CreateClusterCol().

00309 {
00310   vector< mark_col > aClusterCol;
00311 
00312   bool recordFlag     = false;
00313   unsigned int circle = 0;
00314 
00315   for( unsigned int i=0; i<aMarkCol.size(); i++ )
00316   {
00317     recordFlag = false;
00318     for( int j= aClusterCol.size()-1; j>-1; j-- )
00319     {
00320       if( (*aMarkCol[i]).IsInCol(aClusterCol[j]) !=-1 ) {
00321         recordFlag = true;
00322         break;
00323       }
00324       else if( (*aMarkCol[i]).IsNeighborWith(aClusterCol[j]) )
00325       {
00326         aClusterCol[j].push_back( aMarkCol[i] );
00327         recordFlag = true;
00328         break;
00329       }
00330     }
00331 
00332     if( recordFlag == false )
00333     {
00334       mark_col aCluster;
00335       aCluster.push_back( aMarkCol[i] );
00336       aClusterCol.push_back( aCluster );
00337 
00338       circle =0;
00339       do {
00340         circle ++;
00341         for( unsigned int j = i+1; j<aMarkCol.size(); j++ )
00342         {
00343           if( (*aMarkCol[j]).IsInCol(aClusterCol.back()) !=-1 ) continue;
00344           else if( (*aMarkCol[j]).IsNeighborWith( aClusterCol.back()) )
00345             aClusterCol.back().push_back( aMarkCol[j] );
00346         }
00347       } while( circle < aMarkCol.size()-i-1);
00348     } // End if recordflag
00349   } // End fist for
00350 
00351   return aClusterCol;
00352 }

bool MucMark::IsInBoxWith ( MucMark other  ) 

Definition at line 154 of file MucMark.cxx.

References EvtCyclic3::other().

00155 {
00156   if( (*this).Part() == other.Part()       &&
00157       (*this).Segment() == other.Segment() &&
00158       (*this).Layer() == other.Layer()        )
00159     return true;
00160   else
00161     return false;
00162 }

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

Definition at line 122 of file MucMark.cxx.

References genRecEmupikp::i.

00123 { 
00124   for( unsigned int i=0; i<aClusterCol.size(); i++ ) {
00125     if( (*this).IsInCol ( aClusterCol[i] ) ) return i;
00126   }
00127   
00128   return -1;
00129 }

int MucMark::IsInCol ( mark_col aCol  ) 

Definition at line 113 of file MucMark.cxx.

References genRecEmupikp::i.

00114 {
00115   for( unsigned int i=0; i<aCol.size(); i++ ) {
00116     if( (*this) == (*aCol[i]) ) return i;
00117   }
00118   
00119   return -1;
00120 }

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

Definition at line 100 of file MucMark.cxx.

References genRecEmupikp::i, Layer(), Part(), Segment(), and Strip().

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

00101 {
00102   for( unsigned int i=0; i<aCol.size(); i++ ) {
00103     if( part    == aCol[i]->Part()    &&
00104         segment == aCol[i]->Segment() &&
00105         layer   == aCol[i]->Layer()   &&
00106         strip   == aCol[i]->Strip()     )
00107     return i;
00108   }
00109   
00110   return -1;
00111 }

bool MucMark::IsInSegWith ( MucMark other  ) 

Definition at line 144 of file MucMark.cxx.

References EvtCyclic3::other().

Referenced by MucCalibMgr::ReadEvent().

00145 {
00146   if( (*this).Part() == other.Part() &&
00147       (*this).Segment() == other.Segment()  )
00148     return true;
00149   else
00150     return false;
00151 }

bool MucMark::IsNeighborWith ( mark_col aCol  ) 

Definition at line 177 of file MucMark.cxx.

References genRecEmupikp::i.

00178 {
00179   for( unsigned int i=0; i<aCluster.size(); i++ ) {
00180     if( (*this).IsNeighborWith((*aCluster[i])) )
00181       return true;
00182   }
00183   
00184   return false;
00185 }

bool MucMark::IsNeighborWith ( MucMark other  ) 

Definition at line 165 of file MucMark.cxx.

References EvtCyclic3::other().

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

00166 {
00167   if( (*this).Part()    == other.Part()    &&
00168       (*this).Segment() == other.Segment() &&
00169       (*this).Layer()   == other.Layer()   &&
00170       fabs( (*this).Strip() - other.Strip() ) == 1 )
00171     return true;
00172   else 
00173     return false;
00174 }

int MucMark::Layer (  ) 

Definition at line 96 of file MucMark.cxx.

References m_Layer.

Referenced by IsInCol().

00096 { return m_Layer;   }

int MucMark::NumInCol ( mark_col aCol  ) 

Definition at line 132 of file MucMark.cxx.

References genRecEmupikp::i, and num.

00133 {
00134   int num = 0;
00135   
00136   for( unsigned int i=0; i<aCol.size(); i++ ) {
00137     if( (*this) == (*aCol[i]) ) num ++;
00138   }
00139   
00140   return num;
00141 }

bool MucMark::operator== ( MucMark other  ) 

Definition at line 31 of file MucMark.cxx.

References EvtCyclic3::other().

00032 {
00033   if( this == &other ) return true;
00034   
00035   if( (*this).Part()    == other.Part()    &&
00036       (*this).Segment() == other.Segment() &&
00037       (*this).Layer()   == other.Layer()   &&
00038       (*this).Strip()   == other.Strip()       )
00039     return true;
00040   else
00041     return false;
00042 }

int MucMark::Part (  ) 

Definition at line 94 of file MucMark.cxx.

References m_Part.

Referenced by IsInCol().

00094 { return m_Part;    }

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

Definition at line 386 of file MucMark.cxx.

References genRecEmupikp::i, ganga-rec::j, and Print().

00387 {
00388   for( unsigned int i=0; i< aClusterCol.size(); i++ )
00389     for( unsigned int j=0; j< aClusterCol[i].size(); j++ ) {
00390       aClusterCol[i][j]->Print();
00391     }
00392 }

void MucMark::Print ( mark_col aMarkCol  ) 

Definition at line 381 of file MucMark.cxx.

References genRecEmupikp::i, and Print().

00382 {
00383   for( unsigned int i=0; i< aMarkCol.size(); i++ ) aMarkCol[i]->Print();
00384 }

void MucMark::Print (  ) 

Definition at line 373 of file MucMark.cxx.

References m_Layer, m_Part, m_Segment, and m_Strip.

Referenced by Print().

00374 {
00375   cout << "prt: "   << m_Part
00376        << "\tseg: " << m_Segment
00377        << "\tlay: " << m_Layer
00378        << "\tstr: " << m_Strip << endl;
00379 }

int MucMark::Segment (  ) 

Definition at line 95 of file MucMark.cxx.

References m_Segment.

Referenced by IsInCol().

00095 { return m_Segment; }

bool MucMark::SetLayer ( int  layer  ) 

Definition at line 69 of file MucMark.cxx.

References B_LAY_NUM, BRID, E_LAY_NUM, m_Layer, and m_Part.

00070 {
00071   if( layer > ((m_Part == BRID)?B_LAY_NUM:E_LAY_NUM) || layer < 0 ) {  
00072     cout << "layer overflow:\t" << layer << endl;
00073     return false;
00074   }
00075   else {
00076     m_Layer = layer;
00077     return true;
00078   }
00079 }

bool MucMark::SetPart ( int  part  ) 

Definition at line 45 of file MucMark.cxx.

References m_Part, and PART_MAX.

00046 {
00047   if( part > PART_MAX || part < 0 ) {
00048     cout << "part overflow:\t" << part << endl;
00049     return false;
00050   }
00051   else {
00052     m_Part = part;
00053     return true;
00054   }
00055 } 

bool MucMark::SetSegment ( int  segment  ) 

Definition at line 57 of file MucMark.cxx.

References B_SEG_NUM, BRID, E_SEG_NUM, m_Part, and m_Segment.

00058 {
00059   if( segment > ((m_Part == BRID)?B_SEG_NUM:E_SEG_NUM) || segment < 0 ) {  
00060     cout << "segment overflow:\t" << segment << endl;
00061     return false;
00062   }
00063   else {
00064     m_Segment = segment;
00065     return true;
00066   }
00067 }

bool MucMark::SetStrip ( int  strip  ) 

Definition at line 81 of file MucMark.cxx.

References m_Strip, and STRIP_INBOX_MAX.

00082 {
00083   if( strip > STRIP_INBOX_MAX || strip < 0 ) {  
00084     cout << "strip overflow:\t" << strip << endl;
00085     return false;
00086   }
00087   else {
00088     m_Strip = strip;
00089     return true;
00090   }
00091 }

int MucMark::Strip (  ) 

Definition at line 97 of file MucMark.cxx.

References m_Strip.

Referenced by IsInCol().

00097 { return m_Strip;   }


Member Data Documentation

int MucMark::m_Layer [private]

Definition at line 60 of file MucMark.h.

Referenced by Layer(), MucMark(), Print(), and SetLayer().

int MucMark::m_Part [private]

Definition at line 58 of file MucMark.h.

Referenced by MucMark(), Part(), Print(), SetLayer(), SetPart(), and SetSegment().

int MucMark::m_Segment [private]

Definition at line 59 of file MucMark.h.

Referenced by MucMark(), Print(), Segment(), and SetSegment().

int MucMark::m_Strip [private]

Definition at line 61 of file MucMark.h.

Referenced by MucMark(), Print(), SetStrip(), and Strip().


Generated on Tue Nov 29 23:20:29 2016 for BOSS_7.0.2 by  doxygen 1.4.7