ATLAS Offline Software
AFP_NoisyPixelTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef AFP_CALIBRATION_AFP_NOISYPIXELTOOL_H
6 #define AFP_CALIBRATION_AFP_NOISYPIXELTOOL_H
7 
8 // Package includes
10 
11 // ROOT includes
12 #include "TF1.h"
13 #include "TH2F.h"
14 
15 // STL includes
16 #include <string>
17 #include <vector>
18 #include <memory>
19 #include <tuple>
20 #include <utility>
21 
23 public:
24  AFP_NoisyPixelTool() : m_threshNoisy(1.4), m_threshLEff(0.6), m_sensitivity(0.0), m_methods({"2_ROW","2_COL"}) {}
25 
26  int Identify(std::shared_ptr<const TH2F> input, std::vector<TH2F>& output) const override;
27 
28  std::vector<std::vector<double>> makeFits(std::shared_ptr<const TH2F> input) const;
29 
30  void setThreshNoisy(double t) {m_threshNoisy=t;}
31  double getThreshNoisy() const {return m_threshNoisy;}
32 
33  void setThreshLeff(double t) {m_threshLEff=t;}
34  double getThreshLeff() const {return m_threshLEff;}
35 
36  void setSensitivity(double s) {m_sensitivity=s;}
37  double getSensitivity() const {return m_sensitivity;}
38 
39  void setMethods(const std::vector<std::string>& m) {m_methods=m;}
40  const std::vector<std::string>& getMethods() const {return m_methods;}
41 
42 private:
43 
44  double m_threshNoisy; // Minimum efficiency of pixels to be classified as noisy
45  double m_threshLEff; // Maximum efficiency of pixels to be classified as low efficiency
46  double m_sensitivity; // with higher value, the algorithm will be more prone to find noisy pixels near low efficiency ones
47 
48  std::vector<std::string> m_methods; // methods to be used for identification of noisy pixels; available: \"2_ROW\", \"2_COL\", \"4_PIX\", \"8_PIX\", and \"FIT\""};
49 
50  std::vector<std::pair<int,int>> getLegitPixels(std::shared_ptr<const TH2F> input, const int col_ID, const int row_ID, const std::string& method) const;
51 
52  TH2F countInactivePixelsAround(std::shared_ptr<const TH2F> input) const;
53  double getNeighbours(std::shared_ptr<const TH2F> input, int row_ID, int col_ID) const;
54  std::tuple<TH2F,TH2F,TH2F,TH2F> findLEffAndNoisyPixels(std::shared_ptr<const TH2F> input, const TH2F& inact, const std::string& method) const;
55  void filterLEffPixelsAroundNoisy(std::shared_ptr<const TH2F> input, const TH2F& inact, TH2F& fleff, TH2F& fnoisy, TH2F& eleff, TH2F& enoisy, const std::string& method) const;
56 };
57 
58 #endif // AFP_CALIBRATION_AFP_NOISYPIXELTOOL_H
RunTileTBRec.method
method
Definition: RunTileTBRec.py:73
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
AFP_NoisyPixelTool::getSensitivity
double getSensitivity() const
Definition: AFP_NoisyPixelTool.h:37
AFP_NoisyPixelTool
Definition: AFP_NoisyPixelTool.h:22
AFP_NoisyPixelTool::getMethods
const std::vector< std::string > & getMethods() const
Definition: AFP_NoisyPixelTool.h:40
AFP_NoisyPixelTool::setMethods
void setMethods(const std::vector< std::string > &m)
Definition: AFP_NoisyPixelTool.h:39
AFP_NoisyPixelTool::AFP_NoisyPixelTool
AFP_NoisyPixelTool()
Definition: AFP_NoisyPixelTool.h:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
AFP_NoisyPixelTool::getNeighbours
double getNeighbours(std::shared_ptr< const TH2F > input, int row_ID, int col_ID) const
Definition: AFP_NoisyPixelTool.cxx:214
AFP_NoisyPixelTool::makeFits
std::vector< std::vector< double > > makeFits(std::shared_ptr< const TH2F > input) const
Definition: AFP_NoisyPixelTool.cxx:367
AFP_NoisyPixelTool::getLegitPixels
std::vector< std::pair< int, int > > getLegitPixels(std::shared_ptr< const TH2F > input, const int col_ID, const int row_ID, const std::string &method) const
Definition: AFP_NoisyPixelTool.cxx:163
AFP_NoisyPixelTool::m_threshLEff
double m_threshLEff
Definition: AFP_NoisyPixelTool.h:45
AFP_NoisyPixelTool::findLEffAndNoisyPixels
std::tuple< TH2F, TH2F, TH2F, TH2F > findLEffAndNoisyPixels(std::shared_ptr< const TH2F > input, const TH2F &inact, const std::string &method) const
Definition: AFP_NoisyPixelTool.cxx:222
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
AFP_NoisyPixelTool::m_threshNoisy
double m_threshNoisy
Definition: AFP_NoisyPixelTool.h:44
AFP_NoisyPixelTool::getThreshLeff
double getThreshLeff() const
Definition: AFP_NoisyPixelTool.h:34
merge.output
output
Definition: merge.py:17
AFP_NoisyPixelTool::m_sensitivity
double m_sensitivity
Definition: AFP_NoisyPixelTool.h:46
AFP_NoisyPixelTool::countInactivePixelsAround
TH2F countInactivePixelsAround(std::shared_ptr< const TH2F > input) const
Definition: AFP_NoisyPixelTool.cxx:188
AFP_NoisyPixelTool::setThreshLeff
void setThreshLeff(double t)
Definition: AFP_NoisyPixelTool.h:33
IAFP_GenericPixelTool.h
AFP_NoisyPixelTool::getThreshNoisy
double getThreshNoisy() const
Definition: AFP_NoisyPixelTool.h:31
IAFP_GenericPixelTool
Base class for all pixel identifier tool.
Definition: IAFP_GenericPixelTool.h:17
AFP_NoisyPixelTool::setThreshNoisy
void setThreshNoisy(double t)
Definition: AFP_NoisyPixelTool.h:30
AFP_NoisyPixelTool::setSensitivity
void setSensitivity(double s)
Definition: AFP_NoisyPixelTool.h:36
AFP_NoisyPixelTool::m_methods
std::vector< std::string > m_methods
Definition: AFP_NoisyPixelTool.h:48
AFP_NoisyPixelTool::filterLEffPixelsAroundNoisy
void filterLEffPixelsAroundNoisy(std::shared_ptr< const TH2F > input, const TH2F &inact, TH2F &fleff, TH2F &fnoisy, TH2F &eleff, TH2F &enoisy, const std::string &method) const
Definition: AFP_NoisyPixelTool.cxx:291
AFP_NoisyPixelTool::Identify
int Identify(std::shared_ptr< const TH2F > input, std::vector< TH2F > &output) const override
Definition: AFP_NoisyPixelTool.cxx:7