CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSegList Class Reference

#include <MdcSegList.h>

Public Member Functions

 MdcSegList (int nSupers, const MdcSegParams segParms)
 
 ~MdcSegList ()
 
void setPlot (int lPlt)
 
void plot () const
 
const GmsListoneList (int slayIndex) const
 
void append (MdcSeg *aSeg)
 
int count () const
 
void destroySegs ()
 
MdcSeggetSeed (int iview, int goodOnly)
 
void resetSeed (const MdcDetector *gm)
 
MdcSegParamssegPar ()
 

Friends

class MdcSegFinder
 

Detailed Description

Definition at line 20 of file MdcSegList.h.

Constructor & Destructor Documentation

◆ MdcSegList()

MdcSegList::MdcSegList ( int  nSupers,
const MdcSegParams  segParms 
)

Definition at line 35 of file MdcSegList.cxx.

35 {
36/**************************************************************************/
37 segParam = segP; // bit-wise copy
38 MdcSeg::setParam(&segParam);
39 zeroSeed();
40 segList = new GmsList[nSlayer];
41 _nsupers = nSlayer;
42}
static void setParam(MdcSegParams *segpar)
Definition: MdcSeg.h:80

◆ ~MdcSegList()

MdcSegList::~MdcSegList ( )

Definition at line 45 of file MdcSegList.cxx.

45 {
46/**************************************************************************/
47delete [] segList;
48}

Member Function Documentation

◆ append()

void MdcSegList::append ( MdcSeg aSeg)

Definition at line 257 of file MdcSegList.cxx.

257 {
258 /****************************************************************************/
259 segList[aSeg->superlayer()->index()].append(aSeg);
260}
GmsList & append(GmsListLink *)
Definition: GmsList.cxx:20
const MdcSuperLayer * superlayer() const
Definition: MdcSeg.h:51
int index(void) const
Definition: MdcSuperLayer.h:20

◆ count()

int MdcSegList::count ( ) const

Definition at line 419 of file MdcSegList.cxx.

419 {
420 //-------------------------------------------------------------------------
421 int cnt = 0;
422 for (int i = 0; i < _nsupers; i++) cnt += segList[i].count();
423 return cnt;
424}
int count() const
Definition: MdcSegList.cxx:419

Referenced by count(), MdcTrackList::createFromSegs(), and MdcSegFinder::createSegs().

◆ destroySegs()

void MdcSegList::destroySegs ( )

Definition at line 92 of file MdcSegList.cxx.

92 {
93 /****************************************************************************/
94
95 zeroSeed();
96 MdcSeg *aSeg, *bSeg;
97 for (int i = 0; i < _nsupers; i++) {
98 aSeg = (MdcSeg *) segList[i].first();
99 while (aSeg != 0) {
100 bSeg = (MdcSeg *) aSeg->next();
101 segList[i].remove( aSeg );
102 delete aSeg ;
103 aSeg = bSeg;
104 }
105 }
106 return;
107}
GmsList & remove(GmsListLink *)
Definition: GmsList.cxx:118
Definition: MdcSeg.h:42
Index first(Pair i)
Definition: EvtCyclic3.cc:195

◆ getSeed()

MdcSeg * MdcSegList::getSeed ( int  iview,
int  goodOnly 
)

Definition at line 139 of file MdcSegList.cxx.

