ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloBCIDLumi Class Reference

Luminosity-dependent pileup offset correction conditions object. More...

#include <CaloBCIDLumi.h>

Collaboration diagram for CaloBCIDLumi:

Public Member Functions

 CaloBCIDLumi (const CaloBCIDCoeffs &coeffs, const BunchCrossingCondData &bcData)
 Constructor (for MC). More...
 
 CaloBCIDLumi (const CaloBCIDCoeffs &coeffs, const LuminosityCondData &lumiData)
 Constructor (for data). More...
 
void calc (const size_t bcid, const float averageInteractionsPerCrossing, CxxUtils::vec_aligned_vector< float > &out) const
 Perform the calculation for a given BCID. More...
 

Private Member Functions

void initLumi (const std::vector< float > &lumiVec)
 Initialize m_lumiData. More...
 

Private Attributes

std::vector< float > m_lumiData
 Per-BCID luminosities. Padded at the start and end as described above. More...
 
const float * m_lumi = nullptr
 Pointer to the luminosity data for BCID 0 (after initial padding). More...
 
const CaloBCIDCoeffsm_coeffs
 Associated coefficients conditions object. More...
 

Detailed Description

Luminosity-dependent pileup offset correction conditions object.

This implements the cell-by-cell luminosity-dependent offset correction for adjacent bunches. This was previously implemented as an algorithm (CaloBCIDAvgAlg), but it took too long to be usable in the trigger. We can, however, speed it up drastically by preformatting the constant data and saving it in a conditions object. The per-bunch luminosity data are stored here. The processed calibration/shape information is stored in a separate conditions object CaloBCIDCoeffs, as it has a different lifetime.

The per-bunch luminosity vector is considered to be circular. To make this more efficient, we allocate a bit more than is needed, and duplicate the entries at the ends:

bcid[NBCID-nbefore, NBCID)  bcid[0, NBCID)  bcid [0, nafter)

where nbefore is nshapes-1 and nafter is nsamples_coeff-1.

Definition at line 46 of file CaloBCIDLumi.h.

Constructor & Destructor Documentation

◆ CaloBCIDLumi() [1/2]

CaloBCIDLumi::CaloBCIDLumi ( const CaloBCIDCoeffs coeffs,
const BunchCrossingCondData bcData 
)

Constructor (for MC).

Parameters
coeffsCorresponding coefficiencts conditions object.
bcDataFlags of occupied bunches.

Definition at line 23 of file CaloBCIDLumi.cxx.

25  : m_coeffs (coeffs)
26 {
27  // MC case
28  // convert from mu/bunch to lumi in 10**30 units per bunch (for MC only)
29  // 25ns*Nbcid*71mb*10**30 = 25e-9*3564*71e-27*1e30 = 6.31 Use 1/6.31 = 0.158478605
30  // For this implementation, we multiply through by
31  // averageInteractionsByCrossing() in calc().
32  const float xlumiMC = /*ei->averageInteractionsPerCrossing()* */ 0.158478605;
33 
34  static constexpr int MAX_BCID = BunchCrossingCondData::m_MAX_BCID;
35 
36  std::vector<float> lumiVec (MAX_BCID);
37  for (size_t i = 0; i < MAX_BCID; i++) {
38  lumiVec[i] = bcData.isFilled(i)*xlumiMC;
39  }
40 
41  initLumi (lumiVec);
42 }

◆ CaloBCIDLumi() [2/2]

CaloBCIDLumi::CaloBCIDLumi ( const CaloBCIDCoeffs coeffs,
const LuminosityCondData lumiData 
)

Constructor (for data).

Parameters
coeffsCorresponding coefficiencts conditions object.
lumiDataPer-bunch luminosity information.

Definition at line 50 of file CaloBCIDLumi.cxx.

52  : m_coeffs (coeffs)
53 {
55 }

Member Function Documentation

◆ calc()

void CaloBCIDLumi::calc ( const size_t  bcid,
const float  averageInteractionsPerCrossing,
CxxUtils::vec_aligned_vector< float > &  out 
) const

