ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloLumiConditions
src
CaloBCIDLumi.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
3
*/
10
11
12
#include "
CaloLumiConditions/CaloBCIDLumi.h
"
13
#include "
CaloLumiConditions/CaloBCIDCoeffs.h
"
14
#include "
LumiBlockData/LuminosityCondData.h
"
15
#include "
LumiBlockData/BunchCrossingCondData.h
"
16
17
23
CaloBCIDLumi::CaloBCIDLumi
(
const
CaloBCIDCoeffs
& coeffs,
24
const
BunchCrossingCondData
& bcData)
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
}
43
44
50
CaloBCIDLumi::CaloBCIDLumi
(
const
CaloBCIDCoeffs
& coeffs,
51
const
LuminosityCondData
& lumiData)
52
:
m_coeffs
(coeffs)
53
{
54
initLumi
(lumiData.
lbLuminosityPerBCIDVector
());
55
}
56
57
62
void
CaloBCIDLumi::initLumi
(
const
std::vector<float>& lumiVec)
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
}
86
87
94
void
CaloBCIDLumi::calc
(
const
size_t
bcid,
95
const
float
averageInteractionsPerCrossing,
96
CxxUtils::vec_aligned_vector<float>
& out)
const
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
}
BunchCrossingCondData.h
Replaces the BunchCrossing AlgTool used in run1/2.
CaloBCIDCoeffs.h
Luminosity-dependent pileup offset correction conditions object.
CaloBCIDLumi.h
Luminosity-dependent pileup offset correction conditions object.
LuminosityCondData.h
Hold luminosity data produced by LuminosityCondAlg.
BunchCrossingCondData
Definition
BunchCrossingCondData.h:23
BunchCrossingCondData::m_MAX_BCID
static constexpr int m_MAX_BCID
Definition
BunchCrossingCondData.h:28
BunchCrossingCondData::isFilled
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Definition
BunchCrossingCondData.h:339
CaloBCIDCoeffs
Luminosity-dependent pileup offset correction conditions object.
Definition
CaloBCIDCoeffs.h:84
CaloBCIDLumi::calc
void calc(const size_t bcid, const float averageInteractionsPerCrossing, CxxUtils::vec_aligned_vector< float > &out) const
Perform the calculation for a given BCID.
Definition
CaloBCIDLumi.cxx:94
CaloBCIDLumi::m_lumi
const float * m_lumi
Pointer to the luminosity data for BCID 0 (after initial padding).
Definition
CaloBCIDLumi.h:91
CaloBCIDLumi::initLumi
void initLumi(const std::vector< float > &lumiVec)
Initialize m_lumiData.
Definition
CaloBCIDLumi.cxx:62
CaloBCIDLumi::m_lumiData
std::vector< float > m_lumiData
Per-BCID luminosities. Padded at the start and end as described above.
Definition
CaloBCIDLumi.h:87
CaloBCIDLumi::CaloBCIDLumi
CaloBCIDLumi(const CaloBCIDCoeffs &coeffs, const BunchCrossingCondData &bcData)
Constructor (for MC).
Definition
CaloBCIDLumi.cxx:23
CaloBCIDLumi::m_coeffs
const CaloBCIDCoeffs & m_coeffs
Associated coefficients conditions object.
Definition
CaloBCIDLumi.h:95
LuminosityCondData
Definition
LuminosityCondData.h:23
LuminosityCondData::lbLuminosityPerBCIDVector
const std::vector< float > & lbLuminosityPerBCIDVector() const
Definition
LuminosityCondData.cxx:46
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
Generated on
for ATLAS Offline Software by
1.17.0