CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondFormats/L1TObjects/src/L1MuDTTFParameters.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuDTTFParameters
00004 //
00005 //   Description: DTTF Parameters from OMDS
00006 //
00007 //
00008 //   $Date: 2009/05/12 10:38:35 $
00009 //   $Revision: 1.5 $
00010 //
00011 //   Author :
00012 //   J. Troconiz              UAM Madrid
00013 //
00014 //--------------------------------------------------
00015 
00016 //-----------------------
00017 // This Class's Header --
00018 //-----------------------
00019 
00020 #include "CondFormats/L1TObjects/interface/L1MuDTTFParameters.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 #include <iostream>
00027 #include <ostream>
00028 #include <iomanip>
00029 #include <string>
00030 
00031 //-------------------------------
00032 // Collaborating Class Headers --
00033 //-------------------------------
00034 
00035 using namespace std;
00036 
00037 // --------------------------------
00038 //       class L1MuDTTFParameters
00039 //---------------------------------
00040 
00041 //--------------
00042 // Operations --
00043 //--------------
00044 
00045 //
00046 // reset parameters
00047 //
00048 void L1MuDTTFParameters::reset() {
00049 
00050   for( int i=0; i<6; i++ ) {
00051     for( int j=0; j<12; j++ ) {
00052 
00053       inrec_qual_st1[i][j]   = 0;
00054       inrec_qual_st2[i][j]   = 0;
00055       inrec_qual_st3[i][j]   = 0;
00056       inrec_qual_st4[i][j]   = 0;
00057       soc_stdis_n[i][j]      = 0;
00058       soc_stdis_wl[i][j]     = 0;
00059       soc_stdis_wr[i][j]     = 0;
00060       soc_stdis_zl[i][j]     = 0;
00061       soc_stdis_zr[i][j]     = 0;
00062       soc_qcut_st1[i][j]     = 0;
00063       soc_qcut_st2[i][j]     = 0;
00064       soc_qcut_st4[i][j]     = 0;
00065       soc_qual_csc[i][j]     = 0;
00066       soc_run_21[i][j]       = false;
00067       soc_nbx_del[i][j]      = false;
00068       soc_csc_etacanc[i][j]  = false;
00069       soc_openlut_extr[i][j] = false;
00070     }
00071   }
00072 }
00073 
00074 void L1MuDTTFParameters::set_inrec_qual_st1(int wh, int sc, const unsigned short int val) {
00075 
00076   if ( check(wh,sc) == -99 ) return;
00077   inrec_qual_st1[check(wh,sc)][sc] = val&0x7;
00078 }
00079 
00080 unsigned short int L1MuDTTFParameters::get_inrec_qual_st1(int wh, int sc) const{
00081 
00082   if ( check(wh,sc) == -99 ) return 0;
00083   return (inrec_qual_st1[check(wh,sc)][sc])&0x7;
00084 }
00085 
00086 void L1MuDTTFParameters::set_inrec_qual_st2(int wh, int sc, const unsigned short int val) {
00087 
00088   if ( check(wh,sc) == -99 ) return;
00089   inrec_qual_st2[check(wh,sc)][sc] = val&0x7;
00090 }
00091 
00092 unsigned short int L1MuDTTFParameters::get_inrec_qual_st2(int wh, int sc) const{
00093 
00094   if ( check(wh,sc) == -99 ) return 0;
00095   return (inrec_qual_st2[check(wh,sc)][sc])&0x7;
00096 }
00097 
00098 void L1MuDTTFParameters::set_inrec_qual_st3(int wh, int sc, const unsigned short int val) {
00099 
00100   if ( check(wh,sc) == -99 ) return;
00101   inrec_qual_st3[check(wh,sc)][sc] = val&0x7;
00102 }
00103 
00104 unsigned short int L1MuDTTFParameters::get_inrec_qual_st3(int wh, int sc) const{
00105 
00106   if ( check(wh,sc) == -99 ) return 0;
00107   return (inrec_qual_st3[check(wh,sc)][sc])&0x7;
00108 }
00109 
00110 void L1MuDTTFParameters::set_inrec_qual_st4(int wh, int sc, const unsigned short int val) {
00111 
00112   if ( check(wh,sc) == -99 ) return;
00113   inrec_qual_st4[check(wh,sc)][sc] = val&0x7;
00114 }
00115 
00116 unsigned short int L1MuDTTFParameters::get_inrec_qual_st4(int wh, int sc) const{
00117 
00118   if ( check(wh,sc) == -99 ) return 0;
00119   return (inrec_qual_st4[check(wh,sc)][sc])&0x7;
00120 }
00121 
00122 void L1MuDTTFParameters::set_soc_stdis_n(int wh, int sc, const unsigned short int val) {
00123 
00124   if ( check(wh,sc) == -99 ) return;
00125   soc_stdis_n[check(wh,sc)][sc] = val&0x7;
00126 }
00127 
00128 unsigned short int L1MuDTTFParameters::get_soc_stdis_n(int wh, int sc) const{
00129 
00130   if ( check(wh,sc) == -99 ) return 0;
00131   return (soc_stdis_n[check(wh,sc)][sc])&0x7;
00132 }
00133 
00134 void L1MuDTTFParameters::set_soc_stdis_wl(int wh, int sc, const unsigned short int val) {
00135 
00136   if ( check(wh,sc) == -99 ) return;
00137   soc_stdis_wl[check(wh,sc)][sc] = val&0x7;
00138 }
00139 
00140 unsigned short int L1MuDTTFParameters::get_soc_stdis_wl(int wh, int sc) const{
00141 
00142   if ( check(wh,sc) == -99 ) return 0;
00143   return (soc_stdis_wl[check(wh,sc)][sc])&0x7;
00144 }
00145 
00146 void L1MuDTTFParameters::set_soc_stdis_wr(int wh, int sc, const unsigned short int val) {
00147 
00148   if ( check(wh,sc) == -99 ) return;
00149   soc_stdis_wr[check(wh,sc)][sc] = val&0x7;
00150 }
00151 
00152 unsigned short int L1MuDTTFParameters::get_soc_stdis_wr(int wh, int sc) const{
00153 
00154   if ( check(wh,sc) == -99 ) return 0;
00155   return (soc_stdis_wr[check(wh,sc)][sc])&0x7;
00156 }
00157 
00158 void L1MuDTTFParameters::set_soc_stdis_zl(int wh, int sc, const unsigned short int val) {
00159 
00160   if ( check(wh,sc) == -99 ) return;
00161   soc_stdis_zl[check(wh,sc)][sc] = val&0x7;
00162 }
00163 
00164 unsigned short int L1MuDTTFParameters::get_soc_stdis_zl(int wh, int sc) const{
00165 
00166   if ( check(wh,sc) == -99 ) return 0;
00167   return (soc_stdis_zl[check(wh,sc)][sc])&0x7;
00168 }
00169 
00170 void L1MuDTTFParameters::set_soc_stdis_zr(int wh, int sc, const unsigned short int val) {
00171 
00172   if ( check(wh,sc) == -99 ) return;
00173   soc_stdis_zr[check(wh,sc)][sc] = val&0x7;
00174 }
00175 
00176 unsigned short int L1MuDTTFParameters::get_soc_stdis_zr(int wh, int sc) const{
00177 
00178   if ( check(wh,sc) == -99 ) return 0;
00179   return (soc_stdis_zr[check(wh,sc)][sc])&0x7;
00180 }
00181 
00182 void L1MuDTTFParameters::set_soc_qcut_st1(int wh, int sc, const unsigned short int val) {
00183 
00184   if ( check(wh,sc) == -99 ) return;
00185   soc_qcut_st1[check(wh,sc)][sc] = val&0x7;
00186 }
00187 
00188 unsigned short int L1MuDTTFParameters::get_soc_qcut_st1(int wh, int sc) const{
00189 
00190   if ( check(wh,sc) == -99 ) return 0;
00191   return (soc_qcut_st1[check(wh,sc)][sc])&0x7;
00192 }
00193 
00194 void L1MuDTTFParameters::set_soc_qcut_st2(int wh, int sc, const unsigned short int val) {
00195 
00196   if ( check(wh,sc) == -99 ) return;
00197   soc_qcut_st2[check(wh,sc)][sc] = val&0x7;
00198 }
00199 
00200 unsigned short int L1MuDTTFParameters::get_soc_qcut_st2(int wh, int sc) const{
00201 
00202   if ( check(wh,sc) == -99 ) return 0;
00203   return (soc_qcut_st2[check(wh,sc)][sc])&0x7;
00204 }
00205 
00206 void L1MuDTTFParameters::set_soc_qcut_st4(int wh, int sc, const unsigned short int val) {
00207 
00208   if ( check(wh,sc) == -99 ) return;
00209   soc_qcut_st4[check(wh,sc)][sc] = val&0x7;
00210 }
00211 
00212 unsigned short int L1MuDTTFParameters::get_soc_qcut_st4(int wh, int sc) const{
00213 
00214   if ( check(wh,sc) == -99 ) return 0;
00215   return (soc_qcut_st4[check(wh,sc)][sc])&0x7;
00216 }
00217 
00218 void L1MuDTTFParameters::set_soc_qual_csc(int wh, int sc, const unsigned short int val) {
00219 
00220   if ( check(wh,sc) == -99 ) return;
00221   soc_qual_csc[check(wh,sc)][sc] = val&0x7;
00222 }
00223 
00224 unsigned short int L1MuDTTFParameters::get_soc_qual_csc(int wh, int sc) const{
00225 
00226   if ( check(wh,sc) == -99 ) return 0;
00227   return (soc_qual_csc[check(wh,sc)][sc])&0x7;
00228 }
00229 
00230 void L1MuDTTFParameters::set_soc_run_21(int wh, int sc, const bool val) {
00231 
00232   if ( check(wh,sc) == -99 ) return;
00233   soc_run_21[check(wh,sc)][sc] = val;
00234 }
00235 
00236 bool L1MuDTTFParameters::get_soc_run_21(int wh, int sc) const{
00237 
00238   if ( check(wh,sc) == -99 ) return false;
00239   return soc_run_21[check(wh,sc)][sc];
00240 }
00241 
00242 void L1MuDTTFParameters::set_soc_nbx_del(int wh, int sc, const bool val) {
00243 
00244   if ( check(wh,sc) == -99 ) return;
00245   soc_nbx_del[check(wh,sc)][sc] = val;
00246 }
00247 
00248 bool L1MuDTTFParameters::get_soc_nbx_del(int wh, int sc) const{
00249 
00250   if ( check(wh,sc) == -99 ) return false;
00251   return soc_nbx_del[check(wh,sc)][sc];
00252 }
00253 
00254 void L1MuDTTFParameters::set_soc_csc_etacanc(int wh, int sc, const bool val) {
00255 
00256   if ( check(wh,sc) == -99 ) return;
00257   soc_csc_etacanc[check(wh,sc)][sc] = val;
00258 }
00259 
00260 bool L1MuDTTFParameters::get_soc_csc_etacanc(int wh, int sc) const{
00261 
00262   if ( check(wh,sc) == -99 ) return false;
00263   return soc_csc_etacanc[check(wh,sc)][sc];
00264 }
00265 
00266 void L1MuDTTFParameters::set_soc_openlut_extr(int wh, int sc, const bool val) {
00267 
00268   if ( check(wh,sc) == -99 ) return;
00269   soc_openlut_extr[check(wh,sc)][sc] = val;
00270 }
00271 
00272 bool L1MuDTTFParameters::get_soc_openlut_extr(int wh, int sc) const{
00273 
00274   if ( check(wh,sc) == -99 ) return false;
00275   return soc_openlut_extr[check(wh,sc)][sc];
00276 }
00277 
00278 int L1MuDTTFParameters::check(int wh, int sc) const {
00279 
00280   if ( sc<0 || sc>11 || wh==0 || wh>3 || wh<-3 ) return -99; 
00281 
00282   if ( wh < 0 ) return wh+3;
00283   else return wh+2;
00284 }
00285 
00286 void L1MuDTTFParameters::print() const {
00287 
00288   cout << endl;
00289   cout << "L1 barrel Track Finder Parameters :" << endl;
00290   cout << "===================================" << endl;
00291   cout << endl;
00292 
00293   cout << endl;
00294   cout << "Quality Cut St.1 :" << endl;
00295   cout << "==================" << endl;
00296   cout << endl;
00297   for( int i=-3; i<4; i++ ) {
00298     if ( i == 0 ) continue;
00299     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_inrec_qual_st1(i,j); }
00300     cout << endl; }
00301 
00302   cout << endl;
00303   cout << "Quality Cut St.2 :" << endl;
00304   cout << "==================" << endl;
00305   cout << endl;
00306   for( int i=-3; i<4; i++ ) {
00307     if ( i == 0 ) continue;
00308     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_inrec_qual_st2(i,j); }
00309     cout << endl; }
00310 
00311   cout << endl;
00312   cout << "Quality Cut St.3 :" << endl;
00313   cout << "==================" << endl;
00314   cout << endl;
00315   for( int i=-3; i<4; i++ ) {
00316     if ( i == 0 ) continue;
00317     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_inrec_qual_st3(i,j); }
00318     cout << endl; }
00319 
00320   cout << endl;
00321   cout << "Quality Cut St.4 :" << endl;
00322   cout << "==================" << endl;
00323   cout << endl;
00324   for( int i=-3; i<4; i++ ) {
00325     if ( i == 0 ) continue;
00326     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_inrec_qual_st4(i,j); }
00327     cout << endl; }
00328 
00329   cout << endl;
00330   cout << "Quality Cut Next Wheel :" << endl;
00331   cout << "========================" << endl;
00332   cout << endl;
00333   for( int i=-3; i<4; i++ ) {
00334     if ( i == 0 ) continue;
00335     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_stdis_n(i,j); }
00336     cout << endl; }
00337 
00338   cout << endl;
00339   cout << "Quality Cut WL :" << endl;
00340   cout << "================" << endl;
00341   cout << endl;
00342   for( int i=-3; i<4; i++ ) {
00343     if ( i == 0 ) continue;
00344     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_stdis_wl(i,j); }
00345     cout << endl; }
00346 
00347   cout << endl;
00348   cout << "Quality Cut WR :" << endl;
00349   cout << "================" << endl;
00350   cout << endl;
00351   for( int i=-3; i<4; i++ ) {
00352     if ( i == 0 ) continue;
00353     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_stdis_wr(i,j); }
00354     cout << endl; }
00355 
00356   cout << endl;
00357   cout << "Quality Cut ZL :" << endl;
00358   cout << "================" << endl;
00359   cout << endl;
00360   for( int i=-3; i<4; i++ ) {
00361     if ( i == 0 ) continue;
00362     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_stdis_zl(i,j); }
00363     cout << endl; }
00364 
00365   cout << endl;
00366   cout << " Quality Cut ZR :" << endl;
00367   cout << "=================" << endl;
00368   cout << endl;
00369   for( int i=-3; i<4; i++ ) {
00370     if ( i == 0 ) continue;
00371     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_stdis_zr(i,j); }
00372     cout << endl; }
00373 
00374   cout << endl;
00375   cout << "Quality Cut SOC St.1 :" << endl;
00376   cout << "======================" << endl;
00377   cout << endl;
00378   for( int i=-3; i<4; i++ ) {
00379     if ( i == 0 ) continue;
00380     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_qcut_st1(i,j); }
00381     cout << endl; }
00382 
00383   cout << endl;
00384   cout << "Quality Cut SOC St.2 :" << endl;
00385   cout << "======================" << endl;
00386   cout << endl;
00387   for( int i=-3; i<4; i++ ) {
00388     if ( i == 0 ) continue;
00389     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_qcut_st2(i,j); }
00390     cout << endl; }
00391 
00392   cout << endl;
00393   cout << "Quality Cut SOC St.4 :" << endl;
00394   cout << "======================" << endl;
00395   cout << endl;
00396   for( int i=-3; i<4; i++ ) {
00397     if ( i == 0 ) continue;
00398     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_qcut_st4(i,j); }
00399     cout << endl; }
00400 
00401   cout << endl;
00402   cout << "CSC Quality Cut :" << endl;
00403   cout << "=================" << endl;
00404   cout << endl;
00405   for( int i=-3; i<4; i++ ) {
00406     if ( i == 0 ) continue;
00407     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_qual_csc(i,j); }
00408     cout << endl; }
00409 
00410   cout << endl;
00411   cout << "Extrapolation 21 :" << endl;
00412   cout << "==================" << endl;
00413   cout << endl;
00414   for( int i=-3; i<4; i++ ) {
00415     if ( i == 0 ) continue;
00416     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_run_21(i,j); }
00417     cout << endl; }
00418 
00419   cout << endl;
00420   cout << "Herbert Scheme :" << endl;
00421   cout << "================" << endl;
00422   cout << endl;
00423   for( int i=-3; i<4; i++ ) {
00424     if ( i == 0 ) continue;
00425     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_nbx_del(i,j); }
00426     cout << endl; }
00427 
00428   cout << endl;
00429   cout << "CSC Eta Cancellation :" << endl;
00430   cout << "======================" << endl;
00431   cout << endl;
00432   for( int i=-3; i<4; i++ ) {
00433     if ( i == 0 ) continue;
00434     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_csc_etacanc(i,j); }
00435     cout << endl; }
00436 
00437   cout << endl;
00438   cout << "Open LUTs :" << endl;
00439   cout << "===========" << endl;
00440   cout << endl;
00441   for( int i=-3; i<4; i++ ) {
00442     if ( i == 0 ) continue;
00443     for( int j=0; j<12; j++ ) { cout << " " << setw(1) << get_soc_openlut_extr(i,j); }
00444     cout << endl; }
00445 
00446 }