139 {
140 //***************************************************************************
141
142 // Find a suitable segment for starting a track. If goodOnly=1, look for
143 // isolated, unambiguous segments; unambiguous is
144 // defined as being the only segment within a band in phiseg (typically
145 // 2 cell widths wide), or as differing only slightly from nearby
146 // segments in phi and slope. When these have been exhausted, take any
147 // unused segment. Return pointer to seed seg, or 0 if none found.
148
149 int viewIndex = iview + 1;
150 if (seedSlay[viewIndex] == 0) return 0;
151 while (1) {
152 //if(seedSeg[viewIndex] != 0){
153 //seedSeg[viewIndex]->plotSeg(0,0);//yzhang debug
154 //std::cout<<__FILE__<<" "<<__LINE__<<" goodOnly "<<goodOnly<< std::endl;
155 //}
156 if (seedSeg[viewIndex] == 0) {
157 //seedSlay[viewIndex] = seedSlay[viewIndex]->nextInView();//yzhang temp
158 seedSlay[viewIndex] = seedSlay[viewIndex]->prevInView(); //yzhang del
159 if (seedSlay[viewIndex] == 0) return 0;
160 seedSeg[viewIndex] = (MdcSeg *)
161 oneList(seedSlay[viewIndex]->index())->first();
162 } // We have a segment; is it a viable seed?
163 else if (seedSeg[viewIndex]->segUsed()) {
164 //std::cout<<__FILE__<<" segUsed " << std::endl;
165 seedSeg[viewIndex] = (MdcSeg *) seedSeg[viewIndex]->next();
166 }
167 else if (seedSeg[viewIndex]->segAmbig() && goodOnly) {
168 //std::cout<<__FILE__<<" segAmbig && goodOnly" << std::endl;
169 seedSeg[viewIndex] = (MdcSeg *) seedSeg[viewIndex]->next();
170 //yzhang delete 09-10-10
171 //delete (!seedSeg[viewIndex]->segAmbig() && !goodOnly)
172 } //yzhang add 09-09-28
173 else if ( !seedSeg[viewIndex]->segFull() && goodOnly) {
174 //std::cout<<__FILE__<<" segFull && goodOnly" << std::endl;
175 seedSeg[viewIndex] = (MdcSeg *) seedSeg[viewIndex]->next();
176 //zhangy add
177 } else {
178 // Reject segments with a lot of used hits
179 int nused = 0;
180 int navail = seedSeg[viewIndex]->nHit();
181 for (int ihit = 0; ihit < seedSeg[viewIndex]->nHit(); ihit++) {
182 MdcHitUse *ahit = seedSeg[viewIndex]->hit(ihit);
183 if ( ahit->mdcHit()->usedHit() ) nused++;
184 }
185 // Minimum 2 unused hits (but allow special-purpose segs w/ 0 hits)
186 if (navail - nused < 2 && navail > 0) {
187 seedSeg[viewIndex] = (MdcSeg *) seedSeg[viewIndex]->next();
188 } else {
189 //std::cout<<__FILE__<<" Reject segments with a lot of used hits" << std::endl;
190 break;
191 }
192 }
193 /*
194 if(seedSeg[viewIndex]!=0){
195 seedSeg[viewIndex]->plotSeg();
196 std::cout<< __FILE__ << " " << __LINE__ << " goodOnly "
197 <<goodOnly<<" viewIndex "<<viewIndex<< " full "<<seedSeg[viewIndex]->segFull() <<std::endl;
198 }
199 */
200 }
201
202 // We have a seed
203 MdcSeg *theSeed = seedSeg[viewIndex];
204 seedSeg[viewIndex] = (MdcSeg *) seedSeg[viewIndex]->next();
205
206 return theSeed;
207}
const MdcHit * mdcHit() const
Definition: MdcHitUse.cxx:69
const GmsList * oneList(int slayIndex) const
Definition: MdcSegList.cxx:412
int nHit() const
Definition: MdcSeg.cxx:368
MdcHitUse * hit(int i) const
Definition: MdcSeg.h:77
const MdcSuperLayer * prevInView(void) const
Definition: MdcSuperLayer.h:42
bool usedHit(void) const
Definition: TrkFundHit.h:57
Index next(Index i)
Definition: EvtCyclic3.cc:107

Referenced by MdcTrackList::createFromSegs(), and MdcTrackListCsmc::createFromSegs().

◆ oneList()

const GmsList * MdcSegList::oneList ( int  slayIndex) const

Definition at line 412 of file MdcSegList.cxx.

412 {
413 //-------------------------------------------------------------------------
414 return &segList[slayIndex];
415}

Referenced by MdcSegGrouperAx::fillWithSegs(), MdcSegGrouperCsmc::fillWithSegs(), MdcSegGrouperSt::fillWithSegs(), getSeed(), and resetSeed().

◆ plot()

void MdcSegList::plot ( ) const

Definition at line 75 of file MdcSegList.cxx.

75 {
76 /**************************************************************************/
77
78 MdcSeg *aSeg;
79 for (int i = 0; i < _nsupers; i++) {
80 std::cout << " ---------------MdcSeg of Slayer "<<i<<"-------------" << std::endl;
81
82 aSeg = (MdcSeg *) segList[i].first();
83 while (aSeg != 0) {
84 aSeg->plotSegAll();
85 std::cout << endl;
86 aSeg = (MdcSeg *) aSeg->next();
87 }
88 }
89}
void plotSegAll() const
Definition: MdcSeg.cxx:159

◆ resetSeed()

void MdcSegList::resetSeed ( const MdcDetector gm)

Definition at line 57 of file MdcSegList.cxx.

57 {
58/**************************************************************************/
59
60 for (int iview = -1; iview <= 1; iview++) {
61 int viewIndex = iview + 1;
62 /*
63 if(0 == iview){
64 seedSlay[viewIndex] = gm->firstSlayInView(iview);
65 }else{
66 seedSlay[viewIndex] = gm->lastSlayInView(iview);
67 }
68 */
69 seedSlay[viewIndex] = gm->lastSlayInView(iview);
70 if (seedSlay[viewIndex] != 0) seedSeg[viewIndex] =
71 (MdcSeg *) oneList(seedSlay[viewIndex]->index())->first();
72 }
73}
const MdcSuperLayer * lastSlayInView(int iview) const
Definition: MdcDetector.h:50

Referenced by MdcTrackList::createFromSegs(), MdcTrackListCsmc::createFromSegs(), and MdcSegFinder::createSegs().

◆ segPar()

MdcSegParams * MdcSegList::segPar ( )
inline

Definition at line 38 of file MdcSegList.h.

38{return &segParam;}

Referenced by MdcSegFinder::createSegs().

◆ setPlot()

void MdcSegList::setPlot ( int  lPlt)

Definition at line 406 of file MdcSegList.cxx.

406 {
407 MdcSeg::segPar()->lPlot = lPlt;
408}
static MdcSegParams * segPar()
Definition: MdcSeg.h:79

Friends And Related Function Documentation

◆ MdcSegFinder

friend class MdcSegFinder
friend

Definition at line 22 of file MdcSegList.h.


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