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