CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/CondFormats/Calibration/src/big.cc

Go to the documentation of this file.
00001 #include "CondFormats/Calibration/interface/big.h"
00002 #include <iostream>
00003 //fill big
00004 void 
00005 big::fill( size_t tVectorSize,size_t thVectorSize,size_t sVectorSize,
00006            const std::string& atitle){
00007   for(size_t i=0;i<tVectorSize;++i){
00008     big::bigEntry b;
00009     b.fill(i,1.0);
00010     tVector_.push_back(b);
00011   }
00012   for(size_t i=0;i<thVectorSize;++i){
00013     big::bigHeader h;
00014     h.fill(atitle);
00015     thVector_.push_back(h);
00016   }
00017   for(size_t i=0;i<sVectorSize;++i){
00018     big::bigStore s;
00019     s.fill(atitle);
00020     sVector_.push_back(s);
00021   }
00022 }
00023 
00024 //fill bigEntry
00025 void
00026 big::bigEntry::fill(int r,float seed){
00027   runnum=r; alpha=seed; cotalpha=seed; beta=seed; cotbeta=seed;
00028   costrk[0]=seed*0.1;costrk[1]=seed*0.2;costrk[2]=seed*0.3;
00029   qavg=seed ; symax=seed ; dyone=seed; syone=seed;sxmax=seed;
00030   dxone=seed;sxone=seed;dytwo=seed;sytwo=seed;dxtwo=seed;sxtwo=seed;
00031   qmin=seed;
00032   for (int i=0; i<parIDX::LEN1; ++i){
00033     for (int j=0; j<parIDX::LEN2; ++j){
00034       for (int k=0; k<parIDX::LEN3; ++k){
00035         par[parIDX::indexOf(i,j,k)]=seed;
00036       }
00037     }
00038   }
00039   for (int i=0; i<ytempIDX::LEN1; ++i){
00040     for (int j=0; j<ytempIDX::LEN2; ++j){
00041       ytemp[ytempIDX::indexOf(i,j)]=seed;
00042     }
00043   }
00044   for (int i=0; i<xtempIDX::LEN1; ++i){
00045     for (int j=0; j<xtempIDX::LEN2; ++j){
00046       xtemp[xtempIDX::indexOf(i,j)]=seed;
00047     }
00048   }
00049   for (int i=0; i<avgIDX::LEN1; ++i){
00050     for (int j=0; j<avgIDX::LEN2; ++j){
00051       for (int k=0; k<avgIDX::LEN3; ++k){
00052         avg[avgIDX::indexOf(i,j,k)]=seed;
00053       }
00054     }
00055   }
00056   for (int i=0; i<aqflIDX::LEN1; ++i){
00057     for (int j=0; j<aqflIDX::LEN2; ++j){
00058       for (int k=0; k<aqflIDX::LEN3; ++k){
00059         aqfl[aqflIDX::indexOf(i,j,k)]=seed;
00060       }
00061     }
00062   }
00063   for (int i=0; i<chi2IDX::LEN1; ++i){
00064     for (int j=0; j<chi2IDX::LEN2; ++j){
00065       for (int k=0; k<chi2IDX::LEN3; ++k){
00066         chi2[chi2IDX::indexOf(i,j,k)]=seed;
00067       }
00068     }
00069   }
00070   for (int i=0; i<spareIDX::LEN1; ++i){
00071     for (int j=0; j<spareIDX::LEN2; ++j){
00072         spare[spareIDX::indexOf(i,j)]=seed;
00073     }
00074   }
00075 }
00076 
00077 //fill bigHeader
00078 void
00079 big::bigHeader::fill( const std::string& atitle){
00080   title=std::string("atitle");
00081   ID=0; 
00082   NBy=1; 
00083   NByx=2; 
00084   NBxx=3; 
00085   NFy=4; 
00086   NFyx=5;
00087   NFxx=6;
00088   vbias=0.1; 
00089   temperature=0.2;
00090   fluence=0.3;
00091   qscale=0.4;
00092   s50=0.5;
00093   templ_version=1;
00094 }
00095 //fill bigStore
00096 void
00097 big::bigStore::fill( const std::string& atitle ){
00098   head.fill(atitle);
00099   for (int i=0; i<entbyIDX::LEN1; ++i){
00100     bigEntry b;
00101     b.fill(i,0.5*i);
00102     entby[entbyIDX::indexOf(i)]=b;//or use push_back as prefer
00103   }
00104   std::cout<<"length of entbx 1 "<<entbxIDX::LEN1<<std::endl;
00105   std::cout<<"length of entbx 2 "<<entbxIDX::LEN2<<std::endl;
00106   std::cout<<"total size of entbx "<<entbxIDX::SIZE<<std::endl;
00107   for (int i=0; i<entbxIDX::LEN1; ++i){
00108     for (int j=0; j<entbxIDX::LEN2; ++j){
00109       bigEntry c;
00110       c.fill(i*j,0.3*j);
00111       entbx[entbxIDX::indexOf(i,j)]=c;//or use push_back as prefer
00112     }
00113   }
00114   for (int i=0; i<entfyIDX::LEN1; ++i){
00115     bigEntry f;
00116     f.fill(i,0.4*i);
00117     entfy[entfyIDX::indexOf(i)]=f;//or use push_back as prefer
00118   }
00119   for (int i=0; i<entfxIDX::LEN1; ++i){
00120     for (int j=0; j<entfxIDX::LEN2; ++j){
00121       bigEntry f;
00122       f.fill(i*j,0.25*j);
00123       entfx[entfxIDX::indexOf(i,j)]=f;//or use push_back as prefer
00124     }
00125   }
00126 }