BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMLink.h File Reference
#include <iostream>
#include <string>
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Alist/AList.h"
#include "CLHEP/Alist/ConstAList.h"
#include "TrkReco/TMDCWire.h"
#include "TrkReco/TMDCWireHit.h"

Go to the source code of this file.

Classes

 A class to relate TMDCWireHit and TTrack objects. More...

Macros

#define TMLink_INLINE_DEFINE_HERE

Typedefs

typedef HepGeom::Point3D< double > HepPoint3D

Functions

const TTrackHEPLinks2HEP (const AList< TMLink > &links)
 returns TTrackHEP
unsigned NSuperLayers (const AList< TMLink > &links)
 returns # of layers.
unsigned NSuperLayers (const AList< TMLink > &links, unsigned minNHits)
unsigned NMissingAxialSuperLayers (const AList< TMLink > &links)
unsigned NLayers (const AList< TMLink > &links)
 returns # of layers.
void NHits (const AList< TMLink > &links, unsigned nHits[50])
 returns # of hits per layer.
void NHitsSuperLayer (const AList< TMLink > &links, unsigned nHits[11])
 returns # of hits per super layer.
AList< TMLinkAxialHits (const AList< TMLink > &links)
 returns axial hits.
AList< TMLinkStereoHits (const AList< TMLink > &links)
 returns stereo hits.
unsigned NAxialHits (const AList< TMLink > &links)
 returns # of axial hits.
unsigned NStereoHits (const AList< TMLink > &links)
 returns # of stereo hits.
unsigned Width (const AList< TMLink > &)
AList< TMLinkEdges (const AList< TMLink > &)
AList< TMLinkSameLayer (const AList< TMLink > &list, const TMLink &a)
 returns links which are in the same layer as 'a' or 'id'.
AList< TMLinkSameLayer (const AList< TMLink > &list, unsigned id)
AList< TMLinkSameSuperLayer (const AList< TMLink > &list, const TMLink &a)
 returns links which are in the same super layer as 'a' or 'id'.
AList< TMLinkSameSuperLayer (const AList< TMLink > &list, unsigned id)
unsigned SuperLayer (const AList< TMLink > &list)
 returns super layer pattern.
unsigned SuperLayer (const AList< TMLink > &list, unsigned minNHits)
TMLinkInnerMost (const AList< TMLink > &links)
 returns the inner(outer)-most link.
TMLinkOuterMost (const AList< TMLink > &links)
AList< TMLinkInOut (const AList< TMLink > &)
void SeparateCores (const AList< TMLink > &input, AList< TMLink > &cores, AList< TMLink > &nonCores)
 separate cores and non-cores.
AList< TMLinkCores (const AList< TMLink > &input)
void Dump (const CAList< TMLink > &links, const std::string &message=std::string(""), const std::string &prefix=std::string(""))
 dumps TMLinks.
void Dump (const TMLink &link, const std::string &message=std::string(""), const std::string &prefix=std::string(""))
int SortByWireId (const void *a, const void *b)
 Sorter.
int SortByX (const void *a, const void *b)

Macro Definition Documentation

◆ TMLink_INLINE_DEFINE_HERE

#define TMLink_INLINE_DEFINE_HERE

Typedef Documentation

◆ HepPoint3D

typedef HepGeom::Point3D<double> HepPoint3D

Function Documentation

◆ AxialHits()

AList< TMLink > AxialHits ( const AList< TMLink > & links)

returns axial hits.

Definition at line 289 of file TMLink.cxx.

289 {
291 unsigned n = links.length();
292 for ( unsigned i = 0; i < n; i++ )
293 {
294 if ( links[i]->wire()->axial() ) a.append( links[i] );
295 }
296 return a;
297}
const Int_t n

◆ Cores()

AList< TMLink > Cores ( const AList< TMLink > & input)

Definition at line 353 of file TMLink.cxx.

353 {
355 unsigned n = input.length();
356 for ( unsigned i = 0; i < n; i++ )
357 {
358 TMLink& t = *input[i];
359 const TMDCWireHit& h = *t.hit();
360 if ( h.state() & WireHitFittingValid ) a.append( t );
361 }
362 return a;
363}
int t()
Definition t.c:1

◆ Dump() [1/2]

void Dump ( const CAList< TMLink > & links,
const std::string & message = std::string(""),
const std::string & prefix = std::string("") )

dumps TMLinks.

Definition at line 169 of file TMLink.cxx.

