446 double mean_residualx = 0., mean_residualy = 0., mean_resslopex = 0., mean_resslopey = 0.;
447 double mean_trackx = 0., mean_tracky = 0., mean_trackdxdz = 0., mean_trackdydz = 0.;
451 const double redchi2 = (*rit)[
kRedChi2];
452 double weight = 1. / redchi2;
458 double factor_w = 1. / (sum_w +
weight);
459 mean_residualx = factor_w * (sum_w * mean_residualx +
weight * (*rit)[
kResidX]);
460 mean_residualy = factor_w * (sum_w * mean_residualy +
weight * (*rit)[
kResidY]);
461 mean_resslopex = factor_w * (sum_w * mean_resslopex +
weight * (*rit)[
kResSlopeX]);
462 mean_resslopey = factor_w * (sum_w * mean_resslopey +
weight * (*rit)[
kResSlopeY]);
463 mean_trackx = factor_w * (sum_w * mean_trackx +
weight * (*rit)[
kPositionX]);
464 mean_tracky = factor_w * (sum_w * mean_tracky +
weight * (*rit)[
kPositionY]);
465 mean_trackdxdz = factor_w * (sum_w * mean_trackdxdz +
weight * (*rit)[
kAngleX]);
466 mean_trackdydz = factor_w * (sum_w * mean_trackdydz +
weight * (*rit)[
kAngleY]);
471 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,
472 name_y_cut, name_alphax, name_alphay;
473 std::string name_x_trackx, name_y_trackx, name_dxdz_trackx, name_dydz_trackx;
474 std::string name_x_tracky, name_y_tracky, name_dxdz_tracky, name_dydz_tracky;
475 std::string name_x_trackdxdz, name_y_trackdxdz, name_dxdz_trackdxdz, name_dydz_trackdxdz;
476 std::string name_x_trackdydz, name_y_trackdydz, name_dxdz_trackdydz, name_dydz_trackdydz;
478 name_x =
name +
"_x";
479 name_y =
name +
"_y";
480 name_dxdz =
name +
"_dxdz";
481 name_dydz =
name +
"_dydz";
482 name_x_raw =
name +
"_x_raw";
483 name_y_raw =
name +
"_y_raw";
484 name_dxdz_raw =
name +
"_dxdz_raw";
485 name_dydz_raw =
name +
"_dydz_raw";
486 name_x_cut =
name +
"_x_cut";
487 name_y_cut =
name +
"_y_cut";
488 name_alphax =
name +
"_alphax";
489 name_alphay =
name +
"_alphay";
490 name_x_trackx =
name +
"_x_trackx";
491 name_y_trackx =
name +
"_y_trackx";
492 name_dxdz_trackx =
name +
"_dxdz_trackx";
493 name_dydz_trackx =
name +
"_dydz_trackx";
494 name_x_tracky =
name +
"_x_tracky";
495 name_y_tracky =
name +
"_y_tracky";
496 name_dxdz_tracky =
name +
"_dxdz_tracky";
497 name_dydz_tracky =
name +
"_dydz_tracky";
498 name_x_trackdxdz =
name +
"_x_trackdxdz";
499 name_y_trackdxdz =
name +
"_y_trackdxdz";
500 name_dxdz_trackdxdz =
name +
"_dxdz_trackdxdz";
501 name_dydz_trackdxdz =
name +
"_dydz_trackdxdz";
502 name_x_trackdydz =
name +
"_x_trackdydz";
503 name_y_trackdydz =
name +
"_y_trackdydz";
504 name_dxdz_trackdydz =
name +
"_dxdz_trackdydz";
505 name_dydz_trackdydz =
name +
"_dydz_trackdydz";
510 double min_x = -100., max_x = 100.;
511 double min_y = -100., max_y = 100.;
512 double min_dxdz = -75., max_dxdz = 75.;
513 double min_dydz = -150., max_dydz = 150.;
514 double min_trackx = -
width / 2., max_trackx =
width / 2.;
515 double min_tracky = -length / 2., max_tracky = length / 2.;
516 double min_trackdxdz = -1.5, max_trackdxdz = 1.5;
517 double min_trackdydz = -1.5, max_trackdydz = 1.5;
519 TH1F *hist_x =
dir->make<TH1F>(name_x.c_str(),
"",
bins, min_x, max_x);
520 TH1F *hist_y =
dir->make<TH1F>(name_y.c_str(),
"",
bins, min_y, max_y);
521 TH1F *hist_dxdz =
dir->make<TH1F>(name_dxdz.c_str(),
"",
bins, min_dxdz, max_dxdz);
522 TH1F *hist_dydz =
dir->make<TH1F>(name_dydz.c_str(),
"",
bins, min_dydz, max_dydz);
523 TH1F *hist_x_raw =
dir->make<TH1F>(name_x_raw.c_str(),
"",
bins, min_x, max_x);
524 TH1F *hist_y_raw =
dir->make<TH1F>(name_y_raw.c_str(),
"",
bins, min_y, max_y);
525 TH1F *hist_dxdz_raw =
dir->make<TH1F>(name_dxdz_raw.c_str(),
"",
bins, min_dxdz, max_dxdz);
526 TH1F *hist_dydz_raw =
dir->make<TH1F>(name_dydz_raw.c_str(),
"",
bins, min_dydz, max_dydz);
527 TH1F *hist_x_cut =
dir->make<TH1F>(name_x_cut.c_str(),
"",
bins, min_x, max_x);
528 TH1F *hist_y_cut =
dir->make<TH1F>(name_y_cut.c_str(),
"",
bins, min_y, max_y);
529 TH2F *hist_alphax =
dir->make<TH2F>(name_alphax.c_str(),
"", 50, 50, 50, 50, -50., 50.);
530 TH2F *hist_alphay =
dir->make<TH2F>(name_alphay.c_str(),
"", 75, 100, 100, 75, -75., 75.);
532 TProfile *hist_x_trackx =
dir->make<TProfile>(name_x_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_x, max_x);
533 TProfile *hist_y_trackx =
dir->make<TProfile>(name_y_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_y, max_y);
534 TProfile *hist_dxdz_trackx =
535 dir->make<TProfile>(name_dxdz_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_dxdz, max_dxdz);
536 TProfile *hist_dydz_trackx =
537 dir->make<TProfile>(name_dydz_trackx.c_str(),
"", 50, min_trackx, max_trackx, min_dydz, max_dydz);
538 TProfile *hist_x_tracky =
dir->make<TProfile>(name_x_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_x, max_x);
539 TProfile *hist_y_tracky =
dir->make<TProfile>(name_y_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_y, max_y);
540 TProfile *hist_dxdz_tracky =
541 dir->make<TProfile>(name_dxdz_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_dxdz, max_dxdz);
542 TProfile *hist_dydz_tracky =
543 dir->make<TProfile>(name_dydz_tracky.c_str(),
"", 50, min_tracky, max_tracky, min_dydz, max_dydz);
544 TProfile *hist_x_trackdxdz =
545 dir->make<TProfile>(name_x_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_x, max_x);
546 TProfile *hist_y_trackdxdz =
547 dir->make<TProfile>(name_y_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_y, max_y);
548 TProfile *hist_dxdz_trackdxdz =
549 dir->make<TProfile>(name_dxdz_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_dxdz, max_dxdz);
550 TProfile *hist_dydz_trackdxdz =
551 dir->make<TProfile>(name_dydz_trackdxdz.c_str(),
"", 250, min_trackdxdz, max_trackdxdz, min_dydz, max_dydz);
552 TProfile *hist_x_trackdydz =
553 dir->make<TProfile>(name_x_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_x, max_x);
554 TProfile *hist_y_trackdydz =
555 dir->make<TProfile>(name_y_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_y, max_y);
556 TProfile *hist_dxdz_trackdydz =
557 dir->make<TProfile>(name_dxdz_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_dxdz, max_dxdz);
558 TProfile *hist_dydz_trackdydz =
559 dir->make<TProfile>(name_dydz_trackdydz.c_str(),
"", 250, min_trackdydz, max_trackdydz, min_dydz, max_dydz);
561 hist_x_trackx->SetAxisRange(-10., 10.,
"Y");
562 hist_y_trackx->SetAxisRange(-20., 20.,
"Y");
563 hist_dxdz_trackx->SetAxisRange(-10., 10.,
"Y");
564 hist_dydz_trackx->SetAxisRange(-20., 20.,
"Y");
565 hist_x_tracky->SetAxisRange(-10., 10.,
"Y");
566 hist_y_tracky->SetAxisRange(-20., 20.,
"Y");
567 hist_dxdz_tracky->SetAxisRange(-10., 10.,
"Y");
568 hist_dydz_tracky->SetAxisRange(-20., 20.,
"Y");
569 hist_x_trackdxdz->SetAxisRange(-10., 10.,
"Y");
570 hist_y_trackdxdz->SetAxisRange(-20., 20.,
"Y");
571 hist_dxdz_trackdxdz->SetAxisRange(-10., 10.,
"Y");
572 hist_dydz_trackdxdz->SetAxisRange(-20., 20.,
"Y");
573 hist_x_trackdydz->SetAxisRange(-10., 10.,
"Y");
574 hist_y_trackdydz->SetAxisRange(-20., 20.,
"Y");
575 hist_dxdz_trackdydz->SetAxisRange(-10., 10.,
"Y");
576 hist_dydz_trackdydz->SetAxisRange(-20., 20.,
"Y");
582 name_alphax +=
"_fit";
583 name_alphay +=
"_fit";
584 name_x_trackx +=
"_fit";
585 name_y_trackx +=
"_fit";
586 name_dxdz_trackx +=
"_fit";
587 name_dydz_trackx +=
"_fit";
588 name_x_tracky +=
"_fit";
589 name_y_tracky +=
"_fit";
590 name_dxdz_tracky +=
"_fit";
591 name_dydz_tracky +=
"_fit";
592 name_x_trackdxdz +=
"_fit";
593 name_y_trackdxdz +=
"_fit";
594 name_dxdz_trackdxdz +=
"_fit";
595 name_dydz_trackdxdz +=
"_fit";
596 name_x_trackdydz +=
"_fit";
597 name_y_trackdydz +=
"_fit";
598 name_dxdz_trackdydz +=
"_fit";
599 name_dydz_trackdydz +=
"_fit";
601 TF1 *fit_x =
nullptr;
602 TF1 *fit_y =
nullptr;
603 TF1 *fit_dxdz =
nullptr;
604 TF1 *fit_dydz =
nullptr;
609 fit_x->SetParErrors(er_x);
613 fit_y->SetParErrors(er_y);
615 fit_dxdz->SetParameters(
618 fit_dxdz->SetParErrors(er_dxdz);
620 fit_dydz->SetParameters(
623 fit_dydz->SetParErrors(er_dydz);
626 fit_x->SetParameters(sum_of_weights * (max_x - min_x) /
bins,
631 fit_y->SetParameters(sum_of_weights * (max_y - min_y) /
bins,
636 fit_dxdz->SetParameters(sum_of_weights * (max_dxdz - min_dxdz) /
bins,
641 fit_dydz->SetParameters(sum_of_weights * (max_dydz - min_dydz) /
bins,
647 fit_x->SetParameters(sum_of_weights * (max_x - min_x) /
bins,
652 fit_y->SetParameters(sum_of_weights * (max_y - min_y) /
bins,
657 fit_dxdz->SetParameters(sum_of_weights * (max_dxdz - min_dxdz) /
bins,
662 fit_dydz->SetParameters(sum_of_weights * (max_dydz - min_dydz) /
bins,
672 fit_dxdz->SetParameters(
675 fit_dydz->SetParameters(
681 fit_x->SetLineColor(2);
682 fit_x->SetLineWidth(2);
684 fit_y->SetLineColor(2);
685 fit_y->SetLineWidth(2);
687 fit_dxdz->SetLineColor(2);
688 fit_dxdz->SetLineWidth(2);
690 fit_dydz->SetLineColor(2);
691 fit_dydz->SetLineWidth(2);
694 TF1 *fit_alphax =
new TF1(name_alphax.c_str(),
"[0] + x*[1]", min_dxdz, max_dxdz);
695 TF1 *fit_alphay =
new TF1(name_alphay.c_str(),
"[0] + x*[1]", min_dydz, max_dydz);
703 bX = 1. / (
sy /
sx *
r);
704 aX = -bX * mean_resslopex;
712 bY = 1. / (
sy /
sx *
r);
713 aY = -bY * mean_resslopey;
716 fit_alphax->SetParameters(aX, bX);
717 fit_alphay->SetParameters(aY, bY);
719 fit_alphax->SetLineColor(2);
720 fit_alphax->SetLineWidth(2);
722 fit_alphay->SetLineColor(2);
723 fit_alphay->SetLineWidth(2);
726 TProfile *fit_x_trackx =
dir->make<TProfile>(name_x_trackx.c_str(),
"", 100, min_trackx, max_trackx);
727 TProfile *fit_y_trackx =
dir->make<TProfile>(name_y_trackx.c_str(),
"", 100, min_trackx, max_trackx);
728 TProfile *fit_dxdz_trackx =
dir->make<TProfile>(name_dxdz_trackx.c_str(),
"", 100, min_trackx, max_trackx);
729 TProfile *fit_dydz_trackx =
dir->make<TProfile>(name_dydz_trackx.c_str(),
"", 100, min_trackx, max_trackx);
730 TProfile *fit_x_tracky =
dir->make<TProfile>(name_x_tracky.c_str(),
"", 100, min_tracky, max_tracky);
731 TProfile *fit_y_tracky =
dir->make<TProfile>(name_y_tracky.c_str(),
"", 100, min_tracky, max_tracky);
732 TProfile *fit_dxdz_tracky =
dir->make<TProfile>(name_dxdz_tracky.c_str(),
"", 100, min_tracky, max_tracky);
733 TProfile *fit_dydz_tracky =
dir->make<TProfile>(name_dydz_tracky.c_str(),
"", 100, min_tracky, max_tracky);
734 TProfile *fit_x_trackdxdz =
dir->make<TProfile>(name_x_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
735 TProfile *fit_y_trackdxdz =
dir->make<TProfile>(name_y_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
736 TProfile *fit_dxdz_trackdxdz =
737 dir->make<TProfile>(name_dxdz_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
738 TProfile *fit_dydz_trackdxdz =
739 dir->make<TProfile>(name_dydz_trackdxdz.c_str(),
"", 500, min_trackdxdz, max_trackdxdz);
740 TProfile *fit_x_trackdydz =
dir->make<TProfile>(name_x_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
741 TProfile *fit_y_trackdydz =
dir->make<TProfile>(name_y_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
742 TProfile *fit_dxdz_trackdydz =
743 dir->make<TProfile>(name_dxdz_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
744 TProfile *fit_dydz_trackdydz =
745 dir->make<TProfile>(name_dydz_trackdydz.c_str(),
"", 500, min_trackdydz, max_trackdydz);
747 fit_x_trackx->SetLineColor(2);
748 fit_x_trackx->SetLineWidth(2);
749 fit_y_trackx->SetLineColor(2);
750 fit_y_trackx->SetLineWidth(2);
751 fit_dxdz_trackx->SetLineColor(2);
752 fit_dxdz_trackx->SetLineWidth(2);
753 fit_dydz_trackx->SetLineColor(2);
754 fit_dydz_trackx->SetLineWidth(2);
755 fit_x_tracky->SetLineColor(2);
756 fit_x_tracky->SetLineWidth(2);
757 fit_y_tracky->SetLineColor(2);
758 fit_y_tracky->SetLineWidth(2);
759 fit_dxdz_tracky->SetLineColor(2);
760 fit_dxdz_tracky->SetLineWidth(2);
761 fit_dydz_tracky->SetLineColor(2);
762 fit_dydz_tracky->SetLineWidth(2);
763 fit_x_trackdxdz->SetLineColor(2);
764 fit_x_trackdxdz->SetLineWidth(2);
765 fit_y_trackdxdz->SetLineColor(2);
766 fit_y_trackdxdz->SetLineWidth(2);
767 fit_dxdz_trackdxdz->SetLineColor(2);
768 fit_dxdz_trackdxdz->SetLineWidth(2);
769 fit_dydz_trackdxdz->SetLineColor(2);
770 fit_dydz_trackdxdz->SetLineWidth(2);
771 fit_x_trackdydz->SetLineColor(2);
772 fit_x_trackdydz->SetLineWidth(2);
773 fit_y_trackdydz->SetLineColor(2);
774 fit_y_trackdydz->SetLineWidth(2);
775 fit_dxdz_trackdydz->SetLineColor(2);
776 fit_dxdz_trackdydz->SetLineWidth(2);
777 fit_dydz_trackdydz->SetLineColor(2);
778 fit_dydz_trackdydz->SetLineWidth(2);
780 name_x_trackx +=
"line";
781 name_y_trackx +=
"line";
782 name_dxdz_trackx +=
"line";
783 name_dydz_trackx +=
"line";
784 name_x_tracky +=
"line";
785 name_y_tracky +=
"line";
786 name_dxdz_tracky +=
"line";
787 name_dydz_tracky +=
"line";
788 name_x_trackdxdz +=
"line";
789 name_y_trackdxdz +=
"line";
790 name_dxdz_trackdxdz +=
"line";
791 name_dydz_trackdxdz +=
"line";
792 name_x_trackdydz +=
"line";
793 name_y_trackdydz +=
"line";
794 name_dxdz_trackdydz +=
"line";
795 name_dydz_trackdydz +=
"line";
797 TF1 *fitline_x_trackx =
new TF1(name_x_trackx.c_str(), residual_x_trackx_TF1, min_trackx, max_trackx, 14);
798 TF1 *fitline_y_trackx =
new TF1(name_y_trackx.c_str(), residual_y_trackx_TF1, min_trackx, max_trackx, 14);
799 TF1 *fitline_dxdz_trackx =
new TF1(name_dxdz_trackx.c_str(), residual_dxdz_trackx_TF1, min_trackx, max_trackx, 14);
800 TF1 *fitline_dydz_trackx =
new TF1(name_dydz_trackx.c_str(), residual_dydz_trackx_TF1, min_trackx, max_trackx, 14);
801 TF1 *fitline_x_tracky =
new TF1(name_x_tracky.c_str(), residual_x_tracky_TF1, min_tracky, max_tracky, 14);
802 TF1 *fitline_y_tracky =
new TF1(name_y_tracky.c_str(), residual_y_tracky_TF1, min_tracky, max_tracky, 14);
803 TF1 *fitline_dxdz_tracky =
new TF1(name_dxdz_tracky.c_str(), residual_dxdz_tracky_TF1, min_tracky, max_tracky, 14);
804 TF1 *fitline_dydz_tracky =
new TF1(name_dydz_tracky.c_str(), residual_dydz_tracky_TF1, min_tracky, max_tracky, 14);
805 TF1 *fitline_x_trackdxdz =
806 new TF1(name_x_trackdxdz.c_str(), residual_x_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
807 TF1 *fitline_y_trackdxdz =
808 new TF1(name_y_trackdxdz.c_str(), residual_y_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
809 TF1 *fitline_dxdz_trackdxdz =
810 new TF1(name_dxdz_trackdxdz.c_str(), residual_dxdz_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
811 TF1 *fitline_dydz_trackdxdz =
812 new TF1(name_dydz_trackdxdz.c_str(), residual_dydz_trackdxdz_TF1, min_trackdxdz, max_trackdxdz, 14);
813 TF1 *fitline_x_trackdydz =
814 new TF1(name_x_trackdydz.c_str(), residual_x_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
815 TF1 *fitline_y_trackdydz =
816 new TF1(name_y_trackdydz.c_str(), residual_y_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
817 TF1 *fitline_dxdz_trackdydz =
818 new TF1(name_dxdz_trackdydz.c_str(), residual_dxdz_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
819 TF1 *fitline_dydz_trackdydz =
820 new TF1(name_dydz_trackdydz.c_str(), residual_dydz_trackdydz_TF1, min_trackdydz, max_trackdydz, 14);
822 std::vector<TF1 *> fitlines;
823 fitlines.push_back(fitline_x_trackx);
824 fitlines.push_back(fitline_y_trackx);
825 fitlines.push_back(fitline_dxdz_trackx);
826 fitlines.push_back(fitline_dydz_trackx);
827 fitlines.push_back(fitline_x_tracky);
828 fitlines.push_back(fitline_y_tracky);
829 fitlines.push_back(fitline_dxdz_tracky);
830 fitlines.push_back(fitline_dydz_tracky);
831 fitlines.push_back(fitline_x_trackdxdz);
832 fitlines.push_back(fitline_y_trackdxdz);
833 fitlines.push_back(fitline_dxdz_trackdxdz);
834 fitlines.push_back(fitline_dydz_trackdxdz);
835 fitlines.push_back(fitline_x_trackdydz);
836 fitlines.push_back(fitline_y_trackdydz);
837 fitlines.push_back(fitline_dxdz_trackdydz);
838 fitlines.push_back(fitline_dydz_trackdydz);
855 fitparameters[10] = fitparameters[12] = 0.;
857 for (std::vector<TF1 *>::const_iterator itr = fitlines.begin(); itr != fitlines.end(); itr++) {
858 (*itr)->SetParameters(fitparameters);
859 (*itr)->SetLineColor(2);
860 (*itr)->SetLineWidth(2);
865 const double residX = (*resiter)[
kResidX];
866 const double residY = (*resiter)[
kResidY];
867 const double resslopeX = (*resiter)[
kResSlopeX];
868 const double resslopeY = (*resiter)[
kResSlopeY];
869 const double positionX = (*resiter)[
kPositionX];
870 const double positionY = (*resiter)[
kPositionY];
871 const double angleX = (*resiter)[
kAngleX];
872 const double angleY = (*resiter)[
kAngleY];
873 const double redchi2 = (*resiter)[
kRedChi2];
874 double weight = 1. / redchi2;
880 hist_alphax->Fill(1000. * resslopeX, 10. * residX);
881 hist_alphay->Fill(1000. * resslopeY, 10. * residY);
899 hist_x_trackx->Fill(positionX, 10. * residX,
weight);
900 hist_x_tracky->Fill(positionY, 10. * residX,
weight);
901 hist_x_trackdxdz->Fill(angleX, 10. * residX,
weight);
902 hist_x_trackdydz->Fill(angleY, 10. * residX,
weight);
903 fit_x_trackx->Fill(positionX, 10. * geom_residX,
weight);
904 fit_x_tracky->Fill(positionY, 10. * geom_residX,
weight);
905 fit_x_trackdxdz->Fill(angleX, 10. * geom_residX,
weight);
906 fit_x_trackdydz->Fill(angleY, 10. * geom_residX,
weight);
921 hist_y_trackx->Fill(positionX, 10. * residY,
weight);
922 hist_y_tracky->Fill(positionY, 10. * residY,
weight);
923 hist_y_trackdxdz->Fill(angleX, 10. * residY,
weight);
924 hist_y_trackdydz->Fill(angleY, 10. * residY,
weight);
925 fit_y_trackx->Fill(positionX, 10. * geom_residY,
weight);
926 fit_y_tracky->Fill(positionY, 10. * geom_residY,
weight);
927 fit_y_trackdxdz->Fill(angleX, 10. * geom_residY,
weight);
928 fit_y_trackdydz->Fill(angleY, 10. * geom_residY,
weight);
941 hist_dxdz_trackx->Fill(positionX, 1000. * resslopeX,
weight);
942 hist_dxdz_tracky->Fill(positionY, 1000. * resslopeX,
weight);
943 hist_dxdz_trackdxdz->Fill(angleX, 1000. * resslopeX,
weight);
944 hist_dxdz_trackdydz->Fill(angleY, 1000. * resslopeX,
weight);
945 fit_dxdz_trackx->Fill(positionX, 1000. * geom_resslopeX,
weight);
946 fit_dxdz_tracky->Fill(positionY, 1000. * geom_resslopeX,
weight);
947 fit_dxdz_trackdxdz->Fill(angleX, 1000. * geom_resslopeX,
weight);
948 fit_dxdz_trackdydz->Fill(angleY, 1000. * geom_resslopeX,
weight);
961 hist_dydz_trackx->Fill(positionX, 1000. * resslopeY,
weight);
962 hist_dydz_tracky->Fill(positionY, 1000. * resslopeY,
weight);
963 hist_dydz_trackdxdz->Fill(angleX, 1000. * resslopeY,
weight);
964 hist_dydz_trackdydz->Fill(angleY, 1000. * resslopeY,
weight);
965 fit_dydz_trackx->Fill(positionX, 1000. * geom_resslopeY,
weight);
966 fit_dydz_tracky->Fill(positionY, 1000. * geom_resslopeY,
weight);
967 fit_dydz_trackdxdz->Fill(angleX, 1000. * geom_resslopeY,
weight);
968 fit_dydz_trackdydz->Fill(angleY, 1000. * geom_resslopeY,
weight);
971 hist_x_raw->Fill(10. * residX);
972 hist_y_raw->Fill(10. * residY);
973 hist_dxdz_raw->Fill(1000. * resslopeX);
974 hist_dydz_raw->Fill(1000. * resslopeY);
975 if (fabs(resslopeX) < 0.005)
976 hist_x_cut->Fill(10. * residX);
977 if (fabs(resslopeY) < 0.030)
978 hist_y_cut->Fill(10. * residY);
983 for (
int i = 1;
i <= hist_x->GetNbinsX();
i++) {
984 double xi = hist_x->GetBinCenter(
i);
985 double yi = hist_x->GetBinContent(
i);
986 double yerri = hist_x->GetBinError(
i);
987 double yth = fit_x->Eval(
xi);
989 chi2 +=
pow((yth - yi) / yerri, 2);
993 for (
int i = 1;
i <= hist_y->GetNbinsX();
i++) {
994 double xi = hist_y->GetBinCenter(
i);
995 double yi = hist_y->GetBinContent(
i);
996 double yerri = hist_y->GetBinError(
i);
997 double yth = fit_y->Eval(
xi);
999 chi2 +=
pow((yth - yi) / yerri, 2);
1003 for (
int i = 1;
i <= hist_dxdz->GetNbinsX();
i++) {
1004 double xi = hist_dxdz->GetBinCenter(
i);
1005 double yi = hist_dxdz->GetBinContent(
i);
1006 double yerri = hist_dxdz->GetBinError(
i);
1007 double yth = fit_dxdz->Eval(
xi);
1009 chi2 +=
pow((yth - yi) / yerri, 2);
1013 for (
int i = 1;
i <= hist_dydz->GetNbinsX();
i++) {
1014 double xi = hist_dydz->GetBinCenter(
i);
1015 double yi = hist_dydz->GetBinContent(
i);
1016 double yerri = hist_dydz->GetBinError(
i);
1017 double yth = fit_dydz->Eval(
xi);
1019 chi2 +=
pow((yth - yi) / yerri, 2);
Double_t MuonResidualsFitter_powerLawTails_TF1(Double_t *xvec, Double_t *par)
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
int residualsModel() const
std::vector< double * >::const_iterator residuals_begin() const
align::Scalar width() const
std::vector< double * >::const_iterator residuals_end() const
double sumofweights() override
Double_t MuonResidualsFitter_GaussPowerTails_TF1(Double_t *xvec, Double_t *par)
Double_t MuonResidualsFitter_pureGaussian_TF1(Double_t *xvec, Double_t *par)
double errorerror(int parNum)
align::Scalar length() const
Double_t MuonResidualsFitter_ROOTVoigt_TF1(Double_t *xvec, Double_t *par)