big

bigEntry

bigHeader

bigStore

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
#ifndef big_h
#define big_h 1
#include "CondFormats/Serialization/interface/Serializable.h"

#include <vector>
#include <string>
#include "CondFormats/Calibration/interface/TensorIndex.h"
class big {
public:
  big() : id_current(-1), index_id(-1), cota_current(0.), cotb_current(0.), fpix_current(false) {
    //constructor
    tVector_.reserve(1000);
    thVector_.reserve(1000);
    sVector_.reserve(1000);
  }
  void fill(size_t tVectorSize, size_t thVectorSize, size_t sVectorSize, const std::string& atitle);

  ///inline class bigEntry
  class bigEntry {
  public:
    //constructor
    bigEntry() {
      par.reserve(parIDX::SIZE);
      ytemp.reserve(ytempIDX::SIZE);
      xtemp.reserve(xtempIDX::SIZE);
      avg.reserve(avgIDX::SIZE);
      aqfl.reserve(aqflIDX::SIZE);
      chi2.reserve(chi2IDX::SIZE);
      spare.reserve(spareIDX::SIZE);
    }
    void fill(int runnum, float seed);

  public:
    int runnum;
    float alpha;
    float cotalpha;
    float beta;
    float cotbeta;
    float costrk[3];
    float qavg;
    float symax;
    float dyone;
    float syone;
    float sxmax;
    float dxone;
    float sxone;
    float dytwo;
    float sytwo;
    float dxtwo;
    float sxtwo;
    float qmin;
    //projected pixel uncertainty parameterization, first dimension x,y;
    typedef TensorIndex<2, 2, 5> parIDX;
    std::vector<float> par;
    //templates for y-reconstruction (binned over 1 central pixel)
    typedef TensorIndex<9, 21> ytempIDX;
    std::vector<float> ytemp;
    //templates for x-reconstruction (binned over 1 central pixel)
    typedef TensorIndex<9, 7> xtempIDX;
    std::vector<float> xtemp;
    //average parameters (binned in 4 charge bins ), first dimention x,y; second dimention bias,rms,g0,sigma;
    typedef TensorIndex<2, 4, 4> avgIDX;
    std::vector<float> avg;
    //Aqfl-parameterized x,y-correction (in 4 charge bins), first dimension x,y
    typedef TensorIndex<2, 4, 6> aqflIDX;
    std::vector<float> aqfl;
    //chi^2 (in 4 charge bins), first dimension x,y; second dimension average, minimum;
    typedef TensorIndex<2, 2, 4> chi2IDX;
    std::vector<float> chi2;
    //spare entries, first dimension x,y
    typedef TensorIndex<2, 10> spareIDX;
    std::vector<float> spare;

    COND_SERIALIZABLE;
  };  //inline class bigEntry

  //inline class bigHeader
  class bigHeader {
  public:
    bigHeader() : title("") {}
    void fill(const std::string& atitle);
    /// data members
    std::string title;  //!< template title
    int ID;             //!< template ID number
    int NBy;            //!< number of Barrel y entries
    int NByx;           //!< number of Barrel y-slices of x entries
    int NBxx;           //!< number of Barrel x entries in each slice
    int NFy;            //!< number of FPix y entries
    int NFyx;           //!< number of FPix y-slices of x entries
    int NFxx;           //!< number of FPix x entries in each slice
    float vbias;        //!< detector bias potential in Volts
    float temperature;  //!< detector temperature in deg K
    float fluence;      //!< radiation fluence in n_eq/cm^2
    float qscale;       //!< Charge scaling to match cmssw and pixelav
    float s50;          //!< 1/2 of the readout threshold in ADC units
    int templ_version;  //!< Version number of the template to ensure code compatibility

    COND_SERIALIZABLE;
  };  //end inline class bigHeader

  //inline class bigStore
  class bigStore {
  public:
    //constructor
    bigStore() {
      entby.reserve(entbyIDX::SIZE);
      entbx.reserve(entbxIDX::SIZE);
      entfy.reserve(entfyIDX::SIZE);
      entfx.reserve(entfxIDX::SIZE);
    }
    //dummy filler
    void fill(const std::string& atitle);
    //data members
    bigHeader head;
    typedef TensorIndex<60> entbyIDX;
    std::vector<bigEntry> entby;
    typedef TensorIndex<5, 9> entbxIDX;
    std::vector<bigEntry> entbx;
    typedef TensorIndex<5> entfyIDX;
    std::vector<bigEntry> entfy;
    typedef TensorIndex<2, 9> entfxIDX;
    std::vector<bigEntry> entfx;

    COND_SERIALIZABLE;
  };  //end inline class bigStore

  typedef std::vector<bigEntry> entryVector;
  typedef std::vector<bigHeader> headVector;
  typedef std::vector<bigStore> storeVector;

private:
  entryVector tVector_;
  headVector thVector_;
  storeVector sVector_;
  int id_current;      //!< current id
  int index_id;        //!< current index
  float cota_current;  //!< current cot alpha
  float cotb_current;  //!< current cot beta
  float abs_cotb;      //!< absolute value of cot beta
  bool fpix_current;   //!< current pix detector (false for BPix, true for FPix)

  COND_SERIALIZABLE;
};  //end big
#endif