BOSS 8.0.0
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)
 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)
 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)
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)
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 ()
 MdcSegGrouper (const MdcDetector *gm, int nDeep, int debug)
void resetSegCounters ()
 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
bool * leaveGap
int nNull
int maxNull
int * gapCounter
bool lTestGroup
bool lTestSingle
int _debug
bool _noInner

Detailed Description

Constructor & Destructor Documentation

◆ MdcSegGrouperCsmc() [1/3]

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

Definition at line 35 of file MdcSegGrouperCsmc.cxx.

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++ ) { isValid[j] = 0; }
44}
MdcSegGrouper(const MdcDetector *gm, int nDeep, int debug)

Referenced by storePar().

◆ ~MdcSegGrouperCsmc() [1/3]

MdcSegGrouperCsmc::~MdcSegGrouperCsmc ( )
inline

◆ MdcSegGrouperCsmc() [2/3]

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

◆ ~MdcSegGrouperCsmc() [2/3]

MdcSegGrouperCsmc::~MdcSegGrouperCsmc ( )
inline

◆ MdcSegGrouperCsmc() [3/3]

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

◆ ~MdcSegGrouperCsmc() [3/3]

MdcSegGrouperCsmc::~MdcSegGrouperCsmc ( )
inline

Member Function Documentation

◆ fillWithSegs() [1/3]

void MdcSegGrouperCsmc::fillWithSegs ( const MdcSegList * inSegs)

Definition at line 47 of file MdcSegGrouperCsmc.cxx.

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

Referenced by MdcTrackListCsmc::createFromSegs().

◆ fillWithSegs() [2/3]

void MdcSegGrouperCsmc::fillWithSegs ( const MdcSegList * inSegs)

◆ fillWithSegs() [3/3]

void MdcSegGrouperCsmc::fillWithSegs ( const MdcSegList * inSegs)

◆ incompWithGroup() [1/3]

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

Implements MdcSegGrouper.

Definition at line 120 of file MdcSegGrouperCsmc.cxx.

120 {
121 //-------------------------------------------------------------------------
122
123 return 0;
124}

◆ incompWithGroup() [2/3]

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

Implements MdcSegGrouper.

◆ incompWithGroup() [3/3]

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

Implements MdcSegGrouper.

◆ incompWithSeg() [1/3]

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

Implements MdcSegGrouper.

Definition at line 86 of file MdcSegGrouperCsmc.cxx.

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

Referenced by resetComb().

◆ incompWithSeg() [2/3]

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

Implements MdcSegGrouper.

◆ incompWithSeg() [3/3]

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

Implements MdcSegGrouper.

◆ resetComb() [1/3]

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

Definition at line 127 of file MdcSegGrouperCsmc.cxx.

127 {
128 //---------------------------------------------------------------------
129
130 // Delete existing list of valid/invalid segs
131 if ( isValid != 0 )
132 {
133 int i;
134 for ( i = 0; i < nDeep; i++ )
135 {
136 delete[] isValid[i];
137 isValid[i] = 0;
138 }
139 }
140
141 _seed = seed;
142 // Grab the seglist for each slayer
143 int islay = 0;
144 int iply = 0;
145 nPlyFilled = 0;
146 nNull = 0;
147 const MdcSuperLayer* seedSlay = 0;
148 if ( seed != 0 ) seedSlay = seed->superlayer();
149
150 // Set up all sorts of stuff for fast grouping of segs in nextGroup()
151 for ( const MdcSuperLayer* thisSlay = _gm->firstSlay(); thisSlay != 0;
152 thisSlay = thisSlay->next() )
153 {
154 bool noGoodYet = true;
155 islay++;
156
157 if ( thisSlay == seedSlay ) continue;
158 if ( thisSlay->whichView() != 0 ) continue;
159 firstGood[iply] = 0;
160 // Loop over the segs, marking start & end of valid region for this seed
161 firstBad[iply] = 0;
162 if ( segList[islay - 1].length() != 0 )
163 isValid[iply] = new bool[segList[islay - 1].length()];
164 for ( int i = 0; i < (int)segList[islay - 1].length(); i++ )
165 {
166 MdcSeg* aSeg = segList[islay - 1][i];
167 int invalid = incompWithSeg( seed, aSeg );
168 isValid[iply][i] = true;
169 if ( invalid < 0 )
170 {
171 firstBad[iply] = i;
172 isValid[iply][i] = false;
173 if ( noGoodYet ) firstGood[iply] = i + 1;
174 }
175 else if ( invalid > 0 )
176 {
177 // No more valid segs in this slayer
178 firstBad[iply] = i;
179 for ( int j = i; j < (int)segList[islay - 1].length(); j++ ) isValid[iply][j] = false;
180 break;
181 }
182 else
183 {
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 if ( firstGood[iply] > firstBad[iply] ) firstGood[iply] = firstBad[iply];
195 if ( firstGood[iply] == firstBad[iply] )
196 {
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}
virtual int incompWithSeg(const MdcSeg *refSeg, const MdcSeg *testSeg)

◆ resetComb() [2/3]

void MdcSegGrouperCsmc::resetComb ( const class MdcSeg * )

◆ resetComb() [3/3]

void MdcSegGrouperCsmc::resetComb ( const class MdcSeg * )

◆ storePar() [1/3]

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

Implements MdcSegGrouper.

Definition at line 211 of file MdcSegGrouperCsmc.cxx.

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

◆ storePar() [2/3]

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

Implements MdcSegGrouper.

◆ storePar() [3/3]

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

Implements MdcSegGrouper.


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