Project
Loading...
Searching...
No Matches
PadCalibCCDBBuilder.h
Go to the documentation of this file.
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
15
16#ifndef O2_TRD_KRCALIBRATION_H
17#define O2_TRD_KRCALIBRATION_H
18
20#include "Rtypes.h"
21#include "TH2.h"
22#include "TTree.h"
23#include <cstdlib>
24#include <numeric>
25#include <vector>
26
27namespace o2
28{
29namespace trd
30{
31
33{
34 public:
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 std::vector<std::vector<int>> findEmpty(TH2F* hDetectorMap);
47 std::vector<std::vector<int>> findInhomogeneities(TH2F* hDet, float allowedDifference);
48 float getAverageFromNeighbors(TH2F* hDet, int column, int row, int nbuffer = 3);
49 TH2F* getDetectorMap(TTree* tree, int nDet, float mingain = 0, float maxgain = 10'000, TString sDetName = "");
50 bool isHotAreaIsolated(TH2F* hDet, int column, int row, int matrixSize = 1);
51 int isolatedHotPadsContainmentSize(TH2F* hDet, int column, int row);
52 void populateEmptyNormalizedMap(TH2F* hDet, float valueToSet = -1);
53 void removeEdges(TH2F* hDet, int nsize = 2);
54 void removeExtremePads(TH2F* hDet, float upperLimit = 2., float lowerLimit = 0.5);
55 void replacePadCloserToCenter(TH2F* hDet, int column, int row);
56 void replaceIsolatedHotPads(TH2F* hDet, int column, int row, int nsize);
57 void setTreeBranches(TTree* tree);
58 void smoothenTheDetector(TH2F* hDet, float allowedDifference = 1000);
59 TH2F* transformMapIntoAbsoluteValues(TH2F* hDet, TString sName = "");
60
61 private:
62 float mDet;
63 float mCol;
64 float mRow;
65 float mAdc;
66 float mChi;
67 float mSgm;
68 float mAmp;
69
70 ClassDefNV(PadCalibCCDBBuilder, 1);
71};
72
73} // namespace trd
74} // namespace o2
75
76#endif // O2_TRD_KRCALIBRATION_H
uint32_t pad2
uint32_t pad1
Global TRD definitions and constants.
TH2F * fillTheMap(TH2F *hDet, TString sNewName="", int nbuffer=3)
void removeExtremePads(TH2F *hDet, float upperLimit=2., float lowerLimit=0.5)
void removeEdges(TH2F *hDet, int nsize=2)
TH2F * transformMapIntoAbsoluteValues(TH2F *hDet, TString sName="")
void replaceIsolatedHotPads(TH2F *hDet, int column, int row, int nsize)
void replacePadCloserToCenter(TH2F *hDet, int column, int row)
bool isHotAreaIsolated(TH2F *hDet, int column, int row, int matrixSize=1)
std::vector< std::vector< int > > findInhomogeneities(TH2F *hDet, float allowedDifference)
int isolatedHotPadsContainmentSize(TH2F *hDet, int column, int row)
void fillInTheGap(TH2F *hDet, int column, int row, float newGain)
std::vector< int > compareGain(TH2F *hDet, int column, int row, int shiftcolumn, int shiftrow, float allowedDifference)
void populateEmptyNormalizedMap(TH2F *hDet, float valueToSet=-1)
void checkIfIsolatedHotPadCandidate(TH2F *hDet, std::vector< int > coordinates, float upperLimit=1.5, int areaContainedWithin=4)
std::vector< std::vector< int > > findEmpty(TH2F *hDetectorMap)
TH2F * createNormalizedMap(TH2F *hDet, TString sNewName="")
float getAverageFromNeighbors(TH2F *hDet, int column, int row, int nbuffer=3)
void checkIfSmallerCloserToCenter(TH2F *hDet, std::vector< int > coordinates, float allowedDifference)
TH2F * getDetectorMap(TTree *tree, int nDet, float mingain=0, float maxgain=10 '000, TString sDetName="")
void smoothenTheDetector(TH2F *hDet, float allowedDifference=1000)
float computeDistance(std::vector< float > pad1, std::vector< float > pad2)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
std::vector< int > row