BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSegGrouperCsmc Class Reference

#include <MdcSegGrouperCsmc.h>

+ Inheritance diagram for MdcSegGrouperCsmc:

Public Member Functions

 MdcSegGrouperCsmc (const MdcDetector *gm, int debug)
 
 ~MdcSegGrouperCsmc ()
 
void fillWithSegs (const MdcSegList *inSegs)
 
virtual int incompWithSeg (const MdcSeg *refSeg, const MdcSeg *testSeg)
 
virtual int incompWithGroup (MdcSeg **segGroup, const MdcSeg *testSeg, int iply)
 
void resetComb (const class MdcSeg *)
 
virtual MdcTrackstorePar (MdcTrack *trk, double parms[2], double chisq, TrkContext &, double trackT0)
 
- Public Member Functions inherited from MdcSegGrouper
virtual ~MdcSegGrouper ()
 
int nextGroup (MdcSeg **segGroup, bool printit)
 
int updateGap ()
 
void resetGap (int nGap)
 
virtual void resetComb (const MdcSeg *seed)=0
 
int nPly () const
 
int combineSegs (MdcTrack *&, MdcSeg *seed, TrkContext &, double trackT0, double maxSegChisqO, int combineByFitHits=0)
 
void transferHits (MdcTrack *track, int nSegs, MdcSeg **segGroup)
 
void dumpSegList ()
 
double calcParBySegs (MdcSeg **segGroup, double seedAngle[2], int nToUse, double &qual, int &nSegFit, double param[2])
 
double calcParByHits (MdcSeg **segGroup, int nToUse, const TrkExchangePar &par, double &qual, int &nSegFit, double param[2], double Bz)
 
void setNoInner (bool noInnerFlag)
 

Additional Inherited Members

- Protected Member Functions inherited from MdcSegGrouper
 MdcSegGrouper (const MdcDetector *gm, int nDeep, int debug)
 
void resetSegCounters ()
 
- Protected Attributes inherited from MdcSegGrouper
int nDeep
 
int nPlyFilled
 
int * currentSeg
 
int * firstGood
 
int * firstBad
 
bool ** isValid
 
HepAList< MdcSeg > ** combList
 
const MdcDetector_gm
 
HepAList< MdcSeg > * segList
 
boolleaveGap
 
int nNull
 
int maxNull
 
int * gapCounter
 
bool lTestGroup
 
bool lTestSingle
 
int _debug
 
bool _noInner
 

Detailed Description

Definition at line 28 of file MdcSegGrouperCsmc.h.

Constructor & Destructor Documentation

◆ MdcSegGrouperCsmc()

MdcSegGrouperCsmc::MdcSegGrouperCsmc ( const MdcDetector * gm,
int debug )

Definition at line 35 of file MdcSegGrouperCsmc.cxx.

35 :
36 MdcSegGrouper(gm, gm->nAxialSuper()-1, debug) {
37//------------------------------------------------------------------------
38
39 lTestGroup = false;
40 lTestSingle = false;
41
42 isValid = new bool * [nPly()];
43 for (int j = 0; j < nPly(); j++) {
44 isValid[j] = 0;
45 }
46}
int nAxialSuper(void) const
Definition MdcDetector.h:55
MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug)
int nPly() const

◆ ~MdcSegGrouperCsmc()

MdcSegGrouperCsmc::~MdcSegGrouperCsmc ( )
inline

Definition at line 32 of file MdcSegGrouperCsmc.h.

32{ };

Member Function Documentation

◆ fillWithSegs()

void MdcSegGrouperCsmc::fillWithSegs ( const MdcSegList * inSegs)

Definition at line 50 of file MdcSegGrouperCsmc.cxx.

