Project
Loading...
Searching...
No Matches
GainCalibHistos.cxx
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
14
15
#include "
DataFormatsTRD/GainCalibHistos.h
"
16
#include <fairlogger/Logger.h>
17
#include <algorithm>
18
19
using namespace
o2::trd
;
20
using namespace
o2::trd::constants
;
21
22
void
GainCalibHistos::init
()
23
{
24
mdEdxEntries.resize(
constants::MAXCHAMBER
*
constants::NBINSGAINCALIB
, 0);
25
mInitialized =
true
;
26
}
27
28
void
GainCalibHistos::reset
()
29
{
30
if
(!mInitialized) {
31
init
();
32
}
33
std::fill(mdEdxEntries.begin(), mdEdxEntries.end(), 0);
34
mNEntriesTot = 0;
35
}
36
37
void
GainCalibHistos::fill
(
const
std::vector<int>& input)
38
{
39
if
(!mInitialized) {
40
init
();
41
}
42
for
(
auto
elem : input) {
43
++mdEdxEntries[elem];
44
}
45
mNEntriesTot += input.size();
46
}
47
48
void
GainCalibHistos::merge
(
const
GainCalibHistos
* prev)
49
{
50
if
(!mInitialized) {
51
init
();
52
}
53
for
(
int
i
= 0;
i
<
MAXCHAMBER
*
NBINSGAINCALIB
; ++
i
) {
54
mdEdxEntries[
i
] += prev->
getHistogramEntry
(
i
);
55
mNEntriesTot += prev->
getHistogramEntry
(
i
);
56
}
57
}
58
59
void
GainCalibHistos::print
()
60
{
61
LOG
(info) <<
"There are "
<< mNEntriesTot <<
" entries in the container"
;
62
}
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
GainCalibHistos.h
Class to store the TRD dEdx distribution for each TRD chamber.
o2::trd::GainCalibHistos
Definition
GainCalibHistos.h:28
o2::trd::GainCalibHistos::print
void print()
Definition
GainCalibHistos.cxx:59
o2::trd::GainCalibHistos::init
void init()
Definition
GainCalibHistos.cxx:22
o2::trd::GainCalibHistos::fill
void fill(const std::vector< int > &input)
Definition
GainCalibHistos.cxx:37
o2::trd::GainCalibHistos::getHistogramEntry
auto getHistogramEntry(int index) const
Definition
GainCalibHistos.h:35
o2::trd::GainCalibHistos::merge
void merge(const GainCalibHistos *prev)
Definition
GainCalibHistos.cxx:48
o2::trd::GainCalibHistos::reset
void reset()
Definition
GainCalibHistos.cxx:28
o2::trd::constants
Definition
Constants.h:24
o2::trd::constants::MAXCHAMBER
constexpr int MAXCHAMBER
the maximum number of installed chambers
Definition
Constants.h:30
o2::trd::constants::NBINSGAINCALIB
constexpr int NBINSGAINCALIB
number of bins in the charge (Q0+Q1+Q2) histogram for gain calibration
Definition
Constants.h:79
o2::trd
Definition
SimTraits.h:119
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
DataFormats
Detectors
TRD
src
GainCalibHistos.cxx
Generated on Tue Feb 25 2025 17:02:53 for Project by
1.9.8