1+ // Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+ // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+ // All rights not expressly granted are reserved.
4+ //
5+ // This software is distributed under the terms of the GNU General Public
6+ // License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+ //
8+ // In applying this license CERN does not waive the privileges and immunities
9+ // granted to it by virtue of its status as an Intergovernmental Organization
10+ // or submit itself to any jurisdiction.
11+
12+ // / \file PadCalibCCDBBuilder.h
13+ // / \brief Krypton calibration
14+ // / \author Jana Crkovska
15+
16+ #ifndef O2_TRD_KRCALIBRATION_H
17+ #define O2_TRD_KRCALIBRATION_H
18+
19+ #include " DataFormatsTRD/Constants.h"
20+ #include " Rtypes.h"
21+ #include " TH2.h"
22+ #include " TTree.h"
23+ #include < cstdlib>
24+ #include < numeric>
25+ #include < vector>
26+
27+ namespace o2
28+ {
29+ namespace trd
30+ {
31+
32+ class PadCalibCCDBBuilder
33+ {
34+ public:
35+ PadCalibCCDBBuilder (){};
36+ ~PadCalibCCDBBuilder (){};
37+
38+ void CheckIfIsolatedHotPadCandidate (TH2F * hDet, std::vector<int > coordinates, float upperLimit = 1.5 , int areaContainedWithin = 4 );
39+ void CheckIfSmallerCloserToCenter (TH2F * hDet, std::vector<int > coordinates, float allowedDifference);
40+ std::vector<int > CompareGain (TH2F * hDet, int column, int row, int shiftcolumn, int shiftrow, float allowedDifference);
41+ float ComputeDetectorAverage (TH2F * hDet);
42+ float ComputeDistance (std::vector<float > pad1, std::vector<float > pad2);
43+ TH2F * CreateNormalizedMap (TH2F * hDet, TString sNewName = " " );
44+ void FillInTheGap (TH2F * hDet, int column, int row, float newGain);
45+ TH2F * FillTheMap (TH2F * hDet, TString sNewName = " " , int nbuffer = 3 );
46+ // ////////////////////////////////
47+ TH2F * FillTheMapMirror (TH2F * hDet, TString sNewName = " " , int nbuffer = 3 );
48+ TH2F * FillTheMapAverage (TH2F * hDet, TString sNewName = " " , int nbuffer = 3 );
49+ // ////////////////////////////////
50+ std::vector<std::vector<int >> FindEmpty (TH2F * hDetectorMap);
51+ std::vector<std::vector<int >> FindInhomogeneities (TH2F * hDet, float allowedDifference);
52+ float GetAverageFromNeighbors (TH2F * hDet, int column, int row, int nbuffer = 3 );
53+ TH2F * GetDetectorMap (TTree* tree, int nDet, float mingain = 0 , float maxgain = 10'000 , TString sDetName = " " );
54+ bool IsHotAreaIsolated (TH2F * hDet, int column, int row, int matrixSize = 1 );
55+ int IsolatedHotPadsContainmentSize (TH2F * hDet, int column, int row);
56+ void PopulateEmptyNormalizedMap (TH2F * hDet, float valueToSet = -1 );
57+ void RemoveEdges (TH2F * hDet, int nsize = 2 );
58+ void RemoveExtremePads (TH2F * hDet, float upperLimit = 2 ., float lowerLimit = 0.5 );
59+ void ReplacePadCloserToCenter (TH2F * hDet, int column, int row);
60+ void ReplaceIsolatedHotPads (TH2F * hDet, int column, int row, int nsize);
61+ void SetTreeBranches (TTree* tree);
62+ void SmoothenTheDetector (TH2F * hDet, float allowedDifference = 1000 );
63+ TH2F * TransformMapIntoAbsoluteValues (TH2F * hDet, TString sName = " " );
64+
65+ private:
66+ float det;
67+ float col;
68+ float row;
69+ float adc;
70+ float chi;
71+ float sgm;
72+ float amp;
73+
74+ ClassDefNV (PadCalibCCDBBuilder, 1 );
75+ };
76+
77+ } // namespace trd
78+ } // namespace o2
79+
80+ #endif // O2_TRD_KRCALIBRATION_H
0 commit comments