BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
TSegmentCurl Class Reference

#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)
 
TSegmentCurloperator= (const TSegmentCurl &)
 
void dump (void)
 
unsigned wires (const unsigned) const
 
void update (void)
 

Detailed Description

Definition at line 13 of file TSegmentCurl.h.

Constructor & Destructor Documentation

◆ TSegmentCurl() [1/3]

TSegmentCurl::TSegmentCurl ( const unsigned  superLayerId = 9999,
const unsigned  max = 9999 
)

Definition at line 6 of file TSegmentCurl.cxx.

8 : m_MaxLocalLayerId(max), m_superLayerId(superLayerId), m_flagOfUpdate(true)
9{
10 m_list.removeAll();
11 for(unsigned i=0;i<4;++i){
12 m_seqOfLayer[i] = m_sizeOfLayer[i] = 0;
13 m_layer[i].removeAll();
14 }
15}
const unsigned superLayerId(void) const

◆ TSegmentCurl() [2/3]

TSegmentCurl::TSegmentCurl ( TSegmentCurl s)

Definition at line 18 of file TSegmentCurl.cxx.

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)
22{
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];
27 }
28}
XmlRpcServer s
Definition: HelloServer.cpp:11

◆ TSegmentCurl() [3/3]

TSegmentCurl::TSegmentCurl ( TSegmentCurl s)

Definition at line 31 of file TSegmentCurl.cxx.

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)
35{
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];
40 }
41}

◆ ~TSegmentCurl()

TSegmentCurl::~TSegmentCurl ( void  )

Definition at line 44 of file TSegmentCurl.cxx.

45{
46 m_list.removeAll();
47 for(unsigned i=0;i<4;++i){
48 m_layer[i].removeAll();
49 }
50}

Member Function Documentation

◆ append() [1/3]

void TSegmentCurl::append ( AList< TMLink > &  e)
inline

Definition at line 127 of file TSegmentCurl.cxx.

128{
129 m_flagOfUpdate = true;
130 for(unsigned i = 0; i < e.length(); ++i)
131 m_layer[e[i]->hit()->wire()->localLayerId()].append(e[i]);
132 m_list.append(e);
133}

◆ append() [2/3]

void TSegmentCurl::append ( TMLink e)
inline

Definition at line 107 of file TSegmentCurl.cxx.

108{
109 m_flagOfUpdate = true;
110 m_layer[e.hit()->wire()->localLayerId()].append(e);
111 m_list.append(e);
112}
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
Definition: TMDCWireHit.h:218
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition: TMDCWire.h:231

◆ append() [3/3]

void TSegmentCurl::append ( TMLink e)
inline

Definition at line 117 of file TSegmentCurl.cxx.

118{
119 m_flagOfUpdate = true;
120 m_layer[e->hit()->wire()->localLayerId()].append(e);
121 m_list.append(e);
122}

◆ dump()

void TSegmentCurl::dump ( void  )

Definition at line 411 of file TSegmentCurl.cxx.

412{
413 //std::cout.form(" Hep idhep mother mcPX mcPY mcPZ mcE mcMass\n");
414 //std::cout.form(" %3d % 4d % 4d % 2.2f % 2.2f % 2.2f % 2.2f % 2.3f\n",
415 //hepID, partID, mothID, mcpx, mcpy, mcpz, mce, mcmass);
416
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;
425 //std::cout.form(" ID | Seq. of Layer | Size of Layer | Local ID List\n");
426 std::cout << "ID | Seq. of Layer | Size of Layer | Local ID List" << std::endl;
427 for(unsigned i=0;i<4;++i){
428 //std::cout.form(" %1d | %2d | %2d |", i, m_seqOfLayer[i], m_sizeOfLayer[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;
433 }
434}
const unsigned size(void)
Definition: TSegmentCurl.h:36

◆ layerIdOfMaxSeq()

const unsigned TSegmentCurl::layerIdOfMaxSeq ( void  )
inline

Definition at line 193 of file TSegmentCurl.cxx.

194{
195 if(m_flagOfUpdate)update();
196 return m_layerIdOfMaxSeq;
197}
void update(void)

◆ list() [1/2]

const AList< TMLink > & TSegmentCurl::list ( unsigned  i)
inline

Definition at line 52 of file TSegmentCurl.h.

52{ return m_layer[i]; }

◆ list() [2/2]

const AList< TMLink > & TSegmentCurl::list ( void  )
inline

Definition at line 51 of file TSegmentCurl.h.

51{ return m_list; }

◆ maxLocalLayerId() [1/2]

const unsigned TSegmentCurl::maxLocalLayerId ( const unsigned  i)
inline

Definition at line 89 of file TSegmentCurl.cxx.

90{
91 m_MaxLocalLayerId = i;
92 return m_MaxLocalLayerId;
93}

◆ maxLocalLayerId() [2/2]

const unsigned TSegmentCurl::maxLocalLayerId ( void  ) const
inline

Definition at line 55 of file TSegmentCurl.cxx.

56{
57 return m_MaxLocalLayerId;
58}

◆ maxSeq()

const unsigned TSegmentCurl::maxSeq ( void  ) const
inline

Definition at line 181 of file TSegmentCurl.cxx.

182{
183 // I try to use non-const member.
184 // If this method is bad, other methods are necessary.
185 TSegmentCurl * const localThis = const_cast<TSegmentCurl * const>(this);
186 if(m_flagOfUpdate)localThis->update();
187 return m_maxSeq;
188}

