CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/SimMuon/CSCDigitizer/src/CSCConfigurableStripConditions.cc

Go to the documentation of this file.
00001 #include "SimMuon/CSCDigitizer/src/CSCConfigurableStripConditions.h"
00002 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00003 #include "Geometry/CSCGeometry/interface/CSCChamberSpecs.h"
00004 #include "FWCore/Utilities/interface/Exception.h"
00005 
00006 CSCConfigurableStripConditions::CSCConfigurableStripConditions(const edm::ParameterSet & p)
00007 : theGain( p.getParameter<double>("gain") ),
00008   theME11Gain( p.getParameter<double>("me11gain") ),
00009   theGainSigma( p.getParameter<double>("ampGainSigma") ),
00010   thePedestal( p.getParameter<double>("pedestal") ),
00011   thePedestalSigma( p.getParameter<double>("pedestalSigma") ),
00012   theCapacitiveCrosstalk(0.0167),
00013   theResistiveCrosstalk(0.02)
00014 {
00015   theNoisifiers.resize(9);
00016   makeNoisifier(1, p.getParameter<std::vector<double> >("me11a") );
00017   makeNoisifier(2, p.getParameter<std::vector<double> >("me11") );
00018   makeNoisifier(3, p.getParameter<std::vector<double> >("me12") );
00019   makeNoisifier(4, p.getParameter<std::vector<double> >("me13") ); // not sure about this one
00020   makeNoisifier(5, p.getParameter<std::vector<double> >("me21") );
00021   makeNoisifier(6, p.getParameter<std::vector<double> >("me22") );
00022   makeNoisifier(7, p.getParameter<std::vector<double> >("me31") );
00023   makeNoisifier(8, p.getParameter<std::vector<double> >("me32") );
00024   makeNoisifier(9, p.getParameter<std::vector<double> >("me31") ); // for lack of a better idea
00025 }
00026 
00027 
00028 CSCConfigurableStripConditions::~CSCConfigurableStripConditions()
00029 {
00030   for(int i = 0; i < 9; ++i)
00031   {
00032     delete theNoisifiers[i];
00033   }
00034 }
00035 
00036 
00037 float CSCConfigurableStripConditions::gain(const CSCDetId & detId, int channel) const
00038 {
00039   if(detId.station() == 1 && (detId.ring() == 1 || detId.ring() == 4) )
00040   {
00041     return theME11Gain;
00042   }  
00043   else
00044   {
00045     return theGain;
00046   }
00047 }
00048 
00049 
00050 void CSCConfigurableStripConditions::fetchNoisifier(const CSCDetId & detId, int istrip)
00051 {
00052   //TODO get this moved toCSCDetId
00053   int chamberType = CSCChamberSpecs::whatChamberType(detId.station(), detId.ring());
00054   theNoisifier = theNoisifiers[chamberType-1];
00055 }
00056 
00057 
00058 void CSCConfigurableStripConditions::makeNoisifier(int chamberType, const std::vector<double> & correlations)
00059 {
00060 
00061   // format is 33, 34, 44, 35, 45, 55
00062   //           46, 56, 66, 57, 67, 77
00063   if(correlations.size() != 12)
00064   {
00065     throw cms::Exception("CSCConfigurableStripConditions")
00066       << "Expect 12 noise correlation coefficients, but got "
00067       << correlations.size();
00068   }
00069 
00070   CSCCorrelatedNoiseMatrix matrix;
00071   matrix(3,3) = correlations[0];
00072   matrix(3,4) = correlations[1];
00073   matrix(4,4) = correlations[2];
00074   matrix(3,5) = correlations[3];
00075   matrix(4,5) = correlations[4];
00076   matrix(5,5) = correlations[5];
00077   matrix(4,6) = correlations[6];
00078   matrix(5,6) = correlations[7];
00079   matrix(6,6) = correlations[8];
00080   matrix(5,7) = correlations[9];
00081   matrix(6,7) = correlations[10];
00082   matrix(7,7) = correlations[11];
00083 
00084   // since I don't know how to correlate the pedestal samples,
00085   // take as constant
00086   double scaVariance = 2. * thePedestalSigma * thePedestalSigma;
00087   matrix(0,0) = scaVariance;
00088   matrix(1,1) = scaVariance;
00089   matrix(2,2) = scaVariance;
00090   theNoisifiers[chamberType-1] = new CSCCorrelatedNoisifier(matrix);
00091 
00092 }
00093 
00094 void CSCConfigurableStripConditions::crosstalk(const CSCDetId&detId, int channel,
00095                  double stripLength, bool leftRight,
00096                  float & capacitive, float & resistive) const
00097 {
00098   capacitive = theCapacitiveCrosstalk * stripLength;
00099   resistive = theResistiveCrosstalk;
00100 }
00101