1#include "MdcHoughFinder/Hough3D.h"
20 _circleR=other._circleR;
21 _circleX=other._circleX;
22 _circleY=other._circleY;
23 _charge=other._charge;
34 _bunchT0=other._bunchT0;
35 _chi2_aver=other._chi2_aver;
37 _recHitVec=other._recHitVec;
38 vec_mdcHit=other.vec_mdcHit;
46 _d0 = hough2D.
getD0();
63 _d0 = hough2D.
getD0();
92 if (
m_debug>0) cout<<
"q d0 phi0 omega: "<<_charge<<
" "<<_d0<<
" "<<_phi0<<
" "<<_omega<<
" "<<_tanl<<
" "<<_z0<<endl;
97 bool permitFlips =
true;
98 bool lPickHits =
true;
102 std::vector<HoughRecHit>::iterator
iter = _recHitVec.begin();
103 for (;
iter != _recHitVec.end();
iter++, digiId++) {
104 if( (*iter).getflag()!=0 )
continue;
109 const MdcDigi* aDigi = (*iter).digi();
112 vector<MdcHit*>::const_iterator iter_digi = (*vec_mdcHit).
begin();
113 for (;iter_digi != (*vec_mdcHit).end(); iter_digi++) {
114 if( (*iter_digi)->digi() == (*iter).digi() ) {
132 flight = (*iter).getRet().second;
133 double distoTrack= (*iter).getDisToTrack();
141 if(hit->
driftTime(_bunchT0,0)>1000) use_in3d=0;
143 if(
m_debug>0) cout<<
"flt : "<<flight<<endl;
146 if(use_in3d==0)
continue;
160 cout <<
" global 3d fit failed ";
161 if(newFit) cout <<
" nAct "<<newFit->
nActive();
162 cout<<
"ERR1 failure ="<<err.
failure()<<endl;
169 chi2=newFit->
chisq();
176 bool badQuality =
false;
203 std::cout<<__FILE__<<
" "<<__LINE__<<
" drop track by nhit"<<nActiveHit <<
" <= "<<
m_dropTrkNhitCut<<std::endl;
208 if( badQuality) fit_stat=0;
216 cout <<
" global 3d fit success"<<endl;
217 cout<<__FILE__<<__LINE__<<
"AFTER fit 3d "<<endl;
218 newTrack->
print(std::cout);
227 _circleR=_charge/par.
omega();
230 double pxy=fabs(_circleR/333.567);
231 double pz=pxy*par.
tanDip();
232 double pxyz=_charge*sqrt(pxy*pxy+pz*pz);
237 cout<<
" circle after globle 3d: "<<
"("<<_circleX<<
","<<_circleY<<
","<<_circleR<<
")"<<endl;
238 cout<<
"pt_rec: "<<_pt<<endl;
239 cout<<
"pz_rec: "<<_pz<<endl;
240 cout<<
"p_rec: "<<_p<<endl;
244 if(
m_debug>0) cout<<
" hot list:"<<endl;
246 int lay=((
MdcHit*)(hotIter->hit()))->layernumber();
247 int wir=((
MdcHit*)(hotIter->hit()))->wirenumber();
249 if(
m_debug>0){ cout <<
"(" <<((
MdcHit*)(hotIter->hit()))->layernumber()
250 <<
","<<((
MdcHit*)(hotIter->hit()))->wirenumber()
251 <<
":"<<hotIter->isActive()<<
") ";
254 if (hotIter->isActive()==1) nfit3d++;
259 _chi2_aver=chi2/_nfit;
263 if(
m_debug>0) cout<<
" in 3D fit number of Active hits : "<<_nfit<<endl;
268 cout<<
" print hough3d "<<endl;
269 cout<<
"par: "<<_d0<<
" "<<_phi0<<
" "<<_omega<<
" "<<_tanl<<
" "<<_z0<<endl;
277 for(
int ihit=0;ihit<_recHitVec.size();ihit++){
278 if( _recHitVec[ihit].calDriftDist(_bunchT0,0)>0.8 || _recHitVec[ihit].driftTime(_bunchT0,0)>800 ) _recHitVec[ihit].setflag(-5);
281 vector<int> vec_layer_num[43];
282 for(
int ilay=0;ilay<43;ilay++){
283 for(
int ihit=0;ihit<_recHitVec.size();ihit++){
284 if( _recHitVec[ihit].getLayerId()==ilay && _recHitVec[ihit].getflag()==0 ) {
285 vec_layer_num[ilay].push_back( _recHitVec[ihit].getWireId() );
288 std::sort( vec_layer_num[ilay].begin(),vec_layer_num[ilay].end(),
less_layer_3D);
289 if( vec_layer_num[ilay].size() < 4 )
continue;
290 for(
int j=0;j<vec_layer_num[ilay].size();j++) {
292 for(
int jhit=0;jhit<_recHitVec.size();jhit++) {
293 if( (ilay==_recHitVec[jhit].getLayerId()) && (vec_layer_num[ilay][j]==_recHitVec[jhit].getWireId() ) ) {_recHitVec[jhit].setflag(-1);}
vector< TrkRecoTrk * > vectrk_for_clean
vector< MdcHit * > vec_for_clean
bool less_layer_3D(const int &a, const int &b)
double sin(const BesAngle a)
double cos(const BesAngle a)
vector< TrkRecoTrk * > vectrk_for_clean
std::vector< HoughRecHit > recHitCol
static double m_dropTrkDzCut
static double m_dropTrkNhitCut
static TrkContextEv * _context
static double m_dropTrkDrCut
static const MdcCalibFunSvc * _mdcCalibFunSvc
static double m_dropTrkChi2NdfCut
static double m_dropTrkChi2Cut
static int m_qualityFactor
double getT0(int layid, int cellid) const
double getTimeWalk(int layid, double Q) const
void setCalibSvc(const MdcCalibFunSvc *calibSvc)
double driftTime(double tof, double z) const
void setCountPropTime(const bool count)
double driftDist(double, int, double, double, double) const
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
hot_iterator begin() const
virtual int nActive(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
virtual void print(std::ostream &) const
const TrkFit * fitResult() const
virtual void printAll(std::ostream &) const
bool setFlipAndDrop(TrkRecoTrk &, bool allowFlips, bool allowDrops) const
TrkRecoTrk * makeTrack(const TrkExchangePar &helix, const double chi2, const TrkContext &, double trackT0) const