ATLAS Offline Software
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  */
13 #ifndef CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
14 #define CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
15 
16 
19 #include <vector>
20 
21 class ILArOFC;
22 class ILArShape;
23 class ILArMinBiasAverage;
24 class LArOnlineID_Base;
25 
26 
84 {
85 public:
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 
128 private:
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 
203 #include "AthenaKernel/CLASS_DEF.h"
204 CLASS_DEF( CaloBCIDCoeffs , 18590337 , 1 )
205 #include "AthenaKernel/CondCont.h"
207 
208 
212 inline
214 {
215  return m_nshapes;
216 }
217 
218 
223 inline
225 {
226  return m_nsamples_coeff;
227 }
228 
229 
230 #endif // not CALOLUMICONDITIONS_CALOBCIDCOEFFS_H
CxxUtils::vec_aligned_vector
aligned_vector< T, 64 > vec_aligned_vector
A std::vector with alignment sufficient for any vector instructions on this platform.
Definition: aligned_vector.h:51
CaloBCIDCoeffs::m_coeffs
CxxUtils::vec_aligned_vector< float > m_coeffs
Storage for coeffients, m_ncoeff per cell, laid out in groups of CHUNKSIZE like this: icoeff0,...
Definition: CaloBCIDCoeffs.h:157
WriteCellNoiseToCool.icell
icell
Definition: WriteCellNoiseToCool.py:339
CaloBCIDCoeffs::m_nsamples_coeff
unsigned int m_nsamples_coeff
Number of samples per cell used in the calculation, after padding.
Definition: CaloBCIDCoeffs.h:142
CaloBCIDCoeffs::nshapes
size_t nshapes() const
Return the number of shape points per cell.
Definition: CaloBCIDCoeffs.h:213
CaloBCIDCoeffs::m_nshapes
unsigned int m_nshapes
Number of shape points per cell.
Definition: CaloBCIDCoeffs.h:145
CaloBCIDCoeffs::m_npad
unsigned int m_npad
Number of padding cells we need to add to get a multiple of CHUNKSIZE.
Definition: CaloBCIDCoeffs.h:133
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CaloBCIDCoeffs::coeff
float & coeff(size_t icoeff, size_t icell)
Indexing into m_coeffs.
Definition: CaloBCIDCoeffs.h:165
CaloBCIDCoeffs::nsamples_coeff
size_t nsamples_coeff() const
Return the number of samples per cell used in the calculation (after padding).
Definition: CaloBCIDCoeffs.h:224
ILArMinBiasAverage
Definition: ILArMinBiasAverage.h:13
CONDCONT_DEF
CONDCONT_DEF(CaloBCIDCoeffs, 256004943)
CaloBCIDCoeffs::m_ncoeff
unsigned int m_ncoeff
Number of coefficients per cell (length of dot product).
Definition: CaloBCIDCoeffs.h:136
CaloBCIDCoeffs::CHUNKSIZE
static constexpr size_t CHUNKSIZE
Number of cells that we calculate at one time.
Definition: CaloBCIDCoeffs.h:126
CaloBCIDCoeffs::findCellCoeffs
void findCellCoeffs(const float *ofcs, const float *shapes, bool ishec, std::vector< float > &cell_coeffs) const
Find coefficients for one cell.
Definition: CaloBCIDCoeffs.cxx:227
CaloBCIDCoeffs::m_nsamples
unsigned int m_nsamples
Number of samples per cell (length of OFC vector).
Definition: CaloBCIDCoeffs.h:139
ILArOFC
Definition: ILArOFC.h:14
CaloBCIDCoeffs::m_ncell
unsigned int m_ncell
Number of cells.
Definition: CaloBCIDCoeffs.h:130
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
HWIdentifier.h
aligned_vector.h
std::vector with extra alignment.
lumiFormat.lumi
lumi
Definition: lumiFormat.py:113
CaloBCIDCoeffs::fillCoeffs
void fillCoeffs(const std::vector< HWIdentifier > &hwids, const LArOnlineID_Base &online_id, const ILArOFC &ofcs, const ILArShape &shapes, const ILArMinBiasAverage &minbias)
Initialize all coefficients.
Definition: CaloBCIDCoeffs.cxx:184
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
CaloBCIDCoeffs
Luminosity-dependent pileup offset correction conditions object.
Definition: CaloBCIDCoeffs.h:84
CaloBCIDCoeffs::calc
void calc(const float *lumi, CxxUtils::vec_aligned_vector< float > &out) const
Perform the calculation for a given set of per-bunch luminosities.
Definition: CaloBCIDCoeffs.cxx:277
ILArShape
Definition: ILArShape.h:13
CaloBCIDCoeffs::CaloBCIDCoeffs
CaloBCIDCoeffs(const std::vector< HWIdentifier > &hwids, const LArOnlineID_Base &online_id, const ILArOFC &ofcs, const ILArShape &shapes, const ILArMinBiasAverage &minbias)
Constructor.
Definition: CaloBCIDCoeffs.cxx:138
CLASS_DEF.h
macros to associate a CLID to a type