CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RCTConfigProducers.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RCTConfigProducers
4 // Class: RCTConfigProducers
5 //
13 //
14 // Original Author: Sridhara Dasu
15 // Created: Mon Jul 16 23:48:35 CEST 2007
16 // $Id: RCTConfigProducers.cc,v 1.12 2010/05/07 14:41:48 bachtis Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 #include "boost/shared_ptr.hpp"
24 
25 // user include files
30 
37 
38 //
39 // class declaration
40 //
41 
43 public:
46 
47  //typedef boost::shared_ptr<L1RCTParameters> ReturnType;
48  //typedef edm::ESProducts< boost::shared_ptr<L1RCTParameters>, boost::shared_ptr<L1RCTChannelMask> > ReturnType;
49 
50  //ReturnType produce(const L1RCTParametersRcd&);
51  boost::shared_ptr<L1RCTParameters> produceL1RCTParameters(const L1RCTParametersRcd&);
52  boost::shared_ptr<L1RCTChannelMask> produceL1RCTChannelMask(const L1RCTChannelMaskRcd&);
53  boost::shared_ptr<L1RCTNoisyChannelMask> produceL1RCTNoisyChannelMask(const L1RCTNoisyChannelMaskRcd&);
54 
55 private:
56  // ----------member data ---------------------------
60 };
61 
62 //
63 // constants, enums and typedefs
64 //
65 
66 //
67 // static data member definitions
68 //
69 
70 //
71 // constructors and destructor
72 //
74 {
75  //the following line is needed to tell the framework what
76  // data is being produced
77  //setWhatProduced(this);
81 
82  //now do what ever other initialization is needed
83  rctParameters =
84  L1RCTParameters(iConfig.getParameter<double>("eGammaLSB"),
85  iConfig.getParameter<double>("jetMETLSB"),
86  iConfig.getParameter<double>("eMinForFGCut"),
87  iConfig.getParameter<double>("eMaxForFGCut"),
88  iConfig.getParameter<double>("hOeCut"),
89  iConfig.getParameter<double>("eMinForHoECut"),
90  iConfig.getParameter<double>("eMaxForHoECut"),
91  iConfig.getParameter<double>("hMinForHoECut"),
92  iConfig.getParameter<double>("eActivityCut"),
93  iConfig.getParameter<double>("hActivityCut"),
94  iConfig.getParameter<unsigned>("eicIsolationThreshold"),
95  iConfig.getParameter<unsigned>("jscQuietThresholdBarrel"),
96  iConfig.getParameter<unsigned>("jscQuietThresholdEndcap"),
97  iConfig.getParameter<bool>("noiseVetoHB"),
98  iConfig.getParameter<bool>("noiseVetoHEplus"),
99  iConfig.getParameter<bool>("noiseVetoHEminus"),
100  iConfig.getParameter<bool>("useCorrectionsLindsey"),
101  iConfig.getParameter<std::vector< double > >("eGammaECalScaleFactors"),
102  iConfig.getParameter<std::vector< double > >("eGammaHCalScaleFactors"),
103  iConfig.getParameter<std::vector< double > >("jetMETECalScaleFactors"),
104  iConfig.getParameter<std::vector< double > >("jetMETHCalScaleFactors"),
105  iConfig.getParameter<std::vector< double > >("ecal_calib_Lindsey"),
106  iConfig.getParameter<std::vector< double > >("hcal_calib_Lindsey"),
107  iConfig.getParameter<std::vector< double > >("hcal_high_calib_Lindsey"),
108  iConfig.getParameter<std::vector< double > >("cross_terms_Lindsey"),
109  iConfig.getParameter<std::vector< double > >("HoverE_low_Lindsey"),
110  iConfig.getParameter<std::vector< double > >("HoverE_high_Lindsey")
111  );
112 
113 
114 
115  // value of true if channel is masked, false if not masked
116  for (int i = 0; i < 18; i++)
117  {
118  for (int j = 0; j < 2; j++)
119  {
120  for (int k = 0; k < 28; k++)
121  {
122  rctChannelMask.ecalMask[i][j][k] = false;
123  rctChannelMask.hcalMask[i][j][k] = false;
124  }
125  for (int k = 0; k < 4; k++)
126  {
127  rctChannelMask.hfMask[i][j][k] = false;
128  }
129  }
130  }
131 
132 
133 
134  //Now the hot tower mask
135 
136  //first the thresholds
137 
141 
142  for (int i = 0; i < 18; i++)
143  {
144  for (int j = 0; j < 2; j++)
145  {
146  for (int k = 0; k < 28; k++)
147  {
148  rctNoisyChannelMask.ecalMask[i][j][k] = false;
149  rctNoisyChannelMask.hcalMask[i][j][k] = false;
150  }
151  for (int k = 0; k < 4; k++)
152  {
153  rctNoisyChannelMask.hfMask[i][j][k] = false;
154  }
155  }
156  }
157 
158 
159 }
160 
161 
163 {
164 
165  // do anything here that needs to be done at desctruction time
166  // (e.g. close files, deallocate resources etc.)
167 
168 }
169 
170 
171 //
172 // member functions
173 //
174 
175 // ------------ method called to produce the data ------------
176 //RCTConfigProducers::ReturnType
177 boost::shared_ptr<L1RCTParameters>
179 {
180  using namespace edm::es;
181  boost::shared_ptr<L1RCTParameters> pL1RCTParameters =
182  boost::shared_ptr<L1RCTParameters>( new L1RCTParameters( rctParameters ) ) ;
183  return pL1RCTParameters ;
184  //return products( pL1RCTParameters, pL1RCTChannelMask );
185 }
186 
187 boost::shared_ptr<L1RCTChannelMask>
189 {
190  using namespace edm::es;
191  boost::shared_ptr<L1RCTChannelMask> pL1RCTChannelMask =
192  boost::shared_ptr<L1RCTChannelMask>( new L1RCTChannelMask( rctChannelMask ) ) ;
193  return pL1RCTChannelMask ;
194 }
195 
196 boost::shared_ptr<L1RCTNoisyChannelMask>
198 {
199  using namespace edm::es;
200  boost::shared_ptr<L1RCTNoisyChannelMask> pL1RCTChannelMask =
201  boost::shared_ptr<L1RCTNoisyChannelMask>( new L1RCTNoisyChannelMask( rctNoisyChannelMask ) ) ;
202  return pL1RCTChannelMask ;
203 }
204 
205 
206 //define this as a plug-in
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
RCTConfigProducers(const edm::ParameterSet &)
boost::shared_ptr< L1RCTParameters > produceL1RCTParameters(const L1RCTParametersRcd &)
bool ecalMask[18][2][28]
L1RCTChannelMask rctChannelMask
boost::shared_ptr< L1RCTChannelMask > produceL1RCTChannelMask(const L1RCTChannelMaskRcd &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
L1RCTParameters rctParameters
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
L1RCTNoisyChannelMask rctNoisyChannelMask
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
bool hcalMask[18][2][28]
bool hfMask[18][2][4]
boost::shared_ptr< L1RCTNoisyChannelMask > produceL1RCTNoisyChannelMask(const L1RCTNoisyChannelMaskRcd &)