1#include "TrkReco/TSegmentCurl.h"
8 : m_MaxLocalLayerId(
max), m_superLayerId(superLayerId), m_flagOfUpdate(
true)
11 for(
unsigned i=0;i<4;++i){
12 m_seqOfLayer[i] = m_sizeOfLayer[i] = 0;
13 m_layer[i].removeAll();
19 : m_flagOfUpdate(
s.m_flagOfUpdate), m_list(
s.m_list), m_MaxLocalLayerId(
s.m_MaxLocalLayerId), m_superLayerId(
s.m_superLayerId),
20 m_maxSeq(
s.m_maxSeq), m_layerIdOfMaxSeq(
s.m_layerIdOfMaxSeq), m_numOfSeqOneLayer(
s.m_numOfSeqOneLayer),
21 m_numOfLargeSeqLayer(
s.m_numOfLargeSeqLayer)
23 for(
unsigned i=0;i<4;++i){
24 m_seqOfLayer[i] =
s.m_seqOfLayer[i];
25 m_sizeOfLayer[i] =
s.m_sizeOfLayer[i];
26 m_layer[i] =
s.m_layer[i];
32 : m_flagOfUpdate(
s->m_flagOfUpdate), m_list(
s->m_list), m_MaxLocalLayerId(
s->m_MaxLocalLayerId), m_superLayerId(
s->m_superLayerId),
33 m_maxSeq(
s->m_maxSeq), m_layerIdOfMaxSeq(
s->m_layerIdOfMaxSeq), m_numOfSeqOneLayer(
s->m_numOfSeqOneLayer),
34 m_numOfLargeSeqLayer(
s->m_numOfLargeSeqLayer)
36 for(
unsigned i=0;i<4;++i){
37 m_seqOfLayer[i] =
s->m_seqOfLayer[i];
38 m_sizeOfLayer[i] =
s->m_sizeOfLayer[i];
39 m_layer[i] =
s->m_layer[i];
47 for(
unsigned i=0;i<4;++i){
48 m_layer[i].removeAll();
57 return m_MaxLocalLayerId;
65 return m_superLayerId;
73 if(m_flagOfUpdate)
update();
74 return m_seqOfLayer[i];
82 if(m_flagOfUpdate)
update();
83 return m_sizeOfLayer[i];
91 m_MaxLocalLayerId = i;
92 return m_MaxLocalLayerId;
101 return m_superLayerId;
109 m_flagOfUpdate =
true;
119 m_flagOfUpdate =
true;
129 m_flagOfUpdate =
true;
130 for(
unsigned i = 0; i < e.length(); ++i)
131 m_layer[e[i]->hit()->wire()->localLayerId()].append(e[i]);
140 m_flagOfUpdate =
true;
150 m_flagOfUpdate =
true;
160 m_flagOfUpdate =
true;
161 for(
unsigned i = 0; i < e.length(); ++i)
162 m_layer[e[i]->hit()->wire()->localLayerId()].remove(e[i]);
171 m_flagOfUpdate =
true;
173 for(
unsigned i=0;i<4;++i){
174 m_layer[i].removeAll();
186 if(m_flagOfUpdate)localThis->
update();
195 if(m_flagOfUpdate)
update();
196 return m_layerIdOfMaxSeq;
204 if(m_flagOfUpdate)
update();
205 return m_numOfSeqOneLayer;
213 if(m_flagOfUpdate)
update();
214 return m_numOfLargeSeqLayer;
221 if(m_list.length() == 0){
222 m_flagOfUpdate =
false;
225 m_maxSeq = m_layerIdOfMaxSeq = 0;
226 m_numOfSeqOneLayer = m_numOfLargeSeqLayer = 0;
227 for(
unsigned i = 0; i <= m_MaxLocalLayerId; ++i){
228 m_sizeOfLayer[i] = m_layer[i].length();
230 if(m_seqOfLayer[i] >= m_maxSeq){
231 m_maxSeq = m_seqOfLayer[i];
232 m_layerIdOfMaxSeq = i;
234 if(m_seqOfLayer[i] == 1)++m_numOfSeqOneLayer;
238 m_flagOfUpdate =
false;
245 if(
this == &
s)
return *
this;
247 m_flagOfUpdate =
s.m_flagOfUpdate;
249 m_MaxLocalLayerId =
s.m_MaxLocalLayerId;
250 m_superLayerId =
s.m_superLayerId;
252 m_maxSeq =
s.m_maxSeq;
253 m_layerIdOfMaxSeq =
s.m_layerIdOfMaxSeq;
254 m_numOfSeqOneLayer =
s.m_numOfSeqOneLayer;
255 m_numOfLargeSeqLayer =
s.m_numOfLargeSeqLayer;
257 for(
unsigned i=0;i<4;++i){
258 m_seqOfLayer[i] =
s.m_seqOfLayer[i];
259 m_sizeOfLayer[i] =
s.m_sizeOfLayer[i];
260 m_layer[i] =
s.m_layer[i];
270 if( (*a)->hit()->wire()->id() < (*b)->hit()->wire()->id() ){
272 }
else if( (*a)->hit()->wire()->id() == (*b)->hit()->wire()->id() ){
284 if( (*a)->hit()->wire()->id() < (*b)->hit()->wire()->id() ){
286 }
else if( (*a)->hit()->wire()->id() == (*b)->hit()->wire()->id() ){
295TSegmentCurl::calcuSeq(
unsigned i)
298 if(i > m_MaxLocalLayerId){
302 unsigned size = m_layer[i].length();
316 unsigned layerIdForWires = m_layer[i][0]->hit()->wire()->layerId();
320 if(m_layer[i][0]->hit()->wire()->localId() ==
static_cast<unsigned>(
wires(layerIdForWires)-1) &&
321 m_layer[i][
size-1]->hit()->wire()->localId() == 0){
322 for(
unsigned j=0;j<
size-1;++j){
323 if(m_layer[i][j]->hit()->wire()->localIdForMinus()-1 ==
324 m_layer[i][j+1]->hit()->wire()->localId()){
329 if(j ==
size-2)
goto loop;
332 for(
unsigned j=
size-1;j>0;--j){
333 if(m_layer[i][j]->hit()->wire()->localIdForPlus()+1 ==
334 m_layer[i][j-1]->hit()->wire()->localId()){
344 for(
unsigned j=0;j<
size-1;++j){
345 if(m_layer[i][j]->hit()->wire()->localIdForMinus()-1 ==
346 m_layer[i][j+1]->hit()->wire()->localId()){
386 if(LayerId == 0)
return 40;
387 if(LayerId == 1)
return 44;
388 if(LayerId == 2)
return 48;
389 if(LayerId == 3)
return 56;
390 if(LayerId == 4)
return 64;
391 if(LayerId == 5)
return 72;
392 if(LayerId == 6 || LayerId == 7)
return 80;
393 if(LayerId == 8 || LayerId == 9)
return 76;
394 if(LayerId == 10|| LayerId == 11)
return 88;
395 if(LayerId == 12|| LayerId == 13)
return 100;
396 if(LayerId == 14|| LayerId == 15)
return 112;
397 if(LayerId == 16|| LayerId == 17)
return 128;
398 if(LayerId == 18|| LayerId == 19)
return 140;
399 if(LayerId < 24)
return 160;
400 if(LayerId < 28)
return 176;
401 if(LayerId < 32)
return 208;
402 if(LayerId < 36)
return 240;
403 if(LayerId < 40)
return 256;
404 if(LayerId < 43)
return 288;
406 std::cerr <<
"Error in the SegmentCurl(wires)." << std::endl;
417 std::cout <<
"=====Segment for Curling Track Finder=====" << std::endl;
418 std::cout <<
"List Size = " << m_list.length() << std::endl;
419 std::cout <<
"Flag of Update = " << m_flagOfUpdate
420 <<
", Max Local Layer ID = " << m_MaxLocalLayerId
421 <<
", Super Layer ID = " << m_superLayerId << std::endl;
422 std::cout <<
"Max Seq. = " << m_maxSeq <<
", Its Layer ID = " << m_layerIdOfMaxSeq << std::endl;
423 std::cout <<
"# of Seq = 1 Layer = " << m_numOfSeqOneLayer
424 <<
", # of Large Seq. Layer = " << m_numOfLargeSeqLayer << std::endl;
426 std::cout <<
"ID | Seq. of Layer | Size of Layer | Local ID List" << std::endl;
427 for(
unsigned i=0;i<4;++i){
429 std::cout << i <<
" | " << m_seqOfLayer[i] <<
" | " << m_sizeOfLayer[i] <<
" | ";
430 for(
unsigned j = 0,
size = m_layer[i].length(); j <
size; ++j)
431 std::cout << m_layer[i][j]->hit()->wire()->localId() <<
", ";
432 std::cout << std::endl;
const unsigned TCURL_LARGE_SEQUENCE
int sortByWireSerialNumber(const void *av, const void *bv)
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
unsigned localLayerId(void) const
returns local layer id in a super layer.
A class to relate TMDCWireHit and TTrack objects.
const TMDCWireHit * hit(void) const
returns a pointer to a hit.
const unsigned numOfLargeSeqLayer(void)
const unsigned numOfSeqOneLayer(void)
const unsigned layerIdOfMaxSeq(void)
const unsigned sizeOfLayer(const unsigned)
TSegmentCurl(const unsigned superLayerId=9999, const unsigned max=9999)
unsigned wires(const unsigned) const
const unsigned size(void)
const unsigned maxSeq(void) const
const unsigned superLayerId(void) const
const unsigned maxLocalLayerId(void) const
const unsigned seqOfLayer(const unsigned)
TSegmentCurl & operator=(const TSegmentCurl &)