ATLAS Offline Software
Loading...
Searching...
No Matches
CaloBCIDCoeffs.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
4 */
11
12
13#ifndef CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
14#define CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
15
16
19#include <vector>
20
21class ILArOFC;
22class ILArShape;
25
26
84{
85public:
94 CaloBCIDCoeffs (const std::vector<HWIdentifier>& hwids,
95 const LArOnlineID_Base& online_id,
96 const ILArOFC& ofcs,
97 const ILArShape& shapes,
98 const ILArMinBiasAverage& minbias);
99
100
109 void calc (const float* lumi,
111
112
116 size_t nshapes() const;
117
118
123 size_t nsamples_coeff() const;
124
126 static constexpr size_t CHUNKSIZE = 8;
127
128private:
130 unsigned int m_ncell;
131
133 unsigned int m_npad;
134
136 unsigned int m_ncoeff;
137
139 unsigned int m_nsamples;
140
142 unsigned int m_nsamples_coeff;
143
145 unsigned int m_nshapes;
146
158
159
165 float& coeff (size_t icoeff, size_t icell)
166 {
167 size_t chunk = icell / CHUNKSIZE;
168 size_t ndx = chunk * m_ncoeff * CHUNKSIZE + icoeff * CHUNKSIZE + (icell%CHUNKSIZE);
169 return m_coeffs[ndx];
170 }
171
172
181 void fillCoeffs (const std::vector<HWIdentifier>& hwids,
182 const LArOnlineID_Base& online_id,
183 const ILArOFC& ofcs,
184 const ILArShape& shapes,
185 const ILArMinBiasAverage& minbias);
186
187
195 void findCellCoeffs (const float* ofcs,
196 const float* shapes,
197 bool ishec,
198 std::vector<float>& cell_coeffs) const;
199
200};
201
202
204CLASS_DEF( CaloBCIDCoeffs , 18590337 , 1 )
205#include "AthenaKernel/CondCont.h"
207
208
212inline
214{
215 return m_nshapes;
216}
217
218
223inline
225{
226 return m_nsamples_coeff;
227}
228
229
230#endif // not CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
std::vector with extra alignment.
Luminosity-dependent pileup offset correction conditions object.
float & coeff(size_t icoeff, size_t icell)
Indexing into m_coeffs.
unsigned int m_nsamples
Number of samples per cell (length of OFC vector).
CxxUtils::vec_aligned_vector< float > m_coeffs
Storage for coeffients, m_ncoeff per cell, laid out in groups of CHUNKSIZE like this: icoeff0,...
size_t nsamples_coeff() const
Return the number of samples per cell used in the calculation (after padding).
unsigned int m_ncell
Number of cells.
size_t nshapes() const
Return the number of shape points per cell.
unsigned int m_npad
Number of padding cells we need to add to get a multiple of CHUNKSIZE.
CaloBCIDCoeffs(const std::vector< HWIdentifier > &hwids, const LArOnlineID_Base &online_id, const ILArOFC &ofcs, const ILArShape &shapes, const ILArMinBiasAverage &minbias)
Constructor.
void calc(const float *lumi, CxxUtils::vec_aligned_vector< float > &out) const
Perform the calculation for a given set of per-bunch luminosities.
static constexpr size_t CHUNKSIZE
Number of cells that we calculate at one time.
unsigned int m_nsamples_coeff
Number of samples per cell used in the calculation, after padding.
unsigned int m_nshapes
Number of shape points per cell.
unsigned int m_ncoeff
Number of coefficients per cell (length of dot product).
void fillCoeffs(const std::vector< HWIdentifier > &hwids, const LArOnlineID_Base &online_id, const ILArOFC &ofcs, const ILArShape &shapes, const ILArMinBiasAverage &minbias)
Initialize all coefficients.
void findCellCoeffs(const float *ofcs, const float *shapes, bool ishec, std::vector< float > &cell_coeffs) const
Find coefficients for one cell.
Helper for the Liquid Argon Calorimeter cell identifiers.
aligned_vector< T, 64 > vec_aligned_vector
A std::vector with alignment sufficient for any vector instructions on this platform.