169 {
170 bool mc = ( msg.find( "mc" ) != std::string::npos );
171 bool pull = ( msg.find( "pull" ) != std::string::npos );
172 bool flag = ( msg.find( "flag" ) != std::string::npos );
173 bool sort = ( msg.find( "sort" ) != std::string::npos );
174 bool stereo = ( msg.find( "stereo" ) != std::string::npos );
175 bool detail = ( msg.find( "detail" ) != std::string::npos );
176 bool pos = ( msg.find( "position" ) != std::string::npos );
177 if ( detail ) mc = pull = flag = sort = true;
178
179 CAList<TMLink> tmp = links;
180 if ( sort ) tmp.sort( SortByWireId );
181 unsigned n = tmp.length();
182 unsigned nForFit = 0;
183#define MCC_MAX 1000
184 unsigned MCC0[MCC_MAX];
185 unsigned MCC1[MCC_MAX];
186 for ( unsigned i = 0; i < MCC_MAX; i++ )
187 {
188 MCC0[i] = 0;
189 MCC1[i] = 0;
190 }
191 bool MCCOverFlow = false;
192
193 std::cout << pre;
194 for ( unsigned i = 0; i < n; i++ )
195 {
196 const TMLink& l = *tmp[i];
197 std::cout << l.wire()->name();
198
199 double a = l.pull();
200 unsigned mcId = 0;
201 if ( mc )
202 if ( l.hit()->mc() )
203 if ( l.hit()->mc()->hep() ) mcId = l.hit()->mc()->hep()->id();
204 if ( pull ) { std::cout << "[" << a << "]"; }
205 if ( mc )
206 {
207 std::cout << "(" << mcId << ")";
208 if ( mcId < MCC_MAX )
209 {
210 ++MCC0[mcId];
211 if ( l.hit()->state() & WireHitFittingValid )
212 {
213 if ( !( l.hit()->state() & WireHitInvalidForFit ) ) ++MCC1[mcId];
214 }
215 }
216 else { MCCOverFlow = true; }
217 }
218 if ( flag )
219 {
220 if ( l.hit()->state() & WireHitFindingValid ) std::cout << "o";
221 if ( l.hit()->state() & WireHitFittingValid )
222 {
223 std::cout << "+";
224 if ( !( l.hit()->state() & WireHitInvalidForFit ) ) ++nForFit;
225 }
226 if ( l.hit()->state() & WireHitInvalidForFit ) std::cout << "x";
227 }
228 if ( stereo ) { std::cout << "{" << l.leftRight() << "," << l.zStatus() << "}"; }
229 if ( pos ) { std::cout << ",pos=" << l.position(); }
230 std::cout << ",";
231 }
232 std::cout << " " << n << " l(s)";
233 if ( flag ) std::cout << ", fv " << nForFit << " l(s)";
234 if ( mc )
235 {
236 unsigned nMC = 0;
237 std::cout << ", mc";
238 for ( unsigned i = 0; i < MCC_MAX; i++ )
239 {
240 if ( MCC0[i] > 0 )
241 {
242 ++nMC;
243 std::cout << i << ":" << MCC0[i] << ",";
244 }
245 }
246 std::cout << " total " << nMC << " contributions";
247 if ( flag )
248 {
249 nMC = 0;
250 std::cout << ", fv mc";
251 for ( unsigned i = 0; i < MCC_MAX; i++ )
252 {
253 if ( MCC1[i] > 0 )
254 {
255 ++nMC;
256 std::cout << i << ":" << MCC1[i] << ",";
257 }
258 }
259 std::cout << " total " << nMC << " contributions";
260 }
261
262 if ( MCCOverFlow ) std::cout << "(counter overflow)";
263 }
264 std::cout << std::endl;
265}
const TTrackHEP *const hep(void) const
returns a pointer to a GEN_HEPEVT.
const TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
std::string name(void) const
returns name.
unsigned id(void) const
returns an id started from 0.

Referenced by TBuilder0::buildRphi(), TBuilder0::buildStereo(), TBuilder::buildStereo(), TBuilder0::buildStereo0(), TTrackBase::dump(), TTrackManager::dump(), TConformalFinder0::findSegments(), TTrackManager::mask(), TTrackManager::maskCurl(), TTrackManager::maskOut(), TTrackManager::merge(), TTrackBase::refine(), TTrackBase::refine(), and TBuilder::salvage().

◆ Dump() [2/2]

