Project
Loading...
Searching...
No Matches
LZEROElectronics.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
12#ifndef ALICEO2_EMCAL_LZEROELECTRONICS_H_
13#define ALICEO2_EMCAL_LZEROELECTRONICS_H_
14
15#include <memory>
16#include <unordered_map>
17#include <vector>
18#include <deque>
19#include <list>
20#include <optional>
21#include <gsl/span>
22#include "TRandom3.h"
30#include <fairlogger/Logger.h> // for LOG
31
32namespace o2
33{
34namespace emcal
35{
36
43 std::vector<int> mTriggeredPatches;
44 std::vector<std::tuple<int, int, double>> mLastTimesumAllFastOrs;
45};
46
52 std::vector<std::tuple<int, int, double, bool>> mLastTimesumAllPatches;
53};
54
61
63{
64
65 public:
67 LZEROElectronics() = default;
68
70 ~LZEROElectronics() = default;
71
73 void clear();
74
76 void init();
77
79 void setGeometry(o2::emcal::Geometry* gm) { mGeometry = gm; }
80
82 void setMaskedFastOrs(std::vector<int> const& maskedfastors) { mMaskedFastOrs = maskedfastors; }
83 void printMaskedFastOrs();
84
87 void setThreshold(double threshold) { mThreshold = threshold; }
88
92 bool peakFinderOnPatch(TRUElectronics& p, unsigned int patchID);
93
97
101
103 void addNoiseDigits(Digit& d1);
104
109 void fill(const std::deque<o2::emcal::DigitTimebinTRU>& digitlist, const o2::InteractionRecord record, std::vector<TRUElectronics>& patchesFromAllTRUs);
110
113 const std::vector<int>& getFiredPatches(TRUElectronics const& p) const
114 {
115 return p.mFiredPatches;
116 }
117
118 // Getter for the threshold used for the integral of the ADC values in the LZERO algorithm
119 const double getLZEROThreshold() const { return mThreshold; }
120
122 const std::vector<EMCALTriggerInputs>& getTriggerInputs() const
123 {
124 LOG(debug) << "DIG TRU getTriggerInputs in LZEROElectronics: size of mTriggers = " << mTriggers.size();
125 return mTriggers;
126 }
127
129 const std::vector<EMCALTriggerInputsPatch>& getTriggerInputsPatches() const
130 {
131 return mTriggersPatch;
132 }
133
134 private:
135 double mThreshold = 0;
136 // TRandom3* mRandomGenerator = nullptr; ///< random number generator
137 // const SimParam* mSimParam = nullptr; ///< SimParam object
138 std::vector<EMCALTriggerInputs> mTriggers;
139 std::vector<EMCALTriggerInputsPatch> mTriggersPatch;
140 std::vector<int> mMaskedFastOrs;
141 bool mSimulateNoiseDigits = true;
142 // TriggerMappingV2* mTriggerMap = nullptr; ///< Trigger map to properly assign an absolute FastOr to TRU FastOr
143 Geometry* mGeometry = nullptr;
144
145 ClassDefNV(LZEROElectronics, 2);
146};
147
148} // namespace emcal
149
150} // namespace o2
151
152#endif /* ALICEO2_EMCAL_LZEROELECTRONICS_H_ */
EMCAL DigitTimebin for the DigitsWriteoutBuffer and DigitsWriteoutBufferTRU.
Definition of a container to keep Monte Carlo truth external to simulation objects.
EMCAL TRUElectronics for the LZEROElectronics.
std::ostringstream debug
EMCAL digit implementation.
Definition Digit.h:34
EMCAL geometry definition.
Definition Geometry.h:40
Container class for Digits, MC lebels, and trigger records.
void fill(const std::deque< o2::emcal::DigitTimebinTRU > &digitlist, const o2::InteractionRecord record, std::vector< TRUElectronics > &patchesFromAllTRUs)
bool peakFinderOnPatch(TRUElectronics &p, unsigned int patchID)
const std::vector< int > & getFiredPatches(TRUElectronics const &p) const
LZEROElectronics()=default
Default constructor.
void addNoiseDigits(Digit &d1)
Add noise to this digit.
bool peakFinderOnAllPatches(TRUElectronics &p)
~LZEROElectronics()=default
Destructor.
void setMaskedFastOrs(std::vector< int > const &maskedfastors)
Sets the masked fastOrs from the CCDB in the LZERO.
void setGeometry(o2::emcal::Geometry *gm)
Sets geometry for trigger mapping.
const double getLZEROThreshold() const
void init()
Initialize the L0 electronics.
const std::vector< EMCALTriggerInputsPatch > & getTriggerInputsPatches() const
Getter for the trigger inputs per patches found by the LZERO algorithm.
void updatePatchesADC(TRUElectronics &p)
const std::vector< EMCALTriggerInputs > & getTriggerInputs() const
Getter for the trigger inputs found by the LZERO algorithm.
void clear()
clear the L0 electronics
void setThreshold(double threshold)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Trigger Inputs object, summary of the entire information needed for the L1 algorithm.
std::vector< std::tuple< int, int, double, bool > > mLastTimesumAllPatches
TRU ID, PatchID, and its last Timesum.
o2::InteractionRecord mInterRecord
Last known interaction record.
Trigger Inputs object, summary of the entire information needed for the L1 algorithm.
std::vector< int > mTriggeredPatches
Trigger patches, in local STU indexing.
std::vector< std::tuple< int, int, double > > mLastTimesumAllFastOrs
TRU ID, FastOrID with STU indexing, and its last Timesum.
o2::InteractionRecord mInterRecord
Last known interaction record.
TRUElectronics creator, based on the TRUElectronics.
std::vector< int > mFiredPatches
! mask of the patches above threshold
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"