50 {
51//------------------------------------------------------------------------
52 // Prepare for axial finding
53 // Store the segments (pointers, actually), sorting by phi0
54 for (int isuper = 0; isuper < _gm->nSuper(); isuper++) {
55 const GmsList *inList = inSegs->oneList(isuper);
56 if (inList->count() == 0) continue;
57
58 MdcSeg *inSeg = (MdcSeg *) inList->first();
59 // Only load axial segments
60 if (inSeg->superlayer()->whichView() != 0) continue;
61
62 while (inSeg != 0) {
63 // Create an info object within the seg to store info
65 inSeg->setInfo(info);
66 info->calcStraight(inSeg); // calc. origin-dependent info
67
68 // Loop over the segs already stored, looking for the right place
69 // to stick the new one
70 int isInserted = 0;
71 for (int iseg = 0; iseg < (int) segList[isuper].length(); iseg++) {
72 MdcSeg *aSeg = segList[isuper][iseg];
73 if ( ((MdcSegInfoCsmc *)aSeg->info())->phi0() < info->phi0())
74 continue;
75 segList[isuper].insert(inSeg, iseg);
76 isInserted = 1;
77 break;
78 } // end of loop over existing segs
79 if (isInserted == 0) segList[isuper].append(inSeg);
80
81 inSeg = (MdcSeg *) inSeg->next();
82 } // end loop over new segs
83 } // end loop over superlayers
84
85}
GmsListLink * first() const
Definition GmsList.h:42
unsigned int count() const
Definition GmsList.h:43
int nSuper() const
Definition MdcDetector.h:53
HepAList< MdcSeg > * segList
const MdcDetector * _gm
double phi0() const
void calcStraight(double phi, double slope, double rad, const double *inErr)
const GmsList * oneList(int slayIndex) const
const MdcSuperLayer * superlayer() const
Definition MdcSeg.h:51
MdcSegInfo * info() const
Definition MdcSeg.h:52
void setInfo(MdcSegInfo *ptr)
Definition MdcSeg.cxx:96
int whichView(void) const

Referenced by MdcTrackListCsmc::createFromSegs().

◆ incompWithGroup()

int MdcSegGrouperCsmc::incompWithGroup ( MdcSeg ** segGroup,
const MdcSeg * testSeg,
int iply )
virtual

Implements MdcSegGrouper.

Definition at line 124 of file MdcSegGrouperCsmc.cxx.

125 {
126//-------------------------------------------------------------------------
127
128 return 0;
129}

◆ incompWithSeg()

int MdcSegGrouperCsmc::incompWithSeg ( const MdcSeg * refSeg,
const MdcSeg * testSeg )
virtual

Implements MdcSegGrouper.

Definition at line 89 of file MdcSegGrouperCsmc.cxx.

90 {
91//-------------------------------------------------------------------------
92
93 return 0;
94 // Returns 0 if valid, -1 if invalid, +1 if invalid and no more valid
95 // ones possible in this slayer (assumes they're ordered)
96 if (testSeg == 0) return 0;
97
98 // Test phi0 match
99 MdcSegInfoCsmc *refInfo = (MdcSegInfoCsmc *) refSeg->info();
100 MdcSegInfoCsmc *testInfo = (MdcSegInfoCsmc *) testSeg->info();
101 double sigPhi0 = (refInfo->sigPhi0() > testInfo->sigPhi0() ?
102 refInfo->sigPhi0() : testInfo->sigPhi0());
103 double refPhi0 = refInfo->phi0();
104 double testPhi0 = testInfo->phi0();
105 double corrPhi0 = mdcWrapAng(refPhi0, testPhi0);
106 if (refPhi0 - corrPhi0 > 6. * sigPhi0) return -1;
107 if (corrPhi0 - refPhi0 > 6. * sigPhi0) {
108 if (testPhi0 > refPhi0) return 1;
109 else return -1; // => testPhi0>2pi & refPhi0<2pi
110 }
111
112 // Test d0 match
113 // use larger error of the two
114 double sigD0 = (refInfo->sigD0() > testInfo->sigD0() ?
115 refInfo->sigD0() : testInfo->sigD0());
116 double refD0 = refInfo->d0();
117 double testD0 = testInfo->d0();
118 if (fabs(refD0 - testD0) > 6. * sigD0) return -2;
119
120 return 0;
121}
double sigPhi0() const
double d0() const
double sigD0() const
double mdcWrapAng(double phi1, double phi2)
Definition mdcWrapAng.h:12

