ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_NoisyPixelTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 <string_view>
18#include <vector>
19#include <memory>
20#include <tuple>
21#include <utility>
22
24public:
25 AFP_NoisyPixelTool() : m_threshNoisy(1.4), m_threshLEff(0.6), m_sensitivity(0.0), m_methods({"2_ROW","2_COL"}) {}
26
27 int Identify(std::shared_ptr<const TH2F> input, std::vector<TH2F>& output) const override;
28
29 std::vector<std::vector<double>> makeFits(std::shared_ptr<const TH2F> input) const;
30
31 void setThreshNoisy(double t) {m_threshNoisy=t;}
32 double getThreshNoisy() const {return m_threshNoisy;}
33
34 void setThreshLeff(double t) {m_threshLEff=t;}
35 double getThreshLeff() const {return m_threshLEff;}
36
37 void setSensitivity(double s) {m_sensitivity=s;}
38 double getSensitivity() const {return m_sensitivity;}
39
40 void setMethods(const std::vector<std::string>& m) {m_methods=m;}
41 const std::vector<std::string>& getMethods() const {return m_methods;}
42
43private:
44
45 double m_threshNoisy; // Minimum efficiency of pixels to be classified as noisy
46 double m_threshLEff; // Maximum efficiency of pixels to be classified as low efficiency
47 double m_sensitivity; // with higher value, the algorithm will be more prone to find noisy pixels near low efficiency ones
48
49 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\""};
50
51 std::vector<std::pair<int,int>> getLegitPixels(std::shared_ptr<const TH2F> input, const int col_ID, const int row_ID, std::string_view method = "8_PIX") const;
52
53 TH2F countInactivePixelsAround(std::shared_ptr<const TH2F> input) const;
54 double getNeighbours(std::shared_ptr<const TH2F> input, int row_ID, int col_ID) const;
55 std::tuple<TH2F,TH2F,TH2F,TH2F> findLEffAndNoisyPixels(std::shared_ptr<const TH2F> input, const TH2F& inact, const std::string& method) const;
56 void filterLEffPixelsAroundNoisy(std::shared_ptr<const TH2F> input, const TH2F& inact, TH2F& fleff, TH2F& fnoisy, TH2F& eleff, TH2F& enoisy, const std::string& method) const;
57};
58
59#endif // AFP_CALIBRATION_AFP_NOISYPIXELTOOL_H
void setSensitivity(double s)
std::tuple< TH2F, TH2F, TH2F, TH2F > findLEffAndNoisyPixels(std::shared_ptr< const TH2F > input, const TH2F &inact, const std::string &method) const
std::vector< std::pair< int, int > > getLegitPixels(std::shared_ptr< const TH2F > input, const int col_ID, const int row_ID, std::string_view method="8_PIX") const
std::vector< std::vector< double > > makeFits(std::shared_ptr< const TH2F > input) const
TH2F countInactivePixelsAround(std::shared_ptr< const TH2F > input) const
const std::vector< std::string > & getMethods() const
void setMethods(const std::vector< std::string > &m)
double getNeighbours(std::shared_ptr< const TH2F > input, int row_ID, int col_ID) const
double getSensitivity() const
int Identify(std::shared_ptr< const TH2F > input, std::vector< TH2F > &output) const override
double getThreshNoisy() const
void setThreshLeff(double t)
void filterLEffPixelsAroundNoisy(std::shared_ptr< const TH2F > input, const TH2F &inact, TH2F &fleff, TH2F &fnoisy, TH2F &eleff, TH2F &enoisy, const std::string &method) const
void setThreshNoisy(double t)
std::vector< std::string > m_methods
double getThreshLeff() const
Base class for all pixel identifier tool.