345 double mean_residualx = 0., mean_residualy = 0., mean_resslopex = 0., mean_resslopey = 0.;
346 double mean_trackx = 0., mean_tracky = 0., mean_trackdxdz = 0., mean_trackdydz = 0.;
351 const double redchi2 = (*rit)[
kRedChi2];
352 double weight = 1./redchi2;
357 double factor_w = 1./(sum_w +
weight);
358 mean_residualx = factor_w * (sum_w * mean_residualx + weight * (*rit)[
kResidX]);
359 mean_residualy = factor_w * (sum_w * mean_residualy + weight * (*rit)[
kResidY]);
360 mean_resslopex = factor_w * (sum_w * mean_resslopex + weight * (*rit)[
kResSlopeX]);
361 mean_resslopey = factor_w * (sum_w * mean_resslopey + weight * (*rit)[
kResSlopeY]);
362 mean_trackx = factor_w * (sum_w * mean_trackx + weight * (*rit)[
kPositionX]);
363 mean_tracky = factor_w * (sum_w * mean_tracky + weight * (*rit)[
kPositionY]);
364 mean_trackdxdz = factor_w * (sum_w * mean_trackdxdz + weight * (*rit)[
kAngleX]);
365 mean_trackdydz = factor_w * (sum_w * mean_trackdydz + weight * (*rit)[
kAngleY]);
370 std::string name_x, name_y, name_dxdz, name_dydz, name_x_raw, name_y_raw, name_dxdz_raw, name_dydz_raw, name_x_cut, name_y_cut, name_alphax, name_alphay;
371 std::string name_x_trackx, name_y_trackx, name_dxdz_trackx, name_dydz_trackx;
372 std::string name_x_tracky, name_y_tracky, name_dxdz_tracky, name_dydz_tracky;
373 std::string name_x_trackdxdz, name_y_trackdxdz, name_dxdz_trackdxdz, name_dydz_trackdxdz;
374 std::string name_x_trackdydz, name_y_trackdydz, name_dxdz_trackdydz, name_dydz_trackdydz;
376 name_x =
name +
"_x";
377 name_y =
name +
"_y";
378 name_dxdz =
name +
"_dxdz";
379 name_dydz =
name +
"_dydz";
380 name_x_raw =
name +
"_x_raw";
381 name_y_raw =
name +
"_y_raw";
382 name_dxdz_raw =
name +
"_dxdz_raw";
383 name_dydz_raw =
name +
"_dydz_raw";
384 name_x_cut =
name +
"_x_cut";
385 name_y_cut =
name +
"_y_cut";
386 name_alphax =
name +
"_alphax";
387 name_alphay =
name +
"_alphay";
388 name_x_trackx =
name +
"_x_trackx";
389 name_y_trackx =
name +
"_y_trackx";
390 name_dxdz_trackx =
name +
"_dxdz_trackx";
391 name_dydz_trackx =
name +
"_dydz_trackx";
392 name_x_tracky =
name +
"_x_tracky";
393 name_y_tracky =
name +
"_y_tracky";
394 name_dxdz_tracky =
name +
"_dxdz_tracky";
395 name_dydz_tracky =
name +
"_dydz_tracky";
396 name_x_trackdxdz =
name +
"_x_trackdxdz";
397 name_y_trackdxdz =
name +
"_y_trackdxdz";
398 name_dxdz_trackdxdz =
name +
"_dxdz_trackdxdz";
399 name_dydz_trackdxdz =
name +
"_dydz_trackdxdz";
400 name_x_trackdydz =
name +
"_x_trackdydz";
401 name_y_trackdydz =
name +
"_y_trackdydz";
402 name_dxdz_trackdydz =
name +
"_dxdz_trackdydz";
403 name_dydz_trackdydz =
name +
"_dydz_trackdydz";
408 double min_x = -100., max_x = 100.;
409 double min_y = -100., max_y = 100.;
410 double min_dxdz = -75., max_dxdz = 75.;
411 double min_dydz = -150., max_dydz = 150.;
412 double min_trackx = -width/2., max_trackx = width/2.;
413 double min_tracky = -length/2., max_tracky = length/2.;
414 double min_trackdxdz = -1.5, max_trackdxdz = 1.5;
415 double min_trackdydz = -1.5, max_trackdydz = 1.5;
417 TH1F *hist_x = dir->
make<TH1F>(name_x.c_str(),
"", bins, min_x, max_x);
418 TH1F *hist_y = dir->
make<TH1F>(name_y.c_str(),
"", bins, min_y, max_y);
419 TH1F *hist_dxdz = dir->
make<TH1F>(name_dxdz.c_str(),
"", bins, min_dxdz, max_dxdz);
420 TH1F *hist_dydz = dir->
make<TH1F>(name_dydz.c_str(),
"", bins, min_dydz, max_dydz);
421 TH1F *hist_x_raw = dir->
make<TH1F>(name_x_raw.c_str(),
"", bins, min_x, max_x);
422 TH1F *hist_y_raw = dir->
make<TH1F>(name_y_raw.c_str(),
"", bins, min_y, max_y);
423 TH1F *hist_dxdz_raw = dir->
make<TH1F>(name_dxdz_raw.c_str(),
"", bins, min_dxdz, max_dxdz);
424 TH1F *hist_dydz_raw = dir->
make<TH1F>(name_dydz_raw.c_str(),
"", bins, min_dydz, max_dydz);
425 TH1F *hist_x_cut = dir->
make<TH1F>(name_x_cut.c_str(),
"", bins, min_x, max_x);
426 TH1F *hist_y_cut = dir->
make<TH1F>(name_y_cut.c_str(),
"", bins, min_y, max_y);
427 TH2F *hist_alphax = dir->
make<TH2F>(name_alphax.c_str(),
"", 50, 50, 50, 50, -50., 50.);
428 TH2F *hist_alphay = dir->
make<TH2F>(name_alphay.c_str(),
"", 75, 100, 100, 75, -75., 75.);
430 TProfile *hist_x_trackx = dir->
make<TProfile>(name_x_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_x, max_x);
431 TProfile *hist_y_trackx = dir->
make<TProfile>(name_y_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_y, max_y);
432 TProfile *hist_dxdz_trackx = dir->
make<TProfile>(name_dxdz_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_dxdz, max_dxdz);
433 TProfile *hist_dydz_trackx = dir->
make<TProfile>(name_dydz_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_dydz, max_dydz);
434 TProfile *hist_x_tracky = dir->
make<TProfile>(name_x_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_x, max_x);
435 TProfile *hist_y_tracky = dir->
make<TProfile>(name_y_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_y, max_y);
436 TProfile *hist_dxdz_tracky = dir->
make<TProfile>(name_dxdz_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_dxdz, max_dxdz);
437 TProfile *hist_dydz_tracky = dir->
make<TProfile>(name_dydz_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_dydz, max_dydz);
438 TProfile *hist_x_trackdxdz = dir->
make<TProfile>(name_x_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_x, max_x);
439 TProfile *hist_y_trackdxdz = dir->
make<TProfile>(name_y_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_y, max_y);
440 TProfile *hist_dxdz_trackdxdz = dir->
make<TProfile>(name_dxdz_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_dxdz, max_dxdz);
441 TProfile *hist_dydz_trackdxdz = dir->
make<TProfile>(name_dydz_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_dydz, max_dydz);
442 TProfile *hist_x_trackdydz = dir->
make<TProfile>(name_x_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_x, max_x);
443 TProfile *hist_y_trackdydz = dir->
make<TProfile>(name_y_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_y, max_y);
444 TProfile *hist_dxdz_trackdydz = dir->
make<TProfile>(name_dxdz_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_dxdz, max_dxdz);
445 TProfile *hist_dydz_trackdydz = dir->
make<TProfile>(name_dydz_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_dydz, max_dydz);
447 hist_x_trackx->SetAxisRange(-10., 10.,
"Y");
448 hist_y_trackx->SetAxisRange(-20., 20.,
"Y");
449 hist_dxdz_trackx->SetAxisRange(-10., 10.,
"Y");
450 hist_dydz_trackx->SetAxisRange(-20., 20.,
"Y");
451 hist_x_tracky->SetAxisRange(-10., 10.,
"Y");
452 hist_y_tracky->SetAxisRange(-20., 20.,
"Y");
453 hist_dxdz_tracky->SetAxisRange(-10., 10.,
"Y");
454 hist_dydz_tracky->SetAxisRange(-20., 20.,
"Y");
455 hist_x_trackdxdz->SetAxisRange(-10., 10.,
"Y");
456 hist_y_trackdxdz->SetAxisRange(-20., 20.,
"Y");
457 hist_dxdz_trackdxdz->SetAxisRange(-10., 10.,
"Y");
458 hist_dydz_trackdxdz->SetAxisRange(-20., 20.,
"Y");
459 hist_x_trackdydz->SetAxisRange(-10., 10.,
"Y");
460 hist_y_trackdydz->SetAxisRange(-20., 20.,
"Y");
461 hist_dxdz_trackdydz->SetAxisRange(-10., 10.,
"Y");
462 hist_dydz_trackdydz->SetAxisRange(-20., 20.,
"Y");
468 name_alphax +=
"_fit";
469 name_alphay +=
"_fit";
470 name_x_trackx +=
"_fit";
471 name_y_trackx +=
"_fit";
472 name_dxdz_trackx +=
"_fit";
473 name_dydz_trackx +=
"_fit";
474 name_x_tracky +=
"_fit";
475 name_y_tracky +=
"_fit";
476 name_dxdz_tracky +=
"_fit";
477 name_dydz_tracky +=
"_fit";
478 name_x_trackdxdz +=
"_fit";
479 name_y_trackdxdz +=
"_fit";
480 name_dxdz_trackdxdz +=
"_fit";
481 name_dydz_trackdxdz +=
"_fit";
482 name_x_trackdydz +=
"_fit";
483 name_y_trackdydz +=
"_fit";
484 name_dxdz_trackdydz +=
"_fit";
485 name_dydz_trackdydz +=
"_fit";
489 TF1 *fit_dxdz =
NULL;
490 TF1 *fit_dydz =
NULL;
495 fit_x->SetParErrors(er_x);
499 fit_y->SetParErrors(er_y);
503 fit_dxdz->SetParErrors(er_dxdz);
507 fit_dydz->SetParErrors(er_dydz);
539 else { assert(
false); }
541 fit_x->SetLineColor(2); fit_x->SetLineWidth(2); fit_x->Write();
542 fit_y->SetLineColor(2); fit_y->SetLineWidth(2); fit_y->Write();
543 fit_dxdz->SetLineColor(2); fit_dxdz->SetLineWidth(2); fit_dxdz->Write();
544 fit_dydz->SetLineColor(2); fit_dydz->SetLineWidth(2); fit_dydz->Write();
546 TF1 *fit_alphax =
new TF1(name_alphax.c_str(),
"[0] + x*[1]", min_dxdz, max_dxdz);
547 TF1 *fit_alphay =
new TF1(name_alphay.c_str(),
"[0] + x*[1]", min_dydz, max_dydz);
558 aX = - bX * mean_resslopex;
566 aY = - bY * mean_resslopey;
569 fit_alphax->SetParameters(aX, bX);
570 fit_alphay->SetParameters(aY, bY);
572 fit_alphax->SetLineColor(2); fit_alphax->SetLineWidth(2); fit_alphax->Write();
573 fit_alphay->SetLineColor(2); fit_alphay->SetLineWidth(2); fit_alphay->Write();
575 TProfile *fit_x_trackx = dir->
make<TProfile>(name_x_trackx.c_str(),
"", 100, min_trackx, max_trackx);
576 TProfile *fit_y_trackx = dir->
make<TProfile>(name_y_trackx.c_str(),
"", 100, min_trackx, max_trackx);
577 TProfile *fit_dxdz_trackx = dir->
make<TProfile>(name_dxdz_trackx.c_str(),
"", 100, min_trackx, max_trackx);
578 TProfile *fit_dydz_trackx = dir->
make<TProfile>(name_dydz_trackx.c_str(),
"", 100, min_trackx, max_trackx);
579 TProfile *fit_x_tracky = dir->
make<TProfile>(name_x_tracky.c_str(),
"", 100, min_tracky, max_tracky);
580 TProfile *fit_y_tracky = dir->
make<TProfile>(name_y_tracky.c_str(),
"", 100, min_tracky, max_tracky);
581 TProfile *fit_dxdz_tracky = dir->
make<TProfile>(name_dxdz_tracky.c_str(),
"", 100, min_tracky, max_tracky);
582 TProfile *fit_dydz_tracky = dir->
make<TProfile>(name_dydz_tracky.c_str(),
"", 100, min_tracky, max_tracky);
583 TProfile *fit_x_trackdxdz = dir->
make<TProfile>(name_x_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
584 TProfile *fit_y_trackdxdz = dir->
make<TProfile>(name_y_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
585 TProfile *fit_dxdz_trackdxdz = dir->
make<TProfile>(name_dxdz_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
586 TProfile *fit_dydz_trackdxdz = dir->
make<TProfile>(name_dydz_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
587 TProfile *fit_x_trackdydz = dir->
make<TProfile>(name_x_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
588 TProfile *fit_y_trackdydz = dir->
make<TProfile>(name_y_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
589 TProfile *fit_dxdz_trackdydz = dir->
make<TProfile>(name_dxdz_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
590 TProfile *fit_dydz_trackdydz = dir->
make<TProfile>(name_dydz_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
592 fit_x_trackx->SetLineColor(2); fit_x_trackx->SetLineWidth(2);
593 fit_y_trackx->SetLineColor(2); fit_y_trackx->SetLineWidth(2);
594 fit_dxdz_trackx->SetLineColor(2); fit_dxdz_trackx->SetLineWidth(2);
595 fit_dydz_trackx->SetLineColor(2); fit_dydz_trackx->SetLineWidth(2);
596 fit_x_tracky->SetLineColor(2); fit_x_tracky->SetLineWidth(2);
597 fit_y_tracky->SetLineColor(2); fit_y_tracky->SetLineWidth(2);
598 fit_dxdz_tracky->SetLineColor(2); fit_dxdz_tracky->SetLineWidth(2);
599 fit_dydz_tracky->SetLineColor(2); fit_dydz_tracky->SetLineWidth(2);
600 fit_x_trackdxdz->SetLineColor(2); fit_x_trackdxdz->SetLineWidth(2);
601 fit_y_trackdxdz->SetLineColor(2); fit_y_trackdxdz->SetLineWidth(2);
602 fit_dxdz_trackdxdz->SetLineColor(2); fit_dxdz_trackdxdz->SetLineWidth(2);
603 fit_dydz_trackdxdz->SetLineColor(2); fit_dydz_trackdxdz->SetLineWidth(2);
604 fit_x_trackdydz->SetLineColor(2); fit_x_trackdydz->SetLineWidth(2);
605 fit_y_trackdydz->SetLineColor(2); fit_y_trackdydz->SetLineWidth(2);
606 fit_dxdz_trackdydz->SetLineColor(2); fit_dxdz_trackdydz->SetLineWidth(2);
607 fit_dydz_trackdydz->SetLineColor(2); fit_dydz_trackdydz->SetLineWidth(2);
609 name_x_trackx +=
"line";
610 name_y_trackx +=
"line";
611 name_dxdz_trackx +=
"line";
612 name_dydz_trackx +=
"line";
613 name_x_tracky +=
"line";
614 name_y_tracky +=
"line";
615 name_dxdz_tracky +=
"line";
616 name_dydz_tracky +=
"line";
617 name_x_trackdxdz +=
"line";
618 name_y_trackdxdz +=
"line";
619 name_dxdz_trackdxdz +=
"line";
620 name_dydz_trackdxdz +=
"line";
621 name_x_trackdydz +=
"line";
622 name_y_trackdydz +=
"line";
623 name_dxdz_trackdydz +=
"line";
624 name_dydz_trackdydz +=
"line";
626 TF1 *fitline_x_trackx =
new TF1(name_x_trackx.c_str(), residual_x_trackx_TF1, min_trackx, max_trackx, 14);
627 TF1 *fitline_y_trackx =
new TF1(name_y_trackx.c_str(), residual_y_trackx_TF1, min_trackx, max_trackx, 14);
628 TF1 *fitline_dxdz_trackx =
new TF1(name_dxdz_trackx.c_str(), residual_dxdz_trackx_TF1, min_trackx, max_trackx, 14);
629 TF1 *fitline_dydz_trackx =
new TF1(name_dydz_trackx.c_str(), residual_dydz_trackx_TF1, min_trackx, max_trackx, 14);
630 TF1 *fitline_x_tracky =
new TF1(name_x_tracky.c_str(), residual_x_tracky_TF1, min_tracky, max_tracky, 14);
631 TF1 *fitline_y_tracky =
new TF1(name_y_tracky.c_str(), residual_y_tracky_TF1, min_tracky, max_tracky, 14);
632 TF1 *fitline_dxdz_tracky =
new TF1(name_dxdz_tracky.c_str(), residual_dxdz_tracky_TF1, min_tracky, max_tracky, 14);
633 TF1 *fitline_dydz_tracky =
new TF1(name_dydz_tracky.c_str(), residual_dydz_tracky_TF1, min_tracky, max_tracky, 14);
634 TF1 *fitline_x_trackdxdz =
new TF1(name_x_trackdxdz.c_str(), residual_x_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
635 TF1 *fitline_y_trackdxdz =
new TF1(name_y_trackdxdz.c_str(), residual_y_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
636 TF1 *fitline_dxdz_trackdxdz =
new TF1(name_dxdz_trackdxdz.c_str(), residual_dxdz_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
637 TF1 *fitline_dydz_trackdxdz =
new TF1(name_dydz_trackdxdz.c_str(), residual_dydz_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
638 TF1 *fitline_x_trackdydz =
new TF1(name_x_trackdydz.c_str(), residual_x_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
639 TF1 *fitline_y_trackdydz =
new TF1(name_y_trackdydz.c_str(), residual_y_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
640 TF1 *fitline_dxdz_trackdydz =
new TF1(name_dxdz_trackdydz.c_str(), residual_dxdz_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
641 TF1 *fitline_dydz_trackdydz =
new TF1(name_dydz_trackdydz.c_str(), residual_dydz_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
643 std::vector<TF1*> fitlines;
644 fitlines.push_back(fitline_x_trackx);
645 fitlines.push_back(fitline_y_trackx);
646 fitlines.push_back(fitline_dxdz_trackx);
647 fitlines.push_back(fitline_dydz_trackx);
648 fitlines.push_back(fitline_x_tracky);
649 fitlines.push_back(fitline_y_tracky);
650 fitlines.push_back(fitline_dxdz_tracky);
651 fitlines.push_back(fitline_dydz_tracky);
652 fitlines.push_back(fitline_x_trackdxdz);
653 fitlines.push_back(fitline_y_trackdxdz);
654 fitlines.push_back(fitline_dxdz_trackdxdz);
655 fitlines.push_back(fitline_dydz_trackdxdz);
656 fitlines.push_back(fitline_x_trackdydz);
657 fitlines.push_back(fitline_y_trackdydz);
658 fitlines.push_back(fitline_dxdz_trackdydz);
659 fitlines.push_back(fitline_dydz_trackdydz);
662 mean_trackx, mean_tracky, mean_trackdxdz, mean_trackdydz,
666 for(std::vector<TF1*>::const_iterator itr = fitlines.begin(); itr != fitlines.end(); itr++)
668 (*itr)->SetParameters(fitparameters);
669 (*itr)->SetLineColor(2);
670 (*itr)->SetLineWidth(2);
676 const double residX = (*resiter)[
kResidX];
677 const double residY = (*resiter)[
kResidY];
678 const double resslopeX = (*resiter)[
kResSlopeX];
679 const double resslopeY = (*resiter)[
kResSlopeY];
680 const double positionX = (*resiter)[
kPositionX];
681 const double positionY = (*resiter)[
kPositionY];
682 const double angleX = (*resiter)[
kAngleX];
683 const double angleY = (*resiter)[
kAngleY];
684 const double redchi2 = (*resiter)[
kRedChi2];
685 double weight = 1./redchi2;
690 hist_alphax->Fill(1000.*resslopeX, 10.*residX);
691 hist_alphay->Fill(1000.*resslopeY, 10.*residY);
695 double geom_residX = residual_x(
value(
kAlignX),
value(
kAlignY),
value(
kAlignZ),
value(
kAlignPhiX),
value(
kAlignPhiY),
value(
kAlignPhiZ), positionX, positionY, angleX, angleY, coefX, resslopeX);
696 hist_x->Fill(10.*(residX - geom_residX +
value(
kAlignX)), weight);
697 hist_x_trackx->Fill(positionX, 10.*residX, weight);
698 hist_x_tracky->Fill(positionY, 10.*residX, weight);
699 hist_x_trackdxdz->Fill(angleX, 10.*residX, weight);
700 hist_x_trackdydz->Fill(angleY, 10.*residX, weight);
701 fit_x_trackx->Fill(positionX, 10.*geom_residX, weight);
702 fit_x_tracky->Fill(positionY, 10.*geom_residX, weight);
703 fit_x_trackdxdz->Fill(angleX, 10.*geom_residX, weight);
704 fit_x_trackdydz->Fill(angleY, 10.*geom_residX, weight);
706 double geom_residY = residual_y(
value(
kAlignX),
value(
kAlignY),
value(
kAlignZ),
value(
kAlignPhiX),
value(
kAlignPhiY),
value(
kAlignPhiZ), positionX, positionY, angleX, angleY, coefY, resslopeY);
707 hist_y->Fill(10.*(residY - geom_residY +
value(
kAlignY)), weight);
708 hist_y_trackx->Fill(positionX, 10.*residY, weight);
709 hist_y_tracky->Fill(positionY, 10.*residY, weight);
710 hist_y_trackdxdz->Fill(angleX, 10.*residY, weight);
711 hist_y_trackdydz->Fill(angleY, 10.*residY, weight);
712 fit_y_trackx->Fill(positionX, 10.*geom_residY, weight);
713 fit_y_tracky->Fill(positionY, 10.*geom_residY, weight);
714 fit_y_trackdxdz->Fill(angleX, 10.*geom_residY, weight);
715 fit_y_trackdydz->Fill(angleY, 10.*geom_residY, weight);
718 hist_dxdz->Fill(1000.*(resslopeX - geom_resslopeX +
value(
kAlignPhiY)), weight);
719 hist_dxdz_trackx->Fill(positionX, 1000.*resslopeX, weight);
720 hist_dxdz_tracky->Fill(positionY, 1000.*resslopeX, weight);
721 hist_dxdz_trackdxdz->Fill(angleX, 1000.*resslopeX, weight);
722 hist_dxdz_trackdydz->Fill(angleY, 1000.*resslopeX, weight);
723 fit_dxdz_trackx->Fill(positionX, 1000.*geom_resslopeX, weight);
724 fit_dxdz_tracky->Fill(positionY, 1000.*geom_resslopeX, weight);
725 fit_dxdz_trackdxdz->Fill(angleX, 1000.*geom_resslopeX, weight);
726 fit_dxdz_trackdydz->Fill(angleY, 1000.*geom_resslopeX, weight);
729 hist_dydz->Fill(1000.*(resslopeY - geom_resslopeY -
value(
kAlignPhiX)), weight);
730 hist_dydz_trackx->Fill(positionX, 1000.*resslopeY, weight);
731 hist_dydz_tracky->Fill(positionY, 1000.*resslopeY, weight);
732 hist_dydz_trackdxdz->Fill(angleX, 1000.*resslopeY, weight);
733 hist_dydz_trackdydz->Fill(angleY, 1000.*resslopeY, weight);
734 fit_dydz_trackx->Fill(positionX, 1000.*geom_resslopeY, weight);
735 fit_dydz_tracky->Fill(positionY, 1000.*geom_resslopeY, weight);
736 fit_dydz_trackdxdz->Fill(angleX, 1000.*geom_resslopeY, weight);
737 fit_dydz_trackdydz->Fill(angleY, 1000.*geom_resslopeY, weight);
740 hist_x_raw->Fill(10.*residX);
741 hist_y_raw->Fill(10.*residY);
742 hist_dxdz_raw->Fill(1000.*resslopeX);
743 hist_dydz_raw->Fill(1000.*resslopeY);
744 if (fabs(resslopeX) < 0.005) hist_x_cut->Fill(10.*residX);
745 if (fabs(resslopeY) < 0.030) hist_y_cut->Fill(10.*residY);
750 for (
int i = 1;
i <= hist_x->GetNbinsX();
i++) {
751 double xi = hist_x->GetBinCenter(
i);
752 double yi = hist_x->GetBinContent(
i);
753 double yerri = hist_x->GetBinError(
i);
754 double yth = fit_x->Eval(xi);
756 chi2 +=
pow((yth - yi)/yerri, 2);
760 for (
int i = 1;
i <= hist_y->GetNbinsX();
i++) {
761 double xi = hist_y->GetBinCenter(
i);
762 double yi = hist_y->GetBinContent(
i);
763 double yerri = hist_y->GetBinError(
i);
764 double yth = fit_y->Eval(xi);
766 chi2 +=
pow((yth - yi)/yerri, 2);
770 for (
int i = 1;
i <= hist_dxdz->GetNbinsX();
i++) {
771 double xi = hist_dxdz->GetBinCenter(
i);
772 double yi = hist_dxdz->GetBinContent(
i);
773 double yerri = hist_dxdz->GetBinError(
i);
774 double yth = fit_dxdz->Eval(xi);
776 chi2 +=
pow((yth - yi)/yerri, 2);
780 for (
int i = 1;
i <= hist_dydz->GetNbinsX();
i++) {
781 double xi = hist_dydz->GetBinCenter(
i);
782 double yi = hist_dydz->GetBinContent(
i);
783 double yerri = hist_dydz->GetBinError(
i);
784 double yth = fit_dydz->Eval(xi);
786 chi2 +=
pow((yth - yi)/yerri, 2);
792 return (ndof > 0. ? chi2 / ndof : -1.);
align::Scalar width() const
Double_t MuonResidualsFitter_powerLawTails_TF1(Double_t *xvec, Double_t *par)
int residualsModel() const
Double_t MuonResidualsFitter_GaussPowerTails_TF1(Double_t *xvec, Double_t *par)
T * make(const Args &...args) const
make new ROOT object
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Double_t MuonResidualsFitter_pureGaussian_TF1(Double_t *xvec, Double_t *par)
align::Scalar length() const
double errorerror(int parNum)
std::vector< double * >::const_iterator residuals_end() const
Double_t MuonResidualsFitter_ROOTVoigt_TF1(Double_t *xvec, Double_t *par)
std::vector< double * >::const_iterator residuals_begin() const
Power< A, B >::type pow(const A &a, const B &b)