◆ numOfLargeSeqLayer()

const unsigned TSegmentCurl::numOfLargeSeqLayer ( void  )
inline

Definition at line 211 of file TSegmentCurl.cxx.

212{
213 if(m_flagOfUpdate)update();
214 return m_numOfLargeSeqLayer;
215}

◆ numOfSeqOneLayer()

const unsigned TSegmentCurl::numOfSeqOneLayer ( void  )
inline

Definition at line 202 of file TSegmentCurl.cxx.

203{
204 if(m_flagOfUpdate)update();
205 return m_numOfSeqOneLayer;
206}

◆ operator=()

TSegmentCurl & TSegmentCurl::operator= ( const TSegmentCurl s)

Definition at line 243 of file TSegmentCurl.cxx.

244{
245 if(this == &s)return *this;
246
247 m_flagOfUpdate = s.m_flagOfUpdate;
248 m_list = s.m_list;
249 m_MaxLocalLayerId = s.m_MaxLocalLayerId;
250 m_superLayerId = s.m_superLayerId;
251
252 m_maxSeq = s.m_maxSeq;
253 m_layerIdOfMaxSeq = s.m_layerIdOfMaxSeq;
254 m_numOfSeqOneLayer = s.m_numOfSeqOneLayer;
255 m_numOfLargeSeqLayer = s.m_numOfLargeSeqLayer;
256
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];
261 }
262
263 return *this;
264}

◆ releaseMaxSeq()

void TSegmentCurl::releaseMaxSeq ( void  )

◆ remove() [1/3]

void TSegmentCurl::remove ( AList< TMLink > &  e)
inline

Definition at line 158 of file TSegmentCurl.cxx.

159{
160 m_flagOfUpdate = true;
161 for(unsigned i = 0; i < e.length(); ++i)
162 m_layer[e[i]->hit()->wire()->localLayerId()].remove(e[i]);
163 m_list.remove(e);
164}

◆ remove() [2/3]

void TSegmentCurl::remove ( TMLink e)
inline

Definition at line 138 of file TSegmentCurl.cxx.

139{
140 m_flagOfUpdate = true;
141 m_layer[e.hit()->wire()->localLayerId()].remove(e);
142 m_list.remove(e);
143}

◆ remove() [3/3]

void TSegmentCurl::remove ( TMLink e)
inline

Definition at line 148 of file TSegmentCurl.cxx.

149{
150 m_flagOfUpdate = true;
151 m_layer[e->hit()->wire()->localLayerId()].remove(e);
152 m_list.remove(e);
153}

◆ removeAll()

void TSegmentCurl::removeAll ( void  )
inline

Definition at line 169 of file TSegmentCurl.cxx.

170{
171 m_flagOfUpdate = true;
172 m_list.removeAll();
173 for(unsigned i=0;i<4;++i){
174 m_layer[i].removeAll();
175 }
176}

◆ seqOfLayer()

const unsigned TSegmentCurl::seqOfLayer ( const unsigned  i)
inline

Definition at line 71 of file TSegmentCurl.cxx.

72{
73 if(m_flagOfUpdate)update();
74 return m_seqOfLayer[i];
75}

◆ setMaxSeq()

void TSegmentCurl::setMaxSeq ( const unsigned  )

◆ size()

const unsigned TSegmentCurl::size ( void  )
inline

Definition at line 36 of file TSegmentCurl.h.

36{ return m_list.length(); }

Referenced by dump().

◆ sizeOfLayer()

const unsigned TSegmentCurl::sizeOfLayer ( const unsigned  i)
inline

Definition at line 80 of file TSegmentCurl.cxx.

81{
82 if(m_flagOfUpdate)update();
83 return m_sizeOfLayer[i];
84}

◆ superLayerId() [1/2]

const unsigned TSegmentCurl::superLayerId ( const unsigned  i)
inline

Definition at line 98 of file TSegmentCurl.cxx.

99{
100 m_superLayerId = i;
101 return m_superLayerId;
102}

◆ superLayerId() [2/2]

const unsigned TSegmentCurl::superLayerId ( void  ) const
inline

Definition at line 63 of file TSegmentCurl.cxx.

64{
65 return m_superLayerId;
66}

◆ update()

void TSegmentCurl::update ( void  )

Definition at line 219 of file TSegmentCurl.cxx.

220{
221 if(m_list.length() == 0){
222 m_flagOfUpdate = false;
223 return;
224 }
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();
229 calcuSeq(i);
230 if(m_seqOfLayer[i] >= m_maxSeq){
231 m_maxSeq = m_seqOfLayer[i];
232 m_layerIdOfMaxSeq = i;
233 }
234 if(m_seqOfLayer[i] == 1)++m_numOfSeqOneLayer;
235 if(m_seqOfLayer[i] >= TCURL_LARGE_SEQUENCE)++m_numOfLargeSeqLayer;
236 }
237
238 m_flagOfUpdate = false;
239}
const unsigned TCURL_LARGE_SEQUENCE

Referenced by layerIdOfMaxSeq(), maxSeq(), numOfLargeSeqLayer(), numOfSeqOneLayer(), seqOfLayer(), and sizeOfLayer().

◆ wires()

unsigned TSegmentCurl::wires ( const unsigned  LayerId) const

Definition at line 382 of file TSegmentCurl.cxx.

383{
384 // input - layer id#(0-422)
385 // output - # of its layer
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;
405
406 std::cerr << "Error in the SegmentCurl(wires)." << std::endl;
407 return 0;
408}

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