Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:21

0001 
0002 #include "CalibMuon/CSCCalibration/interface/CSCFakeNoiseMatrixConditions.h"
0003 
0004 CSCNoiseMatrix *CSCFakeNoiseMatrixConditions::prefillNoiseMatrix() {
0005   const CSCDetId &detId = CSCDetId();
0006   CSCNoiseMatrix *cnmatrix = new CSCNoiseMatrix();
0007 
0008   int max_istrip, id_layer, max_ring, max_cham;
0009   // endcap=1 to 2,station=1 to 4, ring=1 to 4,chamber=1 to 36,layer=1 to 6
0010 
0011   for (int iendcap = detId.minEndcapId(); iendcap <= detId.maxEndcapId(); iendcap++) {
0012     for (int istation = detId.minStationId(); istation <= detId.maxStationId(); istation++) {
0013       max_ring = detId.maxRingId();
0014       // station 4 ring 4 not there(36 chambers*2 missing)
0015       // 3 rings max this way of counting (ME1a & b)
0016       if (istation == 1)
0017         max_ring = 3;
0018       if (istation == 2)
0019         max_ring = 2;
0020       if (istation == 3)
0021         max_ring = 2;
0022       if (istation == 4)
0023         max_ring = 1;
0024 
0025       for (int iring = detId.minRingId(); iring <= max_ring; iring++) {
0026         max_istrip = 80;
0027         max_cham = detId.maxChamberId();
0028         if (istation == 1 && iring == 1)
0029           max_cham = 36;
0030         if (istation == 1 && iring == 2)
0031           max_cham = 36;
0032         if (istation == 1 && iring == 3)
0033           max_cham = 36;
0034         if (istation == 2 && iring == 1)
0035           max_cham = 18;
0036         if (istation == 2 && iring == 2)
0037           max_cham = 36;
0038         if (istation == 3 && iring == 1)
0039           max_cham = 18;
0040         if (istation == 3 && iring == 2)
0041           max_cham = 36;
0042         if (istation == 4 && iring == 1)
0043           max_cham = 18;
0044 
0045         for (int ichamber = detId.minChamberId(); ichamber <= max_cham; ichamber++) {
0046           for (int ilayer = detId.minLayerId(); ilayer <= detId.maxLayerId(); ilayer++) {
0047             // station 1 ring 3 has 64 strips per layer instead of 80
0048             if (istation == 1 && iring == 3)
0049               max_istrip = 64;
0050 
0051             std::vector<CSCNoiseMatrix::Item> itemvector;
0052             itemvector.resize(max_istrip);
0053             id_layer = 100000 * iendcap + 10000 * istation + 1000 * iring + 10 * ichamber + ilayer;
0054 
0055             for (int istrip = 0; istrip < max_istrip; istrip++) {
0056               if (istation == 1 && iring == 1) {
0057                 itemvector[istrip].elem33 = 7.86675;
0058                 itemvector[istrip].elem34 = 2.07075;
0059                 itemvector[istrip].elem44 = 6.93875;
0060                 itemvector[istrip].elem35 = 1.42525;
0061                 itemvector[istrip].elem45 = 2.51025;
0062                 itemvector[istrip].elem55 = 7.93975;
0063                 itemvector[istrip].elem46 = 0.94725;
0064                 itemvector[istrip].elem56 = 2.39275;
0065                 itemvector[istrip].elem66 = 6.46475;
0066                 itemvector[istrip].elem57 = 1.86325;
0067                 itemvector[istrip].elem67 = 2.08025;
0068                 itemvector[istrip].elem77 = 6.67975;
0069                 cnmatrix->matrix[id_layer] = itemvector;
0070               }
0071 
0072               if (istation == 1 && iring == 2) {
0073                 itemvector[istrip].elem33 = 9.118;
0074                 itemvector[istrip].elem34 = 3.884;
0075                 itemvector[istrip].elem44 = 7.771;
0076                 itemvector[istrip].elem35 = 1.8225;
0077                 itemvector[istrip].elem45 = 3.7505;
0078                 itemvector[istrip].elem55 = 8.597;
0079                 itemvector[istrip].elem46 = 1.651;
0080                 itemvector[istrip].elem56 = 2.5225;
0081                 itemvector[istrip].elem66 = 6.583;
0082                 itemvector[istrip].elem57 = 1.5055;
0083                 itemvector[istrip].elem67 = 2.733;
0084                 itemvector[istrip].elem77 = 6.988;
0085                 cnmatrix->matrix[id_layer] = itemvector;
0086               }
0087 
0088               if (istation == 1 && iring == 3) {
0089                 itemvector[istrip].elem33 = 9.5245;
0090                 itemvector[istrip].elem34 = 3.2415;
0091                 itemvector[istrip].elem44 = 7.6265;
0092                 itemvector[istrip].elem35 = 1.7225;
0093                 itemvector[istrip].elem45 = 3.6075;
0094                 itemvector[istrip].elem55 = 8.7275;
0095                 itemvector[istrip].elem46 = 1.663;
0096                 itemvector[istrip].elem56 = 2.592;
0097                 itemvector[istrip].elem66 = 7.5685;
0098                 itemvector[istrip].elem57 = 1.7905;
0099                 itemvector[istrip].elem67 = 2.409;
0100                 itemvector[istrip].elem77 = 7.1495;
0101                 cnmatrix->matrix[id_layer] = itemvector;
0102               }
0103 
0104               if (istation == 2 && iring == 1) {
0105                 itemvector[istrip].elem33 = 9.06825;
0106                 itemvector[istrip].elem34 = 3.32025;
0107                 itemvector[istrip].elem44 = 7.52925;
0108                 itemvector[istrip].elem35 = 3.66125;
0109                 itemvector[istrip].elem45 = 3.39125;
0110                 itemvector[istrip].elem55 = 9.97625;
0111                 itemvector[istrip].elem46 = 1.32725;
0112                 itemvector[istrip].elem56 = 3.99025;
0113                 itemvector[istrip].elem66 = 8.10125;
0114                 itemvector[istrip].elem57 = 2.56456;
0115                 itemvector[istrip].elem67 = 2.96625;
0116                 itemvector[istrip].elem77 = 7.30925;
0117                 cnmatrix->matrix[id_layer] = itemvector;
0118               }
0119 
0120               if (istation == 2 && iring == 2) {
0121                 itemvector[istrip].elem33 = 16.7442;
0122                 itemvector[istrip].elem34 = 7.96925;
0123                 itemvector[istrip].elem44 = 14.1643;
0124                 itemvector[istrip].elem35 = 4.67975;
0125                 itemvector[istrip].elem45 = 8.44075;
0126                 itemvector[istrip].elem55 = 17.2243;
0127                 itemvector[istrip].elem46 = 3.68575;
0128                 itemvector[istrip].elem56 = 7.48825;
0129                 itemvector[istrip].elem66 = 14.4902;
0130                 itemvector[istrip].elem57 = 4.4482;
0131                 itemvector[istrip].elem67 = 6.47875;
0132                 itemvector[istrip].elem77 = 14.6733;
0133                 cnmatrix->matrix[id_layer] = itemvector;
0134               }
0135 
0136               if (istation == 3 && iring == 1) {
0137                 itemvector[istrip].elem33 = 9.3495;
0138                 itemvector[istrip].elem34 = 3.529;
0139                 itemvector[istrip].elem44 = 7.8715;
0140                 itemvector[istrip].elem35 = 3.8155;
0141                 itemvector[istrip].elem45 = 3.858;
0142                 itemvector[istrip].elem55 = 10.8205;
0143                 itemvector[istrip].elem46 = 1.8585;
0144                 itemvector[istrip].elem56 = 4.445;
0145                 itemvector[istrip].elem66 = 8.0175;
0146                 itemvector[istrip].elem57 = 3.29479;
0147                 itemvector[istrip].elem67 = 3.625;
0148                 itemvector[istrip].elem77 = 8.3895;
0149                 cnmatrix->matrix[id_layer] = itemvector;
0150               }
0151 
0152               if (istation == 3 && iring == 2) {
0153                 itemvector[istrip].elem33 = 13.6193;
0154                 itemvector[istrip].elem34 = 5.91025;
0155                 itemvector[istrip].elem44 = 11.3842;
0156                 itemvector[istrip].elem35 = 3.31775;
0157                 itemvector[istrip].elem45 = 5.69775;
0158                 itemvector[istrip].elem55 = 11.6652;
0159                 itemvector[istrip].elem46 = 2.46175;
0160                 itemvector[istrip].elem56 = 4.48325;
0161                 itemvector[istrip].elem66 = 9.95725;
0162                 itemvector[istrip].elem57 = 2.10561;
0163                 itemvector[istrip].elem67 = 4.04625;
0164                 itemvector[istrip].elem77 = 9.51625;
0165                 cnmatrix->matrix[id_layer] = itemvector;
0166               }
0167 
0168               if (istation == 4 && iring == 1) {
0169                 itemvector[istrip].elem33 = 10.0;
0170                 itemvector[istrip].elem34 = 4.0;
0171                 itemvector[istrip].elem44 = 10.0;
0172                 itemvector[istrip].elem35 = 3.0;
0173                 itemvector[istrip].elem45 = 8.0;
0174                 itemvector[istrip].elem55 = 10.0;
0175                 itemvector[istrip].elem46 = 2.0;
0176                 itemvector[istrip].elem56 = 5.0;
0177                 itemvector[istrip].elem66 = 10.0;
0178                 itemvector[istrip].elem57 = 3.0;
0179                 itemvector[istrip].elem67 = 4.0;
0180                 itemvector[istrip].elem77 = 10.0;
0181                 cnmatrix->matrix[id_layer] = itemvector;
0182               }
0183             }
0184           }
0185         }
0186       }
0187     }
0188   }
0189   return cnmatrix;
0190 }
0191 
0192 CSCFakeNoiseMatrixConditions::CSCFakeNoiseMatrixConditions(const edm::ParameterSet &iConfig) {
0193   // tell the framework what data is being produced
0194   setWhatProduced(this, &CSCFakeNoiseMatrixConditions::produceNoiseMatrix);
0195 
0196   findingRecord<CSCNoiseMatrixRcd>();
0197 
0198   // now do what ever other initialization is needed
0199 }
0200 
0201 CSCFakeNoiseMatrixConditions::~CSCFakeNoiseMatrixConditions() {
0202   // do anything here that needs to be done at destruction time
0203   // (e.g. close files, deallocate resources etc.)
0204 }
0205 
0206 //
0207 // member functions
0208 //
0209 
0210 // ------------ method called to produce the data  ------------
0211 CSCFakeNoiseMatrixConditions::ReturnType CSCFakeNoiseMatrixConditions::produceNoiseMatrix(
0212     const CSCNoiseMatrixRcd &iRecord) {
0213   return CSCFakeNoiseMatrixConditions::ReturnType(prefillNoiseMatrix());
0214 }
0215 
0216 void CSCFakeNoiseMatrixConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &,
0217                                                   const edm::IOVSyncValue &,
0218                                                   edm::ValidityInterval &oValidity) {
0219   oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime());
0220 }