CMS 3D CMS Logo

L1DummyProducer.cc
Go to the documentation of this file.
2 
6 
7 using namespace dedefs;
8 
10  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag", 0);
11 
12  if (verbose())
13  std::cout << "L1DummyProducer::L1DummyProducer...\n" << std::flush;
14 
15  std::vector<unsigned int> compColls = iConfig.getUntrackedParameter<std::vector<unsigned int> >("DO_SYSTEM");
16 
17  for (int i = 0; i < DEnsys; i++)
18  m_doSys[i] = compColls[i];
19 
20  if (verbose()) {
21  std::cout << "[L1DummyProducer] do sys? ";
22  for (int i = 0; i < DEnsys; i++)
23  std::cout << m_doSys[i];
24  std::cout << std::endl;
25  for (int i = 0; i < DEnsys; i++)
26  if (m_doSys[i])
27  std::cout << SystLabel[i] << " ";
28  std::cout << std::endl;
29  }
30 
31  std::string CollInstName[DEnsys][5];
32  for (int i = 0; i < DEnsys; i++)
33  for (int j = 0; j < 5; j++)
34  CollInstName[i][j] = std::string("");
35 
36  CollInstName[GCT][0] += "isoEm";
37  CollInstName[GCT][1] += "nonIsoEm";
38  CollInstName[GCT][2] += "cenJets";
39  CollInstName[GCT][3] += "forJets";
40  CollInstName[GCT][4] += "tauJets";
41  CollInstName[DTF][0] += "DT";
42  CollInstName[DTF][1] += "DTTF";
43  CollInstName[CTF][0] += "CSC";
44  CollInstName[CTF][1] += "";
45  CollInstName[RPC][0] += "RPCb";
46  CollInstName[RPC][1] += "RPCf";
47 
48  for (int i = 0; i < DEnsys; i++)
49  for (int j = 0; j < 5; j++)
50  instName[i][j] = CollInstName[i][j];
51 
52  if (verbose()) {
53  std::cout << "[L1DummyProducer] instName:\n";
54  for (int i = 0; i < DEnsys; i++)
55  for (int j = 0; j < 5; j++)
56  if (!instName[i][j].empty())
57  std::cout << i << " " << SystLabel[i] << " " << j << " " << instName[i][j] << std::endl;
58  std::cout << std::flush;
59  }
60 
62  assert(ETP == 0);
63  assert(HTP == 1);
64  assert(RCT == 2);
65  assert(GCT == 3);
66  assert(DTP == 4);
67  assert(DTF == 5);
68  assert(CTP == 6);
69  assert(CTF == 7);
70  assert(RPC == 8);
71  assert(LTC == 9);
72  assert(GMT == 10);
73  assert(GLT == 11);
74 
76  if (m_doSys[ETP])
77  produces<EcalTrigPrimDigiCollection>(instName[ETP][0]);
78  if (m_doSys[HTP])
79  produces<HcalTrigPrimDigiCollection>(instName[HTP][0]);
80  if (m_doSys[RCT])
81  produces<L1CaloEmCollection>(instName[RCT][0]);
82  if (m_doSys[RCT])
83  produces<L1CaloRegionCollection>(instName[RCT][0]);
84  if (m_doSys[GCT])
85  produces<L1GctEmCandCollection>(instName[GCT][0]);
86  if (m_doSys[GCT])
87  produces<L1GctEmCandCollection>(instName[GCT][1]);
88  if (m_doSys[GCT])
89  produces<L1GctJetCandCollection>(instName[GCT][2]);
90  if (m_doSys[GCT])
91  produces<L1GctJetCandCollection>(instName[GCT][3]);
92  if (m_doSys[GCT])
93  produces<L1GctJetCandCollection>(instName[GCT][4]);
94  if (m_doSys[DTP])
95  produces<L1MuDTChambPhContainer>(instName[DTP][0]);
96  if (m_doSys[DTP])
97  produces<L1MuDTChambThContainer>(instName[DTP][0]);
98  if (m_doSys[DTF])
99  produces<L1MuRegionalCandCollection>(instName[DTF][0]);
100  if (m_doSys[DTF])
101  produces<L1MuDTTrackContainer>(instName[DTF][1]);
102  if (m_doSys[CTP])
103  produces<CSCCorrelatedLCTDigiCollection>(instName[CTP][0]);
104  if (m_doSys[CTF])
105  produces<L1MuRegionalCandCollection>(instName[CTF][0]);
106  if (m_doSys[CTF])
107  produces<L1CSCTrackCollection>(instName[CTF][1]);
108  if (m_doSys[RPC])
109  produces<L1MuRegionalCandCollection>(instName[RPC][0]);
110  if (m_doSys[RPC])
111  produces<L1MuRegionalCandCollection>(instName[RPC][1]);
112  if (m_doSys[LTC])
113  produces<LTCDigiCollection>(instName[LTC][0]);
114  if (m_doSys[GMT])
115  produces<L1MuGMTCandCollection>(instName[GMT][0]);
116  if (m_doSys[GMT])
117  produces<L1MuGMTReadoutCollection>(instName[GMT][0]);
118  if (m_doSys[GLT])
119  produces<L1GlobalTriggerReadoutRecord>(instName[GLT][0]);
120  if (m_doSys[GLT])
121  produces<L1GlobalTriggerEvmReadoutRecord>(instName[GLT][0]);
122  if (m_doSys[GLT])
123  produces<L1GlobalTriggerObjectMapRecord>(instName[GLT][0]);
124 
127  if (!rng.isAvailable()) {
128  throw cms::Exception("Configuration")
129  << "L1DummyProducer requires the RandomNumberGeneratorService\n"
130  "which is not present in the configuration file. You must add the service\n"
131  "in the configuration file or remove the modules that require it.";
132  }
133  EBase_ = iConfig.getUntrackedParameter<double>("EnergyBase", 100.);
134  ESigm_ = iConfig.getUntrackedParameter<double>("EnergySigm", 10.);
135 
136  nevt_ = 0;
137 }
138 
140 
143  CLHEP::HepRandomEngine* engine = &rng->getEngine(iEvent.streamID());
144 
145  if (verbose())
146  std::cout << "L1DummyProducer::produce...\n" << std::flush;
147 
149  std::unique_ptr<EcalTrigPrimDigiCollection> ecal_tp_data(new EcalTrigPrimDigiCollection);
150  std::unique_ptr<HcalTrigPrimDigiCollection> hcal_tp_data(new HcalTrigPrimDigiCollection);
151  std::unique_ptr<L1CaloEmCollection> rct_em_data(new L1CaloEmCollection);
152  std::unique_ptr<L1CaloRegionCollection> rct_rgn_data(new L1CaloRegionCollection);
153  std::unique_ptr<L1GctEmCandCollection> gct_isolaem_data(new L1GctEmCandCollection);
154  std::unique_ptr<L1GctEmCandCollection> gct_noisoem_data(new L1GctEmCandCollection);
155  std::unique_ptr<L1GctJetCandCollection> gct_cenjets_data(new L1GctJetCandCollection);
156  std::unique_ptr<L1GctJetCandCollection> gct_forjets_data(new L1GctJetCandCollection);
157  std::unique_ptr<L1GctJetCandCollection> gct_taujets_data(new L1GctJetCandCollection);
158  std::unique_ptr<L1MuDTChambPhContainer> dtp_ph_data(new L1MuDTChambPhContainer);
159  std::unique_ptr<L1MuDTChambThContainer> dtp_th_data(new L1MuDTChambThContainer);
160  std::unique_ptr<L1MuRegionalCandCollection> dtf_data(new L1MuRegionalCandCollection);
161  std::unique_ptr<L1MuDTTrackContainer> dtf_trk_data(new L1MuDTTrackContainer);
162  std::unique_ptr<CSCCorrelatedLCTDigiCollection> ctp_data(new CSCCorrelatedLCTDigiCollection);
163  std::unique_ptr<L1MuRegionalCandCollection> ctf_data(new L1MuRegionalCandCollection);
164  std::unique_ptr<L1CSCTrackCollection> ctf_trk_data(new L1CSCTrackCollection);
165  std::unique_ptr<L1MuRegionalCandCollection> rpc_cen_data(new L1MuRegionalCandCollection);
166  std::unique_ptr<L1MuRegionalCandCollection> rpc_for_data(new L1MuRegionalCandCollection);
167  std::unique_ptr<LTCDigiCollection> ltc_data(new LTCDigiCollection);
168  std::unique_ptr<L1MuGMTCandCollection> gmt_data(new L1MuGMTCandCollection);
169  std::unique_ptr<L1MuGMTReadoutCollection> gmt_rdt_data(new L1MuGMTReadoutCollection);
170  std::unique_ptr<L1GlobalTriggerReadoutRecord> glt_rdt_data(new L1GlobalTriggerReadoutRecord);
171  std::unique_ptr<L1GlobalTriggerEvmReadoutRecord> glt_evm_data(new L1GlobalTriggerEvmReadoutRecord);
172  std::unique_ptr<L1GlobalTriggerObjectMapRecord> glt_obj_data(new L1GlobalTriggerObjectMapRecord);
173 
174  int nevt = nevt_++;
176  if (m_doSys[ETP])
177  SimpleDigi(nevt, engine, ecal_tp_data);
178  if (m_doSys[HTP])
179  SimpleDigi(nevt, engine, hcal_tp_data);
180  if (m_doSys[RCT])
181  SimpleDigi(nevt, engine, rct_em_data);
182  if (m_doSys[RCT])
183  SimpleDigi(nevt, engine, rct_rgn_data);
184  if (m_doSys[GCT])
185  SimpleDigi(nevt, engine, gct_isolaem_data, 0);
186  if (m_doSys[GCT])
187  SimpleDigi(nevt, engine, gct_noisoem_data, 1);
188  if (m_doSys[GCT])
189  SimpleDigi(nevt, engine, gct_cenjets_data, 0);
190  if (m_doSys[GCT])
191  SimpleDigi(nevt, engine, gct_forjets_data, 1);
192  if (m_doSys[GCT])
193  SimpleDigi(nevt, engine, gct_taujets_data, 2);
194  if (m_doSys[DTP])
195  SimpleDigi(nevt, engine, dtp_ph_data);
196  if (m_doSys[DTP])
197  SimpleDigi(nevt, engine, dtp_th_data);
198  if (m_doSys[DTF])
199  SimpleDigi(nevt, engine, dtf_data, 0);
200  if (m_doSys[DTF])
201  SimpleDigi(nevt, engine, dtf_trk_data);
202  if (m_doSys[CTP])
203  SimpleDigi(nevt, engine, ctp_data);
204  if (m_doSys[CTF])
205  SimpleDigi(nevt, engine, ctf_data, 2);
206  if (m_doSys[CTF])
207  SimpleDigi(nevt, engine, ctf_trk_data);
208  if (m_doSys[RPC])
209  SimpleDigi(nevt, engine, rpc_cen_data, 1);
210  if (m_doSys[RPC])
211  SimpleDigi(nevt, engine, rpc_for_data, 3);
212  if (m_doSys[LTC])
213  SimpleDigi(nevt, engine, ltc_data);
214  if (m_doSys[GMT])
215  SimpleDigi(nevt, engine, gmt_data);
216  if (m_doSys[GMT])
217  SimpleDigi(nevt, engine, gmt_rdt_data);
218  if (m_doSys[GLT])
219  SimpleDigi(nevt, engine, glt_rdt_data);
220  if (m_doSys[GLT])
221  SimpleDigi(nevt, engine, glt_evm_data);
222  if (m_doSys[GLT])
223  SimpleDigi(nevt, engine, glt_obj_data);
224 
226  if (m_doSys[ETP])
227  iEvent.put(std::move(ecal_tp_data), instName[ETP][0]);
228  if (m_doSys[HTP])
229  iEvent.put(std::move(hcal_tp_data), instName[HTP][0]);
230  if (m_doSys[RCT])
231  iEvent.put(std::move(rct_em_data), instName[RCT][0]);
232  if (m_doSys[RCT])
233  iEvent.put(std::move(rct_rgn_data), instName[RCT][0]);
234  if (m_doSys[GCT])
235  iEvent.put(std::move(gct_isolaem_data), instName[GCT][0]);
236  if (m_doSys[GCT])
237  iEvent.put(std::move(gct_noisoem_data), instName[GCT][1]);
238  if (m_doSys[GCT])
239  iEvent.put(std::move(gct_cenjets_data), instName[GCT][2]);
240  if (m_doSys[GCT])
241  iEvent.put(std::move(gct_forjets_data), instName[GCT][3]);
242  if (m_doSys[GCT])
243  iEvent.put(std::move(gct_taujets_data), instName[GCT][4]);
244  if (m_doSys[DTP])
245  iEvent.put(std::move(dtp_ph_data), instName[DTP][0]);
246  if (m_doSys[DTP])
247  iEvent.put(std::move(dtp_th_data), instName[DTP][0]);
248  if (m_doSys[DTF])
249  iEvent.put(std::move(dtf_data), instName[DTF][0]);
250  if (m_doSys[DTF])
251  iEvent.put(std::move(dtf_trk_data), instName[DTF][1]);
252  if (m_doSys[CTP])
253  iEvent.put(std::move(ctp_data), instName[CTP][0]);
254  if (m_doSys[CTF])
255  iEvent.put(std::move(ctf_data), instName[CTF][0]);
256  if (m_doSys[CTF])
257  iEvent.put(std::move(ctf_trk_data), instName[CTF][1]);
258  if (m_doSys[RPC])
259  iEvent.put(std::move(rpc_cen_data), instName[RPC][0]);
260  if (m_doSys[RPC])
261  iEvent.put(std::move(rpc_for_data), instName[RPC][1]);
262  if (m_doSys[LTC])
263  iEvent.put(std::move(ltc_data), instName[LTC][0]);
264  if (m_doSys[GMT])
265  iEvent.put(std::move(gmt_data), instName[GMT][0]);
266  if (m_doSys[GMT])
267  iEvent.put(std::move(gmt_rdt_data), instName[GMT][0]);
268  if (m_doSys[GLT])
269  iEvent.put(std::move(glt_rdt_data), instName[GLT][0]);
270  if (m_doSys[GLT])
271  iEvent.put(std::move(glt_evm_data), instName[GLT][0]);
272  if (m_doSys[GLT])
273  iEvent.put(std::move(glt_obj_data), instName[GLT][0]);
274 
275  if (verbose())
276  std::cout << "L1DummyProducer::produce end.\n" << std::flush;
277 }
std::vector< L1CaloEmCand > L1CaloEmCollection
const int DEnsys
Definition: DEtrait.h:38
bool verbose
assert(be >=bs)
std::vector< L1CSCTrack > L1CSCTrackCollection
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
T getUntrackedParameter(std::string const &, T const &) const
std::vector< L1GctJetCand > L1GctJetCandCollection
int iEvent
Definition: GenABIO.cc:224
L1DummyProducer(const edm::ParameterSet &)
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:91
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:42
~L1DummyProducer() override
Definition: DEtrait.h:36
std::vector< L1CaloRegion > L1CaloRegionCollection
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
def move(src, dest)
Definition: eostools.py:511
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:99
std::vector< L1GctEmCand > L1GctEmCandCollection