79{
80 if(part>2||part<0) {
81 cout<<"BAD part id from MucRecLineFit"<<endl;
82 return -1;
83 }
84
85 int status = -1;
86 float c,d,sigc,sigd;
87
88 if(part != 1 ){
89 for(
int i = 0; i <
n; i++){
91
93
94 }
96
97 }
98 else{
99 if(orient == 0){
100
101 for(
int i = 0; i <
n; i++){
104 }
105 status =
LineFit(
y,x,
w,
n,&c,&d,chisq,&sigc,&sigd);
106
107
108
109
110
111
112 *a = 1/c;
114 *siga = 1/c/c * sigc;
115
116 *sigb = sigd;
117 }
118 else{
119 if(seg == 0||seg == 4){
121 for(
int i = 0; i <
n; i++){
123 }
125 }
126 else if(seg == 2||seg == 6){
128 for(
int i = 0; i <
n; i++){
130 }
131 status =
LineFit(
y,x,
w,
n,&c,&d,chisq,&sigc,&sigd);
132
133 *a = 1/c;
135 *siga = 1/c/c * sigc;
136
137 *sigb = sigd;
138 }
139 else{
140 for(
int i = 0; i <
n; i++){
141 float temp = (
y[i] +
x[i])/sqrt(2.0);
142 y[i] = (
y[i] -
x[i])/sqrt(2.0);
144 }
145
146 if(seg == 1 || seg == 5){
147 for(
int i = 0; i <
n; i++){
150 }
152 }
153 else if(seg == 3 || seg == 7){
154 for(
int i = 0; i <
n; i++){
157 }
159
160 }
161
162 }
163
164
165 }
166
167 }
168
169 return status;
170
171}
HepPoint3D GetCenter() const
Get gap center position in global coordinate.
MucGeoGap * GetGap(const int part, const int seg, const int gap) const
Get a pointer to the gap identified by (part,seg,gap).
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
int LineFit(float x[], float y[], float w[], int n, float *a, float *b, float *chisq, float *siga, float *sigb)