void Dump ( const TMLink & link,
const std::string & message = std::string(""),
const std::string & prefix = std::string("") )

Definition at line 267 of file TMLink.cxx.

267 {
268 CAList<TMLink> tmp;
269 tmp.append( link );
270 Dump( tmp, msg, pre );
271}

◆ Edges()

AList< TMLink > Edges ( const AList< TMLink > & list)

returns links which are edges. This function assumes that all TMLink's are in the same super layer.

Definition at line 446 of file TMLink.cxx.

446 {
448
449 unsigned n = list.length();
450 if ( n < 2 ) return a;
451 else if ( n == 2 ) return list;
452
453 const TMDCWire* w = list[0]->wire();
454 unsigned nWires = w->layer()->nWires();
455 unsigned center = w->localId();
456
457 unsigned left = 0;
458 unsigned right = 0;
459 TMLink* leftL = list[0];
460 TMLink* rightL = list[0];
461 for ( unsigned i = 1; i < n; i++ )
462 {
463 w = list[i]->wire();
464 unsigned id = w->localId();
465
466 unsigned distance0, distance1;
467 if ( id > center )
468 {
469 distance0 = id - center;
470 distance1 = nWires - distance0;
471 }
472 else
473 {
474 distance1 = center - id;
475 distance0 = nWires - distance1;
476 }
477
478 if ( distance0 < distance1 )
479 {
480 if ( distance0 > right )
481 {
482 right = distance0;
483 rightL = list[i];
484 }
485 }
486 else
487 {
488 if ( distance1 > left )
489 {
490 left = distance1;
491 leftL = list[i];
492 }
493 }
494 }
495
496 a.append( leftL );
497 a.append( rightL );
498 return a;
499}
double w

◆ InnerMost()

TMLink * InnerMost ( const AList< TMLink > & links)

returns the inner(outer)-most link.

Definition at line 309 of file TMLink.cxx.

309 {
310 unsigned n = a.length();
311 unsigned minId = 9999;
312 TMLink* t = 0;
313 for ( unsigned i = 0; i < n; i++ )
314 {
315 unsigned id = a[i]->wire()->id();
316 if ( id < minId )
317 {
318 minId = id;
319 t = a[i];
320 }
321 }
322 return t;
323}

Referenced by TTrackManager::maskNormal(), and TTrackManager::merge().

◆ InOut()

AList< TMLink > InOut ( const AList< TMLink > & list)

returns links which are in the inner most and outer most layer. This function assumes that all TMLink's are in the same super layer.

Definition at line 543 of file TMLink.cxx.

543 {
544 AList<TMLink> inners;
545 AList<TMLink> outers;
546 unsigned n = list.length();
547 unsigned innerMostLayer = 999;
548 unsigned outerMostLayer = 0;
549 for ( unsigned i = 0; i < n; i++ )
550 {
551 unsigned id = list[i]->wire()->layerId();
552 if ( id < innerMostLayer ) innerMostLayer = id;
553 else if ( id > outerMostLayer ) outerMostLayer = id;
554 }
555 for ( unsigned i = 0; i < n; i++ )
556 {
557 unsigned id = list[i]->wire()->layerId();
558 if ( id == innerMostLayer ) inners.append( list[i] );
559 else if ( id == outerMostLayer ) outers.append( list[i] );
560 }
561 inners.append( outers );
562 return inners;
563}

Referenced by TSegment0::solveDualHits(), and TSegment::solveDualHits().

◆ Links2HEP()

const TTrackHEP & Links2HEP ( const AList< TMLink > & links)

returns TTrackHEP

Definition at line 631 of file TMLink.cxx.

631 {
632 const TTrackHEP* best = NULL;
633 const AList<TTrackHEP>& list = TTrackHEP::list();
634 unsigned nHep = list.length();
635
636 if ( !nHep ) return *best;
637
638 unsigned* N = (unsigned*)malloc( nHep * sizeof( unsigned ) );
639 for ( unsigned i = 0; i < nHep; i++ ) N[i] = 0;
640
641 for ( unsigned i = 0; i < links.length(); i++ )
642 {
643 const TMLink& l = *links[i];
644 const TTrackHEP& hep = *l.hit()->mc()->hep();
645 for ( unsigned j = 0; j < nHep; j++ )
646 if ( list[j] == &hep ) ++N[j];
647 }
648
649 unsigned nMax = 0;
650 for ( unsigned i = 0; i < nHep; i++ )
651 {
652 if ( N[i] > nMax )
653 {
654 best = list[i];
655 nMax = N[i];
656 }
657 }
658
659 return *best;
660}
A class to represent a GEN_HEPEVT particle in tracking.
static const AList< TTrackHEP > & list(void)
returns a list of TTrackHEP's.
Definition TTrackHEP.cxx:70

