CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CalibMuon/CSCCalibration/plugins/CSCFakeNoiseMatrixConditions.cc

Go to the documentation of this file.
00001 
00002 #include "CalibMuon/CSCCalibration/interface/CSCFakeNoiseMatrixConditions.h"
00003 
00004 void CSCFakeNoiseMatrixConditions::prefillNoiseMatrix(){
00005 
00006   const CSCDetId& detId = CSCDetId();
00007   cnmatrix = new CSCNoiseMatrix();
00008   
00009   int max_istrip,id_layer,max_ring,max_cham;
00010   //endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6 
00011   
00012   for(int iendcap=detId.minEndcapId(); iendcap<=detId.maxEndcapId(); iendcap++){
00013     for(int istation=detId.minStationId() ; istation<=detId.maxStationId(); istation++){
00014       max_ring=detId.maxRingId();
00015       //station 4 ring 4 not there(36 chambers*2 missing)
00016       //3 rings max this way of counting (ME1a & b)
00017       if(istation==1)    max_ring=3;
00018       if(istation==2)    max_ring=2;
00019       if(istation==3)    max_ring=2;
00020       if(istation==4)    max_ring=1;
00021         
00022       for(int iring=detId.minRingId(); iring<=max_ring; iring++){
00023         max_istrip=80;
00024         max_cham=detId.maxChamberId(); 
00025         if(istation==1 && iring==1)    max_cham=36;
00026         if(istation==1 && iring==2)    max_cham=36;
00027         if(istation==1 && iring==3)    max_cham=36;
00028         if(istation==2 && iring==1)    max_cham=18;
00029         if(istation==2 && iring==2)    max_cham=36;
00030         if(istation==3 && iring==1)    max_cham=18;
00031         if(istation==3 && iring==2)    max_cham=36;
00032         if(istation==4 && iring==1)    max_cham=18;
00033         
00034         for(int ichamber=detId.minChamberId(); ichamber<=max_cham; ichamber++){
00035           for(int ilayer=detId.minLayerId(); ilayer<=detId.maxLayerId(); ilayer++){
00036             //station 1 ring 3 has 64 strips per layer instead of 80 
00037             if(istation==1 && iring==3)   max_istrip=64;
00038 
00039             std::vector<CSCNoiseMatrix::Item> itemvector;
00040             itemvector.resize(max_istrip);
00041             id_layer = 100000*iendcap + 10000*istation + 1000*iring + 10*ichamber + ilayer;
00042             
00043             for(int istrip=0;istrip<max_istrip;istrip++){
00044               
00045               if(istation==1 && iring==1){
00046                 itemvector[istrip].elem33 = 7.86675;
00047                 itemvector[istrip].elem34 = 2.07075;
00048                 itemvector[istrip].elem44 = 6.93875;
00049                 itemvector[istrip].elem35 = 1.42525;
00050                 itemvector[istrip].elem45 = 2.51025;
00051                 itemvector[istrip].elem55 = 7.93975;
00052                 itemvector[istrip].elem46 = 0.94725;
00053                 itemvector[istrip].elem56 = 2.39275;
00054                 itemvector[istrip].elem66 = 6.46475;
00055                 itemvector[istrip].elem57 = 1.86325;
00056                 itemvector[istrip].elem67 = 2.08025;
00057                 itemvector[istrip].elem77 = 6.67975;
00058                 cnmatrix->matrix[id_layer]=itemvector;
00059               }
00060 
00061               if(istation==1 && iring==2){
00062                 itemvector[istrip].elem33 = 9.118;
00063                 itemvector[istrip].elem34 = 3.884;
00064                 itemvector[istrip].elem44 = 7.771;
00065                 itemvector[istrip].elem35 = 1.8225;
00066                 itemvector[istrip].elem45 = 3.7505;
00067                 itemvector[istrip].elem55 = 8.597;
00068                 itemvector[istrip].elem46 = 1.651;
00069                 itemvector[istrip].elem56 = 2.5225;
00070                 itemvector[istrip].elem66 = 6.583;
00071                 itemvector[istrip].elem57 = 1.5055;
00072                 itemvector[istrip].elem67 = 2.733;
00073                 itemvector[istrip].elem77 = 6.988;
00074                 cnmatrix->matrix[id_layer]=itemvector;
00075               }
00076 
00077               if(istation==1 && iring==3){
00078                 itemvector[istrip].elem33 = 9.5245;
00079                 itemvector[istrip].elem34 = 3.2415;
00080                 itemvector[istrip].elem44 = 7.6265;
00081                 itemvector[istrip].elem35 = 1.7225;
00082                 itemvector[istrip].elem45 = 3.6075;
00083                 itemvector[istrip].elem55 = 8.7275;
00084                 itemvector[istrip].elem46 = 1.663;
00085                 itemvector[istrip].elem56 = 2.592;
00086                 itemvector[istrip].elem66 = 7.5685;
00087                 itemvector[istrip].elem57 = 1.7905;
00088                 itemvector[istrip].elem67 = 2.409;
00089                 itemvector[istrip].elem77 = 7.1495;
00090                 cnmatrix->matrix[id_layer]=itemvector;
00091               }
00092 
00093               if(istation==2 && iring==1){
00094                 itemvector[istrip].elem33 = 9.06825;
00095                 itemvector[istrip].elem34 = 3.32025;
00096                 itemvector[istrip].elem44 = 7.52925;
00097                 itemvector[istrip].elem35 = 3.66125;
00098                 itemvector[istrip].elem45 = 3.39125;
00099                 itemvector[istrip].elem55 = 9.97625;
00100                 itemvector[istrip].elem46 = 1.32725;
00101                 itemvector[istrip].elem56 = 3.99025;
00102                 itemvector[istrip].elem66 = 8.10125;
00103                 itemvector[istrip].elem57 = 2.56456;
00104                 itemvector[istrip].elem67 = 2.96625;
00105                 itemvector[istrip].elem77 = 7.30925;
00106                 cnmatrix->matrix[id_layer]=itemvector;
00107               } 
00108 
00109               if(istation==2 &&iring==2){
00110                 itemvector[istrip].elem33 = 16.7442;
00111                 itemvector[istrip].elem34 = 7.96925;
00112                 itemvector[istrip].elem44 = 14.1643;
00113                 itemvector[istrip].elem35 = 4.67975;
00114                 itemvector[istrip].elem45 = 8.44075;
00115                 itemvector[istrip].elem55 = 17.2243;
00116                 itemvector[istrip].elem46 = 3.68575;
00117                 itemvector[istrip].elem56 = 7.48825;
00118                 itemvector[istrip].elem66 = 14.4902;
00119                 itemvector[istrip].elem57 = 4.4482;
00120                 itemvector[istrip].elem67 = 6.47875;
00121                 itemvector[istrip].elem77 = 14.6733;
00122                 cnmatrix->matrix[id_layer]=itemvector;
00123               } 
00124 
00125               if(istation==3 && iring==1){
00126                 itemvector[istrip].elem33 = 9.3495;
00127                 itemvector[istrip].elem34 = 3.529;
00128                 itemvector[istrip].elem44 = 7.8715;
00129                 itemvector[istrip].elem35 = 3.8155;
00130                 itemvector[istrip].elem45 = 3.858;
00131                 itemvector[istrip].elem55 = 10.8205;
00132                 itemvector[istrip].elem46 = 1.8585;
00133                 itemvector[istrip].elem56 = 4.445;
00134                 itemvector[istrip].elem66 = 8.0175;
00135                 itemvector[istrip].elem57 = 3.29479;
00136                 itemvector[istrip].elem67 = 3.625;
00137                 itemvector[istrip].elem77 = 8.3895;
00138                 cnmatrix->matrix[id_layer]=itemvector;
00139               } 
00140         
00141               if(istation==3 && iring==2){
00142                 itemvector[istrip].elem33 = 13.6193;
00143                 itemvector[istrip].elem34 = 5.91025;
00144                 itemvector[istrip].elem44 = 11.3842;
00145                 itemvector[istrip].elem35 = 3.31775;
00146                 itemvector[istrip].elem45 = 5.69775;
00147                 itemvector[istrip].elem55 = 11.6652;
00148                 itemvector[istrip].elem46 = 2.46175;
00149                 itemvector[istrip].elem56 = 4.48325;
00150                 itemvector[istrip].elem66 = 9.95725;
00151                 itemvector[istrip].elem57 = 2.10561;
00152                 itemvector[istrip].elem67 = 4.04625;
00153                 itemvector[istrip].elem77 = 9.51625;
00154                 cnmatrix->matrix[id_layer]=itemvector;
00155               } 
00156 
00157               if(istation==4 && iring==1){
00158                 itemvector[istrip].elem33 = 10.0;
00159                 itemvector[istrip].elem34 = 4.0;
00160                 itemvector[istrip].elem44 = 10.0;
00161                 itemvector[istrip].elem35 = 3.0;
00162                 itemvector[istrip].elem45 = 8.0;
00163                 itemvector[istrip].elem55 = 10.0;
00164                 itemvector[istrip].elem46 = 2.0;
00165                 itemvector[istrip].elem56 = 5.0;
00166                 itemvector[istrip].elem66 = 10.0;
00167                 itemvector[istrip].elem57 = 3.0;
00168                 itemvector[istrip].elem67 = 4.0;
00169                 itemvector[istrip].elem77 = 10.0;
00170                 cnmatrix->matrix[id_layer]=itemvector;
00171               }
00172             }
00173           }
00174         }
00175       }
00176     }
00177   }
00178 }
00179 
00180 CSCFakeNoiseMatrixConditions::CSCFakeNoiseMatrixConditions(const edm::ParameterSet& iConfig)
00181 {
00182   
00183   //tell the framework what data is being produced
00184   prefillNoiseMatrix();  
00185   setWhatProduced(this,&CSCFakeNoiseMatrixConditions::produceNoiseMatrix);
00186   
00187   findingRecord<CSCNoiseMatrixRcd>();
00188   
00189   //now do what ever other initialization is needed
00190   
00191 }
00192 
00193 
00194 CSCFakeNoiseMatrixConditions::~CSCFakeNoiseMatrixConditions()
00195 {
00196   // do anything here that needs to be done at destruction time
00197   // (e.g. close files, deallocate resources etc.)
00198   delete cnmatrix; // since not made persistent so we still own it.
00199 }
00200 
00201 //
00202 // member functions
00203 //
00204 
00205 // ------------ method called to produce the data  ------------
00206 CSCFakeNoiseMatrixConditions::ReturnType
00207 CSCFakeNoiseMatrixConditions::produceNoiseMatrix(const CSCNoiseMatrixRcd& iRecord)
00208 {
00209   return cnmatrix;
00210 }
00211 
00212 void CSCFakeNoiseMatrixConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&,
00213                                                   edm::ValidityInterval & oValidity)
00214 {
00215   oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime());
00216   
00217 }