BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TSegment.h File Reference
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Geometry/Vector3D.h"
#include "TrkReco/TMDCUtil.h"
#include "TrkReco/TMLink.h"
#include "TrkReco/TTrackBase.h"

Go to the source code of this file.

Classes

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

Macros

#define TSegmentCrowd   8
#define TSegment_INLINE_DEFINE_HERE

Typedefs

typedef HepGeom::Point3D< double > HepPoint3D
typedef HepGeom::Vector3D< double > HepVector3D

Functions

unsigned NCoreLinks (const CAList< TSegment > &list)
 returns # of core links in segments.
AList< TMLinkLinks (const TSegment &, const TTrack &)
 returns AList of TMLink used for a track.
AList< TMLinkLinks (const AList< TSegment > &list)
 returns AList of TMLink.
unsigned NUniqueLinks (const TSegment &a)
 checks property of segments.
AList< TSegmentUniqueLinks (const TSegment &a)
 returns a list of unique segments in links.
TSegmentOuterMostUniqueLink (const TSegment &a)
 returns a segment to the outer-most unique segment.
unsigned NMajorLinks (const TSegment &a)
 returns # of links in the major link.
AList< TSegmentMajorLinks (const TSegment &a)
 returns a list of segments in major links.
unsigned NLinkBranches (const TSegment &a)
 returns # of link branches in the major link.
void SeparateCrowded (const AList< TSegment > &input, AList< TSegment > &isolated, AList< TSegment > &crowded)
 returns isolated and crowded list.
unsigned SuperLayer (const AList< TSegment > &list)
 returns super layer pattern.

Macro Definition Documentation

◆ TSegment_INLINE_DEFINE_HERE

#define TSegment_INLINE_DEFINE_HERE

◆ TSegmentCrowd

#define TSegmentCrowd   8

Typedef Documentation

◆ HepPoint3D

typedef HepGeom::Point3D<double> HepPoint3D

◆ HepVector3D

typedef HepGeom::Vector3D<double> HepVector3D

Function Documentation

◆ Links() [1/2]

AList< TMLink > Links ( const AList< TSegment > & list)

returns AList of TMLink.

Definition at line 1129 of file TSegment.cxx.

1129 {
1130 AList<TMLink> links;
1131 unsigned n = list.length();
1132 for ( unsigned i = 0; i < n; i++ ) links.append( list[i]->links() );
1133 return links;
1134}
const Int_t n

◆ Links() [2/2]

AList< TMLink > Links ( const TSegment & s,
const TTrack & t )

returns AList of TMLink used for a track.

Definition at line 1002 of file TSegment.cxx.

1002 {
1003 AList<TMLink> a;
1004
1005 const AList<TMLink>& links = s.links();
1006 const AList<TMLink>& trackLinks = t.links();
1007 unsigned n = links.length();
1008 for ( unsigned i = 0; i < n; i++ )
1009 {
1010 if ( trackLinks.hasMember( links[i] ) ) a.append( links[i] );
1011 }
1012
1013 return a;
1014}
XmlRpcServer s
int t()
Definition t.c:1

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

◆ MajorLinks()

AList< TSegment > MajorLinks ( const TSegment & a)

returns a list of segments in major links.

Definition at line 1066 of file TSegment.cxx.

1066 {
1067 AList<TSegment> links;
1068 const TSegment* s = &a;
1069 while ( s )
1070 {
1071 unsigned nLinks = s->innerLinks().length();
1072 if ( nLinks == 0 ) return links;
1073 int tmp = 0, ii = 0;
1074 for ( int i = 0; i < nLinks; ++i )
1075 {
1076 if ( s->innerLinks()[i]->links().length() > tmp )
1077 {
1078 tmp = s->innerLinks()[i]->links().length();
1079 ii = i;
1080 }
1081 }
1082 const TSegment* t = s->innerLinks()[ii];
1083 // const TSegment * t = s->innerLinks()[0]; //tmp for tsf
1084 links.append( (TSegment*)t );
1085 s = t;
1086 }
1087 return links;
1088}
A class to relate TMDCWireHit and TTrack objects.

◆ NCoreLinks()

unsigned NCoreLinks ( const CAList< TSegment > & list)

returns # of core links in segments.

Definition at line 987 of file TSegment.cxx.

