Project
Loading...
Searching...
No Matches
TurnOnHistos.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
18
19#ifndef PHOS_TURNONHISTOS_H
20#define PHOS_TURNONHISTOS_H
21
22#include <bitset>
23#include <array>
24#include "TObject.h"
25
26namespace o2
27{
28
29namespace phos
30{
31
33{
34 public:
35 //class to collect statistics to calculate trigger turn-on curves and trigger bad maps
36 static constexpr short NCHANNELS = 3136;
37 static constexpr short NDDL = 14;
38 static constexpr short Npt = 200;
39 static constexpr float dpt = 0.1;
40
42 TurnOnHistos() = default;
43
45
47 ~TurnOnHistos() = default;
48
52
56 void fillTotSp(short ddl, float e)
57 {
58 short bin = e / dpt;
59 if (bin < Npt) {
60 mTotSp[ddl][bin]++;
61 }
62 }
63
67 void fillFiredSp(short ddl, float e)
68 {
69 short bin = e / dpt;
70 if (bin < Npt) {
71 mTrSp[ddl][bin]++;
72 }
73 }
74
77 void fillFiredMap(const std::bitset<NCHANNELS>& bs)
78 {
79 for (size_t i = 0; i < NCHANNELS; ++i) {
80 if (bs[i]) {
81 mGoodMap[i]++;
82 }
83 }
84 }
85
88 void fillNoisyMap(const std::bitset<NCHANNELS>& bs)
89 {
90 for (size_t i = 0; i < NCHANNELS; ++i) {
91 if (bs[i]) {
92 mNoisyMap[i]++;
93 }
94 }
95 }
96
97 //getters now
98 const std::array<float, Npt>& getTotSpectrum(short ddl) const { return mTotSp[ddl]; }
99 const std::array<float, Npt>& getTrSpectrum(short ddl) const { return mTrSp[ddl]; }
100 const std::array<float, NCHANNELS>& getGoodMap() const { return mGoodMap; }
101 const std::array<float, NCHANNELS>& getNoisyMap() const { return mNoisyMap; }
102
103 private:
104 std::array<float, NCHANNELS> mGoodMap;
105 std::array<float, NCHANNELS> mNoisyMap;
106 std::array<std::array<float, Npt>, NDDL> mTotSp;
107 std::array<std::array<float, Npt>, NDDL> mTrSp;
108
109 ClassDefNV(TurnOnHistos, 1);
110};
111
112} // namespace phos
113
114} // namespace o2
115#endif
int32_t i
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
const std::array< float, NCHANNELS > & getNoisyMap() const
void fillFiredMap(const std::bitset< NCHANNELS > &bs)
Collects entries in good map.
static constexpr short Npt
Number of bins in pt distribution.
TurnOnHistos()=default
Constructor.
TurnOnHistos & operator=(const TurnOnHistos &other)=default
const std::array< float, Npt > & getTrSpectrum(short ddl) const
const std::array< float, Npt > & getTotSpectrum(short ddl) const
const std::array< float, NCHANNELS > & getGoodMap() const
void fillTotSp(short ddl, float e)
Fill spectum of all clusters.
void fillNoisyMap(const std::bitset< NCHANNELS > &bs)
Collects entries in noisy map.
static constexpr float dpt
bin width
static constexpr short NCHANNELS
Number of trigger channels.
void fillFiredSp(short ddl, float e)
Fill spectum of clusters fired trigger.
~TurnOnHistos()=default
Destructor.
void merge(TurnOnHistos &other)
Merge statistics in two containers.
static constexpr short NDDL
Number of DDLs.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other