Go to the documentation of this file.00001 #include "SimMuon/CSCDigitizer/src/CSCDbStripConditions.h"
00002 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 #include "FWCore/Framework/interface/ESHandle.h"
00005 #include "CondFormats/CSCObjects/interface/CSCChannelTranslator.h"
00006 #include "CondFormats/DataRecord/interface/CSCDBGainsRcd.h"
00007 #include "CondFormats/DataRecord/interface/CSCDBPedestalsRcd.h"
00008 #include "CondFormats/DataRecord/interface/CSCDBNoiseMatrixRcd.h"
00009 #include "CondFormats/DataRecord/interface/CSCDBCrosstalkRcd.h"
00010
00011
00012 CSCDbStripConditions::CSCDbStripConditions(const edm::ParameterSet & pset)
00013 : CSCStripConditions(),
00014 theConditions( pset ),
00015 theCapacitiveCrosstalk(pset.getParameter<double>("capacativeCrosstalk")),
00016 theResistiveCrosstalkScaling(pset.getParameter<double>("resistiveCrosstalkScaling")),
00017 theGainsConstant(pset.getParameter<double>("gainsConstant")),
00018 doCorrelatedNoise_(pset.getParameter<bool>("doCorrelatedNoise"))
00019 {
00020
00021
00022 }
00023
00024
00025 CSCDbStripConditions::~CSCDbStripConditions()
00026 {
00027 if(theNoisifier != 0) delete theNoisifier;
00028 }
00029
00030
00031 void CSCDbStripConditions::initializeEvent(const edm::EventSetup & es)
00032 {
00033 theConditions.initializeEvent(es);
00034 }
00035
00036
00037 float CSCDbStripConditions::gain(const CSCDetId & id, int channel) const
00038 {
00039 return theConditions.gain(id, channel) * theGainsConstant;
00040 }
00041
00042
00043 float CSCDbStripConditions::pedestal(const CSCDetId & id, int channel) const
00044 {
00045 return theConditions.pedestal(id, channel);
00046 }
00047
00048
00049 float CSCDbStripConditions::pedestalSigma(const CSCDetId& id, int channel) const
00050 {
00051 return theConditions.pedestalSigma(id, channel);
00052 }
00053
00054
00055 void CSCDbStripConditions::crosstalk(const CSCDetId& id, int channel,
00056 double stripLength, bool leftRight,
00057 float & capacitive, float & resistive) const
00058 {
00059 resistive = theConditions.crosstalkIntercept(id, channel, leftRight)
00060 * theResistiveCrosstalkScaling;
00061 float slope = theConditions.crosstalkSlope(id, channel, leftRight);
00062
00063 float maxSlopeTime = 60.;
00064
00065 float capacitiveFraction = fabs(slope)*maxSlopeTime;
00066
00067 capacitive = theCapacitiveCrosstalk * capacitiveFraction;
00068 }
00069
00070
00071 void CSCDbStripConditions::fetchNoisifier(const CSCDetId & id, int istrip)
00072 {
00073 std::vector<float> me(12);
00074 theConditions.noiseMatrixElements( id, istrip, me );
00075
00076 CSCCorrelatedNoiseMatrix matrix;
00077
00078 matrix(2,2) = me[0];
00079 matrix(3,3) = me[3];
00080 matrix(4,4) = me[6];
00081 matrix(5,5) = me[9];
00082 matrix(6,6) = me[11];
00083
00084 if(doCorrelatedNoise_)
00085 {
00086 matrix(2,3) = me[1];
00087 matrix(2,4) = me[2];
00088 matrix(3,4) = me[4];
00089 matrix(3,5) = me[5];
00090 matrix(4,5) = me[7];
00091 matrix(4,6) = me[8];
00092 matrix(5,6) = me[10];
00093 }
00094
00095
00096 float sigma = pedestalSigma(id, istrip);
00097
00098
00099
00100
00101 float scaVariance = sigma * sigma;
00102 matrix(0,0) = matrix(1,1) = matrix(7,7) = scaVariance;
00103
00104
00105
00106
00107
00108
00109
00110 if(theNoisifier != 0) delete theNoisifier;
00111 theNoisifier = new CSCCorrelatedNoisifier(matrix);
00112 }
00113
00114 bool CSCDbStripConditions::isInBadChamber( const CSCDetId& id ) const
00115 {
00116 return theConditions.isInBadChamber( id );
00117 }