#include <TSegmentCurl.h>
Public Member Functions | |
TSegmentCurl (const unsigned superLayerId=9999, const unsigned max=9999) | |
TSegmentCurl (TSegmentCurl &) | |
TSegmentCurl (TSegmentCurl *) | |
~TSegmentCurl (void) | |
const unsigned | maxLocalLayerId (void) const |
const unsigned | superLayerId (void) const |
const unsigned | seqOfLayer (const unsigned) |
const unsigned | sizeOfLayer (const unsigned) |
const unsigned | maxSeq (void) const |
const unsigned | layerIdOfMaxSeq (void) |
const unsigned | numOfSeqOneLayer (void) |
const unsigned | numOfLargeSeqLayer (void) |
void | setMaxSeq (const unsigned) |
void | releaseMaxSeq (void) |
const unsigned | size (void) |
const unsigned | maxLocalLayerId (const unsigned) |
const unsigned | superLayerId (const unsigned) |
void | append (TMLink &) |
void | append (TMLink *) |
void | append (AList< TMLink > &) |
void | remove (TMLink &) |
void | remove (TMLink *) |
void | remove (AList< TMLink > &) |
void | removeAll (void) |
const AList< TMLink > & | list (void) |
const AList< TMLink > & | list (unsigned i) |
TSegmentCurl & | operator= (const TSegmentCurl &) |
void | dump (void) |
unsigned | wires (const unsigned) const |
void | update (void) |
Private Member Functions | |
void | calcuSeq (unsigned) |
Private Attributes | |
bool | m_flagOfUpdate |
AList< TMLink > | m_list |
unsigned | m_MaxLocalLayerId |
unsigned | m_superLayerId |
unsigned | m_seqOfLayer [4] |
unsigned | m_sizeOfLayer [4] |
AList< TMLink > | m_layer [4] |
unsigned | m_maxSeq |
unsigned | m_layerIdOfMaxSeq |
unsigned | m_numOfSeqOneLayer |
unsigned | m_numOfLargeSeqLayer |
Definition at line 13 of file TSegmentCurl.h.
TSegmentCurl::TSegmentCurl | ( | const unsigned | superLayerId = 9999 , |
|
const unsigned | max = 9999 | |||
) |
Definition at line 6 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_layer, m_list, m_seqOfLayer, and m_sizeOfLayer.
00008 : m_MaxLocalLayerId(max), m_superLayerId(superLayerId), m_flagOfUpdate(true) 00009 { 00010 m_list.removeAll(); 00011 for(unsigned i=0;i<4;++i){ 00012 m_seqOfLayer[i] = m_sizeOfLayer[i] = 0; 00013 m_layer[i].removeAll(); 00014 } 00015 }
TSegmentCurl::TSegmentCurl | ( | TSegmentCurl & | ) |
Definition at line 18 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_layer, m_seqOfLayer, m_sizeOfLayer, and s.
00019 : m_flagOfUpdate(s.m_flagOfUpdate), m_list(s.m_list), m_MaxLocalLayerId(s.m_MaxLocalLayerId), m_superLayerId(s.m_superLayerId), 00020 m_maxSeq(s.m_maxSeq), m_layerIdOfMaxSeq(s.m_layerIdOfMaxSeq), m_numOfSeqOneLayer(s.m_numOfSeqOneLayer), 00021 m_numOfLargeSeqLayer(s.m_numOfLargeSeqLayer) 00022 { 00023 for(unsigned i=0;i<4;++i){ 00024 m_seqOfLayer[i] = s.m_seqOfLayer[i]; 00025 m_sizeOfLayer[i] = s.m_sizeOfLayer[i]; 00026 m_layer[i] = s.m_layer[i]; 00027 } 00028 }
TSegmentCurl::TSegmentCurl | ( | TSegmentCurl * | ) |
Definition at line 31 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_layer, m_seqOfLayer, m_sizeOfLayer, and s.
00032 : m_flagOfUpdate(s->m_flagOfUpdate), m_list(s->m_list), m_MaxLocalLayerId(s->m_MaxLocalLayerId), m_superLayerId(s->m_superLayerId), 00033 m_maxSeq(s->m_maxSeq), m_layerIdOfMaxSeq(s->m_layerIdOfMaxSeq), m_numOfSeqOneLayer(s->m_numOfSeqOneLayer), 00034 m_numOfLargeSeqLayer(s->m_numOfLargeSeqLayer) 00035 { 00036 for(unsigned i=0;i<4;++i){ 00037 m_seqOfLayer[i] = s->m_seqOfLayer[i]; 00038 m_sizeOfLayer[i] = s->m_sizeOfLayer[i]; 00039 m_layer[i] = s->m_layer[i]; 00040 } 00041 }
TSegmentCurl::~TSegmentCurl | ( | void | ) |
Definition at line 44 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_layer, m_list, and removeAll().
00045 { 00046 m_list.removeAll(); 00047 for(unsigned i=0;i<4;++i){ 00048 m_layer[i].removeAll(); 00049 } 00050 }
void TSegmentCurl::append | ( | AList< TMLink > & | ) | [inline] |
Definition at line 127 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_flagOfUpdate, m_layer, and m_list.
00128 { 00129 m_flagOfUpdate = true; 00130 for(unsigned i = 0; i < e.length(); ++i) 00131 m_layer[e[i]->hit()->wire()->localLayerId()].append(e[i]); 00132 m_list.append(e); 00133 }
void TSegmentCurl::append | ( | TMLink * | ) | [inline] |
Definition at line 117 of file TSegmentCurl.cxx.
References TMLink::hit(), TMDCWire::localLayerId(), m_flagOfUpdate, m_layer, m_list, and TMDCWireHit::wire().
00118 { 00119 m_flagOfUpdate = true; 00120 m_layer[e->hit()->wire()->localLayerId()].append(e); 00121 m_list.append(e); 00122 }
void TSegmentCurl::append | ( | TMLink & | ) | [inline] |
Definition at line 107 of file TSegmentCurl.cxx.
References TMLink::hit(), TMDCWire::localLayerId(), m_flagOfUpdate, m_layer, m_list, and TMDCWireHit::wire().
Referenced by TCurlFinder::checkExceptionalSegmentsType01(), TCurlFinder::createSegments(), and TCurlFinder::searchSegment().
00108 { 00109 m_flagOfUpdate = true; 00110 m_layer[e.hit()->wire()->localLayerId()].append(e); 00111 m_list.append(e); 00112 }
void TSegmentCurl::calcuSeq | ( | unsigned | ) | [private] |
Definition at line 295 of file TSegmentCurl.cxx.
References ganga-rec::j, m_layer, m_MaxLocalLayerId, m_seqOfLayer, maxSeq(), size(), sortByWireSerialNumber(), and wires().
Referenced by update().
00296 { 00297 //...exception 00298 if(i > m_MaxLocalLayerId){ 00299 m_seqOfLayer[i] = 0; 00300 return; 00301 } 00302 unsigned size = m_layer[i].length(); 00303 if(size < 1){ 00304 m_seqOfLayer[i] = 0; 00305 return; 00306 } 00307 if(size == 1){ 00308 m_seqOfLayer[i] = 1; 00309 return; 00310 } 00311 00312 //...initialize 00313 m_layer[i].sort(sortByWireSerialNumber); 00314 unsigned seq = 1; 00315 unsigned maxSeq = 0; 00316 unsigned layerIdForWires = m_layer[i][0]->hit()->wire()->layerId(); 00317 00318 //...calculation 00319 // if(m_layer[i][0]->hit()->wire()->localId() == static_cast<unsigned>(wires(m_superLayerId)-1) && 00320 if(m_layer[i][0]->hit()->wire()->localId() == static_cast<unsigned>(wires(layerIdForWires)-1) && 00321 m_layer[i][size-1]->hit()->wire()->localId() == 0){ 00322 for(unsigned j=0;j<size-1;++j){ 00323 if(m_layer[i][j]->hit()->wire()->localIdForMinus()-1 == 00324 m_layer[i][j+1]->hit()->wire()->localId()){ 00325 ++seq; 00326 }else{ 00327 break; 00328 } 00329 if(j == size-2)goto loop; 00330 } 00331 ++seq; 00332 for(unsigned j=size-1;j>0;--j){ 00333 if(m_layer[i][j]->hit()->wire()->localIdForPlus()+1 == 00334 m_layer[i][j-1]->hit()->wire()->localId()){ 00335 ++seq; 00336 }else{ 00337 break; 00338 } 00339 } 00340 loop: 00341 if(seq > maxSeq)maxSeq = seq; 00342 } 00343 seq = 1; 00344 for(unsigned j=0;j<size-1;++j){ 00345 if(m_layer[i][j]->hit()->wire()->localIdForMinus()-1 == 00346 m_layer[i][j+1]->hit()->wire()->localId()){ 00347 ++seq; 00348 }else{ 00349 if(seq > maxSeq)maxSeq = seq; 00350 seq = 1; 00351 } 00352 } 00353 if(seq > maxSeq)maxSeq = seq; 00354 00355 //...set and return 00356 m_seqOfLayer[i] = maxSeq; 00357 return; 00358 }
void TSegmentCurl::dump | ( | void | ) |
Definition at line 411 of file TSegmentCurl.cxx.
References genRecEmupikp::i, ganga-rec::j, m_flagOfUpdate, m_layer, m_layerIdOfMaxSeq, m_list, m_MaxLocalLayerId, m_maxSeq, m_numOfLargeSeqLayer, m_numOfSeqOneLayer, m_seqOfLayer, m_sizeOfLayer, m_superLayerId, and size().
Referenced by TCurlFinder::createSegments().
00412 { 00413 //std::cout.form(" Hep idhep mother mcPX mcPY mcPZ mcE mcMass\n"); 00414 //std::cout.form(" %3d % 4d % 4d % 2.2f % 2.2f % 2.2f % 2.2f % 2.3f\n", 00415 //hepID, partID, mothID, mcpx, mcpy, mcpz, mce, mcmass); 00416 00417 std::cout << "=====Segment for Curling Track Finder=====" << std::endl; 00418 std::cout << "List Size = " << m_list.length() << std::endl; 00419 std::cout << "Flag of Update = " << m_flagOfUpdate 00420 << ", Max Local Layer ID = " << m_MaxLocalLayerId 00421 << ", Super Layer ID = " << m_superLayerId << std::endl; 00422 std::cout << "Max Seq. = " << m_maxSeq << ", Its Layer ID = " << m_layerIdOfMaxSeq << std::endl; 00423 std::cout << "# of Seq = 1 Layer = " << m_numOfSeqOneLayer 00424 << ", # of Large Seq. Layer = " << m_numOfLargeSeqLayer << std::endl; 00425 //std::cout.form(" ID | Seq. of Layer | Size of Layer | Local ID List\n"); 00426 std::cout << "ID | Seq. of Layer | Size of Layer | Local ID List" << std::endl; 00427 for(unsigned i=0;i<4;++i){ 00428 //std::cout.form(" %1d | %2d | %2d |", i, m_seqOfLayer[i], m_sizeOfLayer[i]); 00429 std::cout << i << " | " << m_seqOfLayer[i] << " | " << m_sizeOfLayer[i] << " | "; 00430 for(unsigned j = 0, size = m_layer[i].length(); j < size; ++j) 00431 std::cout << m_layer[i][j]->hit()->wire()->localId() << ", "; 00432 std::cout << std::endl; 00433 } 00434 }
const unsigned TSegmentCurl::layerIdOfMaxSeq | ( | void | ) | [inline] |
Definition at line 193 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_layerIdOfMaxSeq, and update().
00194 { 00195 if(m_flagOfUpdate)update(); 00196 return m_layerIdOfMaxSeq; 00197 }
const AList<TMLink>& TSegmentCurl::list | ( | unsigned | i | ) | [inline] |
const AList<TMLink>& TSegmentCurl::list | ( | void | ) | [inline] |
Definition at line 51 of file TSegmentCurl.h.
References m_list.
Referenced by TCurlFinder::checkExceptionalSegmentsType01().
00051 { return m_list; }
const unsigned TSegmentCurl::maxLocalLayerId | ( | const | unsigned | ) | [inline] |
Definition at line 89 of file TSegmentCurl.cxx.
References m_MaxLocalLayerId.
00090 { 00091 m_MaxLocalLayerId = i; 00092 return m_MaxLocalLayerId; 00093 }
const unsigned TSegmentCurl::maxLocalLayerId | ( | void | ) | const [inline] |
Definition at line 55 of file TSegmentCurl.cxx.
References m_MaxLocalLayerId.
00056 { 00057 return m_MaxLocalLayerId; 00058 }
const unsigned TSegmentCurl::maxSeq | ( | void | ) | const [inline] |
Definition at line 181 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_maxSeq, and update().
Referenced by calcuSeq().
00182 { 00183 // I try to use non-const member. 00184 // If this method is bad, other methods are necessary. 00185 TSegmentCurl * const localThis = const_cast<TSegmentCurl * const>(this); 00186 if(m_flagOfUpdate)localThis->update(); 00187 return m_maxSeq; 00188 }
const unsigned TSegmentCurl::numOfLargeSeqLayer | ( | void | ) | [inline] |
Definition at line 211 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_numOfLargeSeqLayer, and update().
00212 { 00213 if(m_flagOfUpdate)update(); 00214 return m_numOfLargeSeqLayer; 00215 }
const unsigned TSegmentCurl::numOfSeqOneLayer | ( | void | ) | [inline] |
Definition at line 202 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_numOfSeqOneLayer, and update().
00203 { 00204 if(m_flagOfUpdate)update(); 00205 return m_numOfSeqOneLayer; 00206 }
TSegmentCurl & TSegmentCurl::operator= | ( | const TSegmentCurl & | ) |
Definition at line 243 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_flagOfUpdate, m_layer, m_layerIdOfMaxSeq, m_list, m_MaxLocalLayerId, m_maxSeq, m_numOfLargeSeqLayer, m_numOfSeqOneLayer, m_seqOfLayer, m_sizeOfLayer, m_superLayerId, and s.
00244 { 00245 if(this == &s)return *this; 00246 00247 m_flagOfUpdate = s.m_flagOfUpdate; 00248 m_list = s.m_list; 00249 m_MaxLocalLayerId = s.m_MaxLocalLayerId; 00250 m_superLayerId = s.m_superLayerId; 00251 00252 m_maxSeq = s.m_maxSeq; 00253 m_layerIdOfMaxSeq = s.m_layerIdOfMaxSeq; 00254 m_numOfSeqOneLayer = s.m_numOfSeqOneLayer; 00255 m_numOfLargeSeqLayer = s.m_numOfLargeSeqLayer; 00256 00257 for(unsigned i=0;i<4;++i){ 00258 m_seqOfLayer[i] = s.m_seqOfLayer[i]; 00259 m_sizeOfLayer[i] = s.m_sizeOfLayer[i]; 00260 m_layer[i] = s.m_layer[i]; 00261 } 00262 00263 return *this; 00264 }
void TSegmentCurl::releaseMaxSeq | ( | void | ) |
void TSegmentCurl::remove | ( | AList< TMLink > & | ) | [inline] |
Definition at line 158 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_flagOfUpdate, m_layer, and m_list.
00159 { 00160 m_flagOfUpdate = true; 00161 for(unsigned i = 0; i < e.length(); ++i) 00162 m_layer[e[i]->hit()->wire()->localLayerId()].remove(e[i]); 00163 m_list.remove(e); 00164 }
void TSegmentCurl::remove | ( | TMLink * | ) | [inline] |
Definition at line 148 of file TSegmentCurl.cxx.
References TMLink::hit(), TMDCWire::localLayerId(), m_flagOfUpdate, m_layer, m_list, and TMDCWireHit::wire().
00149 { 00150 m_flagOfUpdate = true; 00151 m_layer[e->hit()->wire()->localLayerId()].remove(e); 00152 m_list.remove(e); 00153 }
void TSegmentCurl::remove | ( | TMLink & | ) | [inline] |
Definition at line 138 of file TSegmentCurl.cxx.
References TMLink::hit(), TMDCWire::localLayerId(), m_flagOfUpdate, m_layer, m_list, and TMDCWireHit::wire().
00139 { 00140 m_flagOfUpdate = true; 00141 m_layer[e.hit()->wire()->localLayerId()].remove(e); 00142 m_list.remove(e); 00143 }
void TSegmentCurl::removeAll | ( | void | ) | [inline] |
Definition at line 169 of file TSegmentCurl.cxx.
References genRecEmupikp::i, m_flagOfUpdate, m_layer, and m_list.
Referenced by TCurlFinder::checkExceptionalSegmentsType01(), and ~TSegmentCurl().
00170 { 00171 m_flagOfUpdate = true; 00172 m_list.removeAll(); 00173 for(unsigned i=0;i<4;++i){ 00174 m_layer[i].removeAll(); 00175 } 00176 }
const unsigned TSegmentCurl::seqOfLayer | ( | const | unsigned | ) | [inline] |
Definition at line 71 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_seqOfLayer, and update().
00072 { 00073 if(m_flagOfUpdate)update(); 00074 return m_seqOfLayer[i]; 00075 }
void TSegmentCurl::setMaxSeq | ( | const | unsigned | ) |
const unsigned TSegmentCurl::size | ( | void | ) | [inline] |
Definition at line 36 of file TSegmentCurl.h.
References m_list.
Referenced by calcuSeq(), TCurlFinder::checkExceptionalSegmentsType01(), TCurlFinder::createSegments(), and dump().
00036 { return m_list.length(); }
const unsigned TSegmentCurl::sizeOfLayer | ( | const | unsigned | ) | [inline] |
Definition at line 80 of file TSegmentCurl.cxx.
References m_flagOfUpdate, m_sizeOfLayer, and update().
00081 { 00082 if(m_flagOfUpdate)update(); 00083 return m_sizeOfLayer[i]; 00084 }
const unsigned TSegmentCurl::superLayerId | ( | const | unsigned | ) | [inline] |
Definition at line 98 of file TSegmentCurl.cxx.
References m_superLayerId.
00099 { 00100 m_superLayerId = i; 00101 return m_superLayerId; 00102 }
const unsigned TSegmentCurl::superLayerId | ( | void | ) | const [inline] |
Definition at line 63 of file TSegmentCurl.cxx.
References m_superLayerId.
00064 { 00065 return m_superLayerId; 00066 }
void TSegmentCurl::update | ( | void | ) |
Definition at line 219 of file TSegmentCurl.cxx.
References calcuSeq(), genRecEmupikp::i, m_flagOfUpdate, m_layer, m_layerIdOfMaxSeq, m_list, m_MaxLocalLayerId, m_maxSeq, m_numOfLargeSeqLayer, m_numOfSeqOneLayer, m_seqOfLayer, m_sizeOfLayer, and TCURL_LARGE_SEQUENCE.
Referenced by TCurlFinder::createSegments(), layerIdOfMaxSeq(), maxSeq(), numOfLargeSeqLayer(), numOfSeqOneLayer(), seqOfLayer(), and sizeOfLayer().
00220 { 00221 if(m_list.length() == 0){ 00222 m_flagOfUpdate = false; 00223 return; 00224 } 00225 m_maxSeq = m_layerIdOfMaxSeq = 0; 00226 m_numOfSeqOneLayer = m_numOfLargeSeqLayer = 0; 00227 for(unsigned i = 0; i <= m_MaxLocalLayerId; ++i){ 00228 m_sizeOfLayer[i] = m_layer[i].length(); 00229 calcuSeq(i); 00230 if(m_seqOfLayer[i] >= m_maxSeq){ 00231 m_maxSeq = m_seqOfLayer[i]; 00232 m_layerIdOfMaxSeq = i; 00233 } 00234 if(m_seqOfLayer[i] == 1)++m_numOfSeqOneLayer; 00235 if(m_seqOfLayer[i] >= TCURL_LARGE_SEQUENCE)++m_numOfLargeSeqLayer; 00236 } 00237 00238 m_flagOfUpdate = false; 00239 }
unsigned TSegmentCurl::wires | ( | const | unsigned | ) | const |
Definition at line 382 of file TSegmentCurl.cxx.
Referenced by calcuSeq().
00383 { 00384 // input - layer id#(0-422) 00385 // output - # of its layer 00386 if(LayerId == 0)return 40; 00387 if(LayerId == 1)return 44; 00388 if(LayerId == 2)return 48; 00389 if(LayerId == 3)return 56; 00390 if(LayerId == 4)return 64; 00391 if(LayerId == 5)return 72; 00392 if(LayerId == 6 || LayerId == 7) return 80; 00393 if(LayerId == 8 || LayerId == 9) return 76; 00394 if(LayerId == 10|| LayerId == 11)return 88; 00395 if(LayerId == 12|| LayerId == 13)return 100; 00396 if(LayerId == 14|| LayerId == 15)return 112; 00397 if(LayerId == 16|| LayerId == 17)return 128; 00398 if(LayerId == 18|| LayerId == 19)return 140; 00399 if(LayerId < 24)return 160; 00400 if(LayerId < 28)return 176; 00401 if(LayerId < 32)return 208; 00402 if(LayerId < 36)return 240; 00403 if(LayerId < 40)return 256; 00404 if(LayerId < 43)return 288; 00405 00406 std::cerr << "Error in the SegmentCurl(wires)." << std::endl; 00407 return 0; 00408 }
bool TSegmentCurl::m_flagOfUpdate [private] |
Definition at line 64 of file TSegmentCurl.h.
Referenced by append(), dump(), layerIdOfMaxSeq(), maxSeq(), numOfLargeSeqLayer(), numOfSeqOneLayer(), operator=(), remove(), removeAll(), seqOfLayer(), sizeOfLayer(), and update().
AList<TMLink> TSegmentCurl::m_layer[4] [private] |
Definition at line 78 of file TSegmentCurl.h.
Referenced by append(), calcuSeq(), dump(), list(), operator=(), remove(), removeAll(), TSegmentCurl(), update(), and ~TSegmentCurl().
unsigned TSegmentCurl::m_layerIdOfMaxSeq [private] |
Definition at line 82 of file TSegmentCurl.h.
Referenced by dump(), layerIdOfMaxSeq(), operator=(), and update().
AList<TMLink> TSegmentCurl::m_list [private] |
Definition at line 67 of file TSegmentCurl.h.
Referenced by append(), dump(), list(), operator=(), remove(), removeAll(), size(), TSegmentCurl(), update(), and ~TSegmentCurl().
unsigned TSegmentCurl::m_MaxLocalLayerId [private] |
Definition at line 69 of file TSegmentCurl.h.
Referenced by calcuSeq(), dump(), maxLocalLayerId(), operator=(), and update().
unsigned TSegmentCurl::m_maxSeq [private] |
Definition at line 81 of file TSegmentCurl.h.
Referenced by dump(), maxSeq(), operator=(), and update().
unsigned TSegmentCurl::m_numOfLargeSeqLayer [private] |
Definition at line 84 of file TSegmentCurl.h.
Referenced by dump(), numOfLargeSeqLayer(), operator=(), and update().
unsigned TSegmentCurl::m_numOfSeqOneLayer [private] |
Definition at line 83 of file TSegmentCurl.h.
Referenced by dump(), numOfSeqOneLayer(), operator=(), and update().
unsigned TSegmentCurl::m_seqOfLayer[4] [private] |
Definition at line 73 of file TSegmentCurl.h.
Referenced by calcuSeq(), dump(), operator=(), seqOfLayer(), TSegmentCurl(), and update().
unsigned TSegmentCurl::m_sizeOfLayer[4] [private] |
Definition at line 75 of file TSegmentCurl.h.
Referenced by dump(), operator=(), sizeOfLayer(), TSegmentCurl(), and update().
unsigned TSegmentCurl::m_superLayerId [private] |
Definition at line 71 of file TSegmentCurl.h.
Referenced by dump(), operator=(), and superLayerId().