CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalPulseSymmCovariances.h
Go to the documentation of this file.
1 #ifndef EcalPulseSymmCovariances_h
2 #define EcalPulseSymmCovariances_h
3 
5 
8 
9 #include <algorithm>
10 
12 public:
14 
16 
17  int indexFor(int i, int j) const {
18  int m = std::min(i, j);
19  int n = std::max(i, j);
20  return n + EcalPulseShape::TEMPLATESAMPLES * m - m * (m + 1) / 2;
21  }
22 
23  float val(int i, int j) const { return covval[indexFor(i, j)]; }
24  float& val(int i, int j) { return covval[indexFor(i, j)]; }
25 
27 };
28 
32 
33 #endif
static const int TEMPLATESAMPLES
EcalPulseSymmCovariancesMap EcalPulseSymmCovariances
float val(int i, int j) const
T min(T a, T b)
Definition: MathUtil.h:58
EcalCondObjectContainer< EcalPulseSymmCovariance > EcalPulseSymmCovariancesMap
EcalPulseSymmCovariancesMap::const_iterator EcalPulseSymmCovariancesMapIterator
std::vector< Item >::const_iterator const_iterator
#define COND_SERIALIZABLE
Definition: Serializable.h:39
float covval[EcalPulseShape::TEMPLATESAMPLES *(EcalPulseShape::TEMPLATESAMPLES+1)/2]
int indexFor(int i, int j) const