12 |
extern "C" { |
extern "C" { |
13 |
void dotrack_(int*, double*, double*, double*, double*, int*); |
void dotrack_(int*, double*, double*, double*, double*, int*); |
14 |
void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*); |
void dotrack2_(int*, double*, double*, double*, double*,double*, double*, double*,int*); |
15 |
|
void dotrack3_(int*, double*, double*, double*, double*,double*, double*, double*,double*,int*); |
16 |
void mini2_(int*,int*,int*); |
void mini2_(int*,int*,int*); |
17 |
void guess_(); |
void guess_(); |
18 |
void gufld_(float*, float*); |
void gufld_(float*, float*); |
178 |
// |
// |
179 |
//-------------------------------------- |
//-------------------------------------- |
180 |
/** |
/** |
|
* Evaluates the trajectory in the apparatus associated to the track. |
|
|
* It integrates the equations of motion in the magnetic field. The magnetic field should be previously loaded ( by calling TrkLevel2::LoadField() ), otherwise an error message is returned. |
|
|
* @param t pointer to an object of the class Trajectory, |
|
|
* which z coordinates should be previously initialized by calling the proper constructor ( Trajectory::Trajectory(int n, float* zin) ). |
|
|
* @return error flag. |
|
181 |
* |
* |
182 |
* >>> OBSOLETE !!! use TrkTrack::DoTrack2(Trajectory* t) instead |
* >>> OBSOLETE !!! use TrkTrack::DoTrack(Trajectory* t) instead |
183 |
* |
* |
184 |
*/ |
*/ |
185 |
int TrkTrack::DoTrack(Trajectory* t){ |
int TrkTrack::DoTrack2(Trajectory* t){ |
|
|
|
|
cout << " int TrkTrack::DoTrack(Trajectory* t) --->> OBSOLETE !!! "<<endl; |
|
|
cout << " use int TrkTrack::DoTrack2(Trajectory* t)"<<endl; |
|
|
|
|
|
double *dxout = new double[t->npoint]; |
|
|
double *dyout = new double[t->npoint]; |
|
|
double *dzin = new double[t->npoint]; |
|
|
double dal[5]; |
|
|
|
|
|
int ifail = 0; |
|
|
|
|
|
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
|
|
for (int i=0; i<t->npoint; i++) dzin[i] = (double)t->z[i]; |
|
186 |
|
|
187 |
TrkParams::Load(1); |
cout << endl; |
188 |
if( !TrkParams::IsLoaded(1) ){ |
cout << " int TrkTrack::DoTrack2(Trajectory* t) --->> NB NB !! this method is going to be eliminated !!! "<<endl; |
189 |
cout << "int TrkTrack::DoTrack(Trajectory* t) --- ERROR --- m.field not loaded"<<endl; |
cout << " >>>> replace it with TrkTrack::DoTrack(Trajectory* t) <<<<"<<endl; |
190 |
return 0; |
cout << " (Sorry Wolfgang!! Don't be totally confused!! By Elena)"<<endl; |
191 |
} |
cout << endl; |
|
dotrack_(&(t->npoint),dzin,dxout,dyout,dal,&ifail); |
|
|
|
|
|
for (int i=0; i<t->npoint; i++){ |
|
|
t->x[i] = (float)*(dxout+i); |
|
|
t->y[i] = (float)*(dyout+i); |
|
|
} |
|
192 |
|
|
193 |
delete [] dxout; |
return DoTrack(t); |
|
delete [] dyout; |
|
|
delete [] dzin; |
|
194 |
|
|
|
return ifail; |
|
195 |
}; |
}; |
196 |
//-------------------------------------- |
//-------------------------------------- |
197 |
// |
// |
198 |
// |
// |
199 |
//-------------------------------------- |
//-------------------------------------- |
200 |
/** |
/** |
201 |
* Evaluates the trajectory in the apparatus associated to the track. |
* Evaluates the trajectory in the apparatus associated to the track state-vector. |
202 |
* It integrates the equations of motion in the magnetic field. The magnetic field should be previously loaded ( by calling TrkLevel2::LoadField() ), otherwise an error message is returned. |
* It integrates the equations of motion in the magnetic field. |
203 |
* @param t pointer to an object of the class Trajectory, |
* @param t pointer to an object of the class Trajectory, |
204 |
* which z coordinates should be previously initialized by calling the proper constructor ( Trajectory::Trajectory(int n, float* zin) ). |
* which z coordinates should be previously assigned. |
205 |
* @return error flag. |
* @return error flag. |
206 |
*/ |
*/ |
207 |
int TrkTrack::DoTrack2(Trajectory* t){ |
int TrkTrack::DoTrack(Trajectory* t){ |
208 |
|
|
209 |
double *dxout = new double[t->npoint]; |
double *dxout = new double[t->npoint]; |
210 |
double *dyout = new double[t->npoint]; |
double *dyout = new double[t->npoint]; |
221 |
|
|
222 |
TrkParams::Load(1); |
TrkParams::Load(1); |
223 |
if( !TrkParams::IsLoaded(1) ){ |
if( !TrkParams::IsLoaded(1) ){ |
224 |
cout << "int TrkTrack::DoTrack2(Trajectory* t) --- ERROR --- m.field not loaded"<<endl; |
cout << "int TrkTrack::DoTrack(Trajectory* t) --- ERROR --- m.field not loaded"<<endl; |
225 |
return 0; |
return 0; |
226 |
} |
} |
227 |
dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
dotrack2_(&(t->npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
687 |
// --- temporaneo ---------------------------- |
// --- temporaneo ---------------------------- |
688 |
|
|
689 |
if( XGood(i) || YGood(i) ){ |
if( XGood(i) || YGood(i) ){ |
690 |
double segment = 2.;//cm |
//NB!! the length of the sensor is not exactely taken into account |
691 |
|
double segment = 7.;// 2.;//cm //Elena 10th |
692 |
// NB: i parametri di allineamento hanno una notazione particolare!!! |
// NB: i parametri di allineamento hanno una notazione particolare!!! |
693 |
// sensor = 0 (hybrid side), 1 |
// sensor = 0 (hybrid side), 1 |
694 |
// ladder = 0-2 (increasing x) |
// ladder = 0-2 (increasing x) |
698 |
int il = (int)GetLadder(i); |
int il = (int)GetLadder(i); |
699 |
|
|
700 |
double omega = 0.; |
double omega = 0.; |
701 |
double beta = 0.; |
// double beta = 0.;// EM GCC 4.7 |
702 |
double gamma = 0.; |
// double gamma = 0.; |
703 |
if( |
if( |
704 |
(is < 0 || is > 1 || ip < 0 || ip > 5 || il < 0 || il > 2) && |
(is < 0 || is > 1 || ip < 0 || ip > 5 || il < 0 || il > 2) && |
705 |
true){ |
true){ |
709 |
cout << " is ip il = "<<is<<" "<<ip<<" "<<il<<endl; |
cout << " is ip il = "<<is<<" "<<ip<<" "<<il<<endl; |
710 |
}else{ |
}else{ |
711 |
omega = alignparameters_.omega[is][il][ip]; |
omega = alignparameters_.omega[is][il][ip]; |
712 |
beta = alignparameters_.beta[is][il][ip]; |
// beta = alignparameters_.beta[is][il][ip];// EM GCC 4.7 unused |
713 |
gamma = alignparameters_.gamma[is][il][ip]; |
// gamma = alignparameters_.gamma[is][il][ip];// EM GCC 4.7 unused |
714 |
} |
} |
715 |
|
|
716 |
if( XGood(i) && !YGood(i) ){ |
if( XGood(i) && !YGood(i) ){ |
761 |
zm[i] = track->zm[i]; |
zm[i] = track->zm[i]; |
762 |
axv[i] = track->axv[i]; |
axv[i] = track->axv[i]; |
763 |
ayv[i] = track->ayv[i]; |
ayv[i] = track->ayv[i]; |
764 |
|
resx[i] = track->resx[i]; //Elena 10th |
765 |
|
resy[i] = track->resy[i]; |
766 |
} |
} |
767 |
|
|
768 |
} |
} |
795 |
|
|
796 |
// cout << "void TrkTrack::GetClusterositions() "<<endl; |
// cout << "void TrkTrack::GetClusterositions() "<<endl; |
797 |
|
|
798 |
bool OK=true; |
TrkParams::Load(1); |
799 |
TrkParams::Load(1); if( !TrkParams::IsLoaded(1) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- m.field not loaded "<<endl; |
if( !TrkParams::IsLoaded(1) ){ |
800 |
TrkParams::Load(4); if( !TrkParams::IsLoaded(4) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- p.f.a. par. not loaded "<<endl; |
cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- m.field not loaded "<<endl; |
801 |
TrkParams::Load(5); if( !TrkParams::IsLoaded(5) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- alignment par. not loaded "<<endl; |
return false; |
802 |
if(!OK)return false; |
} |
803 |
|
TrkParams::Load(4); |
804 |
|
if( !TrkParams::IsLoaded(4) ){ |
805 |
|
cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- p.f.a. par. not loaded "<<endl; |
806 |
|
return false; |
807 |
|
} |
808 |
|
TrkParams::Load(5); |
809 |
|
if( !TrkParams::IsLoaded(5) ){ |
810 |
|
cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- alignment par. not loaded "<<endl; |
811 |
|
return false; |
812 |
|
} |
813 |
|
|
814 |
for(int ip=0; ip<6; ip++){ |
for(int ip=0; ip<6; ip++){ |
815 |
// cout << ip<<" ** "<<xm[ip]<<" / "<<ym[ip]<<endl;; |
// cout << ip<<" ** "<<xm[ip]<<" / "<<ym[ip]<<endl;; |
816 |
int icx = GetClusterX_ID(ip)+1; |
int icx = GetClusterX_ID(ip)+1;//0=no-cluster,1-N |
817 |
int icy = GetClusterY_ID(ip)+1; |
int icy = GetClusterY_ID(ip)+1;//0=no-cluster,1-N |
818 |
int sensor = GetSensor(ip)+1;//<< convenzione "Paolo" |
int sensor = GetSensor(ip)+1;//<< convenzione "Paolo" |
819 |
if(ip==5 && sensor!=0)sensor=3-sensor;//<< convenzione "Elena" |
if(ip==5 && sensor!=0)sensor=3-sensor;//<< convenzione "Elena" |
820 |
int ladder = GetLadder(ip)+1; |
int ladder = GetLadder(ip)+1; |
828 |
float bfy = 10*TrkParams::GetBY(v);//Tesla |
float bfy = 10*TrkParams::GetBY(v);//Tesla |
829 |
int ipp=ip+1; |
int ipp=ip+1; |
830 |
xyzpam_(&ipp,&icx,&icy,&ladder,&sensor,&ax,&ay,&bfx,&bfy); |
xyzpam_(&ipp,&icx,&icy,&ladder,&sensor,&ax,&ay,&bfx,&bfy); |
831 |
if(icx<0 || icy<0)return false; |
// if(icx<0 || icy<0)return false; |
832 |
} |
} |
833 |
return true; |
return true; |
834 |
} |
} |
862 |
*/ |
*/ |
863 |
void TrkTrack::Fit(double pfixed, int& fail, int iprint, int froml1){ |
void TrkTrack::Fit(double pfixed, int& fail, int iprint, int froml1){ |
864 |
|
|
865 |
bool OK=true; |
TrkParams::Load(1); |
866 |
TrkParams::Load(1); if( !TrkParams::IsLoaded(1) )cout << "void TrkTrack::Fit(double,int&,int,int) ---ERROR--- m.field not loaded "<<endl; |
if( !TrkParams::IsLoaded(1) ){ |
867 |
if(!OK)return; |
cout << "void TrkTrack::Fit(double,int&,int,int) ---ERROR--- m.field not loaded "<<endl; |
868 |
|
return; |
869 |
|
} |
870 |
|
TrkParams::Load(5); |
871 |
|
if( !TrkParams::IsLoaded(5) ){ |
872 |
|
cout << "void TrkTrack::Fit(double,int&,int,int) ---ERROR--- align.param. not loaded "<<endl; |
873 |
|
return; |
874 |
|
} |
875 |
|
|
876 |
float al_ini[] = {0.,0.,0.,0.,0.}; |
float al_ini[] = {0.,0.,0.,0.,0.}; |
877 |
|
|
878 |
extern cMini2track track_; |
extern cMini2track track_; |
879 |
fail = 0; |
fail = 0; |
880 |
|
|
881 |
FillMiniStruct(track_); |
// FillMiniStruct(track_); |
882 |
|
|
883 |
if(froml1!=0){ |
if(froml1!=0){ |
884 |
if( !EvaluateClusterPositions() ){ |
if( !EvaluateClusterPositions() ){ |
917 |
if(iprint)cout << "ERROR: ifail= " << ifail << endl; |
if(iprint)cout << "ERROR: ifail= " << ifail << endl; |
918 |
fail = 1; |
fail = 1; |
919 |
} |
} |
920 |
|
if(chi2!=chi2){ |
921 |
|
if(iprint)cout << "ERROR: chi2= " << chi2 << endl; |
922 |
|
FitReset(); |
923 |
|
fail = 1; |
924 |
|
} |
925 |
// ------------------------------------------ |
// ------------------------------------------ |
926 |
|
|
927 |
SetFromMiniStruct(&track_); |
SetFromMiniStruct(&track_); |
1027 |
* by the intersection among magnet cavity, silicon-plane sensitive area and |
* by the intersection among magnet cavity, silicon-plane sensitive area and |
1028 |
* ToF sensitive area (nominal values from the official document used to |
* ToF sensitive area (nominal values from the official document used to |
1029 |
* calculate the geometrical factor) |
* calculate the geometrical factor) |
1030 |
|
* @param toll Tolerance around the nominal volume (toll>0 define an inner fiducial volume) |
1031 |
*/ |
*/ |
1032 |
Bool_t TrkTrack::IsInsideAcceptance(){ |
// Bool_t TrkTrack::IsInsideAcceptance(){ |
1033 |
|
|
1034 |
|
// int ngf = TrkParams::nGF; |
1035 |
|
// for(int i=0; i<ngf; i++){ |
1036 |
|
// if( |
1037 |
|
// xGF[i] <= TrkParams::xGF_min[i] || |
1038 |
|
// xGF[i] >= TrkParams::xGF_max[i] || |
1039 |
|
// yGF[i] <= TrkParams::yGF_min[i] || |
1040 |
|
// yGF[i] >= TrkParams::yGF_max[i] || |
1041 |
|
// false)return false; |
1042 |
|
// } |
1043 |
|
// return true; |
1044 |
|
|
1045 |
|
// } |
1046 |
|
Bool_t TrkTrack::IsInsideAcceptance(float toll){ |
1047 |
|
|
1048 |
|
|
1049 |
int ngf = TrkParams::nGF; |
int ngf = TrkParams::nGF; |
1050 |
for(int i=0; i<ngf; i++){ |
for(int i=0; i<ngf; i++){ |
1051 |
|
// |
1052 |
|
// cout << endl << TrkParams::GF_element[i]; |
1053 |
|
if( |
1054 |
|
TrkParams::GF_element[i].CompareTo("S11") && |
1055 |
|
TrkParams::GF_element[i].CompareTo("S12") && |
1056 |
|
TrkParams::GF_element[i].CompareTo("S21") && |
1057 |
|
TrkParams::GF_element[i].CompareTo("S22") && |
1058 |
|
TrkParams::GF_element[i].CompareTo("T1") && |
1059 |
|
TrkParams::GF_element[i].CompareTo("CUF") && |
1060 |
|
TrkParams::GF_element[i].CompareTo("T2") && |
1061 |
|
TrkParams::GF_element[i].CompareTo("T3") && |
1062 |
|
TrkParams::GF_element[i].CompareTo("T4") && |
1063 |
|
TrkParams::GF_element[i].CompareTo("T5") && |
1064 |
|
TrkParams::GF_element[i].CompareTo("CLF") && |
1065 |
|
TrkParams::GF_element[i].CompareTo("T6") && |
1066 |
|
TrkParams::GF_element[i].CompareTo("S31") && |
1067 |
|
TrkParams::GF_element[i].CompareTo("S32") && |
1068 |
|
true)continue; |
1069 |
|
// apply condition only within the cavity |
1070 |
|
// cout << " -- "<<xGF[i]<<" "<<yGF[i]; |
1071 |
if( |
if( |
1072 |
xGF[i] <= TrkParams::xGF_min[i] || |
xGF[i] <= TrkParams::xGF_min[i] + toll || |
1073 |
xGF[i] >= TrkParams::xGF_max[i] || |
xGF[i] >= TrkParams::xGF_max[i] - toll || |
1074 |
yGF[i] <= TrkParams::yGF_min[i] || |
yGF[i] <= TrkParams::yGF_min[i] + toll || |
1075 |
yGF[i] >= TrkParams::yGF_max[i] || |
yGF[i] >= TrkParams::yGF_max[i] - toll || |
1076 |
false)return false; |
false){ |
1077 |
|
|
1078 |
|
return false; |
1079 |
|
} |
1080 |
} |
} |
1081 |
return true; |
return true; |
1082 |
|
} |
1083 |
|
|
1084 |
|
/** |
1085 |
|
* Returns true if the track is inside one of the surfaces which define the |
1086 |
|
* geometrical acceptance. |
1087 |
|
* @param surf tag of the surface (possible values are: S11 S12 S21 S22 T1 |
1088 |
|
* CUF T2 T3 T4 T5 CLF T6 S31 S32). |
1089 |
|
* @param toll Tolerance around the nominal surface (toll>0 define an inner |
1090 |
|
* fiducial surface) |
1091 |
|
*/ |
1092 |
|
Bool_t TrkTrack::IsInsideGFSurface(const char* surf, float toll){ |
1093 |
|
|
1094 |
|
|
1095 |
|
int ngf = TrkParams::nGF; |
1096 |
|
bool SURFOK = false; |
1097 |
|
for(int i=0; i<ngf; i++){ |
1098 |
|
if( !TrkParams::GF_element[i].CompareTo(surf) ){ |
1099 |
|
SURFOK=true; |
1100 |
|
if( |
1101 |
|
xGF[i] > TrkParams::xGF_min[i] + toll && |
1102 |
|
xGF[i] < TrkParams::xGF_max[i] - toll && |
1103 |
|
yGF[i] > TrkParams::yGF_min[i] + toll && |
1104 |
|
yGF[i] < TrkParams::yGF_max[i] - toll && |
1105 |
|
true)return true; |
1106 |
|
} |
1107 |
|
} |
1108 |
|
if( !SURFOK )cout << " Bool_t TrkTrack::IsInsideGFSurface(char* surf, float toll) --> suface "<<surf<<" not defined "<<endl; |
1109 |
|
return false; |
1110 |
|
|
1111 |
} |
} |
1112 |
|
|
1113 |
/** |
/** |
1114 |
* Method to retrieve ID (0,1,...) of x-cluster (if any) associated to this track. |
* Method to retrieve ID (0,1,...) of x-cluster (if any) associated to this track. |
1115 |
* If no cluster is associated, ID=-1. |
* If no cluster is associated, ID=-1. |
1160 |
void TrkTrack::SetXGood(int ip, int clid, int il, int is, bool bad){ |
void TrkTrack::SetXGood(int ip, int clid, int il, int is, bool bad){ |
1161 |
// int il=0; //ladder (temporary) |
// int il=0; //ladder (temporary) |
1162 |
// bool bad=false; //ladder (temporary) |
// bool bad=false; //ladder (temporary) |
1163 |
if(ip<0||ip>5||clid<0||il<-1||il>2||is<-1||is>1) |
if(ip<0||ip>5||clid<1||il<-1||il>2||is<-1||is>1) |
1164 |
cout << " void TrkTrack::SetXGood(int,int,int,int,bool) --> MA SEI DI COCCIO?!?!"<<endl; |
cout << " void TrkTrack::SetXGood(int,int,int,int,bool) --> MA SEI DI COCCIO?!?!"<<endl; |
1165 |
xgood[ip]=(il+1)*100000000+(is+1)*10000000+clid; |
xgood[ip]=(il+1)*100000000+(is+1)*10000000+clid; |
1166 |
if(bad)xgood[ip]=-xgood[ip]; |
if(bad)xgood[ip]=-xgood[ip]; |
1177 |
void TrkTrack::SetYGood(int ip, int clid, int il, int is, bool bad){ |
void TrkTrack::SetYGood(int ip, int clid, int il, int is, bool bad){ |
1178 |
// int il=0; //ladder (temporary) |
// int il=0; //ladder (temporary) |
1179 |
// bool bad=false; //ladder (temporary) |
// bool bad=false; //ladder (temporary) |
1180 |
if(ip<0||ip>5||clid<0||il<-1||il>2||is<-1||is>1) |
if(ip<0||ip>5||clid<1||il<-1||il>2||is<-1||is>1) |
1181 |
cout << " void TrkTrack::SetYGood(int,int,int,int,bool) --> MA SEI DI COCCIO?!?!"<<endl; |
cout << " void TrkTrack::SetYGood(int,int,int,int,bool) --> MA SEI DI COCCIO?!?!"<<endl; |
1182 |
ygood[ip]=(il+1)*100000000+(is+1)*10000000+clid; |
ygood[ip]=(il+1)*100000000+(is+1)*10000000+clid; |
1183 |
if(bad)ygood[ip]=-ygood[ip]; |
if(bad)ygood[ip]=-ygood[ip]; |
1757 |
int ngf = TrkParams::nGF; |
int ngf = TrkParams::nGF; |
1758 |
float *zgf = TrkParams::zGF; |
float *zgf = TrkParams::zGF; |
1759 |
Trajectory tgf = Trajectory(ngf,zgf); |
Trajectory tgf = Trajectory(ngf,zgf); |
1760 |
tgf.DoTrack2(t_track->al);//<<<< integrate the trajectory |
tgf.DoTrack(t_track->al);//<<<< integrate the trajectory |
1761 |
for(int ip=0; ip<ngf; ip++){ |
for(int ip=0; ip<ngf; ip++){ |
1762 |
t_track->xGF[ip] = tgf.x[ip]; |
t_track->xGF[ip] = tgf.x[ip]; |
1763 |
t_track->yGF[ip] = tgf.y[ip]; |
t_track->yGF[ip] = tgf.y[ip]; |
1915 |
|
|
1916 |
if(!Track)return 0; |
if(!Track)return 0; |
1917 |
|
|
1918 |
TRefArray *sorted = new TRefArray(); |
// TRefArray *sorted = new TRefArray(); |
1919 |
|
TRefArray *sorted = NULL; |
1920 |
|
|
1921 |
TClonesArray &t = *Track; |
TClonesArray &t = *Track; |
1922 |
// TClonesArray &ts = *PhysicalTrack; |
// TClonesArray &ts = *PhysicalTrack; |
1954 |
|
|
1955 |
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
// cout << "i** "<< ((TrkTrack *)t[indi])->image << " " << nfiti <<" "<<chi2i<<endl; |
1956 |
}; |
}; |
1957 |
|
if(!sorted)sorted = new TRefArray( TProcessID::GetProcessWithUID(t[indi])); |
1958 |
sorted->Add( (TrkTrack*)t[indi] ); |
sorted->Add( (TrkTrack*)t[indi] ); |
1959 |
|
|
1960 |
m[indi] = 0; |
m[indi] = 0; |
2315 |
|
|
2316 |
/** |
/** |
2317 |
* Evaluates the trajectory in the apparatus associated to the track. |
* Evaluates the trajectory in the apparatus associated to the track. |
2318 |
* It integrates the equations of motion in the magnetic field. The magnetic field should be previously loaded ( by calling TrkLevel2::LoadField() ), otherwise an error message is returned. |
* It integrates the equations of motion in the magnetic field. |
2319 |
* @param t pointer to an object of the class Trajectory, |
* @param al Track state-vector (X0,Y0,sin(theta),phi,deflection). |
2320 |
* which z coordinates should be previously initialized by calling the proper constructor ( Trajectory::Trajectory(int n, float* zin) ). |
* @param zini z-coordinate of the reference plane (Z0). |
2321 |
* @return error flag. |
* @return error flag. |
2322 |
|
* |
2323 |
|
* This method is needed when you want to integrate the particle trajectory |
2324 |
|
* starting from a track state-vector relative to an arbitrary reference plane. |
2325 |
|
* The default reference plane, used by the tracker routines, is at zini=23.5. |
2326 |
|
* If you give as input the track state-vector from a TrkTrack object, |
2327 |
|
* you can use Trajectory::DoTrack(float* al) instead. |
2328 |
*/ |
*/ |
2329 |
int Trajectory::DoTrack2(float* al){ |
int Trajectory::DoTrack(float* al, float zini){ |
2330 |
|
|
2331 |
// double *dxout = new double[npoint]; |
// double *dxout = new double[npoint]; |
2332 |
// double *dyout = new double[npoint]; |
// double *dyout = new double[npoint]; |
2335 |
// double *dtlout = new double[npoint]; |
// double *dtlout = new double[npoint]; |
2336 |
// double *dzin = new double[npoint]; |
// double *dzin = new double[npoint]; |
2337 |
|
|
2338 |
double *dxout; |
double *dxout; |
2339 |
double *dyout; |
double *dyout; |
2340 |
double *dthxout; |
double *dthxout; |
2341 |
double *dthyout; |
double *dthyout; |
2342 |
double *dtlout; |
double *dtlout; |
2343 |
double *dzin; |
double *dzin; |
2344 |
|
|
2345 |
dxout = (double*) malloc(npoint*sizeof(double)); |
dxout = (double*) malloc(npoint*sizeof(double)); |
2346 |
dyout = (double*) malloc(npoint*sizeof(double)); |
dyout = (double*) malloc(npoint*sizeof(double)); |
2347 |
dthxout = (double*) malloc(npoint*sizeof(double)); |
dthxout = (double*) malloc(npoint*sizeof(double)); |
2348 |
dthyout = (double*) malloc(npoint*sizeof(double)); |
dthyout = (double*) malloc(npoint*sizeof(double)); |
2349 |
dtlout = (double*) malloc(npoint*sizeof(double)); |
dtlout = (double*) malloc(npoint*sizeof(double)); |
2350 |
dzin = (double*) malloc(npoint*sizeof(double)); |
dzin = (double*) malloc(npoint*sizeof(double)); |
2351 |
|
|
2352 |
|
double dal[5]; |
2353 |
|
|
2354 |
double dal[5]; |
double dzini = (double)zini; |
2355 |
|
|
2356 |
int ifail = 0; |
int ifail = 0; |
2357 |
|
|
2358 |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
for (int i=0; i<5; i++) dal[i] = (double)al[i]; |
2359 |
for (int i=0; i<npoint; i++) dzin[i] = (double)z[i]; |
for (int i=0; i<npoint; i++) dzin[i] = (double)z[i]; |
2360 |
|
|
2361 |
TrkParams::Load(1); |
TrkParams::Load(1); |
2362 |
if( !TrkParams::IsLoaded(1) ){ |
if( !TrkParams::IsLoaded(1) ){ |
2363 |
cout << "int Trajectory::DoTrack2(float* al) --- ERROR --- m.field not loaded"<<endl; |
cout << "int Trajectory::DoTrack(float* al) --- ERROR --- m.field not loaded"<<endl; |
2364 |
return 0; |
return 0; |
2365 |
} |
} |
2366 |
dotrack2_(&(npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
// dotrack2_(&(npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&ifail); |
2367 |
|
dotrack3_(&(npoint),dzin,dxout,dyout,dthxout,dthyout,dtlout,dal,&dzini,&ifail); |
2368 |
|
|
2369 |
for (int i=0; i<npoint; i++){ |
for (int i=0; i<npoint; i++){ |
2370 |
x[i] = (float)*(dxout+i); |
x[i] = (float)*(dxout+i); |
2392 |
return ifail; |
return ifail; |
2393 |
}; |
}; |
2394 |
|
|
2395 |
|
/** |
2396 |
|
* |
2397 |
|
* >>> OBSOLETE !!! use Trajectory::DoTrack(float* al, float zini) instead |
2398 |
|
* |
2399 |
|
*/ |
2400 |
|
int Trajectory::DoTrack2(float* al, float zini){ |
2401 |
|
|
2402 |
|
cout << endl; |
2403 |
|
cout << " int Trajectory::DoTrack2(float* al, float zini) --->> NB NB !! this method is going to be eliminated !!! "<<endl; |
2404 |
|
cout << " >>>> replace it with TrkTrack::DoTrack(Trajectory* t) <<<<"<<endl; |
2405 |
|
cout << " (Sorry Wolfgang!! Don't be totally confused!! By Elena)"<<endl; |
2406 |
|
cout << endl; |
2407 |
|
|
2408 |
|
return DoTrack(al,zini); |
2409 |
|
|
2410 |
|
}; |
2411 |
|
|
2412 |
|
|
2413 |
|
|
2414 |
ClassImp(TrkLevel2); |
ClassImp(TrkLevel2); |
2415 |
ClassImp(TrkSinglet); |
ClassImp(TrkSinglet); |
2416 |
ClassImp(TrkTrack); |
ClassImp(TrkTrack); |