10 void initialize(
const std::map<std::string, float>& coeffmap,
const std::map<unsigned int, float>& afterglowmap);
11 float getCorrection(
float luminonorm,
float intglumi,
unsigned int nBXs)
const override;
16 const std::map<unsigned int, float>& afterglowmap) {
24 std::map<std::string, float>::const_iterator coeffIt = m_coeffmap.find(
"C1");
25 if (coeffIt != m_coeffmap.end()) {
28 if (c1 != 0. && nBXs > 0) {
29 avglumi = c1 * luminonorm / nBXs;
31 float Afterglow = 1.0;
32 if (!m_afterglowmap.empty()) {
33 std::map<unsigned int, float>::const_iterator afterglowit = m_afterglowmap.lower_bound(nBXs + 1);
34 if (afterglowit != m_afterglowmap.begin()) {
35 Afterglow = (--afterglowit)->
second;
38 float driftterm = 1.0;
39 coeffIt = m_coeffmap.find(
"DRIFT");
40 if (coeffIt != m_coeffmap.end()) {
41 driftterm = 1.0 + coeffIt->second * intglumi;
44 coeffIt = m_coeffmap.find(
"A0");
45 if (coeffIt != m_coeffmap.end()) {
49 coeffIt = m_coeffmap.find(
"A1");
50 if (coeffIt != m_coeffmap.end()) {
54 coeffIt = m_coeffmap.find(
"A2");
55 if (coeffIt != m_coeffmap.end()) {
58 result = a0 * Afterglow / (1. + a1 * avglumi + a2 * avglumi * avglumi) * driftterm;
U second(std::pair< T, U > const &p)
static constexpr float a0
std::map< std::string, float > m_coeffmap
std::map< unsigned int, float > m_afterglowmap
void initialize(const std::map< std::string, float > &coeffmap, const std::map< unsigned int, float > &afterglowmap)
#define DEFINE_EDM_PLUGIN(factory, type, name)
float getCorrection(float luminonorm, float intglumi, unsigned int nBXs) const override