◆ NAxialHits()

unsigned NAxialHits ( const AList< TMLink > & links)

returns # of axial hits.

Definition at line 281 of file TMLink.cxx.

281 {
282 unsigned nLinks = links.length();
283 unsigned n = 0;
284 for ( unsigned i = 0; i < nLinks; i++ )
285 if ( links[i]->wire()->axial() ) ++n;
286 return n;
287}

◆ NHits()

void NHits ( const AList< TMLink > & links,
unsigned nHits[50] )

returns # of hits per layer.

Referenced by BesMdcDigitizer::Digitize(), and TTrackManager::mask().

◆ NHitsSuperLayer()

void NHitsSuperLayer ( const AList< TMLink > & links,
unsigned nHits[11] )

returns # of hits per super layer.

Definition at line 163 of file TMLink.cxx.

163 {
164 for ( unsigned i = 0; i < 11; i++ ) nHits[i] = 0;
165 unsigned nLinks = links.length();
166 for ( unsigned i = 0; i < nLinks; i++ ) ++nHits[links[i]->wire()->superLayerId()];
167}

Referenced by TrackLayerUsage().

◆ NLayers()

unsigned NLayers ( const AList< TMLink > & links)

returns # of layers.

Definition at line 137 of file TMLink.cxx.

137 {
138 unsigned l0 = 0;
139 unsigned l1 = 0;
140 unsigned n = list.length();
141 for ( unsigned i = 0; i < n; i++ )
142 {
143 unsigned id = list[i]->wire()->layerId();
144 if ( id < 32 ) l0 |= ( 1 << id );
145 else l1 |= ( 1 << ( id - 32 ) );
146 }
147
148 unsigned l = 0;
149 for ( unsigned i = 0; i < 32; i++ )
150 {
151 if ( l0 & ( 1 << i ) ) ++l;
152 if ( l1 & ( 1 << i ) ) ++l;
153 }
154 return l;
155}

Referenced by TBuilder0::buildRphi(), and TTrackManager::maskNormal().

◆ NMissingAxialSuperLayers()

unsigned NMissingAxialSuperLayers ( const AList< TMLink > & links)

Definition at line 609 of file TMLink.cxx.

609 {
610 unsigned n = links.length();
611 // Liuqg, change the following to BES. unsigned nHits[6] = {0, 0, 0, 0, 0, 0};
612 unsigned nHits[5] = { 0, 0, 0, 0, 0 };
613 for ( unsigned i = 0; i < n; i++ )
614 if ( links[i]->wire()->axial() ) ++nHits[links[i]->wire()->axialStereoLayerId() / 4];
615 unsigned j = 0;
616 while ( nHits[j] == 0 ) ++j;
617 unsigned nMissing = 0;
618 unsigned nMax = 0;
619 for ( unsigned i = j; i < 5; i++ )
620 {
621 if ( nHits[i] == 0 ) ++nMissing;
622 else
623 {
624 if ( nMax < nMissing ) nMax = nMissing;
625 nMissing = 0;
626 }
627 }
628 return nMax;
629}

◆ NStereoHits()

unsigned NStereoHits ( const AList< TMLink > & links)

returns # of stereo hits.

Definition at line 273 of file TMLink.cxx.

273 {
274 unsigned nLinks = links.length();
275 unsigned n = 0;
276 for ( unsigned i = 0; i < nLinks; i++ )
277 if ( links[i]->wire()->stereo() ) ++n;
278 return n;
279}

Referenced by T3DLineFitter::fit(), TRungeFitter::fit(), and TrackInformation().

◆ NSuperLayers() [1/2]

unsigned NSuperLayers ( const AList< TMLink > & links)

returns # of layers.

Definition at line 582 of file TMLink.cxx.

582 {
583 unsigned l0 = 0;
584 unsigned n = list.length();
585 for ( unsigned i = 0; i < n; i++ )
586 {
587 unsigned id = list[i]->wire()->superLayerId();
588 l0 |= ( 1 << id );
589 }
590
591 unsigned l = 0;
592 for ( unsigned i = 0; i < 11; i++ )
593 {
594 if ( l0 & ( 1 << i ) ) ++l;
595 }
596 return l;
597}

