Go to the documentation of this file.00001 #ifndef CondFormats_EcalShowerContainmentCorrections_h
00002 #define CondFormats_EcalShowerContainmentCorrections_h
00003
00004
00005
00006
00007
00035 #include <vector>
00036 #include <algorithm>
00037 #include <map>
00038 #include <boost/cstdint.hpp>
00039
00040 #include <DataFormats/Math/interface/Point3D.h>
00041
00042 class EBDetId;
00043
00044 class EcalShowerContainmentCorrections {
00045
00046 public:
00047
00049
00059 struct Coefficients{
00060
00061 Coefficients(){for(unsigned int i=0; i<Coefficients::kSize; ++i) data[i]=0;}
00062 Coefficients(const Coefficients& coeff){
00063 std::copy(coeff.data,
00064 coeff.data+Coefficients::kSize,
00065 data);
00066 }
00067
00068 Coefficients& operator=(const Coefficients& coeff){
00069 if (this == &coeff) return *this;
00070 std::copy(coeff.data,coeff.data+Coefficients::kSize,data);
00071 return *this;
00072 }
00073
00075 static const int kPolynomialDegree = 4;
00076
00078 static const int kNTypes = 8;
00079 static const unsigned int kSize = kPolynomialDegree* kNTypes ;
00080
00081 double data[kSize];
00082
00083 };
00084
00085
00087
00089 const Coefficients correctionCoefficients(const EBDetId& centerxtal) const;
00090
00092
00093 void fillCorrectionCoefficients(const EBDetId& xtal,
00094 int group,
00095 const Coefficients& coefficients);
00096
00098
00100 void fillCorrectionCoefficients(const int supermodule, const int module,
00101 const Coefficients& coefficients);
00102
00103
00105
00110 const double correction3x3(const EBDetId& xtal,
00111 const math::XYZPoint& pos) const;
00112
00113
00115
00120 const double correction5x5(const EBDetId& xtal,
00121 const math::XYZPoint& pos) const;
00122
00123
00124
00125 private:
00126 enum Direction{eX,eY};
00127 enum Type{e3x3,e5x5};
00128
00130 const double correctionXY(const EBDetId& xtal,
00131 double position,
00132 Direction dir,
00133 Type type) const ;
00134
00135
00136 typedef std::map<EBDetId,int> GroupMap;
00137
00139 GroupMap groupmap_;
00140
00141
00143 std::vector<Coefficients> coefficients_;
00144
00145 };
00146
00147 #endif