ATLAS Offline Software
Loading...
Searching...
No Matches
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).
 CaloBCIDLumi (const CaloBCIDCoeffs &coeffs, const LuminosityCondData &lumiData)
 Constructor (for data).
void calc (const size_t bcid, const float averageInteractionsPerCrossing, CxxUtils::vec_aligned_vector< float > &out) const
 Perform the calculation for a given BCID.

Private Member Functions

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

Private Attributes

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

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}
static constexpr int m_MAX_BCID
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
void initLumi(const std::vector< float > &lumiVec)
Initialize m_lumiData.
const CaloBCIDCoeffs & m_coeffs
Associated coefficients conditions object.

◆ 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}
const std::vector< float > & lbLuminosityPerBCIDVector() const

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.
99 m_coeffs.calc (m_lumi + bcid, out);
100
101 // Scale the results if requested (for MC).
102 if (averageInteractionsPerCrossing != 1) {
103 for (float& o : out) {
104 o *= averageInteractionsPerCrossing;
105 }
106 }
107}
const float * m_lumi
Pointer to the luminosity data for BCID 0 (after initial padding).

◆ 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}
std::vector< float > m_lumiData
Per-BCID luminosities. Padded at the start and end as described above.

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: