14 TH2F tmp_dead_pixels(*
static_cast<TH2F*
>(
input->Clone(
"tmp_dead_pixels")));
15 tmp_dead_pixels.Reset();
18 deadpixels_output.SetName(Form(
"deadpixels_%s",deadpixels_output.GetName()));
19 deadpixels_output.SetTitle(Form(
"dead pixels, %s",deadpixels_output.GetTitle()));
20 deadpixels_output.Reset();
22 auto maxHitValue=
input->GetMaximum();
25 for(
int col_ID=1; col_ID<=
input->GetNbinsY(); col_ID++)
27 for(
int row_ID=1; row_ID<=
input->GetNbinsX(); row_ID++)
29 if(
input->GetBinContent(row_ID, col_ID)==0 )
34 int inactive_pixels_around=0;
37 for(
auto legpix : legit_pixels)
39 sum_neighbours+=
input->GetBinContent(legpix.first, legpix.second);
40 if(
input->GetBinContent(legpix.first, legpix.second)<1) ++inactive_pixels_around;
45 deadpixels_output.Fill(row_ID, col_ID);
46 tmp_dead_pixels.SetBinContent(row_ID,col_ID, 1);
57 for(
int col_ID=1; col_ID<=
input->GetNbinsY(); col_ID++)
59 for(
int row_ID=1; row_ID<=
input->GetNbinsX(); row_ID++)
61 if(tmp_dead_pixels.GetBinContent(row_ID,col_ID)==0 &&
input->GetBinContent(row_ID, col_ID)==0)
66 int inactive_pixels_around=0;
67 int dead_pixels_around=0;
70 for(
auto legpix : legit_pixels)
72 sum_neighbours+=
input->GetBinContent(legpix.first, legpix.second);
73 if(
input->GetBinContent(legpix.first, legpix.second)<1) ++inactive_pixels_around;
75 if(tmp_dead_pixels.GetBinContent(legpix.first, legpix.second)>0) dead_pixels_around++;
81 deadpixels_output.Fill(row_ID, col_ID);
82 tmp_dead_pixels.SetBinContent(row_ID,col_ID, 1);
96 std::vector<std::pair<int,int>> legit_pixels={};
98 for(
int r=-1;
r<2;
r++)
100 for(
int c=-1;
c<2;
c++)
102 if( (row_ID+
r)>=1 && (col_ID+
c)>=1 && (col_ID+
c)<=
input->GetNbinsY() && (row_ID+
r)<=
input->GetNbinsX() && (
r!=0 ||
c!=0))
104 legit_pixels.push_back(std::pair<int,int>(row_ID+
r,col_ID+
c));
115 if( row_ID!=
input->GetNbinsX() && row_ID!=1 && col_ID!=1 && col_ID!=
input->GetNbinsY())
return 8.;
116 else if( (row_ID==
input->GetNbinsX() || row_ID==1) && (col_ID==1 || col_ID==
input->GetNbinsY()))
return 3.;