Perform the calculation for a given BCID.

Parameters
bcidDesired BCID.
averageInteractionsPerCrossingScale to be applied to all outputs.
outOutput per-cell offsets.

Definition at line 94 of file CaloBCIDLumi.cxx.

97 {
98  // Perform the calculation using the proper lumi range for the BCID.
100 
101  // Scale the results if requested (for MC).
102  if (averageInteractionsPerCrossing != 1) {
103  for (float& o : out) {
104  o *= averageInteractionsPerCrossing;
105  }
106  }
107 }

◆ initLumi()

void CaloBCIDLumi::initLumi ( const std::vector< float > &  lumiVec)
private

Initialize m_lumiData.

Parameters
lumiVecPer-BCID luminosities.

Definition at line 62 of file CaloBCIDLumi.cxx.

63 {
64  // Number of entries from the end we put at the beginning.
65  unsigned int nbefore = m_coeffs.nshapes()-1;
66  // Number of entries from the beginning we put at the end.
67  unsigned int nafter = m_coeffs.nsamples_coeff()-1;
68 
69  m_lumiData.resize (nbefore + lumiVec.size() + nafter);
70 
71  // Copy [BCID-nbefore, NBCID) to the start of m_lumiData.
72  std::copy (lumiVec.end() - nbefore, lumiVec.end(),
73  m_lumiData.begin());
74 
75  // Append [0, NBCID)
76  std::copy (lumiVec.begin(), lumiVec.end(),
77  m_lumiData.begin() + nbefore);
78 
79  // Append [0, nafter)
80  std::copy (lumiVec.begin(), lumiVec.begin() + nafter,
81  m_lumiData.begin() + nbefore + lumiVec.size());
82 
83  // Set the pointer to BCID 0.
84  m_lumi = m_lumiData.data() + nbefore;
85 }

Member Data Documentation

◆ m_coeffs

const CaloBCIDCoeffs& CaloBCIDLumi::m_coeffs
private

Associated coefficients conditions object.

Definition at line 95 of file CaloBCIDLumi.h.

◆ m_lumi

const float* CaloBCIDLumi::m_lumi = nullptr
private

Pointer to the luminosity data for BCID 0 (after initial padding).

Definition at line 91 of file CaloBCIDLumi.h.

◆ m_lumiData

std::vector<float> CaloBCIDLumi::m_lumiData
private

Per-BCID luminosities. Padded at the start and end as described above.

Definition at line 87 of file CaloBCIDLumi.h.


The documentation for this class was generated from the following files:
CaloBCIDLumi::m_lumi
const float * m_lumi
Pointer to the luminosity data for BCID 0 (after initial padding).
Definition: CaloBCIDLumi.h:91
LuminosityCondData::lbLuminosityPerBCIDVector
const std::vector< float > & lbLuminosityPerBCIDVector() const
Definition: LuminosityCondData.cxx:46
CaloBCIDLumi::m_coeffs
const CaloBCIDCoeffs & m_coeffs
Associated coefficients conditions object.
Definition: CaloBCIDLumi.h:95
CaloBCIDCoeffs::nshapes
size_t nshapes() const
Return the number of shape points per cell.
Definition: CaloBCIDCoeffs.h:213
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
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
CaloBCIDLumi::m_lumiData
std::vector< float > m_lumiData
Per-BCID luminosities. Padded at the start and end as described above.
Definition: CaloBCIDLumi.h:87
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
BunchCrossingCondData::m_MAX_BCID
static constexpr int m_MAX_BCID
Definition: BunchCrossingCondData.h:28
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
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
calibdata.copy
bool copy
Definition: calibdata.py:27
CaloBCIDLumi::initLumi
void initLumi(const std::vector< float > &lumiVec)
Initialize m_lumiData.
Definition: CaloBCIDLumi.cxx:62
BunchCrossingCondData::isFilled
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Definition: BunchCrossingCondData.h:339