ATLAS Offline Software
Loading...
Searching...
No Matches
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
23public:
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
42private:
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
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::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
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
Base class for all pixel identifier tool.