#include #include #include #include #include #include template void _MRF_binarizeHisto_ ( ATH* histo ) ; #ifdef __MAKECINT__ #pragma link C++ function _MRF_binarizeHisto_(TH1*) ; #endif template void _MRF_binarizeHisto_ ( ATH* histo ) { if ( !histo->InheritsFrom(TH1::Class()) ) { printf("\n\n!!!ERROR!!!\n\n") ; getchar() ; exit(1) ; } if ( histo->InheritsFrom(TH2::Class()) ) { for (Int_t col=1; col<=histo->GetNbinsX(); col++) { for (Int_t row=1; row<=histo->GetNbinsY(); row++) { if ( TMath::Abs(histo->GetBinContent(col,row)) > 0. ) { histo->SetBinContent(col,row,1.) ; } } } } else { for (Int_t ibin=1; ibin<=histo->GetNbinsX(); ibin++) { if ( TMath::Abs(histo->GetBinContent(ibin)) > 0. ) { histo->SetBinContent(ibin,1.) ; } } } return ; }