610 const int x_bins = h_conversion.GetNbinsX();
611 const int y_bins = h_conversion.GetNbinsY();
619 h_derivative_x.SetBinContent(ix,iy,
620 0.5*(h_conversion.GetBinContent(ix+1,iy)-h_conversion.GetBinContent(ix-1,iy))
621 + 0.25*(h_conversion.GetBinContent(ix+1,iy+1)-h_conversion.GetBinContent(ix-1,iy+1))
622 + 0.25*(h_conversion.GetBinContent(ix+1,iy-1)-h_conversion.GetBinContent(ix-1,iy-1)));
623 h_derivative_y.SetBinContent(ix,iy,
624 0.5*(h_conversion.GetBinContent(ix,iy+1)-h_conversion.GetBinContent(ix,iy-1))
625 + 0.25*(h_conversion.GetBinContent(ix-1,iy+1)-h_conversion.GetBinContent(ix-1,iy-1))
626 + 0.25*(h_conversion.GetBinContent(ix+1,iy+1)-h_conversion.GetBinContent(ix+1,iy-1)));
629 h_derivative_x.SetBinContent(ix,iy,
630 12*(h_conversion.GetBinContent(ix+1,iy)-h_conversion.GetBinContent(ix-1,iy))
631 + 8*(h_conversion.GetBinContent(ix+1,iy+1)-h_conversion.GetBinContent(ix-1,iy+1))
632 + 8*(h_conversion.GetBinContent(ix+1,iy-1)-h_conversion.GetBinContent(ix-1,iy-1))
633 + 2*(h_conversion.GetBinContent(ix+1,iy+2)-h_conversion.GetBinContent(ix-1,iy+2))
634 + 2*(h_conversion.GetBinContent(ix+1,iy-2)-h_conversion.GetBinContent(ix-1,iy-2))
635 + 6*(h_conversion.GetBinContent(ix+2,iy)-h_conversion.GetBinContent(ix-2,iy))
636 + 4*(h_conversion.GetBinContent(ix+2,iy+1)-h_conversion.GetBinContent(ix-2,iy+1))
637 + 4*(h_conversion.GetBinContent(ix+2,iy-1)-h_conversion.GetBinContent(ix-2,iy-1))
638 + 1*(h_conversion.GetBinContent(ix+2,iy+2)-h_conversion.GetBinContent(ix-2,iy+2))
639 + 1*(h_conversion.GetBinContent(ix+2,iy-2)-h_conversion.GetBinContent(ix-2,iy-2)));
640 h_derivative_y.SetBinContent(ix,iy,
641 12*(h_conversion.GetBinContent(ix,iy+1)-h_conversion.GetBinContent(ix,iy-1))
642 + 8*(h_conversion.GetBinContent(ix-1,iy+1)-h_conversion.GetBinContent(ix-1,iy-1))
643 + 8*(h_conversion.GetBinContent(ix+1,iy+1)-h_conversion.GetBinContent(ix+1,iy-1))
644 + 2*(h_conversion.GetBinContent(ix-2,iy+1)-h_conversion.GetBinContent(ix-2,iy-1))
645 + 2*(h_conversion.GetBinContent(ix+2,iy+1)-h_conversion.GetBinContent(ix+2,iy-1))
646 + 6*(h_conversion.GetBinContent(ix,iy+2)-h_conversion.GetBinContent(ix,iy-2))
647 + 4*(h_conversion.GetBinContent(ix-1,iy+2)-h_conversion.GetBinContent(ix-1,iy-2))
648 + 4*(h_conversion.GetBinContent(ix+1,iy+2)-h_conversion.GetBinContent(ix+1,iy-2))
649 + 1*(h_conversion.GetBinContent(ix-2,iy+2)-h_conversion.GetBinContent(ix-2,iy-2))
650 + 1*(h_conversion.GetBinContent(ix+2,iy+2)-h_conversion.GetBinContent(ix+2,iy-2)));
653 mf::LogError(
"CornerFinderAlg") <<
"Sobel derivative not supported for neighborhoods > 2.";
662 h_derivative_x.SetBinContent(ix,iy,
663 (h_conversion.GetBinContent(ix+1,iy)-h_conversion.GetBinContent(ix-1,iy)));
664 h_derivative_y.SetBinContent(ix,iy,
665 (h_conversion.GetBinContent(ix,iy+1)-h_conversion.GetBinContent(ix,iy-1)));
668 mf::LogError(
"CornerFinderAlg") <<
"Local derivative not yet supported for neighborhoods > 1.";
683 float func_blur[11][11];
684 func_blur[0][0] = 0.000000;
685 func_blur[0][1] = 0.000000;
686 func_blur[0][2] = 0.000000;
687 func_blur[0][3] = 0.000001;
688 func_blur[0][4] = 0.000002;
689 func_blur[0][5] = 0.000004;
690 func_blur[0][6] = 0.000002;
691 func_blur[0][7] = 0.000001;
692 func_blur[0][8] = 0.000000;
693 func_blur[0][9] = 0.000000;
694 func_blur[0][10] = 0.000000;
695 func_blur[1][0] = 0.000000;
696 func_blur[1][1] = 0.000000;
697 func_blur[1][2] = 0.000004;
698 func_blur[1][3] = 0.000045;
699 func_blur[1][4] = 0.000203;
700 func_blur[1][5] = 0.000335;
701 func_blur[1][6] = 0.000203;
702 func_blur[1][7] = 0.000045;
703 func_blur[1][8] = 0.000004;
704 func_blur[1][9] = 0.000000;
705 func_blur[1][10] = 0.000000;
706 func_blur[2][0] = 0.000000;
707 func_blur[2][1] = 0.000004;
708 func_blur[2][2] = 0.000123;
709 func_blur[2][3] = 0.001503;
710 func_blur[2][4] = 0.006738;
711 func_blur[2][5] = 0.011109;
712 func_blur[2][6] = 0.006738;
713 func_blur[2][7] = 0.001503;
714 func_blur[2][8] = 0.000123;
715 func_blur[2][9] = 0.000004;
716 func_blur[2][10] = 0.000000;
717 func_blur[3][0] = 0.000001;
718 func_blur[3][1] = 0.000045;
719 func_blur[3][2] = 0.001503;
720 func_blur[3][3] = 0.018316;
721 func_blur[3][4] = 0.082085;
722 func_blur[3][5] = 0.135335;
723 func_blur[3][6] = 0.082085;
724 func_blur[3][7] = 0.018316;
725 func_blur[3][8] = 0.001503;
726 func_blur[3][9] = 0.000045;
727 func_blur[3][10] = 0.000001;
728 func_blur[4][0] = 0.000002;
729 func_blur[4][1] = 0.000203;
730 func_blur[4][2] = 0.006738;
731 func_blur[4][3] = 0.082085;
732 func_blur[4][4] = 0.367879;
733 func_blur[4][5] = 0.606531;
734 func_blur[4][6] = 0.367879;
735 func_blur[4][7] = 0.082085;
736 func_blur[4][8] = 0.006738;
737 func_blur[4][9] = 0.000203;
738 func_blur[4][10] = 0.000002;
739 func_blur[5][0] = 0.000004;
740 func_blur[5][1] = 0.000335;
741 func_blur[5][2] = 0.011109;
742 func_blur[5][3] = 0.135335;
743 func_blur[5][4] = 0.606531;
744 func_blur[5][5] = 1.000000;
745 func_blur[5][6] = 0.606531;
746 func_blur[5][7] = 0.135335;
747 func_blur[5][8] = 0.011109;
748 func_blur[5][9] = 0.000335;
749 func_blur[5][10] = 0.000004;
750 func_blur[6][0] = 0.000002;
751 func_blur[6][1] = 0.000203;
752 func_blur[6][2] = 0.006738;
753 func_blur[6][3] = 0.082085;
754 func_blur[6][4] = 0.367879;
755 func_blur[6][5] = 0.606531;
756 func_blur[6][6] = 0.367879;
757 func_blur[6][7] = 0.082085;
758 func_blur[6][8] = 0.006738;
759 func_blur[6][9] = 0.000203;
760 func_blur[6][10] = 0.000002;
761 func_blur[7][0] = 0.000001;
762 func_blur[7][1] = 0.000045;
763 func_blur[7][2] = 0.001503;
764 func_blur[7][3] = 0.018316;
765 func_blur[7][4] = 0.082085;
766 func_blur[7][5] = 0.135335;
767 func_blur[7][6] = 0.082085;
768 func_blur[7][7] = 0.018316;
769 func_blur[7][8] = 0.001503;
770 func_blur[7][9] = 0.000045;
771 func_blur[7][10] = 0.000001;
772 func_blur[8][0] = 0.000000;
773 func_blur[8][1] = 0.000004;
774 func_blur[8][2] = 0.000123;
775 func_blur[8][3] = 0.001503;
776 func_blur[8][4] = 0.006738;
777 func_blur[8][5] = 0.011109;
778 func_blur[8][6] = 0.006738;
779 func_blur[8][7] = 0.001503;
780 func_blur[8][8] = 0.000123;
781 func_blur[8][9] = 0.000004;
782 func_blur[8][10] = 0.000000;
783 func_blur[9][0] = 0.000000;
784 func_blur[9][1] = 0.000000;
785 func_blur[9][2] = 0.000004;
786 func_blur[9][3] = 0.000045;
787 func_blur[9][4] = 0.000203;
788 func_blur[9][5] = 0.000335;
789 func_blur[9][6] = 0.000203;
790 func_blur[9][7] = 0.000045;
791 func_blur[9][8] = 0.000004;
792 func_blur[9][9] = 0.000000;
793 func_blur[9][10] = 0.000000;
794 func_blur[10][0] = 0.000000;
795 func_blur[10][1] = 0.000000;
796 func_blur[10][2] = 0.000000;
797 func_blur[10][3] = 0.000001;
798 func_blur[10][4] = 0.000002;
799 func_blur[10][5] = 0.000004;
800 func_blur[10][6] = 0.000002;
801 func_blur[10][7] = 0.000001;
802 func_blur[10][8] = 0.000000;
803 func_blur[10][9] = 0.000000;
804 func_blur[10][10] = 0.000000;
806 double temp_integral_x = 0;
807 double temp_integral_y = 0;
812 mf::LogWarning(
"CornerFinderAlg") <<
"WARNING...BlurNeighborhoods>10 not currently allowed. Shrinking to 10.";
816 TH2F *h_clone_derivative_x = (TH2F*)h_derivative_x.Clone(
"h_clone_derivative_x");
817 TH2F *h_clone_derivative_y = (TH2F*)h_derivative_y.Clone(
"h_clone_derivative_y");
822 for(
int ix=1; ix<=h_derivative_x.GetNbinsX(); ix++){
823 for(
int iy=1; iy<=h_derivative_y.GetNbinsY(); iy++){
830 temp_integral_x += h_clone_derivative_x->GetBinContent(jx,jy)*func_blur[(ix-jx)+5][(iy-jy)+5];
831 temp_integral_y += h_clone_derivative_y->GetBinContent(jx,jy)*func_blur[(ix-jx)+5][(iy-jy)+5];
834 h_derivative_x.SetBinContent(ix,iy,temp_integral_x);
835 h_derivative_y.SetBinContent(ix,iy,temp_integral_y);
840 delete h_clone_derivative_x;
841 delete h_clone_derivative_y;
int fDerivative_neighborhood
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::string fDerivative_method
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
int fDerivative_BlurNeighborhood