Project
Loading...
Searching...
No Matches
TRUElectronics.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
14#ifndef ALICEO2_EMCAL_PATCH_H
15#define ALICEO2_EMCAL_PATCH_H
16
17#include <array>
18#include <vector>
19#include <gsl/span>
20#include "Rtypes.h"
21// #include "DataFormatsEMCAL/Cluster.h"
22// #include "DataFormatsEMCAL/Digit.h"
23// #include "DataFormatsEMCAL/Cell.h"
24// #include "EMCALBase/Geometry.h"
25
26// #include <fairlogger/Logger.h> // for LOG
27
28namespace o2
29{
30
31namespace emcal
32{
33
37 std::vector<double> mADCvalues;
39
41 double timesum()
42 {
43 double timesumvalue = 0;
44 for (auto ADCvalue : mADCvalues) {
45 timesumvalue += ADCvalue;
46 }
47 return timesumvalue;
48 }
49
50 void init()
51 {
52 }
53
54 // Update internal ADC values (4 timebins)
55 void updateADC(double ADCvalue)
56 {
57
58 if (mADCvalues.size() == 4) {
60 mADCvalues.erase(mADCvalues.begin());
61 }
62 mADCvalues.push_back(ADCvalue);
63 }
64};
65
73
75
80 TRUElectronics(int patchSize, int whichSide, int whichSuperModuleSize);
81
84
86 ~TRUElectronics() = default;
87
89 void clear();
90
92 void init();
93
97
101
104
107
109 void updateADC();
110
114
115 std::vector<std::tuple<int, int>> mPatchIDSeedFastOrIDs;
116 std::vector<std::tuple<int, std::vector<int>>> mIndexMapPatch;
117 std::vector<std::tuple<int, std::vector<int>>> mFiredFastOrIndexMapPatch;
118 std::vector<int> mFiredPatches;
119 std::vector<std::tuple<int, std::vector<double>>> mADCvalues;
120 std::vector<std::tuple<int, std::vector<double>>> mTimesum;
121 std::vector<std::tuple<int, double>> mPreviousTimebinADCvalue;
122 std::vector<FastOrStruct> mFastOrs;
123
125};
126
127} // namespace emcal
128} // namespace o2
129#endif /* ALICEO2_EMCAL_PATCH_H */
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void updateADC(double ADCvalue)
std::vector< double > mADCvalues
double timesum()
Compute current timesum.
TRUElectronics creator, based on the TRUElectronics.
int mPatchSize
! patch size (2x2 or 4x4 typically)
std::vector< std::tuple< int, std::vector< double > > > mTimesum
! Time sums for peak finding
std::vector< std::tuple< int, std::vector< int > > > mFiredFastOrIndexMapPatch
! mask of the FastOrs above threshold in each patch
void assignSeedModuleToPatchWithSTUIndexingFullModule(int &patchID)
Assign seed module to a Full SM.
int mWhichSuperModuleSize
! Either Full/2/3 = 0 or 1/3 = 1 size
TRUElectronics()
Default constructor.
void init()
Initialise internal members.
void updateADC()
Updates the patches.
void assignSeedModuleToAllPatches()
Assign seed module to all patches.
std::vector< int > mFiredPatches
! mask of the patches above threshold
ClassDefNV(TRUElectronics, 1)
std::vector< FastOrStruct > mFastOrs
! FastOr objects
void assignModulesToAllPatches()
Assign modules to all patches.
std::vector< std::tuple< int, std::vector< int > > > mIndexMapPatch
! mask of the FastOrs assigned to each patch
std::vector< std::tuple< int, int > > mPatchIDSeedFastOrIDs
! mask containing Patch IDs, their seed FastOrs
void clear()
Clear internal members.
std::vector< std::tuple< int, std::vector< double > > > mADCvalues
! ADC values for peak finding
~TRUElectronics()=default
Destructor.
std::vector< std::tuple< int, double > > mPreviousTimebinADCvalue
! ADC that was just removed from the time bins
int mWhichSide
! Either A = 0 or C = 1 side
void assignSeedModuleToPatchWithSTUIndexingOneThirdModule(int &patchID)
Assign seed module to a 1/3 SM.