Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:09

0001 #ifndef EcalPedestals_h
0002 #define EcalPedestals_h
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h"
0007 
0008 struct EcalPedestal {
0009   EcalPedestal() : mean_x12(0), rms_x12(0), mean_x6(0), rms_x6(0), mean_x1(0), rms_x1(0) {}
0010 
0011   struct Zero {
0012     Zero() : z1(0), z2(0) {}
0013     float z1;
0014     float z2;
0015   };
0016 
0017   static const Zero zero;
0018 
0019   float mean_x12;
0020   float rms_x12;
0021   float mean_x6;
0022   float rms_x6;
0023   float mean_x1;
0024   float rms_x1;
0025 
0026 public:
0027   float const* mean_rms(int i) const {
0028     if (i == 0)
0029       return &zero.z1;
0030     return (&mean_x12) + (2 * (i - 1));
0031   }
0032 
0033   float mean(int i) const {
0034     if (i == 0)
0035       return 0.;
0036     return *(&mean_x12 + (2 * (i - 1)));
0037   }
0038 
0039   float rms(int i) const {
0040     if (i == 0)
0041       return 0.;
0042     return *(&rms_x12 + (2 * (i - 1)));
0043   }
0044 
0045   COND_SERIALIZABLE;
0046 };
0047 
0048 typedef EcalCondObjectContainer<EcalPedestal> EcalPedestalsMap;
0049 typedef EcalPedestalsMap::const_iterator EcalPedestalsMapIterator;
0050 typedef EcalPedestalsMap EcalPedestals;
0051 
0052 #endif