/** * \file ExtTrack.cpp * \author Elena Vannuccini */ #include #include #include using namespace std; ExtTrack::ExtTrack(int dim){ //cout << " ExtTrack::ExtTrack("< 1 || ip < 0 || ippp > 5 || il < 0 || il > 2) && true){ cout << " void ExtTrack::FillMiniStruct(TrkTrack&) --- WARNING ---trk sensor not defined, cannot read alignment parameters "<=nplanes){ cout << " ExtTrack::SetZ("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::ResetXY("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::SetXY("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::SetX("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::SetX("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::SetXGood("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::SetYGood("< exceed vector dimension = "<0. ? 1./sqrt(coval[4][4]) : 0. ) ; cout << endl << "dedx_x : "; for(int i=0; i>>> fit failed "<al[i]); for(int j=0; j<5; j++) coval[i][j] = (float) (track->cov[i][j]); } chi2 = (float) (track->chi2); nstep = (float) (track->nstep); for(int i=0; ixv[i]); yv[i] = (float) (track->yv[i]); zv[i] = (float) (track->zv[i]); xm[i] = (float) (track->xm[i]); ym[i] = (float) (track->ym[i]); zm[i] = (float) (track->zm[i]); xma[i] = (float) (track->xm_a[i]); yma[i] = (float) (track->ym_a[i]); zma[i] = (float) (track->zm_a[i]); xmb[i] = (float) (track->xm_b[i]); ymb[i] = (float) (track->ym_b[i]); zmb[i] = (float) (track->zm_b[i]); axv[i] = (float) (track->axv[i]); ayv[i] = (float) (track->ayv[i]); } zini = (float) (track->zini); } /** * Method to retrieve ID (0,1,...) of x-cluster (if any) associated to this track. * If no cluster is associated, ID=-1. * */ int ExtTrack::GetClusterX_ID(int ip){ if(ip<0 || ip>=nplanes)return -1; return ((int)fabs(xgood[ip]))%10000000-1; }; /** * Method to retrieve ID (0-xxx) of y-cluster (if any) associated to this track. * */ int ExtTrack::GetClusterY_ID(int ip){ if(ip<0 || ip>=nplanes)return -1; return ((int)fabs(ygood[ip]))%10000000-1; }; /** * Method to retrieve the dE/dx measured on a tracker view. * @param ip plane (0-5) * @param iv view (0=x 1=y) */ Float_t ExtTrack::GetDEDX(int ip, int iv){ if(iv==0 && ip>=0 && ip=0 && ip0)return dedx/np; return -1; }; /** * Method to evaluate the dE/dx averaged over all Y views. */ Float_t ExtTrack::GetDEDXY(bool cutSat){ Float_t dedx=0; Int_t np=0; for(Int_t ip=0; ip0)return dedx/np; return -1; }; /** * Returns 1 if the cluster on a tracker view includes bad strips * (at least one bad strip among the four strip used by p.f.a.) * @param ip plane (0-5) * @param iv view (0=x 1=y) */ Bool_t ExtTrack::IsBad(int ip,int iv){ if(ip>=6&&ip<8)return false; if(iv==0 && ip>=0 && ip<6)return (xgood[ip]<0) ; else if(iv==1 && ip>=0 && ip<6)return (ygood[ip]<0) ; else { cout << "ExtTrack::IsBad(int ip, int iv) -- wrong input parameters "<=nplanes){ cout << " ExtTrack::GetClusterX_Multiplicity("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::GetClusterY_Multiplicity("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::GetClusterX_MaxStrip("< exceed vector dimension = "<=nplanes){ cout << " ExtTrack::GetClusterY_MaxStrip("< exceed vector dimension = "<0)rig=1./al[4]; if(rig<0) rig=-rig; return rig; }; // Float_t ExtTrack::GetDeflection(){ Float_t def=0; if(chi2>0)def=al[4]; return def; }; // // all that follows: EM porting from TrkLevel2 // Bool_t ExtTrack::IsInsideAcceptance(float toll){ int ngf = TrkParams::nGF; float* zgf = TrkParams::zGF; //this is a patch, to assign correctly xGF and yGF cordinates. Trajectory tj = Trajectory(ngf,zgf); tj.DoTrack(al,zini); //NB the folowing assignment is NOT permanent!!! for(int i=0; i<14; i++){ xGF[i] = tj.x[i]; yGF[i] = tj.y[i]; } for(int i=0; i= TrkParams::xGF_max[i] - toll || // yGF[i] <= TrkParams::yGF_min[i] + toll || // yGF[i] >= TrkParams::yGF_max[i] - toll || tj.x[i] <= TrkParams::xGF_min[i] + toll || tj.x[i] >= TrkParams::xGF_max[i] - toll || tj.y[i] <= TrkParams::yGF_min[i] + toll || tj.y[i] >= TrkParams::yGF_max[i] - toll || false){ return false; } } return true; } /** * Returns the reduced chi-square of track x-projection */ Float_t ExtTrack::GetChi2X(){ float chiq=0; for(int ip=0; ip3)chiq=chiq/(GetNX()-3); else chiq=0; // if(chiq==0)cout << " Float_t ExtTrack::GetChi2X() -- WARNING -- value not defined "<2)chiq=chiq/(GetNY()-2); else chiq=0; // if(chiq==0)cout << " Float_t ExtTrack::GetChi2Y() -- WARNING -- value not defined "<=6 && ip<8)return false; if(iv==0 && ip>=0 && ip<6)return (dedx_x[ip]<0) ; else if(iv==1 && ip>=0 && ip<6)return (dedx_y[ip]<0) ; else { cout << "ExtTrack::IsSaturated(int ip, int iv) -- wrong input parameters "<