Skip to content

Commit 9e87563

Browse files
committed
class to prepare upload of normalized gain per chamber where inter/extrapolated gain is negative
1 parent 7c4f76b commit 9e87563

7 files changed

Lines changed: 708 additions & 0 deletions

File tree

Detectors/TRD/base/include/TRDBase/PadParameters.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "DataFormatsTRD/Constants.h"
2727
#include "DataFormatsTRD/HelperMethods.h"
28+
#include "Framework/Logger.h"
2829

2930
namespace o2
3031
{

Detectors/TRD/calibration/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ add_subdirectory(macros)
1414
o2_add_library(TRDCalibration
1515
SOURCES src/TrackBasedCalib.cxx
1616
src/CalibratorVdExB.cxx
17+
src/PadCalibCCDBBuilder.cxx
1718
src/KrClusterFinder.cxx
1819
src/DCSProcessor.cxx
1920
PUBLIC_LINK_LIBRARIES O2::TRDBase
@@ -28,6 +29,7 @@ o2_add_library(TRDCalibration
2829
o2_target_root_dictionary(TRDCalibration
2930
HEADERS include/TRDCalibration/TrackBasedCalib.h
3031
include/TRDCalibration/CalibratorVdExB.h
32+
include/TRDCalibration/PadCalibCCDBBuilder.h
3133
include/TRDCalibration/KrClusterFinder.h
3234
include/TRDCalibration/DCSProcessor.h)
3335

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

Comments
 (0)