CMS 3D CMS Logo

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