ATLAS Offline Software
LArXTalkWeight.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARRECCONDITIONS_LARXTALKWEIGHT_H
6 #define LARRECCONDITIONS_LARXTALKWEIGHT_H
7 
8 #include <vector>
9 
11  public :
12  LArXTalkWeight(const std::vector<float>& vec, const float factor, const std::vector<int>& table);
13  float get_xtalk(const int eta) const;
14  float get_xtalk(const int region, const int eta) const;
15  private:
16  std::vector<float> m_vector;
17  std::vector<int> m_table;
18 };
19 
20 inline float LArXTalkWeight::get_xtalk(const int eta) const {
21  return m_vector.at(eta);
22 }
23 inline float LArXTalkWeight::get_xtalk(const int region, const int eta) const{
24  if ( m_table.empty() ) return 0.;
25  const int eta2 = eta+m_table.at(region);
26  return m_vector.at(eta2);
27 }
28 
29 #include "AthenaKernel/CLASS_DEF.h"
30 CLASS_DEF( LArXTalkWeight , 154494079, 1)
31 #include "AthenaKernel/CondCont.h"
32 CLASS_DEF( CondCont<LArXTalkWeight> , 180267049, 1)
33 #endif
LArXTalkWeight
Definition: LArXTalkWeight.h:10
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
LArXTalkWeight::m_vector
std::vector< float > m_vector
Definition: LArXTalkWeight.h:16
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LArXTalkWeight::get_xtalk
float get_xtalk(const int eta) const
Definition: LArXTalkWeight.h:20
python.ext.table_printer.table
list table
Definition: table_printer.py:81
CondCont< LArXTalkWeight >
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
LArXTalkWeight::m_table
std::vector< int > m_table
Definition: LArXTalkWeight.h:17
LArXTalkWeight::LArXTalkWeight
LArXTalkWeight(const std::vector< float > &vec, const float factor, const std::vector< int > &table)
Definition: LArXTalkWeight.cxx:8
CLASS_DEF.h
macros to associate a CLID to a type