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
16#include <fairlogger/Logger.h>
17#include <algorithm>
18
19using namespace o2::trd;
20using namespace o2::trd::constants;
21
23{
24 mdEdxEntries.resize(constants::MAXCHAMBER * constants::NBINSGAINCALIB, 0);
25 mInitialized = true;
26}
27
29{
30 if (!mInitialized) {
31 init();
32 }
33 std::fill(mdEdxEntries.begin(), mdEdxEntries.end(), 0);
34 mNEntriesTot = 0;
35}
36
37void 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
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
60{
61 LOG(info) << "There are " << mNEntriesTot << " entries in the container";
62}
int32_t i
Class to store the TRD dEdx distribution for each TRD chamber.
void fill(const std::vector< int > &input)
auto getHistogramEntry(int index) const
void merge(const GainCalibHistos *prev)
constexpr int MAXCHAMBER
the maximum number of installed chambers
Definition Constants.h:30
constexpr int NBINSGAINCALIB
number of bins in the charge (Q0+Q1+Q2) histogram for gain calibration
Definition Constants.h:79
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"