Referenced by TBuilder0::buildRphi(), TBuilder::initialLine(), TBuilder::initialLineOld(), TTrackManager::maskCurl(), TTrackManager::maskNormal(), TTrackManager::merge(), and TMSelector::preSelect().

◆ NSuperLayers() [2/2]

unsigned NSuperLayers ( const AList< TMLink > & links,
unsigned minNHits )

Definition at line 599 of file TMLink.cxx.

599 {
600 unsigned n = links.length();
601 unsigned nHits[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
602 for ( unsigned i = 0; i < n; i++ ) ++nHits[links[i]->wire()->superLayerId()];
603 unsigned sl = 0;
604 for ( unsigned i = 0; i < 11; i++ )
605 if ( nHits[i] >= minN ) ++sl;
606 return sl;
607}

◆ OuterMost()

TMLink * OuterMost ( const AList< TMLink > & links)

Definition at line 325 of file TMLink.cxx.

325 {
326 unsigned n = a.length();
327 unsigned maxId = 0;
328 TMLink* t = 0;
329 for ( unsigned i = 0; i < n; i++ )
330 {
331 unsigned id = a[i]->wire()->id();
332 if ( id > maxId )
333 {
334 maxId = id;
335 t = a[i];
336 }
337 }
338 return t;
339}

Referenced by TTrackManager::divide(), TTrackManager::divideByIp(), and TTrackManager::makeTds().

◆ SameLayer() [1/2]

AList< TMLink > SameLayer ( const AList< TMLink > & list,
const TMLink & a )

returns links which are in the same layer as 'a' or 'id'.

Definition at line 501 of file TMLink.cxx.

501 {
502 AList<TMLink> same;
503 unsigned id = a.wire()->layerId();
504 unsigned n = list.length();
505 for ( unsigned i = 0; i < n; i++ )
506 {
507 if ( list[i]->wire()->layerId() == id ) same.append( list[i] );
508 }
509 return same;
510}
unsigned layerId(void) const
returns layer id.

Referenced by TTrackManager::mask(), TTrackManager::maskMultiHits(), TSegment0::solveDualHits(), TSegment::solveDualHits(), and TSegment::width().

◆ SameLayer() [2/2]

AList< TMLink > SameLayer ( const AList< TMLink > & list,
unsigned id )

Definition at line 523 of file TMLink.cxx.

523 {
524 AList<TMLink> same;
525 unsigned n = list.length();
526 for ( unsigned i = 0; i < n; i++ )
527 {
528 if ( list[i]->wire()->layerId() == id ) same.append( list[i] );
529 }
530 return same;
531}

◆ SameSuperLayer() [1/2]

AList< TMLink > SameSuperLayer ( const AList< TMLink > & list,
const TMLink & a )

returns links which are in the same super layer as 'a' or 'id'.

Definition at line 512 of file TMLink.cxx.

512 {
513 AList<TMLink> same;
514 unsigned id = a.wire()->superLayerId();
515 unsigned n = list.length();
516 for ( unsigned i = 0; i < n; i++ )
517 {
518 if ( list[i]->wire()->superLayerId() == id ) same.append( list[i] );
519 }
520 return same;
521}
unsigned superLayerId(void) const
returns super layer id.

Referenced by TBuilder0::buildRphi().

◆ SameSuperLayer() [2/2]

AList< TMLink > SameSuperLayer ( const AList< TMLink > & list,
unsigned id )

Definition at line 533 of file TMLink.cxx.

533 {
534 AList<TMLink> same;
535 unsigned n = list.length();
536 for ( unsigned i = 0; i < n; i++ )
537 {
538 if ( list[i]->wire()->superLayerId() == id ) same.append( list[i] );
539 }
540 return same;
541}

◆ SeparateCores()

void SeparateCores ( const AList< TMLink > & input,
AList< TMLink > & cores,
AList< TMLink > & nonCores )

separate cores and non-cores.

Definition at line 341 of file TMLink.cxx.

342 {
343 unsigned n = input.length();
344 for ( unsigned i = 0; i < n; i++ )
345 {
346 TMLink& t = *input[i];
347 const TMDCWireHit& h = *t.hit();
348 if ( h.state() & WireHitFittingValid ) cores.append( t );
349 else nonCores.append( t );
350 }
351}

Referenced by TBuilder::buildRphi(), and TBuilder::buildStereo().

◆ SortByWireId()

int SortByWireId ( const void * a,
const void * b )

Sorter.

Definition at line 379 of file TMLink.cxx.

379 {
380 const TMLink** a( (const TMLink**)av );
381 const TMLink** b( (const TMLink**)bv );
382 if ( ( *a )->wire()->id() > ( *b )->wire()->id() ) return 1;
383 else if ( ( *a )->wire()->id() == ( *b )->wire()->id() ) return 0;
384 else return -1;
385}

Referenced by TBuilderCosmic::buildStereo(), Dump(), TTrackManager::maskMultiHits(), TLine0::refine(), TMLine::refine(), TSegment::TSegment(), and TSegment0::TSegment0().

◆ SortByX()

int SortByX ( const void * a,
const void * b )

Definition at line 387 of file TMLink.cxx.

387 {
388 const TMLink** a( (const TMLink**)av );
389 const TMLink** b( (const TMLink**)bv );
390 if ( ( *a )->position().x() > ( *b )->position().x() ) return 1;
391 else if ( ( *a )->position().x() == ( *b )->position().x() ) return 0;
392 else return -1;
393}

◆ StereoHits()

AList< TMLink > StereoHits ( const AList< TMLink > & links)

returns stereo hits.

Definition at line 299 of file TMLink.cxx.

299 {
301 unsigned n = links.length();
302 for ( unsigned i = 0; i < n; i++ )
303 {
304 if ( !links[i]->wire()->axial() ) a.append( links[i] );
305 }
306 return a;
307}

Referenced by TBuilder::buildStereo(), and TBuilder::buildStereoNew().

◆ SuperLayer() [1/2]

unsigned SuperLayer ( const AList< TMLink > & list)

returns super layer pattern.

Definition at line 565 of file TMLink.cxx.

565 {
566 unsigned sl = 0;
567 unsigned n = list.length();
568 for ( unsigned i = 0; i < n; i++ ) sl |= ( 1 << ( list[i]->wire()->superLayerId() ) );
569 return sl;
570}

Referenced by TBuilder0::buildRphi(), and MdcxFindTracks::process().

◆ SuperLayer() [2/2]

unsigned SuperLayer ( const AList< TMLink > & list,
unsigned minNHits )

Definition at line 572 of file TMLink.cxx.

572 {
573 unsigned n = links.length();
574 unsigned nHits[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
575 for ( unsigned i = 0; i < n; i++ ) ++nHits[links[i]->wire()->superLayerId()];
576 unsigned sl = 0;
577 for ( unsigned i = 0; i < 11; i++ )
578 if ( nHits[i] >= minN ) sl |= ( 1 << i );
579 return sl;
580}

◆ Width()

unsigned Width ( const AList< TMLink > & list)

returns width(wire cell unit) of given AList<TMLink>. This function assumes that all TMLink's are in the same super layer.

Definition at line 397 of file TMLink.cxx.

397 {
398 unsigned n = list.length();
399 if ( n < 2 ) return n;
400
401 const TMDCWire* w = list[0]->wire();
402 unsigned nWires = w->layer()->nWires();
403 unsigned center = w->localId();
404
405#ifdef TRKRECO_DEBUG_DETAIL
406 unsigned sId = w->superLayerId();
407#endif
408
409 unsigned left = 0;
410 unsigned right = 0;
411 for ( unsigned i = 1; i < n; i++ )
412 {
413 w = list[i]->wire();
414 unsigned id = w->localId();
415
416 unsigned distance0, distance1;
417 if ( id > center )
418 {
419 distance0 = id - center;
420 distance1 = nWires - distance0;
421 }
422 else
423 {
424 distance1 = center - id;
425 distance0 = nWires - distance1;
426 }
427
428 if ( distance0 < distance1 )
429 {
430 if ( distance0 > right ) right = distance0;
431 }
432 else
433 {
434 if ( distance1 > left ) left = distance1;
435 }
436
437#ifdef TRKRECO_DEBUG_DETAIL
438 if ( w->superLayerId() != sId )
439 std::cout << "::width !!! super layer assumption violation" << std::endl;
440#endif
441 }
442
443 return right + left + 1;
444}

Referenced by BesMucNoise::Initialize(), TTrackManager::mask(), TSegment0::solveDualHits(), TSegment::solveDualHits(), and TSegment::width().