987 {
988 unsigned n = 0;
989 unsigned nList = list.length();
990 for ( unsigned i = 0; i < nList; i++ )
991 {
992 const AList<TMLink>& links = list[i]->links();
993 for ( unsigned j = 0; j < links.length(); j++ )
994 {
995 unsigned state = links[j]->hit()->state();
996 if ( ( !( state & WireHitPatternLeft ) ) && ( !( state & WireHitPatternRight ) ) ) ++n;
997 }
998 }
999 return n;
1000}

◆ NLinkBranches()

unsigned NLinkBranches ( const TSegment & a)

returns # of link branches in the major link.

Definition at line 1090 of file TSegment.cxx.

1090 {
1091 unsigned n = 0;
1092 const TSegment* s = &a;
1093 while ( s )
1094 {
1095 unsigned nLinks = s->innerLinks().length();
1096 if ( nLinks == 0 ) return n;
1097 if ( nLinks > 1 ) ++n;
1098 s = s->innerLinks()[0];
1099 }
1100 return n;
1101}

◆ NMajorLinks()

unsigned NMajorLinks ( const TSegment & a)

returns # of links in the major link.

Definition at line 1043 of file TSegment.cxx.

1043 {
1044 unsigned n = 0;
1045 const TSegment* s = &a;
1046 while ( s )
1047 {
1048 unsigned nLinks = s->innerLinks().length();
1049 if ( nLinks == 0 ) return n;
1050 ++n;
1051 int tmp = 0, ii = 0;
1052 for ( int i = 0; i < nLinks; ++i )
1053 {
1054 if ( s->innerLinks()[i]->links().length() > tmp )
1055 {
1056 tmp = s->innerLinks()[i]->links().length();
1057 ii = i;
1058 }
1059 }
1060 s = s->innerLinks()[ii];
1061 // s = s->innerLinks()[0]; //tmp for tsf
1062 }
1063 return n;
1064}

◆ NUniqueLinks()

unsigned NUniqueLinks ( const TSegment & a)

checks property of segments.

checks to link segments. returns # of unique segment links.

Definition at line 1016 of file TSegment.cxx.

1016 {
1017 unsigned n = 0;
1018 const TSegment* s = &a;
1019 while ( s )
1020 {
1021 unsigned nLinks = s->innerLinks().length();
1022 if ( nLinks != 1 ) return n;
1023 ++n;
1024 s = s->innerLinks()[0];
1025 }
1026 return n;
1027}

◆ OuterMostUniqueLink()

TSegment * OuterMostUniqueLink ( const TSegment & a)

returns a segment to the outer-most unique segment.

Definition at line 1123 of file TSegment.cxx.

1123 {
1124 const TSegment* o = &a;
1125 while ( o->outerLinks().length() == 1 ) o = o->outerLinks()[0];
1126 return (TSegment*)o;
1127}

◆ SeparateCrowded()

void SeparateCrowded ( const AList< TSegment > & input,
AList< TSegment > & isolated,
AList< TSegment > & crowded )

returns isolated and crowded list.

Definition at line 1103 of file TSegment.cxx.

1104 {
1105 unsigned n = in.length();
1106 if ( n == 0 ) return;
1107
1108 for ( unsigned i = 0; i < n; i++ )
1109 {
1110 TSegment& s = *in[i];
1111 if ( s.state() & TSegmentCrowd ) crowded.append( s );
1112 else isolated.append( s );
1113 }
1114}

◆ SuperLayer()

unsigned SuperLayer ( const AList< TSegment > & list)

returns super layer pattern.

Definition at line 1116 of file TSegment.cxx.

1116 {
1117 unsigned sl = 0;
1118 unsigned n = list.length();
1119 for ( unsigned i = 0; i < n; i++ ) sl |= ( 1 << ( list[i]->superLayerId() ) );
1120 return sl;
1121}

◆ UniqueLinks()

AList< TSegment > UniqueLinks ( const TSegment & a)

returns a list of unique segments in links.

Definition at line 1029 of file TSegment.cxx.

1029 {
1030 AList<TSegment> links;
1031 const TSegment* s = &a;
1032 while ( s )
1033 {
1034 unsigned nLinks = s->innerLinks().length();
1035 if ( nLinks != 1 ) return links;
1036 const TSegment* t = s->innerLinks()[0];
1037 links.append( (TSegment*)t );
1038 s = t;
1039 }
1040 return links;
1041}