762 |
TrkCluster *cluster = (TrkCluster*)t[is]; |
TrkCluster *cluster = (TrkCluster*)t[is]; |
763 |
return cluster; |
return cluster; |
764 |
} |
} |
|
//-------------------------------------- |
|
|
// |
|
|
// |
|
|
//-------------------------------------- |
|
|
// /** |
|
|
// * Load Position-Finding-Algorythm parameters (call the F77 routine). |
|
|
// * |
|
|
// */ |
|
|
// int TrkLevel1::LoadPfaParam(TString path){ |
|
|
|
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadPfaParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/eta_param-0/"); |
|
|
// } |
|
765 |
|
|
|
// strcpy(path_.path,path.Data()); |
|
|
// path_.pathlen = path.Length(); |
|
|
// path_.error = 0; |
|
|
// cout <<"Loading p.f.a. parameters: "<<path<<endl; |
|
|
// return readetaparam_(); |
|
|
// } |
|
766 |
|
|
767 |
// /** |
// int TrkLevel1::GetPfaNbinsAngle(){ |
768 |
// * Load magnetic field parameters (call the F77 routine). |
// TrkParams::Load(4); |
769 |
// * |
// if( !TrkParams::IsLoaded(4) ){ |
770 |
// */ |
// cout << "int TrkLevel1::GetPfaNbinsAngle() --- ERROR --- p.f.a. parameters not loaded"<<endl; |
771 |
// int TrkLevel1::LoadFieldParam(TString path){ |
// return 0; |
|
|
|
|
// // if( strcmp(path_.path,path.Data()) ){ |
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadFieldParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/field_param-0/"); |
|
|
// } |
|
|
// cout <<"Loading magnetic field "<<path<<endl; |
|
|
// strcpy(path_.path,path.Data()); |
|
|
// path_.pathlen = path.Length(); |
|
|
// path_.error = 0; |
|
|
// return readb_(); |
|
|
// // } |
|
|
// // return 0; |
|
|
// } |
|
|
// /** |
|
|
// * Load magnetic field parameters (call the F77 routine). |
|
|
// * |
|
|
// */ |
|
|
// int TrkLevel1::LoadChargeParam(TString path){ |
|
|
|
|
|
// // if( strcmp(path_.path,path.Data()) ){ |
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadChargeParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/charge_param-1/"); |
|
|
// } |
|
|
// cout <<"Loading charge-correlation parameters: "<<path<<endl; |
|
|
// strcpy(path_.path,path.Data()); |
|
|
// path_.pathlen = path.Length(); |
|
|
// path_.error = 0; |
|
|
// return readchargeparam_(); |
|
|
// // } |
|
|
// // return 0; |
|
|
// } |
|
|
// /** |
|
|
// * Load magnetic field parameters (call the F77 routine). |
|
|
// * |
|
|
// */ |
|
|
// int TrkLevel1::LoadAlignmentParam(TString path){ |
|
|
|
|
|
// // if( strcmp(path_.path,path.Data()) ){ |
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadAlignmentParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/align_param-0/"); |
|
772 |
// } |
// } |
773 |
// cout <<"Loading alignment parameters: "<<path<<endl; |
// return pfa_.nangbin; |
774 |
// strcpy(path_.path,path.Data()); |
// }; |
775 |
// path_.pathlen = path.Length(); |
|
776 |
// path_.error = 0; |
// int TrkLevel1::GetPfaNbinsETA(){ |
777 |
// return readalignparam_(); |
// TrkParams::Load(4); |
778 |
// // } |
// if( !TrkParams::IsLoaded(4) ){ |
779 |
// // return 0; |
// cout << "int TrkLevel1::GetPfaNbinsETA() --- ERROR --- p.f.a. parameters not loaded"<<endl; |
780 |
// } |
// return 0; |
|
// /** |
|
|
// * Load magnetic field parameters (call the F77 routine). |
|
|
// * |
|
|
// */ |
|
|
// int TrkLevel1::LoadMipParam(TString path){ |
|
|
|
|
|
// // if( strcmp(path_.path,path.Data()) ){ |
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadMipParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/mip_param-0/"); |
|
|
// } |
|
|
// cout <<"Loading ADC-to-MIP conversion parameters: "<<path<<endl; |
|
|
// strcpy(path_.path,path.Data()); |
|
|
// path_.pathlen = path.Length(); |
|
|
// path_.error = 0; |
|
|
// return readmipparam_(); |
|
|
// // } |
|
|
// // return 0; |
|
|
// } |
|
|
// /** |
|
|
// * Load magnetic field parameters (call the F77 routine). |
|
|
// * |
|
|
// */ |
|
|
// int TrkLevel1::LoadVKMaskParam(TString path){ |
|
|
|
|
|
// // if( strcmp(path_.path,path.Data()) ){ |
|
|
// if( path.IsNull() ){ |
|
|
// path = gSystem->Getenv("PAM_CALIB"); |
|
|
// if(path.IsNull()){ |
|
|
// cout << " TrkLevel1::LoadVKMaskParam() ==> No PAMELA environment variables defined "<<endl; |
|
|
// return 0; |
|
|
// } |
|
|
// path.Append("/trk-param/mask_param-1/"); |
|
781 |
// } |
// } |
782 |
// cout <<"Loading VK-mask parameters: "<<path<<endl; |
// return pfa_.netaval; |
783 |
// strcpy(path_.path,path.Data()); |
// }; |
|
// path_.pathlen = path.Length(); |
|
|
// path_.error = 0; |
|
|
// return readvkmask_(); |
|
|
// // } |
|
|
// // return 0; |
|
|
// } |
|
784 |
|
|
785 |
// /** |
// /** |
786 |
// * Load all (default) parameters. Environment variable must be defined. |
// * |
787 |
// * |
// * |
788 |
// */ |
// */ |
789 |
// int TrkLevel1::LoadParams(){ |
// float* TrkLevel1::GetPfaCoord(TString pfa, int nview, int nladder, int nang){ |
|
|
|
|
// int result=0; |
|
|
|
|
|
// result = result * LoadFieldParam(); |
|
|
// result = result * LoadPfaParam(); |
|
|
// result = result * LoadChargeParam(); |
|
|
// result = result * LoadAlignmentParam(); |
|
|
// result = result * LoadMipParam(); |
|
|
// result = result * LoadVKMaskParam(); |
|
|
|
|
|
// return result; |
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
int TrkLevel1::GetPfaNbinsAngle(){ |
|
|
TrkParams::Load(4); |
|
|
if( !TrkParams::IsLoaded(4) ){ |
|
|
cout << "int TrkLevel1::GetPfaNbinsAngle() --- ERROR --- p.f.a. parameters not loaded"<<endl; |
|
|
return 0; |
|
|
} |
|
|
return pfa_.nangbin; |
|
|
}; |
|
|
|
|
|
int TrkLevel1::GetPfaNbinsETA(){ |
|
|
TrkParams::Load(4); |
|
|
if( !TrkParams::IsLoaded(4) ){ |
|
|
cout << "int TrkLevel1::GetPfaNbinsETA() --- ERROR --- p.f.a. parameters not loaded"<<endl; |
|
|
return 0; |
|
|
} |
|
|
return pfa_.netaval; |
|
|
}; |
|
790 |
|
|
791 |
/** |
// TrkParams::Load(4); |
792 |
* |
// if( !TrkParams::IsLoaded(4) ){ |
793 |
* |
// cout << "float* TrkLevel1::GetPfaCoord(TString pfa, int nview, int nladder, int nang) --- ERROR --- p.f.a. parameters not loaded"<<endl; |
794 |
*/ |
// return 0; |
795 |
float* TrkLevel1::GetPfaCoord(TString pfa, int nview, int nladder, int nang){ |
// } |
|
|
|
|
TrkParams::Load(4); |
|
|
if( !TrkParams::IsLoaded(4) ){ |
|
|
cout << "float* TrkLevel1::GetPfaCoord(TString pfa, int nview, int nladder, int nang) --- ERROR --- p.f.a. parameters not loaded"<<endl; |
|
|
return 0; |
|
|
} |
|
796 |
|
|
797 |
int nbins = GetPfaNbinsETA(); |
// int nbins = GetPfaNbinsETA(); |
798 |
if(!nbins)return 0; |
// if(!nbins)return 0; |
799 |
|
|
800 |
float *fcorr = new float [nbins]; |
// float *fcorr = new float [nbins]; |
801 |
|
|
802 |
if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
// if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
803 |
for(int ib=0; ib<nbins; ib++){ |
// for(int ib=0; ib<nbins; ib++){ |
804 |
fcorr[ib] = pfa_.feta2[nang][nladder][nview][ib]; |
// fcorr[ib] = pfa_.feta2[nang][nladder][nview][ib]; |
805 |
cout << pfa_.eta2[nang][ib] << " - " << pfa_.feta2[nang][nladder][nview][ib]<<endl;; |
// cout << pfa_.eta2[nang][ib] << " - " << pfa_.feta2[nang][nladder][nview][ib]<<endl;; |
806 |
} |
// } |
807 |
}else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
// }else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
808 |
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta3[nang][nladder][nview][ib]; |
// for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta3[nang][nladder][nview][ib]; |
809 |
}else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
// }else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
810 |
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta4[nang][nladder][nview][ib]; |
// for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.feta4[nang][nladder][nview][ib]; |
811 |
}else{ |
// }else{ |
812 |
cout << pfa<<" pfa parameters not implemented "<<endl; |
// cout << pfa<<" pfa parameters not implemented "<<endl; |
813 |
return 0; |
// return 0; |
814 |
} |
// } |
815 |
|
|
816 |
return fcorr; |
// return fcorr; |
817 |
|
|
818 |
}; |
// }; |
819 |
|
|
820 |
float* TrkLevel1::GetPfaAbs(TString pfa, int nang){ |
// float* TrkLevel1::GetPfaAbs(TString pfa, int nang){ |
821 |
|
|
822 |
TrkParams::Load(4); |
// TrkParams::Load(4); |
823 |
if( !TrkParams::IsLoaded(4) ){ |
// if( !TrkParams::IsLoaded(4) ){ |
824 |
cout << "float* TrkLevel1::GetPfaAbs(TString pfa, int nang) --- ERROR --- p.f.a. parameters not loaded"<<endl; |
// cout << "float* TrkLevel1::GetPfaAbs(TString pfa, int nang) --- ERROR --- p.f.a. parameters not loaded"<<endl; |
825 |
return 0; |
// return 0; |
826 |
} |
// } |
827 |
|
|
828 |
int nbins = GetPfaNbinsETA(); |
// int nbins = GetPfaNbinsETA(); |
829 |
if(!nbins)return 0; |
// if(!nbins)return 0; |
830 |
|
|
831 |
float *fcorr = new float [nbins]; |
// float *fcorr = new float [nbins]; |
832 |
|
|
833 |
if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
// if(!pfa.CompareTo("ETA2",TString::kIgnoreCase)){ |
834 |
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta2[nang][ib]; |
// for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta2[nang][ib]; |
835 |
}else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
// }else if (!pfa.CompareTo("ETA3",TString::kIgnoreCase)){ |
836 |
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta3[nang][ib]; |
// for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta3[nang][ib]; |
837 |
}else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
// }else if (!pfa.CompareTo("ETA4",TString::kIgnoreCase)){ |
838 |
for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta4[nang][ib]; |
// for(int ib=0; ib<nbins; ib++)fcorr[ib] = pfa_.eta4[nang][ib]; |
839 |
}else{ |
// }else{ |
840 |
cout << pfa<<" pfa parameters not implemented "<<endl; |
// cout << pfa<<" pfa parameters not implemented "<<endl; |
841 |
return 0; |
// return 0; |
842 |
} |
// } |
843 |
|
|
844 |
return fcorr; |
// return fcorr; |
845 |
|
|
846 |
}; |
// }; |
847 |
|
|
848 |
/** |
/** |
849 |
* Method to call the F77 routine that performs level1->level2 processing. |
* Method to call the F77 routine that performs level1->level2 processing. |