Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:57

0001 #ifndef big_h
0002 #define big_h 1
0003 #include "CondFormats/Serialization/interface/Serializable.h"
0004 
0005 #include <vector>
0006 #include <string>
0007 #include "CondFormats/Calibration/interface/TensorIndex.h"
0008 class big {
0009 public:
0010   big() : id_current(-1), index_id(-1), cota_current(0.), cotb_current(0.), fpix_current(false) {
0011     //constructor
0012     tVector_.reserve(1000);
0013     thVector_.reserve(1000);
0014     sVector_.reserve(1000);
0015   }
0016   void fill(size_t tVectorSize, size_t thVectorSize, size_t sVectorSize, const std::string& atitle);
0017 
0018   ///inline class bigEntry
0019   class bigEntry {
0020   public:
0021     //constructor
0022     bigEntry() {
0023       par.reserve(parIDX::SIZE);
0024       ytemp.reserve(ytempIDX::SIZE);
0025       xtemp.reserve(xtempIDX::SIZE);
0026       avg.reserve(avgIDX::SIZE);
0027       aqfl.reserve(aqflIDX::SIZE);
0028       chi2.reserve(chi2IDX::SIZE);
0029       spare.reserve(spareIDX::SIZE);
0030     }
0031     void fill(int runnum, float seed);
0032 
0033   public:
0034     int runnum;
0035     float alpha;
0036     float cotalpha;
0037     float beta;
0038     float cotbeta;
0039     float costrk[3];
0040     float qavg;
0041     float symax;
0042     float dyone;
0043     float syone;
0044     float sxmax;
0045     float dxone;
0046     float sxone;
0047     float dytwo;
0048     float sytwo;
0049     float dxtwo;
0050     float sxtwo;
0051     float qmin;
0052     //projected pixel uncertainty parameterization, first dimension x,y;
0053     typedef TensorIndex<2, 2, 5> parIDX;
0054     std::vector<float> par;
0055     //templates for y-reconstruction (binned over 1 central pixel)
0056     typedef TensorIndex<9, 21> ytempIDX;
0057     std::vector<float> ytemp;
0058     //templates for x-reconstruction (binned over 1 central pixel)
0059     typedef TensorIndex<9, 7> xtempIDX;
0060     std::vector<float> xtemp;
0061     //average parameters (binned in 4 charge bins ), first dimention x,y; second dimention bias,rms,g0,sigma;
0062     typedef TensorIndex<2, 4, 4> avgIDX;
0063     std::vector<float> avg;
0064     //Aqfl-parameterized x,y-correction (in 4 charge bins), first dimension x,y
0065     typedef TensorIndex<2, 4, 6> aqflIDX;
0066     std::vector<float> aqfl;
0067     //chi^2 (in 4 charge bins), first dimension x,y; second dimension average, minimum;
0068     typedef TensorIndex<2, 2, 4> chi2IDX;
0069     std::vector<float> chi2;
0070     //spare entries, first dimension x,y
0071     typedef TensorIndex<2, 10> spareIDX;
0072     std::vector<float> spare;
0073 
0074     COND_SERIALIZABLE;
0075   };  //inline class bigEntry
0076 
0077   //inline class bigHeader
0078   class bigHeader {
0079   public:
0080     bigHeader() : title("") {}
0081     void fill(const std::string& atitle);
0082     /// data members
0083     std::string title;  //!< template title
0084     int ID;             //!< template ID number
0085     int NBy;            //!< number of Barrel y entries
0086     int NByx;           //!< number of Barrel y-slices of x entries
0087     int NBxx;           //!< number of Barrel x entries in each slice
0088     int NFy;            //!< number of FPix y entries
0089     int NFyx;           //!< number of FPix y-slices of x entries
0090     int NFxx;           //!< number of FPix x entries in each slice
0091     float vbias;        //!< detector bias potential in Volts
0092     float temperature;  //!< detector temperature in deg K
0093     float fluence;      //!< radiation fluence in n_eq/cm^2
0094     float qscale;       //!< Charge scaling to match cmssw and pixelav
0095     float s50;          //!< 1/2 of the readout threshold in ADC units
0096     int templ_version;  //!< Version number of the template to ensure code compatibility
0097 
0098     COND_SERIALIZABLE;
0099   };  //end inline class bigHeader
0100 
0101   //inline class bigStore
0102   class bigStore {
0103   public:
0104     //constructor
0105     bigStore() {
0106       entby.reserve(entbyIDX::SIZE);
0107       entbx.reserve(entbxIDX::SIZE);
0108       entfy.reserve(entfyIDX::SIZE);
0109       entfx.reserve(entfxIDX::SIZE);
0110     }
0111     //dummy filler
0112     void fill(const std::string& atitle);
0113     //data members
0114     bigHeader head;
0115     typedef TensorIndex<60> entbyIDX;
0116     std::vector<bigEntry> entby;
0117     typedef TensorIndex<5, 9> entbxIDX;
0118     std::vector<bigEntry> entbx;
0119     typedef TensorIndex<5> entfyIDX;
0120     std::vector<bigEntry> entfy;
0121     typedef TensorIndex<2, 9> entfxIDX;
0122     std::vector<bigEntry> entfx;
0123 
0124     COND_SERIALIZABLE;
0125   };  //end inline class bigStore
0126 
0127   typedef std::vector<bigEntry> entryVector;
0128   typedef std::vector<bigHeader> headVector;
0129   typedef std::vector<bigStore> storeVector;
0130 
0131 private:
0132   entryVector tVector_;
0133   headVector thVector_;
0134   storeVector sVector_;
0135   int id_current;      //!< current id
0136   int index_id;        //!< current index
0137   float cota_current;  //!< current cot alpha
0138   float cotb_current;  //!< current cot beta
0139   float abs_cotb;      //!< absolute value of cot beta
0140   bool fpix_current;   //!< current pix detector (false for BPix, true for FPix)
0141 
0142   COND_SERIALIZABLE;
0143 };  //end big
0144 #endif