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 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 #include "boost/shared_ptr.hpp"
23 
24 // user include files
29 
36 
37 //
38 // class declaration
39 //
40 
42 public:
45 
46  //typedef boost::shared_ptr<L1RCTParameters> ReturnType;
47  //typedef edm::ESProducts< boost::shared_ptr<L1RCTParameters>, boost::shared_ptr<L1RCTChannelMask> > ReturnType;
48 
49  //ReturnType produce(const L1RCTParametersRcd&);
50  boost::shared_ptr<L1RCTParameters> produceL1RCTParameters(const L1RCTParametersRcd&);
51  boost::shared_ptr<L1RCTChannelMask> produceL1RCTChannelMask(const L1RCTChannelMaskRcd&);
52  boost::shared_ptr<L1RCTNoisyChannelMask> produceL1RCTNoisyChannelMask(const L1RCTNoisyChannelMaskRcd&);
53 
54 private:
55  // ----------member data ---------------------------
59 };
60 
61 //
62 // constants, enums and typedefs
63 //
64 
65 //
66 // static data member definitions
67 //
68 
69 //
70 // constructors and destructor
71 //
73 {
74  //the following line is needed to tell the framework what
75  // data is being produced
76  //setWhatProduced(this);
80 
81  //now do what ever other initialization is needed
82  rctParameters =
83  L1RCTParameters(iConfig.getParameter<double>("eGammaLSB"),
84  iConfig.getParameter<double>("jetMETLSB"),
85  iConfig.getParameter<double>("eMinForFGCut"),
86  iConfig.getParameter<double>("eMaxForFGCut"),
87  iConfig.getParameter<double>("hOeCut"),
88  iConfig.getParameter<double>("eMinForHoECut"),
89  iConfig.getParameter<double>("eMaxForHoECut"),
90  iConfig.getParameter<double>("hMinForHoECut"),
91  iConfig.getParameter<double>("eActivityCut"),
92  iConfig.getParameter<double>("hActivityCut"),
93  iConfig.getParameter<unsigned>("eicIsolationThreshold"),
94  iConfig.getParameter<unsigned>("jscQuietThresholdBarrel"),
95  iConfig.getParameter<unsigned>("jscQuietThresholdEndcap"),
96  iConfig.getParameter<bool>("noiseVetoHB"),
97  iConfig.getParameter<bool>("noiseVetoHEplus"),
98  iConfig.getParameter<bool>("noiseVetoHEminus"),
99  iConfig.getParameter<bool>("useCorrectionsLindsey"),
100  iConfig.getParameter<std::vector< double > >("eGammaECalScaleFactors"),
101  iConfig.getParameter<std::vector< double > >("eGammaHCalScaleFactors"),
102  iConfig.getParameter<std::vector< double > >("jetMETECalScaleFactors"),
103  iConfig.getParameter<std::vector< double > >("jetMETHCalScaleFactors"),
104  iConfig.getParameter<std::vector< double > >("ecal_calib_Lindsey"),
105  iConfig.getParameter<std::vector< double > >("hcal_calib_Lindsey"),
106  iConfig.getParameter<std::vector< double > >("hcal_high_calib_Lindsey"),
107  iConfig.getParameter<std::vector< double > >("cross_terms_Lindsey"),
108  iConfig.getParameter<std::vector< double > >("HoverE_low_Lindsey"),
109  iConfig.getParameter<std::vector< double > >("HoverE_high_Lindsey")
110  );
111 
112 
113 
114  // value of true if channel is masked, false if not masked
115  for (int i = 0; i < 18; i++)
116  {
117  for (int j = 0; j < 2; j++)
118  {
119  for (int k = 0; k < 28; k++)
120  {
121  rctChannelMask.ecalMask[i][j][k] = false;
122  rctChannelMask.hcalMask[i][j][k] = false;
123  }
124  for (int k = 0; k < 4; k++)
125  {
126  rctChannelMask.hfMask[i][j][k] = false;
127  }
128  }
129  }
130 
131 
132 
133  //Now the hot tower mask
134 
135  //first the thresholds
136 
140 
141  for (int i = 0; i < 18; i++)
142  {
143  for (int j = 0; j < 2; j++)
144  {
145  for (int k = 0; k < 28; k++)
146  {
147  rctNoisyChannelMask.ecalMask[i][j][k] = false;
148  rctNoisyChannelMask.hcalMask[i][j][k] = false;
149  }
150  for (int k = 0; k < 4; k++)
151  {
152  rctNoisyChannelMask.hfMask[i][j][k] = false;
153  }
154  }
155  }
156 
157 
158 }
159 
160 
162 {
163 
164  // do anything here that needs to be done at desctruction time
165  // (e.g. close files, deallocate resources etc.)
166 
167 }
168 
169 
170 //
171 // member functions
172 //
173 
174 // ------------ method called to produce the data ------------
175 //RCTConfigProducers::ReturnType
176 boost::shared_ptr<L1RCTParameters>
178 {
179  using namespace edm::es;
180  boost::shared_ptr<L1RCTParameters> pL1RCTParameters =
181  boost::shared_ptr<L1RCTParameters>( new L1RCTParameters( rctParameters ) ) ;
182  return pL1RCTParameters ;
183  //return products( pL1RCTParameters, pL1RCTChannelMask );
184 }
185 
186 boost::shared_ptr<L1RCTChannelMask>
188 {
189  using namespace edm::es;
190  boost::shared_ptr<L1RCTChannelMask> pL1RCTChannelMask =
191  boost::shared_ptr<L1RCTChannelMask>( new L1RCTChannelMask( rctChannelMask ) ) ;
192  return pL1RCTChannelMask ;
193 }
194 
195 boost::shared_ptr<L1RCTNoisyChannelMask>
197 {
198  using namespace edm::es;
199  boost::shared_ptr<L1RCTNoisyChannelMask> pL1RCTChannelMask =
200  boost::shared_ptr<L1RCTNoisyChannelMask>( new L1RCTNoisyChannelMask( rctNoisyChannelMask ) ) ;
201  return pL1RCTChannelMask ;
202 }
203 
204 
205 //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 &)