BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkReco/TrkReco/TSegment.h File Reference
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Geometry/Vector3D.h"
#include "TrkReco/TTrackBase.h"
#include "TrkReco/TMDCUtil.h"
#include "TrkReco/TMLink.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

◆ HepVector3D

Function Documentation

◆ Links() [1/2]

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

returns AList of TMLink.

Definition at line 1092 of file TSegment.cxx.

1092 {
1093 AList<TMLink> links;
1094 unsigned n = list.length();
1095 for (unsigned i = 0; i < n; i++)
1096 links.append(list[i]->links());
1097 return links;
1098}
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 963 of file TSegment.cxx.

963 {
965
966 const AList<TMLink> & links = s.links();
967 const AList<TMLink> & trackLinks = t.links();
968 unsigned n = links.length();
969 for (unsigned i = 0; i < n; i++) {
970 if (trackLinks.hasMember(links[i]))
971 a.append(links[i]);
972 }
973
974 return a;
975}
XmlRpcServer s
Definition: HelloServer.cpp:11
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 1026 of file TSegment.cxx.

1026 {
1027 AList<TSegment> links;
1028 const TSegment * s = & a;
1029 while (s) {
1030 unsigned nLinks = s->innerLinks().length();
1031 if (nLinks == 0) return links;
1032 int tmp = 0, ii = 0;
1033 for (int i = 0; i < nLinks; ++i) {
1034 if(s->innerLinks()[i]->links().length() > tmp) {
1035 tmp = s->innerLinks()[i]->links().length();
1036 ii = i;
1037 }
1038 }
1039 const TSegment * t = s->innerLinks()[ii];
1040// const TSegment * t = s->innerLinks()[0]; //tmp for tsf
1041 links.append((TSegment *) t);
1042 s = t;
1043 }
1044 return links;
1045}
A class to relate TMDCWireHit and TTrack objects.

◆ NCoreLinks()

unsigned NCoreLinks ( const CAList< TSegment > &  list)

returns # of core links in segments.

Definition at line 947 of file TSegment.cxx.

947 {
948 unsigned n = 0;
949 unsigned nList = list.length();
950 for (unsigned i = 0; i < nList; i++) {
951 const AList<TMLink> & links = list[i]->links();
952 for (unsigned j = 0; j < links.length(); j++) {
953 unsigned state = links[j]->hit()->state();
954 if ((! (state & WireHitPatternLeft)) &&
955 (! (state & WireHitPatternRight)))
956 ++n;
957 }
958 }
959 return n;
960}

◆ NLinkBranches()

unsigned NLinkBranches ( const TSegment a)

returns # of link branches in the major link.

Definition at line 1048 of file TSegment.cxx.

1048 {
1049 unsigned n = 0;
1050 const TSegment * s = & a;
1051 while (s) {
1052 unsigned nLinks = s->innerLinks().length();
1053 if (nLinks == 0) return n;
1054 if (nLinks > 1) ++n;
1055 s = s->innerLinks()[0];
1056 }
1057 return n;
1058}

◆ NMajorLinks()

unsigned NMajorLinks ( const TSegment a)

returns # of links in the major link.

Definition at line 1005 of file TSegment.cxx.

1005 {
1006 unsigned n = 0;
1007 const TSegment * s = & a;
1008 while (s) {
1009 unsigned nLinks = s->innerLinks().length();
1010 if (nLinks == 0) return n;
1011 ++n;
1012 int tmp = 0, ii = 0;
1013 for (int i = 0; i < nLinks; ++i) {
1014 if(s->innerLinks()[i]->links().length() > tmp) {
1015 tmp = s->innerLinks()[i]->links().length();
1016 ii = i;
1017 }
1018 }
1019 s = s->innerLinks()[ii];
1020// s = s->innerLinks()[0]; //tmp for tsf
1021 }
1022 return n;
1023}

◆ NUniqueLinks()

unsigned NUniqueLinks ( const TSegment a)

checks property of segments.

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

Definition at line 978 of file TSegment.cxx.

978 {
979 unsigned n = 0;
980 const TSegment * s = & a;
981 while (s) {
982 unsigned nLinks = s->innerLinks().length();
983 if (nLinks != 1) return n;
984 ++n;
985 s = s->innerLinks()[0];
986 }
987 return n;
988}

◆ OuterMostUniqueLink()

TSegment * OuterMostUniqueLink ( const TSegment a)

returns a segment to the outer-most unique segment.

Definition at line 1084 of file TSegment.cxx.

1084 {
1085 const TSegment * o = & a;
1086 while (o->outerLinks().length() == 1)
1087 o = o->outerLinks()[0];
1088 return (TSegment *) o;
1089}
AList< TSegment > & outerLinks(void)

◆ SeparateCrowded()

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

returns isolated and crowded list.

Definition at line 1061 of file TSegment.cxx.

1063 {
1064 unsigned n = in.length();
1065 if (n == 0) return;
1066
1067 for (unsigned i = 0; i < n; i++) {
1068 TSegment & s = * in[i];
1069 if (s.state() & TSegmentCrowd) crowded.append(s);
1070 else isolated.append(s);
1071 }
1072}

◆ SuperLayer()

unsigned SuperLayer ( const AList< TSegment > &  list)

returns super layer pattern.

Definition at line 1075 of file TSegment.cxx.

1075 {
1076 unsigned sl = 0;
1077 unsigned n = list.length();
1078 for (unsigned i = 0; i < n; i++)
1079 sl |= (1 << (list[i]->superLayerId()));
1080 return sl;
1081}

◆ UniqueLinks()

AList< TSegment > UniqueLinks ( const TSegment a)

returns a list of unique segments in links.

Definition at line 991 of file TSegment.cxx.

991 {
992 AList<TSegment> links;
993 const TSegment * s = & a;
994 while (s) {
995 unsigned nLinks = s->innerLinks().length();
996 if (nLinks != 1) return links;
997 const TSegment * t = s->innerLinks()[0];
998 links.append((TSegment *) t);
999 s = t;
1000 }
1001 return links;
1002}