| 135 |
// cout << " ExtTrack::Copy( ExtTrack& t ) "<<endl; |
// cout << " ExtTrack::Copy( ExtTrack& t ) "<<endl; |
| 136 |
|
|
| 137 |
t.Reset();//reset variables |
t.Reset();//reset variables |
| 138 |
t.Clear();//deallocate vectors |
t.Clear("C");//deallocate vectors |
| 139 |
t.SetDimension(nplanes);//allocate vectors |
t.SetDimension(nplanes);//allocate vectors |
| 140 |
|
|
| 141 |
t.zini = zini; |
t.zini = zini; |
| 145 |
t.al[it1] = al[it1]; |
t.al[it1] = al[it1]; |
| 146 |
for(int it2=0;it2<5;it2++)t.coval[it1][it2] = coval[it1][it2]; |
for(int it2=0;it2<5;it2++)t.coval[it1][it2] = coval[it1][it2]; |
| 147 |
}; |
}; |
| 148 |
// cout << "ExtTrack::Copy()........nplanes "<<nplanes<<endl; |
// cout << "ExtTrack::Copy()........nplanes "<<nplanes<<endl; |
| 149 |
for(int ip=0;ip<nplanes;ip++){ |
for(int ip=0;ip<nplanes;ip++){ |
| 150 |
t.xgood[ip] = xgood[ip]; |
t.xgood[ip] = xgood[ip]; |
| 151 |
t.ygood[ip] = ygood[ip]; |
t.ygood[ip] = ygood[ip]; |
| 185 |
|
|
| 186 |
// cout << "Set("<< &t <<", "<<index<<")"<<endl; |
// cout << "Set("<< &t <<", "<<index<<")"<<endl; |
| 187 |
if(index < 0 ){ //NON FUNZIONA |
if(index < 0 ){ //NON FUNZIONA |
| 188 |
cout << "Clear() "<<endl; |
cout << "Clear(\"C\") "<<endl; |
| 189 |
Reset();//reset variables |
Reset();//reset variables |
| 190 |
Clear();//deallocate vectors |
Clear("C");//deallocate vectors |
| 191 |
cout << "SetDimension("<<t.GetNhit()<<")"<<endl; |
cout << "SetDimension("<<t.GetNhit()<<")"<<endl; |
| 192 |
SetDimension(t.GetNhit()); //allocate vectors |
SetDimension(t.GetNhit()); //allocate vectors |
| 193 |
// }else{ |
// }else{ |
| 230 |
ymb[ipp] = dummy; |
ymb[ipp] = dummy; |
| 231 |
zmb[ipp] = zm[ipp]; |
zmb[ipp] = zm[ipp]; |
| 232 |
|
|
| 233 |
if( t.XGood(ip)*t.YGood(ip) ){ //double hit |
if( t.XGood(ip) && t.YGood(ip) ){ //double hit |
| 234 |
xma[ipp] = t.xm[ip]; |
xma[ipp] = t.xm[ip]; |
| 235 |
yma[ipp] = t.ym[ip]; |
yma[ipp] = t.ym[ip]; |
| 236 |
zma[ipp] = t.zm[ip]; |
zma[ipp] = t.zm[ip]; |
| 496 |
// |
// |
| 497 |
// |
// |
| 498 |
//-------------------------------------- |
//-------------------------------------- |
| 499 |
|
/** |
| 500 |
|
* Clear the track. If option C is specied, deallocate the hit vectors. |
| 501 |
|
*/ |
| 502 |
void ExtTrack::Clear(Option_t* option){ |
void ExtTrack::Clear(Option_t* option){ |
| 503 |
|
|
| 504 |
|
Reset(); |
| 505 |
|
|
| 506 |
|
|
| 507 |
// cout << " ExtTrack::Clear("<<option<<") "<<this<<endl; |
// cout << " ExtTrack::Clear("<<option<<") "<<this<<endl; |
| 508 |
|
|
| 509 |
|
|
| 510 |
// cout << " xgood "<<xgood<<endl; |
// cout << " xgood "<<xgood<<endl; |
| 511 |
|
|
| 512 |
// if(nplanes>0){ |
// if(nplanes>0){ |
|
if(xgood) delete [] xgood; |
|
|
if(ygood) delete [] ygood; |
|
|
if(multmaxx) delete [] multmaxx; |
|
|
if(multmaxy) delete [] multmaxy; |
|
|
if(xm) delete [] xm; |
|
|
if(ym) delete [] ym; |
|
|
if(zm) delete [] zm; |
|
|
if(xma) delete [] xma; |
|
|
if(yma) delete [] yma; |
|
|
if(zma) delete [] zma; |
|
|
if(xmb) delete [] xmb; |
|
|
if(ymb) delete [] ymb; |
|
|
if(zmb) delete [] zmb; |
|
|
if(resx) delete [] resx; |
|
|
if(resy) delete [] resy; |
|
|
if(xv) delete [] xv; |
|
|
if(yv) delete [] yv; |
|
|
if(zv) delete [] zv; |
|
|
if(axv) delete [] axv; |
|
|
if(ayv) delete [] ayv; |
|
|
if(dedx_x)delete [] dedx_x; |
|
|
if(dedx_y)delete [] dedx_y; |
|
|
//} |
|
|
|
|
|
xgood = NULL; |
|
|
ygood = NULL; |
|
|
multmaxx = NULL; |
|
|
multmaxy = NULL; |
|
|
xm = NULL; |
|
|
ym = NULL; |
|
|
zm = NULL; |
|
|
xma = NULL; |
|
|
yma = NULL; |
|
|
zma = NULL; |
|
|
xmb = NULL; |
|
|
ymb = NULL; |
|
|
zmb = NULL; |
|
|
resx = NULL; |
|
|
resy = NULL; |
|
|
xv = NULL; |
|
|
yv = NULL; |
|
|
zv = NULL; |
|
|
axv = NULL; |
|
|
ayv = NULL; |
|
|
dedx_x = NULL; |
|
|
dedx_y = NULL; |
|
| 513 |
|
|
| 514 |
nplanes = 0; |
if (option && option[0] == 'C') { |
| 515 |
|
|
| 516 |
|
|
| 517 |
|
if(xgood) delete [] xgood; |
| 518 |
|
if(ygood) delete [] ygood; |
| 519 |
|
if(multmaxx) delete [] multmaxx; |
| 520 |
|
if(multmaxy) delete [] multmaxy; |
| 521 |
|
if(xm) delete [] xm; |
| 522 |
|
if(ym) delete [] ym; |
| 523 |
|
if(zm) delete [] zm; |
| 524 |
|
if(xma) delete [] xma; |
| 525 |
|
if(yma) delete [] yma; |
| 526 |
|
if(zma) delete [] zma; |
| 527 |
|
if(xmb) delete [] xmb; |
| 528 |
|
if(ymb) delete [] ymb; |
| 529 |
|
if(zmb) delete [] zmb; |
| 530 |
|
if(resx) delete [] resx; |
| 531 |
|
if(resy) delete [] resy; |
| 532 |
|
if(xv) delete [] xv; |
| 533 |
|
if(yv) delete [] yv; |
| 534 |
|
if(zv) delete [] zv; |
| 535 |
|
if(axv) delete [] axv; |
| 536 |
|
if(ayv) delete [] ayv; |
| 537 |
|
if(dedx_x)delete [] dedx_x; |
| 538 |
|
if(dedx_y)delete [] dedx_y; |
| 539 |
|
//} |
| 540 |
|
|
| 541 |
|
xgood = NULL; |
| 542 |
|
ygood = NULL; |
| 543 |
|
multmaxx = NULL; |
| 544 |
|
multmaxy = NULL; |
| 545 |
|
xm = NULL; |
| 546 |
|
ym = NULL; |
| 547 |
|
zm = NULL; |
| 548 |
|
xma = NULL; |
| 549 |
|
yma = NULL; |
| 550 |
|
zma = NULL; |
| 551 |
|
xmb = NULL; |
| 552 |
|
ymb = NULL; |
| 553 |
|
zmb = NULL; |
| 554 |
|
resx = NULL; |
| 555 |
|
resy = NULL; |
| 556 |
|
xv = NULL; |
| 557 |
|
yv = NULL; |
| 558 |
|
zv = NULL; |
| 559 |
|
axv = NULL; |
| 560 |
|
ayv = NULL; |
| 561 |
|
dedx_x = NULL; |
| 562 |
|
dedx_y = NULL; |
| 563 |
|
|
| 564 |
|
nplanes = 0; |
| 565 |
|
|
| 566 |
// Reset(); |
} |
| 567 |
|
|
| 568 |
}; |
}; |
| 569 |
|
|
| 570 |
void ExtTrack::Delete(){ |
void ExtTrack::Delete(){ |
| 571 |
Clear(); |
Clear("C"); |
| 572 |
// delete [] xGF; |
// delete [] xGF; |
| 573 |
// delete [] yGF; |
// delete [] yGF; |
| 574 |
} |
} |
| 817 |
* |
* |
| 818 |
*/ |
*/ |
| 819 |
int ExtTrack::GetClusterX_ID(int ip){ |
int ExtTrack::GetClusterX_ID(int ip){ |
| 820 |
|
if(ip<0 || ip>=nplanes)return -1; |
| 821 |
return ((int)fabs(xgood[ip]))%10000000-1; |
return ((int)fabs(xgood[ip]))%10000000-1; |
| 822 |
}; |
}; |
| 823 |
/** |
/** |
| 825 |
* |
* |
| 826 |
*/ |
*/ |
| 827 |
int ExtTrack::GetClusterY_ID(int ip){ |
int ExtTrack::GetClusterY_ID(int ip){ |
| 828 |
|
if(ip<0 || ip>=nplanes)return -1; |
| 829 |
return ((int)fabs(ygood[ip]))%10000000-1; |
return ((int)fabs(ygood[ip]))%10000000-1; |
| 830 |
}; |
}; |
| 831 |
|
|
| 835 |
* @param iv view (0=x 1=y) |
* @param iv view (0=x 1=y) |
| 836 |
*/ |
*/ |
| 837 |
Float_t ExtTrack::GetDEDX(int ip, int iv){ |
Float_t ExtTrack::GetDEDX(int ip, int iv){ |
| 838 |
if(iv==0 && ip>=0 && ip<6)return fabs(dedx_x[ip]); |
if(iv==0 && ip>=0 && ip<nplanes)return fabs(dedx_x[ip]); |
| 839 |
else if(iv==1 && ip>=0 && ip<6)return fabs(dedx_y[ip]); |
else if(iv==1 && ip>=0 && ip<nplanes)return fabs(dedx_y[ip]); |
| 840 |
else { |
else { |
| 841 |
cout << "TrkTrack::GetDEDX(int ip, int iv) -- wrong input parameters "<<ip<<iv<<endl; |
cout << "TrkTrack::GetDEDX(int ip, int iv) -- wrong input parameters "<<ip<<iv<<endl; |
| 842 |
return 0.; |
return 0.; |
| 857 |
*/ |
*/ |
| 858 |
Float_t ExtTrack::GetDEDX(){ |
Float_t ExtTrack::GetDEDX(){ |
| 859 |
Float_t dedx=0; |
Float_t dedx=0; |
| 860 |
for(Int_t ip=0; ip<6; ip++)dedx+=GetDEDX(ip,0)*XGood(ip)+GetDEDX(ip,1)*YGood(ip); |
for(Int_t ip=0; ip<nplanes; ip++)dedx+=GetDEDX(ip,0)*XGood(ip)+GetDEDX(ip,1)*YGood(ip); |
| 861 |
dedx = dedx/(GetNX()+GetNY()); |
dedx = dedx/(GetNX()+GetNY()); |
| 862 |
return dedx; |
return dedx; |
| 863 |
}; |
}; |
| 997 |
return chiq; |
return chiq; |
| 998 |
} |
} |
| 999 |
|
|
| 1000 |
|
/** |
| 1001 |
|
* Returns the track "lever-arm" on the x view, defined as the distance (in planes) between |
| 1002 |
|
* the upper and lower x measurements (the maximum value of lever-arm is 6). |
| 1003 |
|
*/ |
| 1004 |
|
Int_t ExtTrack::GetLeverArmX(){ |
| 1005 |
|
int first_plane = -1; |
| 1006 |
|
int last_plane = -1; |
| 1007 |
|
for(Int_t ip=0; ip<nplanes; ip++){ |
| 1008 |
|
if( XGood(ip) && first_plane == -1 )first_plane = ip; |
| 1009 |
|
if( XGood(ip) && first_plane != -1 )last_plane = ip; |
| 1010 |
|
} |
| 1011 |
|
if( first_plane == -1 || last_plane == -1){ |
| 1012 |
|
cout<< "Int_t ExtTrack::GetLeverArmX() -- XGood(ip) always false ??? "<<endl; |
| 1013 |
|
return 0; |
| 1014 |
|
} |
| 1015 |
|
return (last_plane-first_plane+1); |
| 1016 |
|
} |
| 1017 |
|
/** |
| 1018 |
|
* Returns the track "lever-arm" on the y view, defined as the distance (in planes) between |
| 1019 |
|
* the upper and lower y measurements (the maximum value of lever-arm is 6). |
| 1020 |
|
*/ |
| 1021 |
|
Int_t ExtTrack::GetLeverArmY(){ |
| 1022 |
|
int first_plane = -1; |
| 1023 |
|
int last_plane = -1; |
| 1024 |
|
for(Int_t ip=0; ip<nplanes; ip++){ |
| 1025 |
|
if( YGood(ip) && first_plane == -1 )first_plane = ip; |
| 1026 |
|
if( YGood(ip) && first_plane != -1 )last_plane = ip; |
| 1027 |
|
} |
| 1028 |
|
if( first_plane == -1 || last_plane == -1){ |
| 1029 |
|
cout<< "Int_t ExtTrack::GetLeverArmY() -- YGood(ip) always false ??? "<<endl; |
| 1030 |
|
return 0; |
| 1031 |
|
} |
| 1032 |
|
return (last_plane-first_plane+1); |
| 1033 |
|
} |
| 1034 |
|
/** |
| 1035 |
|
* Returns the track "lever-arm" on the x+y view, defined as the distance (in planes) between |
| 1036 |
|
* the upper and lower x,y (couple) measurements (the maximum value of lever-arm is 6). |
| 1037 |
|
*/ |
| 1038 |
|
Int_t ExtTrack::GetLeverArmXY(){ |
| 1039 |
|
int first_plane = -1; |
| 1040 |
|
int last_plane = -1; |
| 1041 |
|
for(Int_t ip=0; ip<nplanes; ip++){ |
| 1042 |
|
if( XGood(ip) && YGood(ip) && first_plane == -1 )first_plane = ip; |
| 1043 |
|
if( XGood(ip) && YGood(ip) && first_plane != -1 )last_plane = ip; |
| 1044 |
|
} |
| 1045 |
|
if( first_plane == -1 || last_plane == -1){ |
| 1046 |
|
// cout<< "Int_t ExtTrack::GetLeverArmXY() -- XGood(ip)*YGood(ip) always false ??? "<<endl; |
| 1047 |
|
return 0; |
| 1048 |
|
} |
| 1049 |
|
return (last_plane-first_plane+1); |
| 1050 |
|
} |
| 1051 |
|
|
| 1052 |
|
|
| 1053 |
|
|
| 1054 |
ClassImp(ExtTrack); |
ClassImp(ExtTrack); |