Project
Loading...
Searching...
No Matches
TriggerMap.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_TRIGGERMAP_H
20#define PHOS_TRIGGERMAP_H
21
22#include <array>
23#include <bitset>
24#include "TObject.h"
25
26class TH1;
27
28namespace o2
29{
30
31namespace phos
32{
33
35{
36 public:
38 TriggerMap() = default;
39
41 TriggerMap(int test);
42
44
46 ~TriggerMap() = default;
47
51 bool isGood2x2(short cellID) const { return !mTrigger2x2Map.test(cellID - OFFSET); }
52
55 void addBad2x2Channel(short cellID) { mTrigger2x2Map.set(cellID - OFFSET); } // set bit to true
56
59 void set2x2ChannelGood(short cellID) { mTrigger2x2Map.set(cellID - OFFSET, false); }
60
64 bool isGood4x4(short cellID) const { return !mTrigger4x4Map.test(cellID - OFFSET); }
65
68 void addBad4x4Channel(short cellID) { mTrigger4x4Map.set(cellID - OFFSET); } // set bit to true
69
72 void set4x4ChannelGood(short cellID) { mTrigger2x2Map.set(cellID - OFFSET, false); }
73
74 void setTurnOnCurvesVestion(int v = 0);
75
79 bool isFiredMC2x2(float a, short iTRU, short ix, short iz) const;
80
84 bool isFiredMC4x4(float a, short iTRU, short ix, short iz) const;
85
86 bool try2x2(float a, short iTRU) const;
87 bool try4x4(float a, short iTRU) const;
88
89 void addTurnOnCurvesParams(std::string_view versionName, std::array<std::array<float, 10>, 14>& params);
90 bool selectTurnOnCurvesParams(std::string_view versionName);
91
92 float L0triggerProbability(float e, short ddl) const;
93
94 private:
95 static constexpr short NCHANNELS = 3136;
96 static constexpr short OFFSET = 14337;
97 std::bitset<NCHANNELS> mTrigger2x2Map;
98 std::bitset<NCHANNELS> mTrigger4x4Map;
99
100 short mVersion; // current parameterization of turn-on curves
101 static constexpr short NDDL = 14;
102 static constexpr short NMAXPAR = 10;
103 std::vector<std::string> mParamDescr;
104 std::vector<std::array<std::array<float, NMAXPAR>, NDDL>> mParamSets;
105 std::array<std::array<float, NMAXPAR>, NDDL> mCurrentSet;
106
107 ClassDefNV(TriggerMap, 1);
108};
109
110} // namespace phos
111
112} // namespace o2
113#endif
float L0triggerProbability(float e, short ddl) const
void setTurnOnCurvesVestion(int v=0)
bool isFiredMC2x2(float a, short iTRU, short ix, short iz) const
random return true with probability to fire trigger
bool isFiredMC4x4(float a, short iTRU, short ix, short iz) const
random return true with probability to fire trigger
TriggerMap & operator=(const TriggerMap &other)=default
bool isGood2x2(short cellID) const
tests if cell is in active trigger region
Definition TriggerMap.h:51
void addBad4x4Channel(short cellID)
Add bad triger cell to the container.
Definition TriggerMap.h:68
void addBad2x2Channel(short cellID)
Add bad triger cell to the container.
Definition TriggerMap.h:55
void addTurnOnCurvesParams(std::string_view versionName, std::array< std::array< float, 10 >, 14 > &params)
void set2x2ChannelGood(short cellID)
Mark trigger channel as good.
Definition TriggerMap.h:59
bool try2x2(float a, short iTRU) const
void set4x4ChannelGood(short cellID)
Mark trigger channel as good.
Definition TriggerMap.h:72
bool selectTurnOnCurvesParams(std::string_view versionName)
~TriggerMap()=default
Destructor.
bool try4x4(float a, short iTRU) const
TriggerMap()=default
Constructor.
bool isGood4x4(short cellID) const
tests if cell is in active trigger region
Definition TriggerMap.h:64
const GLdouble * v
Definition glcorearb.h:832
GLenum const GLfloat * params
Definition glcorearb.h:272
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.
VectorOfTObjectPtrs other