20 _circleR = other._circleR;
21 _circleX = other._circleX;
22 _circleY = other._circleY;
23 _charge = other._charge;
26 _omega = other._omega;
34 _bunchT0 = other._bunchT0;
35 _chi2_aver = other._chi2_aver;
37 _recHitVec = other._recHitVec;
38 vec_mdcHit = other.vec_mdcHit;
43 : _tanl( tanl ), _z0( z0 ) {
48 _d0 = hough2D.
getD0();
61 double z0,
const vector<MdcHit*>* mdchit )
62 : _tanl( tanl ), _z0( z0 ), vec_mdcHit( mdchit ) {
67 _d0 = hough2D.
getD0();
99 cout <<
"q d0 phi0 omega: " << _charge <<
" " << _d0 <<
" " << _phi0 <<
" " << _omega
100 <<
" " << _tanl <<
" " << _z0 << endl;
105 bool permitFlips =
true;
106 bool lPickHits =
true;
110 std::vector<HoughRecHit>::iterator
iter = _recHitVec.begin();
111 for ( ;
iter != _recHitVec.end();
iter++, digiId++ )
113 if ( ( *iter ).getflag() != 0 )
continue;
119 const MdcDigi* aDigi = ( *iter ).digi();
122 vector<MdcHit*>::const_iterator iter_digi = ( *vec_mdcHit ).
begin();
123 for ( ; iter_digi != ( *vec_mdcHit ).end(); iter_digi++ )
125 if ( ( *iter_digi )->digi() == ( *iter ).digi() ) { hit = ( *iter_digi ); }
142 flight = ( *iter ).getRet().second;
143 double distoTrack = ( *iter ).getDisToTrack();
151 if ( hit->
driftTime( _bunchT0, 0 ) > 1000 ) use_in3d = 0;
153 if (
m_debug > 0 ) cout <<
"flt : " << flight << endl;
155 std::cout <<
" (" << layer <<
"," << wire <<
",rt " << hit->
rawTime() <<
",dt "
156 << hit->
driftTime( _bunchT0, 0 ) <<
") T0 "
159 <<
"dist: " << hit->
driftDist( _bunchT0, 0 ) <<
" disToTrk " << distoTrack
160 <<
" use?: " << use_in3d << endl;
162 if ( use_in3d == 0 )
continue;
165 if (
m_debug > 0 ) newTrack->printAll( std::cout );
169 const TrkFit* newFit = newTrack->fitResult();
170 int nActiveHit = newTrack->hots()->
nActive();
171 int fit_stat =
false;
178 cout <<
" global 3d fit failed ";
179 if ( newFit ) cout <<
" nAct " << newFit->
nActive();
180 cout <<
"ERR1 failure =" << err.
failure() << endl;
187 if (
abs( 1 / ( par.
omega() ) ) > 0.03 )
190 chi2 = newFit->
chisq();
198 bool badQuality =
false;
203 std::cout << __FILE__ <<
" " << __LINE__ <<
" drop track by chi2 " << chi2 <<
" > "
212 std::cout << __FILE__ <<
" " << __LINE__ <<
" drop track by d0 " << par.
d0() <<
" > "
221 std::cout << __FILE__ <<
" " << __LINE__ <<
" drop track by z0 " << par.
z0() <<
" > "
230 std::cout << __FILE__ <<
" " << __LINE__ <<
" drop track by chi2/ndf"
240 std::cout << __FILE__ <<
" " << __LINE__ <<
" drop track by nhit" << nActiveHit
246 if ( badQuality ) fit_stat = 0;
257 cout <<
" global 3d fit success" << endl;
258 cout << __FILE__ << __LINE__ <<
"AFTER fit 3d " << endl;
259 newTrack->print( std::cout );
264 _omega = par.
omega();
268 _circleR = _charge / par.
omega();
271 _circleY = -1. *
cos( par.
phi0() ) * ( par.
d0() + 1 / par.
omega() ) * -1;
272 double pxy = fabs( _circleR / 333.567 );
273 double pz = pxy * par.
tanDip();
274 double pxyz = _charge * sqrt( pxy * pxy + pz * pz );
280 cout <<
" circle after globle 3d: "
281 <<
"(" << _circleX <<
"," << _circleY <<
"," << _circleR <<
")" << endl;
282 cout <<
"pt_rec: " << _pt << endl;
283 cout <<
"pz_rec: " << _pz << endl;
284 cout <<
"p_rec: " << _p << endl;
288 if (
m_debug > 0 ) cout <<
" hot list:" << endl;
290 int lay = ( (
MdcHit*)( hotIter->
hit() ) )->layernumber();
291 int wir = ( (
MdcHit*)( hotIter->
hit() ) )->wirenumber();
296 cout <<
"(" << ( (
MdcHit*)( hotIter->
hit() ) )->layernumber() <<
","
301 if ( hotIter->
isActive() == 1 ) nfit3d++;
306 _chi2_aver = chi2 / _nfit;
310 if (
m_debug > 0 ) cout <<
" in 3D fit number of Active hits : " << _nfit << endl;
315 cout <<
" print hough3d " << endl;
316 cout <<
"par: " << _d0 <<
" " << _phi0 <<
" " << _omega <<
" " << _tanl <<
" " << _z0
323 for (
int ihit = 0; ihit < _recHitVec.size(); ihit++ )
325 if ( _recHitVec[ihit].calDriftDist( _bunchT0, 0 ) > 0.8 ||
326 _recHitVec[ihit].driftTime( _bunchT0, 0 ) > 800 )
327 _recHitVec[ihit].setflag( -5 );
330 vector<int> vec_layer_num[43];
331 for (
int ilay = 0; ilay < 43; ilay++ )
333 for (
int ihit = 0; ihit < _recHitVec.size(); ihit++ )
335 if ( _recHitVec[ihit].getLayerId() == ilay && _recHitVec[ihit].getflag() == 0 )
336 { vec_layer_num[ilay].push_back( _recHitVec[ihit].getWireId() ); }
338 std::sort( vec_layer_num[ilay].begin(), vec_layer_num[ilay].end(),
less_layer_3D );
339 if ( vec_layer_num[ilay].size() < 4 )
continue;
340 for (
int j = 0; j < vec_layer_num[ilay].size(); j++ )
346 for (
int jhit = 0; jhit < _recHitVec.size(); jhit++ )
348 if ( ( ilay == _recHitVec[jhit].getLayerId() ) &&
349 ( vec_layer_num[ilay][j] == _recHitVec[jhit].getWireId() ) )
350 { _recHitVec[jhit].setflag( -1 ); }
vector< TrkRecoTrk * > vectrk_for_clean
vector< MdcHit * > vec_for_clean
bool less_layer_3D(const int &a, const int &b)
vector< TrkRecoTrk * > vectrk_for_clean
std::vector< HoughRecHit > recHitCol
double sin(const BesAngle a)
double cos(const BesAngle a)
static double m_dropTrkDzCut
static double m_dropTrkNhitCut
static TrkContextEv * _context
static double m_dropTrkDrCut
static const IMdcCalibFunSvc * _mdcCalibFunSvc
static double m_dropTrkChi2NdfCut
static double m_dropTrkChi2Cut
static int m_qualityFactor
double driftTime(double tof, double z) const
void setCountPropTime(const bool count)
double driftDist(double, int, double, double, double) const
void setCalibSvc(const IMdcCalibFunSvc *calibSvc)
static int layer(const Identifier &id)
Values of different levels (failure returns 0).
static int wire(const Identifier &id)
virtual Identifier identify() const
unsigned int getChargeChannel() const
virtual double chisq() const =0
virtual int nActive() const =0
virtual TrkExchangePar helix(double fltL) const =0
TrkFundHit::hot_iterator begin() const
TrkHitOnTrk * appendHot(const TrkHitOnTrk *theHot)
const TrkHotList & hotList() const
const TrkFundHit * hit() const
TrkHitOnTrkIter< TrkHotList::const_iterator_traits > hot_iterator
hot_iterator begin() const
bool setFlipAndDrop(TrkRecoTrk &, bool allowFlips, bool allowDrops) const
TrkRecoTrk * makeTrack(const TrkExchangePar &helix, const double chi2, const TrkContext &, double trackT0) const