| 895 |
*/ |
*/ |
| 896 |
Bool_t TrkTrack::IsInsideCavity(){ |
Bool_t TrkTrack::IsInsideCavity(){ |
| 897 |
float xmagntop, ymagntop, xmagnbottom, ymagnbottom; |
float xmagntop, ymagntop, xmagnbottom, ymagnbottom; |
| 898 |
xmagntop = xv[0] + (ZMAGNHIGH-zv[0])*tan(cos(-1.0)*axv[0]/180.); |
xmagntop = xv[0] + (ZMAGNHIGH-zv[0])*tan(acos(-1.0)*axv[0]/180.); |
| 899 |
ymagntop = yv[0] + (ZMAGNHIGH-zv[0])*tan(cos(-1.0)*ayv[0]/180.); |
ymagntop = yv[0] + (ZMAGNHIGH-zv[0])*tan(acos(-1.0)*ayv[0]/180.); |
| 900 |
xmagnbottom = xv[5] + (ZMAGNLOW-zv[5])*tan(cos(-1.0)*axv[5]/180.); |
xmagnbottom = xv[5] + (ZMAGNLOW-zv[5])*tan(acos(-1.0)*axv[5]/180.); |
| 901 |
ymagnbottom = yv[5] + (ZMAGNLOW-zv[5])*tan(cos(-1.0)*ayv[5]/180.); |
ymagnbottom = yv[5] + (ZMAGNLOW-zv[5])*tan(acos(-1.0)*ayv[5]/180.); |
| 902 |
if( xmagntop>XMAGNLOW && xmagntop<XMAGNHIGH && |
if( xmagntop>XMAGNLOW && xmagntop<XMAGNHIGH && |
| 903 |
ymagntop>YMAGNLOW && ymagntop<YMAGNHIGH && |
ymagntop>YMAGNLOW && ymagntop<YMAGNHIGH && |
| 904 |
xmagnbottom>XMAGNLOW && xmagnbottom<XMAGNHIGH && |
xmagnbottom>XMAGNLOW && xmagnbottom<XMAGNHIGH && |
| 970 |
if(bad)ygood[ip]=-ygood[ip]; |
if(bad)ygood[ip]=-ygood[ip]; |
| 971 |
}; |
}; |
| 972 |
|
|
| 973 |
|
/** |
| 974 |
|
* \brief Average X |
| 975 |
|
* Average value of <xv>, evaluated from the first to the last hit x view. |
| 976 |
|
*/ |
| 977 |
|
Float_t TrkTrack::GetXav(){ |
| 978 |
|
|
| 979 |
|
int first_plane = -1; |
| 980 |
|
int last_plane = -1; |
| 981 |
|
for(Int_t ip=0; ip<6; ip++){ |
| 982 |
|
if( XGood(ip) && first_plane == -1 )first_plane = ip; |
| 983 |
|
if( XGood(ip) && first_plane != -1 )last_plane = ip; |
| 984 |
|
} |
| 985 |
|
if( first_plane == -1 || last_plane == -1){ |
| 986 |
|
return -100; |
| 987 |
|
} |
| 988 |
|
if( last_plane-first_plane+1 ==0 )return -100; |
| 989 |
|
|
| 990 |
|
Float_t av = 0; |
| 991 |
|
for(int ip=first_plane; ip<=last_plane; ip++)av+=xv[ip]; |
| 992 |
|
|
| 993 |
|
return (av/(last_plane-first_plane+1)); |
| 994 |
|
} |
| 995 |
|
/** |
| 996 |
|
* \brief Average Y |
| 997 |
|
* Average value of <yv>, evaluated from the first to the last hit x view. |
| 998 |
|
*/ |
| 999 |
|
Float_t TrkTrack::GetYav(){ |
| 1000 |
|
|
| 1001 |
|
int first_plane = -1; |
| 1002 |
|
int last_plane = -1; |
| 1003 |
|
for(Int_t ip=0; ip<6; ip++){ |
| 1004 |
|
if( XGood(ip) && first_plane == -1 )first_plane = ip; |
| 1005 |
|
if( XGood(ip) && first_plane != -1 )last_plane = ip; |
| 1006 |
|
} |
| 1007 |
|
if( first_plane == -1 || last_plane == -1){ |
| 1008 |
|
return -100; |
| 1009 |
|
} |
| 1010 |
|
if( last_plane-first_plane+1 ==0 )return -100; |
| 1011 |
|
|
| 1012 |
|
Float_t av = 0; |
| 1013 |
|
for(int ip=first_plane; ip<=last_plane; ip++)av+=yv[ip]; |
| 1014 |
|
|
| 1015 |
|
return (av/(last_plane-first_plane+1)); |
| 1016 |
|
} |
| 1017 |
|
/** |
| 1018 |
|
* \brief Average Z |
| 1019 |
|
* Average value of <zv>, evaluated from the first to the last hit x view. |
| 1020 |
|
*/ |
| 1021 |
|
Float_t TrkTrack::GetZav(){ |
| 1022 |
|
|
| 1023 |
|
int first_plane = -1; |
| 1024 |
|
int last_plane = -1; |
| 1025 |
|
for(Int_t ip=0; ip<6; ip++){ |
| 1026 |
|
if( XGood(ip) && first_plane == -1 )first_plane = ip; |
| 1027 |
|
if( XGood(ip) && first_plane != -1 )last_plane = ip; |
| 1028 |
|
} |
| 1029 |
|
if( first_plane == -1 || last_plane == -1){ |
| 1030 |
|
return -100; |
| 1031 |
|
} |
| 1032 |
|
if( last_plane-first_plane+1 ==0 )return -100; |
| 1033 |
|
|
| 1034 |
|
Float_t av = 0; |
| 1035 |
|
for(int ip=first_plane; ip<=last_plane; ip++)av+=zv[ip]; |
| 1036 |
|
|
| 1037 |
|
return (av/(last_plane-first_plane+1)); |
| 1038 |
|
} |
| 1039 |
|
|
| 1040 |
|
/** |
| 1041 |
|
* \brief Number of column traversed |
| 1042 |
|
*/ |
| 1043 |
|
Int_t TrkTrack::GetNColumns(){ |
| 1044 |
|
int sensors[] = {0,0,0,0,0,0}; |
| 1045 |
|
for(int ip=0; ip<6; ip++){ |
| 1046 |
|
int sensorid = GetLadder(ip)+3*GetSensor(ip); |
| 1047 |
|
if(XGood(ip)||YGood(ip)) |
| 1048 |
|
if(sensorid>=0 && sensorid<6)sensors[sensorid]=1; |
| 1049 |
|
} |
| 1050 |
|
int nsensors=0; |
| 1051 |
|
for(int is=0; is<6; is++)nsensors += sensors[is]; |
| 1052 |
|
return nsensors; |
| 1053 |
|
}; |
| 1054 |
|
/** |
| 1055 |
|
* \brief Give the maximum energy release |
| 1056 |
|
*/ |
| 1057 |
|
Float_t TrkTrack::GetDEDX_max(int ip, int iv){ |
| 1058 |
|
Float_t max=0; |
| 1059 |
|
int pfrom = 0; |
| 1060 |
|
int pto = 6; |
| 1061 |
|
int vfrom = 0; |
| 1062 |
|
int vto = 2; |
| 1063 |
|
if(ip>=0&&ip<6){ |
| 1064 |
|
pfrom = ip; |
| 1065 |
|
pto = ip+1; |
| 1066 |
|
} |
| 1067 |
|
if(iv>=0&&iv<2){ |
| 1068 |
|
vfrom = iv; |
| 1069 |
|
vto = iv+1; |
| 1070 |
|
} |
| 1071 |
|
for(int i=pfrom; i<pto; i++) |
| 1072 |
|
for(int j=0; j<vto; j++) |
| 1073 |
|
if(GetDEDX(i,j)>max)max=GetDEDX(i,j); |
| 1074 |
|
|
| 1075 |
|
return max; |
| 1076 |
|
|
| 1077 |
|
}; |
| 1078 |
|
|
| 1079 |
|
/** |
| 1080 |
|
* \brief Give the minimum energy release |
| 1081 |
|
*/ |
| 1082 |
|
Float_t TrkTrack::GetDEDX_min(int ip, int iv){ |
| 1083 |
|
Float_t min=100000000; |
| 1084 |
|
int pfrom = 0; |
| 1085 |
|
int pto = 6; |
| 1086 |
|
int vfrom = 0; |
| 1087 |
|
int vto = 2; |
| 1088 |
|
if(ip>=0&&ip<6){ |
| 1089 |
|
pfrom = ip; |
| 1090 |
|
pto = ip+1; |
| 1091 |
|
} |
| 1092 |
|
if(iv>=0&&iv<2){ |
| 1093 |
|
vfrom = iv; |
| 1094 |
|
vto = iv+1; |
| 1095 |
|
} |
| 1096 |
|
for(int i=pfrom; i<pto; i++) |
| 1097 |
|
for(int j=0; j<vto; j++) |
| 1098 |
|
if(GetDEDX(i,j)<min)min=GetDEDX(i,j); |
| 1099 |
|
|
| 1100 |
|
return min; |
| 1101 |
|
|
| 1102 |
|
}; |
| 1103 |
|
|
| 1104 |
|
/** |
| 1105 |
|
* \brief Give the maximum spatial residual release |
| 1106 |
|
*/ |
| 1107 |
|
Float_t TrkTrack::GetResidual_max(int ip, int iv){ |
| 1108 |
|
Float_t max=0; |
| 1109 |
|
int pfrom = 0; |
| 1110 |
|
int pto = 6; |
| 1111 |
|
int vfrom = 0; |
| 1112 |
|
int vto = 2; |
| 1113 |
|
if(ip>=0&&ip<6){ |
| 1114 |
|
pfrom = ip; |
| 1115 |
|
pto = ip+1; |
| 1116 |
|
} |
| 1117 |
|
if(iv>=0&&iv<2){ |
| 1118 |
|
vfrom = iv; |
| 1119 |
|
vto = iv+1; |
| 1120 |
|
} |
| 1121 |
|
for(int i=pfrom; i<pto; i++){ |
| 1122 |
|
for(int j=0; j<vto; j++){ |
| 1123 |
|
if(j==0 && XGood(i) && fabs(xm[i]-xv[i])>fabs(max))max=xv[i]-xm[i]; |
| 1124 |
|
if(j==1 && YGood(i) && fabs(ym[i]-yv[i])>fabs(max))max=yv[i]-ym[i]; |
| 1125 |
|
} |
| 1126 |
|
} |
| 1127 |
|
return max; |
| 1128 |
|
|
| 1129 |
|
}; |
| 1130 |
|
|
| 1131 |
|
|
| 1132 |
|
/** |
| 1133 |
|
* \brief Give the maximum multiplicity on the x view |
| 1134 |
|
*/ |
| 1135 |
|
Int_t TrkTrack::GetClusterX_Multiplicity_max(){ |
| 1136 |
|
int max=0; |
| 1137 |
|
for(int ip=0; ip<6; ip++) |
| 1138 |
|
if(GetClusterX_Multiplicity(ip)>max)max=GetClusterX_Multiplicity(ip); |
| 1139 |
|
return max; |
| 1140 |
|
}; |
| 1141 |
|
/** |
| 1142 |
|
* \brief Give the minimum multiplicity on the x view |
| 1143 |
|
*/ |
| 1144 |
|
Int_t TrkTrack::GetClusterX_Multiplicity_min(){ |
| 1145 |
|
int min=50; |
| 1146 |
|
for(int ip=0; ip<6; ip++) |
| 1147 |
|
if(GetClusterX_Multiplicity(ip)<min)min=GetClusterX_Multiplicity(ip); |
| 1148 |
|
return min; |
| 1149 |
|
}; |
| 1150 |
|
/** |
| 1151 |
|
* \brief Give the maximum multiplicity on the x view |
| 1152 |
|
*/ |
| 1153 |
|
Int_t TrkTrack::GetClusterY_Multiplicity_max(){ |
| 1154 |
|
int max=0; |
| 1155 |
|
for(int ip=0; ip<6; ip++) |
| 1156 |
|
if(GetClusterY_Multiplicity(ip)>max)max=GetClusterY_Multiplicity(ip); |
| 1157 |
|
return max; |
| 1158 |
|
}; |
| 1159 |
|
/** |
| 1160 |
|
* \brief Give the minimum multiplicity on the x view |
| 1161 |
|
*/ |
| 1162 |
|
Int_t TrkTrack::GetClusterY_Multiplicity_min(){ |
| 1163 |
|
int min=50; |
| 1164 |
|
for(int ip=0; ip<6; ip++) |
| 1165 |
|
if(GetClusterY_Multiplicity(ip)<min)min=GetClusterY_Multiplicity(ip); |
| 1166 |
|
return min; |
| 1167 |
|
}; |
| 1168 |
|
|
| 1169 |
|
/** |
| 1170 |
|
* \brief Give the minimum seed on the x view |
| 1171 |
|
*/ |
| 1172 |
|
Float_t TrkTrack::GetClusterX_Seed_min(){ |
| 1173 |
|
Float_t min=100000; |
| 1174 |
|
for(int ip=0; ip<6; ip++) |
| 1175 |
|
if(XGood(ip) && GetClusterX_Seed(ip)<min)min=GetClusterX_Seed(ip); |
| 1176 |
|
return min; |
| 1177 |
|
}; |
| 1178 |
|
/** |
| 1179 |
|
* \brief Give the minimum seed on the x view |
| 1180 |
|
*/ |
| 1181 |
|
Float_t TrkTrack::GetClusterY_Seed_min(){ |
| 1182 |
|
Float_t min=100000; |
| 1183 |
|
for(int ip=0; ip<6; ip++) |
| 1184 |
|
if(YGood(ip) && GetClusterY_Seed(ip)<min)min=GetClusterY_Seed(ip); |
| 1185 |
|
return min; |
| 1186 |
|
}; |
| 1187 |
|
|
| 1188 |
|
|
| 1189 |
//-------------------------------------- |
//-------------------------------------- |
| 1190 |
// |
// |
| 1191 |
// |
// |