Changeset 4279 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 06/07/04 18:47:53 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeFastSpline.cc
r4262 r4279 193 193 for (Int_t i=1;i<range-1;i++) 194 194 { 195 p++; 195 196 pp = fHiGainSecondDeriv[i-1] + 4.; 196 197 fHiGainSecondDeriv[i] = -1.0/pp; 197 fHiGainFirstDeriv [i] = *(p+ 2) - 2.* *(p+1) + *(p);198 fHiGainFirstDeriv [i] = *(p+1) - 2.* *(p) + *(p-1); 198 199 fHiGainFirstDeriv [i] = (6.0*fHiGainFirstDeriv[i]-fHiGainFirstDeriv[i-1])/pp; 199 p++;200 200 } 201 201 202 202 fHiGainSecondDeriv[range-1] = 0.; 203 203 204 for (Int_t k=range-2;k>=0;k--) 205 fHiGainSecondDeriv[k] = (fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k])/6.; 204 for (Int_t k=range-2;k>0;k--) 205 fHiGainSecondDeriv[k] = fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k]; 206 for (Int_t k=range-2;k>0;k--) 207 fHiGainSecondDeriv[k] /= 6.; 206 208 207 209 // … … 219 221 Float_t klocont = (Float_t)*(first+klo); 220 222 Float_t khicont = (Float_t)*(first+khi); 221 time = lower;222 Float_t abmax = k locont;223 time = upper; 224 Float_t abmax = khicont; 223 225 224 226 // … … 226 228 // interval maxpos+1. 227 229 // 228 while (x<upper-0. 1)229 { 230 230 while (x<upper-0.3) 231 { 232 231 233 x += step; 232 234 a -= step; 233 235 b += step; 234 236 235 237 y = a*klocont 236 238 + b*khicont 237 239 + (a*a*a-a)*fHiGainSecondDeriv[klo] 238 240 + (b*b*b-b)*fHiGainSecondDeriv[khi]; 239 241 240 242 if (y > abmax) 241 243 { … … 243 245 time = x; 244 246 } 245 246 }247 248 if (time < lower+0.1)249 { 250 251 upper = (Float_t)maxpos -1.;252 lower = (Float_t)maxpos -2.;247 } 248 249 250 if (time > upper-0.1) 251 { 252 253 upper = (Float_t)maxpos+1.; 254 lower = (Float_t)maxpos; 253 255 x = lower; 254 256 a = 1.; 255 257 b = 0.; 256 khi = maxpos -1;257 klo = maxpos -2;258 khi = maxpos+1; 259 klo = maxpos; 258 260 klocont = (Float_t)*(first+klo); 259 261 khicont = (Float_t)*(first+khi); 260 262 261 while (x<upper-0. 1)263 while (x<upper-0.3) 262 264 { 263 265 … … 309 311 } 310 312 313 if (time < klo + 0.02) 314 { 315 klo--; 316 khi--; 317 klocont = (Float_t)*(first+klo); 318 khicont = (Float_t)*(first+khi); 319 upper--; 320 lower--; 321 } 322 311 323 x = maxpossave; 312 324 a = upper - x; … … 330 342 time = x; 331 343 } 332 333 344 } 334 345 … … 340 351 // First, find the right FADC slice: 341 352 // 342 klo = maxpos - 1;353 klo = maxpos; 343 354 while (klo > maxpos-4) 344 355 { … … 443 454 for (Int_t i=1;i<range-1;i++) 444 455 { 456 p++; 445 457 pp = fLoGainSecondDeriv[i-1] + 4.; 446 458 fLoGainSecondDeriv[i] = -1.0/pp; 447 fLoGainFirstDeriv [i] = *(p+ 2) - 2.* *(p+1) + *(p);459 fLoGainFirstDeriv [i] = *(p+1) - 2.* *(p) + *(p-1); 448 460 fLoGainFirstDeriv [i] = (6.0*fLoGainFirstDeriv[i]-fLoGainFirstDeriv[i-1])/pp; 449 p++;450 461 } 451 462 452 463 fLoGainSecondDeriv[range-1] = 0.; 453 464 454 for (Int_t k=range-2;k>=0;k--) 455 fLoGainSecondDeriv[k] = (fLoGainSecondDeriv[k]*fLoGainSecondDeriv[k+1] + fLoGainFirstDeriv[k])/6.; 465 for (Int_t k=range-2;k>0;k--) 466 fLoGainSecondDeriv[k] = fLoGainSecondDeriv[k]*fLoGainSecondDeriv[k+1] + fLoGainFirstDeriv[k]; 467 for (Int_t k=range-2;k>0;k--) 468 fLoGainSecondDeriv[k] /= 6.; 456 469 457 470 // … … 469 482 Float_t klocont = (Float_t)*(first+klo); 470 483 Float_t khicont = (Float_t)*(first+khi); 471 time = lower;472 Float_t abmax = k locont;484 time = upper; 485 Float_t abmax = khicont; 473 486 474 487 // … … 476 489 // interval maxpos+1. 477 490 // 478 while (x<upper-0. 1)491 while (x<upper-0.3) 479 492 { 480 493 … … 496 509 } 497 510 498 if (time < lower+0.1)499 { 500 501 upper = (Float_t)maxpos -1.;502 lower = (Float_t)maxpos -2.;511 if (time > upper-0.1) 512 { 513 514 upper = (Float_t)maxpos+1.; 515 lower = (Float_t)maxpos; 503 516 x = lower; 504 517 a = 1.; 505 518 b = 0.; 506 khi = maxpos -1;507 klo = maxpos -2;519 khi = maxpos+1; 520 klo = maxpos; 508 521 klocont = (Float_t)*(first+klo); 509 522 khicont = (Float_t)*(first+khi); 510 523 511 while (x<upper-0. 1)524 while (x<upper-0.3) 512 525 { 513 526 … … 559 572 } 560 573 574 if (time < klo + 0.01) 575 { 576 klo--; 577 khi--; 578 klocont = (Float_t)*(first+klo); 579 khicont = (Float_t)*(first+khi); 580 upper--; 581 lower--; 582 } 583 561 584 x = maxpossave; 562 585 a = upper - x;
Note:
See TracChangeset
for help on using the changeset viewer.