Referenced by resetComb().

◆ resetComb()

void MdcSegGrouperCsmc::resetComb ( const class MdcSeg * seed)

Definition at line 133 of file MdcSegGrouperCsmc.cxx.

133 {
134//---------------------------------------------------------------------
135
136 // Delete existing list of valid/invalid segs
137 if (isValid != 0) {
138 int i;
139 for (i = 0; i < nDeep; i++) {
140 delete [] isValid[i];
141 isValid[i] = 0;
142 }
143 }
144
145 _seed = seed;
146 //Grab the seglist for each slayer
147 int islay = 0;
148 int iply = 0;
149 nPlyFilled = 0;
150 nNull = 0;
151 const MdcSuperLayer *seedSlay = 0;
152 if (seed != 0) seedSlay = seed->superlayer();
153
154 // Set up all sorts of stuff for fast grouping of segs in nextGroup()
155 for (const MdcSuperLayer *thisSlay = _gm->firstSlay(); thisSlay != 0;
156 thisSlay = thisSlay->next()) {
157 bool noGoodYet = true;
158 islay++;
159
160 if (thisSlay == seedSlay) continue;
161 if (thisSlay->whichView() != 0) continue;
162 firstGood[iply] = 0;
163 // Loop over the segs, marking start & end of valid region for this seed
164 firstBad[iply] = 0;
165 if (segList[islay-1].length() != 0)
166 isValid[iply] = new bool[segList[islay-1].length()];
167 for (int i = 0; i < (int) segList[islay-1].length(); i++) {
168 MdcSeg *aSeg = segList[islay-1][i];
169 int invalid = incompWithSeg(seed, aSeg);
170 isValid[iply][i] = true;
171 if (invalid < 0) {
172 firstBad[iply] = i;
173 isValid[iply][i] = false;
174 if (noGoodYet) firstGood[iply] = i+1;
175 }
176 else if (invalid > 0) {
177 // No more valid segs in this slayer
178 firstBad[iply] = i;
179 for (int j = i; j < (int) segList[islay-1].length(); j++)
180 isValid[iply][j] = false;
181 break;
182 }
183 else {
184 firstBad[iply] = i+1;
185 noGoodYet = false;
186 }
187 }
188 // if (thisSlay->whichView() != 0) continue;
189 // firstGood[iply] = 0;
190 // // Loop over the segs, marking start & end of valid region
191 // firstBad[iply] = 0;
192 // firstBad[iply] = segList[islay-1].length();
193
194
195 if (firstGood[iply] > firstBad[iply]) firstGood[iply] = firstBad[iply];
196 if (firstGood[iply] == firstBad[iply]) {
197 // If there are no valid segs for this ply, skip it
198 continue;
199 }
200 // Associate correct seglist with this ply
201 combList[iply] = &segList[islay-1];
202 leaveGap[iply] = false;
203 iply++;
204 }
205 nPlyFilled = iply;
207 maxNull = nPlyFilled - 2;
208 maxNull++;
209}
const MdcSuperLayer * firstSlay(void) const
Definition MdcDetector.h:46
virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg)
HepAList< MdcSeg > ** combList
const MdcSuperLayer * next(void) const

◆ storePar()

MdcTrack * MdcSegGrouperCsmc::storePar ( MdcTrack * trk,
double parms[2],
double chisq,
TrkContext & context,
double trackT0 )
virtual

Implements MdcSegGrouper.

Definition at line 212 of file MdcSegGrouperCsmc.cxx.

213 {
214//---------------------------------------------------------------------
215 assert(trk == 0);
216 BesAngle foundPhi0(parms[1]);
217 TrkExchangePar par(parms[0], foundPhi0.Rad(), 0., 0., 0.);
218 return new MdcTrack(_gm->nSuper(), par, chi2, context, t0);
219}

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