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 
175  if (m_doSys[ETP])
176  SimpleDigi(engine, ecal_tp_data);
177  if (m_doSys[HTP])
178  SimpleDigi(engine, hcal_tp_data);
179  if (m_doSys[RCT])
180  SimpleDigi(engine, rct_em_data);
181  if (m_doSys[RCT])
182  SimpleDigi(engine, rct_rgn_data);
183  if (m_doSys[GCT])
184  SimpleDigi(engine, gct_isolaem_data, 0);
185  if (m_doSys[GCT])
186  SimpleDigi(engine, gct_noisoem_data, 1);
187  if (m_doSys[GCT])
188  SimpleDigi(engine, gct_cenjets_data, 0);
189  if (m_doSys[GCT])
190  SimpleDigi(engine, gct_forjets_data, 1);
191  if (m_doSys[GCT])
192  SimpleDigi(engine, gct_taujets_data, 2);
193  if (m_doSys[DTP])
194  SimpleDigi(engine, dtp_ph_data);
195  if (m_doSys[DTP])
196  SimpleDigi(engine, dtp_th_data);
197  if (m_doSys[DTF])
198  SimpleDigi(engine, dtf_data, 0);
199  if (m_doSys[DTF])
200  SimpleDigi(engine, dtf_trk_data);
201  if (m_doSys[CTP])
202  SimpleDigi(engine, ctp_data);
203  if (m_doSys[CTF])
204  SimpleDigi(engine, ctf_data, 2);
205  if (m_doSys[CTF])
206  SimpleDigi(engine, ctf_trk_data);
207  if (m_doSys[RPC])
208  SimpleDigi(engine, rpc_cen_data, 1);
209  if (m_doSys[RPC])
210  SimpleDigi(engine, rpc_for_data, 3);
211  if (m_doSys[LTC])
212  SimpleDigi(engine, ltc_data);
213  if (m_doSys[GMT])
214  SimpleDigi(engine, gmt_data);
215  if (m_doSys[GMT])
216  SimpleDigi(engine, gmt_rdt_data);
217  if (m_doSys[GLT])
218  SimpleDigi(engine, glt_rdt_data);
219  if (m_doSys[GLT])
220  SimpleDigi(engine, glt_evm_data);
221  if (m_doSys[GLT])
222  SimpleDigi(engine, glt_obj_data);
223 
225  if (m_doSys[ETP])
226  iEvent.put(std::move(ecal_tp_data), instName[ETP][0]);
227  if (m_doSys[HTP])
228  iEvent.put(std::move(hcal_tp_data), instName[HTP][0]);
229  if (m_doSys[RCT])
230  iEvent.put(std::move(rct_em_data), instName[RCT][0]);
231  if (m_doSys[RCT])
232  iEvent.put(std::move(rct_rgn_data), instName[RCT][0]);
233  if (m_doSys[GCT])
234  iEvent.put(std::move(gct_isolaem_data), instName[GCT][0]);
235  if (m_doSys[GCT])
236  iEvent.put(std::move(gct_noisoem_data), instName[GCT][1]);
237  if (m_doSys[GCT])
238  iEvent.put(std::move(gct_cenjets_data), instName[GCT][2]);
239  if (m_doSys[GCT])
240  iEvent.put(std::move(gct_forjets_data), instName[GCT][3]);
241  if (m_doSys[GCT])
242  iEvent.put(std::move(gct_taujets_data), instName[GCT][4]);
243  if (m_doSys[DTP])
244  iEvent.put(std::move(dtp_ph_data), instName[DTP][0]);
245  if (m_doSys[DTP])
246  iEvent.put(std::move(dtp_th_data), instName[DTP][0]);
247  if (m_doSys[DTF])
248  iEvent.put(std::move(dtf_data), instName[DTF][0]);
249  if (m_doSys[DTF])
250  iEvent.put(std::move(dtf_trk_data), instName[DTF][1]);
251  if (m_doSys[CTP])
252  iEvent.put(std::move(ctp_data), instName[CTP][0]);
253  if (m_doSys[CTF])
254  iEvent.put(std::move(ctf_data), instName[CTF][0]);
255  if (m_doSys[CTF])
256  iEvent.put(std::move(ctf_trk_data), instName[CTF][1]);
257  if (m_doSys[RPC])
258  iEvent.put(std::move(rpc_cen_data), instName[RPC][0]);
259  if (m_doSys[RPC])
260  iEvent.put(std::move(rpc_for_data), instName[RPC][1]);
261  if (m_doSys[LTC])
262  iEvent.put(std::move(ltc_data), instName[LTC][0]);
263  if (m_doSys[GMT])
264  iEvent.put(std::move(gmt_data), instName[GMT][0]);
265  if (m_doSys[GMT])
266  iEvent.put(std::move(gmt_rdt_data), instName[GMT][0]);
267  if (m_doSys[GLT])
268  iEvent.put(std::move(glt_rdt_data), instName[GLT][0]);
269  if (m_doSys[GLT])
270  iEvent.put(std::move(glt_evm_data), instName[GLT][0]);
271  if (m_doSys[GLT])
272  iEvent.put(std::move(glt_obj_data), instName[GLT][0]);
273 
274  nevt_++;
275 
276  if (verbose())
277  std::cout << "L1DummyProducer::produce end.\n" << std::flush;
278 }
dedefs::HTP
Definition: DEtrait.h:40
dedefs::SystLabel
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:42
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
mps_fire.i
i
Definition: mps_fire.py:428
L1DummyProducer::~L1DummyProducer
~L1DummyProducer() override
Definition: L1DummyProducer.cc:139
dedefs::RPC
Definition: DEtrait.h:40
L1MuGMTCandCollection
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:99
RandomNumberGenerator.h
L1GctJetCandCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
Definition: L1GctCollections.h:31
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dedefs::CTP
Definition: DEtrait.h:40
dedefs::GMT
Definition: DEtrait.h:40
cms::cuda::assert
assert(be >=bs)
edm::SortedCollection
Definition: SortedCollection.h:49
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
L1CSCTrackCollection
std::vector< L1CSCTrack > L1CSCTrackCollection
Definition: L1CSCTrackCollection.h:8
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
dedefs::DTP
Definition: DEtrait.h:40
L1CaloEmCollection
std::vector< L1CaloEmCand > L1CaloEmCollection
Definition: L1CaloCollections.h:10
L1GlobalTriggerEvmReadoutRecord
Definition: L1GlobalTriggerEvmReadoutRecord.h:36
dedefs::GCT
Definition: DEtrait.h:40
Service.h
dedefs::ETP
Definition: DEtrait.h:40
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
LTCDigiCollection
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:91
edm::ParameterSet
Definition: ParameterSet.h:47
dedefs::GLT
Definition: DEtrait.h:40
L1GlobalTriggerObjectMapRecord
Definition: L1GlobalTriggerObjectMapRecord.h:29
dedefs::DTF
Definition: DEtrait.h:40
edm::Service< edm::RandomNumberGenerator >
iEvent
int iEvent
Definition: GenABIO.cc:224
dedefs::LTC
Definition: DEtrait.h:40
edm::EventSetup
Definition: EventSetup.h:58
CSCCorrelatedLCTDigiCollection
dedefs
Definition: DEtrait.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1DummyProducer::L1DummyProducer
L1DummyProducer(const edm::ParameterSet &)
Definition: L1DummyProducer.cc:9
dedefs::DEnsys
const int DEnsys
Definition: DEtrait.h:38
L1MuGMTReadoutCollection
Definition: L1MuGMTReadoutCollection.h:39
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1CaloRegionCollection
std::vector< L1CaloRegion > L1CaloRegionCollection
Definition: L1CaloCollections.h:11
L1GctEmCandCollection
std::vector< L1GctEmCand > L1GctEmCandCollection
Definition: L1GctCollections.h:30
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:245
Exception.h
L1MuRegionalCandCollection
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
Definition: RPCRecHitFilter.cc:53
L1DummyProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1DummyProducer.cc:141
L1DummyProducer.h
L1MuDTTrackContainer
Definition: L1MuDTTrackContainer.h:33
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
L1MuDTChambThContainer
Definition: L1MuDTChambThContainer.h:33
dedefs::RCT
Definition: DEtrait.h:40
dedefs::CTF
Definition: DEtrait.h:40