65 {
66
67
68
69
70 int nsuper =
_gm->nSuper();
71 resetList();
73 std::cout << std::endl << "=====MdcSegGrouperSt::fillWithSegs=====" << std::endl;
74
75 const TrkFit* tkFit = track->track().fitResult();
76 if ( tkFit == 0 ) return;
77 TrkExchangePar par = tkFit->
helix( 0.0 );
78 double kap = 0.5 * par.
omega();
79 double phi0 = par.
phi0();
81 MdcSegWorks segStuff;
82
83 bool lStraight = false;
84 if ( fabs( kap ) < 1.e-9 ) { lStraight = true; }
85
86 double rCurl = 99999999.;
87 if ( !lStraight ) { rCurl = fabs( d0 + 1. / kap ); }
88
89
90 MdcSegInfoSterO* info = new MdcSegInfoSterO;
91
92
93 for ( int isuper = 0; isuper < nsuper; isuper++ )
94 {
95 const GmsList* inList = inSegs->
oneList( isuper );
96
97 if ( inList->
count() == 0 )
continue;
98
99 MdcSeg* inSeg = (MdcSeg*)inList->
first();
100
102
103
105 if ( radius >= rCurl ) break;
106 double phiArg = kap * radius;
107 if ( lStraight ) phiArg = d0 / radius;
108 if ( phiArg < -1.0 ) phiArg = -1.0;
109 else if ( phiArg > 1.0 ) phiArg = 1.0;
113
114
115 BesAngle maxPhiA = segStuff.
phiAx + delPhi + 0.1;
116 BesAngle minPhiA = segStuff.
phiAx - delPhi - 0.1;
117
118 double maxPhi = maxPhiA;
119 double minPhi = minPhiA;
120 bool phitest = ( maxPhi > minPhi );
121
122
123
124
126
128 std::cout << std::endl
129 << "Pick segment by phi from " << minPhi << " to " << maxPhi
130 <<
" phiAx=" << segStuff.
phiAx <<
" delPhi=" << delPhi << std::endl;
131 for ( ; inSeg != 0; inSeg = (MdcSeg*)inSeg->
next() )
132 {
133
134 BesAngle phiSeg( inSeg->
phi() );
135
137 if ( phitest )
138 {
139 if ( phiSeg < minPhi )
140 {
142 {
143 std::cout << " CUT by phi " << phiSeg << "<min " << minPhi << std::endl;
144 }
145 continue;
146 }
147 else if ( phiSeg > maxPhi )
148 {
150 {
151 std::cout << " CUT by phi " << phiSeg << ">max " << maxPhi << std::endl;
152 }
153 break;
154 }
155 }
156 else
157 {
158 if ( phiSeg > maxPhi && phiSeg < minPhi )
159 {
161 {
162 std::cout << "!phitest " << phiSeg << " max " << maxPhi << " min " << minPhi
163 << std::endl;
164 }
165 continue;
166 }
167 }
168
169 if (
_debug == 3 ) std::cout <<
" **KEEP seg phi=" << phiSeg << std::endl;
170
171
172
173 int isBad = info->
calcStereo( inSeg, track->track(), segStuff );
174
175 if ( isBad )
176 {
177 if (
_debug == 3 ) { std::cout <<
" CUT by calcStereo isBad!" << std::endl; }
178 continue;
179 }
180
184 {
186 {
187 std::cout <<
" CUT by ctcut! " << fabs( info->
ct() )
188 <<
" > cut:" << inSeg->
segPar()->
ctcut <<
" " << phiSeg << std::endl;
189 }
190 continue;
191 }
193 {
195 {
196 std::cout <<
" CUT by z0cut! " << fabs( info->
z0() ) <<
" >cut "
197 << inSeg->
segPar()->
z0cut <<
" " << phiSeg << std::endl;
198 }
199 continue;
200 }
202 info = new MdcSegInfoSterO;
203 segList[isuper].append( inSeg );
204
205
206 }
207 }
208 delete info;
209}
AIDA::IHistogram1D * g_z0Cut
AIDA::IHistogram1D * g_ctCut
void setRad(const double)
GmsListLink * next() const
GmsListLink * first() const
unsigned int count() const
HepAList< MdcSeg > * segList
int calcStereo(MdcSeg *parentSeg, const TrkRecoTrk &track, MdcSegWorks &segStuff)
const GmsList * oneList(int slayIndex) const
const MdcSuperLayer * superlayer() const
static MdcSegParams * segPar()
void setInfo(MdcSegInfo *ptr)
int whichView(void) const
double delPhi(void) const
virtual TrkExchangePar helix(double fltL) const =0