test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCConfigurableStripConditions.cc
Go to the documentation of this file.
5 
7 : theGain( p.getParameter<double>("gain") ),
8  theME11Gain( p.getParameter<double>("me11gain") ),
9  theGainSigma( p.getParameter<double>("ampGainSigma") ),
10  thePedestal( p.getParameter<double>("pedestal") ),
11  thePedestalSigma( p.getParameter<double>("pedestalSigma") ),
12  theCapacitiveCrosstalk(0.0167),
13  theResistiveCrosstalk(0.02)
14 {
15  theNoisifiers.resize(9);
16  makeNoisifier(1, p.getParameter<std::vector<double> >("me11a") );
17  makeNoisifier(2, p.getParameter<std::vector<double> >("me11") );
18  makeNoisifier(3, p.getParameter<std::vector<double> >("me12") );
19  makeNoisifier(4, p.getParameter<std::vector<double> >("me13") ); // not sure about this one
20  makeNoisifier(5, p.getParameter<std::vector<double> >("me21") );
21  makeNoisifier(6, p.getParameter<std::vector<double> >("me22") );
22  makeNoisifier(7, p.getParameter<std::vector<double> >("me31") );
23  makeNoisifier(8, p.getParameter<std::vector<double> >("me32") );
24  makeNoisifier(9, p.getParameter<std::vector<double> >("me31") ); // for lack of a better idea
25 }
26 
27 
29 {
30  for(int i = 0; i < 9; ++i)
31  {
32  delete theNoisifiers[i];
33  }
34 }
35 
36 
37 float CSCConfigurableStripConditions::gain(const CSCDetId & detId, int channel) const
38 {
39  if(detId.station() == 1 && (detId.ring() == 1 || detId.ring() == 4) )
40  {
41  return theME11Gain;
42  }
43  else
44  {
45  return theGain;
46  }
47 }
48 
49 
51 {
52  //TODO get this moved toCSCDetId
53  int chamberType = CSCChamberSpecs::whatChamberType(detId.station(), detId.ring());
54  theNoisifier = theNoisifiers[chamberType-1];
55 }
56 
57 
58 void CSCConfigurableStripConditions::makeNoisifier(int chamberType, const std::vector<double> & correlations)
59 {
60 
61  // format is 33, 34, 44, 35, 45, 55
62  // 46, 56, 66, 57, 67, 77
63  if(correlations.size() != 12)
64  {
65  throw cms::Exception("CSCConfigurableStripConditions")
66  << "Expect 12 noise correlation coefficients, but got "
67  << correlations.size();
68  }
69 
71  matrix(3,3) = correlations[0];
72  matrix(3,4) = correlations[1];
73  matrix(4,4) = correlations[2];
74  matrix(3,5) = correlations[3];
75  matrix(4,5) = correlations[4];
76  matrix(5,5) = correlations[5];
77  matrix(4,6) = correlations[6];
78  matrix(5,6) = correlations[7];
79  matrix(6,6) = correlations[8];
80  matrix(5,7) = correlations[9];
81  matrix(6,7) = correlations[10];
82  matrix(7,7) = correlations[11];
83 
84  // since I don't know how to correlate the pedestal samples,
85  // take as constant
86  double scaVariance = 2. * thePedestalSigma * thePedestalSigma;
87  matrix(0,0) = scaVariance;
88  matrix(1,1) = scaVariance;
89  matrix(2,2) = scaVariance;
90  theNoisifiers[chamberType-1] = new CSCCorrelatedNoisifier(matrix);
91 
92 }
93 
95  double stripLength, bool leftRight,
96  float & capacitive, float & resistive) const
97 {
98  capacitive = theCapacitiveCrosstalk * stripLength;
99  resistive = theResistiveCrosstalk;
100 }
101 
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
static int whatChamberType(int istation, int iring)
virtual float gain(const CSCDetId &detId, int channel) const
channels count from 1
CSCConfigurableStripConditions(const edm::ParameterSet &p)
void makeNoisifier(int chamberType, const std::vector< double > &correlations)
math::ErrorD< 8 >::type CSCCorrelatedNoiseMatrix
std::vector< CSCCorrelatedNoisifier * > theNoisifiers
virtual void crosstalk(const CSCDetId &detId, int channel, double stripLength, bool leftRight, float &capacitive, float &resistive) const
int ring() const
Definition: CSCDetId.h:75
virtual void fetchNoisifier(const CSCDetId &detId, int istrip)
CSCCorrelatedNoisifier * theNoisifier
CorrelatedNoisifier< CSCCorrelatedNoiseMatrix > CSCCorrelatedNoisifier
int station() const
Definition: CSCDetId.h:86