test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1DummyProducer.cc
Go to the documentation of this file.
2 
6 
7 using namespace dedefs;
8 
10 
11  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag",0);
12 
13  if(verbose())
14  std::cout << "L1DummyProducer::L1DummyProducer...\n" << std::flush;
15 
16  std::vector<unsigned int> compColls
17  = iConfig.getUntrackedParameter<std::vector<unsigned int> >("DO_SYSTEM");
18 
19  for(int i=0; i<DEnsys; i++)
20  m_doSys[i] = compColls[i];
21 
22  if(verbose()) {
23  std::cout << "[L1DummyProducer] do sys? ";
24  for(int i=0; i<DEnsys; i++)
25  std::cout << m_doSys[i];
26  std::cout << std::endl;
27  for(int i=0; i<DEnsys; i++)
28  if(m_doSys[i])
29  std::cout << SystLabel[i] << " ";
30  std::cout << std::endl;
31  }
32 
33  std::string CollInstName[DEnsys][5];
34  for(int i=0; i<DEnsys; i++)
35  for(int j=0; j<5; j++)
36  CollInstName[i][j]=std::string("");
37 
38  CollInstName[GCT][0]+="isoEm" ;
39  CollInstName[GCT][1]+="nonIsoEm";
40  CollInstName[GCT][2]+="cenJets" ;
41  CollInstName[GCT][3]+="forJets" ;
42  CollInstName[GCT][4]+="tauJets" ;
43  CollInstName[DTF][0]+="DT" ;
44  CollInstName[DTF][1]+="DTTF" ;
45  CollInstName[CTF][0]+="CSC" ;
46  CollInstName[CTF][1]+="" ;
47  CollInstName[RPC][0]+="RPCb" ;
48  CollInstName[RPC][1]+="RPCf" ;
49 
50  for(int i=0; i<DEnsys; i++)
51  for(int j=0; j<5; j++)
52  instName[i][j] = CollInstName[i][j];
53 
54  if(verbose()) {
55  std::cout << "[L1DummyProducer] instName:\n";
56  for(int i=0; i<DEnsys; i++)
57  for(int j=0; j<5; j++)
58  if(instName[i][j] != "")
59  std::cout << i << " " << SystLabel[i] << " " << j << " "
60  << instName[i][j] << std::endl;
61  std::cout << std::flush;
62  }
63 
65  assert(ETP==0); assert(HTP==1); assert(RCT== 2); assert(GCT== 3);
66  assert(DTP==4); assert(DTF==5); assert(CTP== 6); assert(CTF== 7);
67  assert(RPC==8); assert(LTC==9); assert(GMT==10); assert(GLT==11);
68 
70  if(m_doSys[ETP]) produces<EcalTrigPrimDigiCollection> (instName[ETP][0]);
71  if(m_doSys[HTP]) produces<HcalTrigPrimDigiCollection> (instName[HTP][0]);
72  if(m_doSys[RCT]) produces<L1CaloEmCollection> (instName[RCT][0]);
73  if(m_doSys[RCT]) produces<L1CaloRegionCollection> (instName[RCT][0]);
74  if(m_doSys[GCT]) produces<L1GctEmCandCollection> (instName[GCT][0]);
75  if(m_doSys[GCT]) produces<L1GctEmCandCollection> (instName[GCT][1]);
76  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][2]);
77  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][3]);
78  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][4]);
79  if(m_doSys[DTP]) produces<L1MuDTChambPhContainer> (instName[DTP][0]);
80  if(m_doSys[DTP]) produces<L1MuDTChambThContainer> (instName[DTP][0]);
81  if(m_doSys[DTF]) produces<L1MuRegionalCandCollection> (instName[DTF][0]);
82  if(m_doSys[DTF]) produces<L1MuDTTrackContainer> (instName[DTF][1]);
83  if(m_doSys[CTP]) produces<CSCCorrelatedLCTDigiCollection> (instName[CTP][0]);
84  if(m_doSys[CTF]) produces<L1MuRegionalCandCollection> (instName[CTF][0]);
85  if(m_doSys[CTF]) produces<L1CSCTrackCollection> (instName[CTF][1]);
86  if(m_doSys[RPC]) produces<L1MuRegionalCandCollection> (instName[RPC][0]);
87  if(m_doSys[RPC]) produces<L1MuRegionalCandCollection> (instName[RPC][1]);
88  if(m_doSys[LTC]) produces<LTCDigiCollection> (instName[LTC][0]);
89  if(m_doSys[GMT]) produces<L1MuGMTCandCollection> (instName[GMT][0]);
90  if(m_doSys[GMT]) produces<L1MuGMTReadoutCollection> (instName[GMT][0]);
91  if(m_doSys[GLT]) produces<L1GlobalTriggerReadoutRecord> (instName[GLT][0]);
92  if(m_doSys[GLT]) produces<L1GlobalTriggerEvmReadoutRecord>(instName[GLT][0]);
93  if(m_doSys[GLT]) produces<L1GlobalTriggerObjectMapRecord> (instName[GLT][0]);
94 
97  if(!rng.isAvailable()) {
98  throw cms::Exception("Configuration")
99  << "L1DummyProducer requires the RandomNumberGeneratorService\n"
100  "which is not present in the configuration file. You must add the service\n"
101  "in the configuration file or remove the modules that require it.";
102  }
103  EBase_ = iConfig.getUntrackedParameter<double>("EnergyBase",100.);
104  ESigm_ = iConfig.getUntrackedParameter<double>("EnergySigm",10.);
105 
106  nevt_=0;
107 
108 }
109 
111 }
112 
113 void
115 
117  CLHEP::HepRandomEngine* engine = &rng->getEngine(iEvent.streamID());
118 
119  if(verbose())
120  std::cout << "L1DummyProducer::produce...\n" << std::flush;
121 
123  std::auto_ptr<EcalTrigPrimDigiCollection> ecal_tp_data(new EcalTrigPrimDigiCollection );
124  std::auto_ptr<HcalTrigPrimDigiCollection> hcal_tp_data(new HcalTrigPrimDigiCollection );
125  std::auto_ptr<L1CaloEmCollection> rct_em_data(new L1CaloEmCollection );
126  std::auto_ptr<L1CaloRegionCollection> rct_rgn_data(new L1CaloRegionCollection );
127  std::auto_ptr<L1GctEmCandCollection> gct_isolaem_data(new L1GctEmCandCollection );
128  std::auto_ptr<L1GctEmCandCollection> gct_noisoem_data(new L1GctEmCandCollection );
129  std::auto_ptr<L1GctJetCandCollection> gct_cenjets_data(new L1GctJetCandCollection );
130  std::auto_ptr<L1GctJetCandCollection> gct_forjets_data(new L1GctJetCandCollection );
131  std::auto_ptr<L1GctJetCandCollection> gct_taujets_data(new L1GctJetCandCollection );
132  std::auto_ptr<L1MuDTChambPhContainer> dtp_ph_data(new L1MuDTChambPhContainer );
133  std::auto_ptr<L1MuDTChambThContainer> dtp_th_data(new L1MuDTChambThContainer );
134  std::auto_ptr<L1MuRegionalCandCollection> dtf_data(new L1MuRegionalCandCollection );
135  std::auto_ptr<L1MuDTTrackContainer> dtf_trk_data(new L1MuDTTrackContainer );
136  std::auto_ptr<CSCCorrelatedLCTDigiCollection> ctp_data(new CSCCorrelatedLCTDigiCollection );
137  std::auto_ptr<L1MuRegionalCandCollection> ctf_data(new L1MuRegionalCandCollection );
138  std::auto_ptr<L1CSCTrackCollection> ctf_trk_data(new L1CSCTrackCollection );
139  std::auto_ptr<L1MuRegionalCandCollection> rpc_cen_data(new L1MuRegionalCandCollection );
140  std::auto_ptr<L1MuRegionalCandCollection> rpc_for_data(new L1MuRegionalCandCollection );
141  std::auto_ptr<LTCDigiCollection> ltc_data(new LTCDigiCollection );
142  std::auto_ptr<L1MuGMTCandCollection> gmt_data(new L1MuGMTCandCollection );
143  std::auto_ptr<L1MuGMTReadoutCollection> gmt_rdt_data(new L1MuGMTReadoutCollection );
144  std::auto_ptr<L1GlobalTriggerReadoutRecord> glt_rdt_data(new L1GlobalTriggerReadoutRecord );
145  std::auto_ptr<L1GlobalTriggerEvmReadoutRecord> glt_evm_data(new L1GlobalTriggerEvmReadoutRecord);
146  std::auto_ptr<L1GlobalTriggerObjectMapRecord> glt_obj_data(new L1GlobalTriggerObjectMapRecord );
147 
149  if(m_doSys[ETP]) SimpleDigi(engine, ecal_tp_data );
150  if(m_doSys[HTP]) SimpleDigi(engine, hcal_tp_data );
151  if(m_doSys[RCT]) SimpleDigi(engine, rct_em_data );
152  if(m_doSys[RCT]) SimpleDigi(engine, rct_rgn_data );
153  if(m_doSys[GCT]) SimpleDigi(engine, gct_isolaem_data,0);
154  if(m_doSys[GCT]) SimpleDigi(engine, gct_noisoem_data,1);
155  if(m_doSys[GCT]) SimpleDigi(engine, gct_cenjets_data,0);
156  if(m_doSys[GCT]) SimpleDigi(engine, gct_forjets_data,1);
157  if(m_doSys[GCT]) SimpleDigi(engine, gct_taujets_data,2);
158  if(m_doSys[DTP]) SimpleDigi(engine, dtp_ph_data );
159  if(m_doSys[DTP]) SimpleDigi(engine, dtp_th_data );
160  if(m_doSys[DTF]) SimpleDigi(engine, dtf_data,0);
161  if(m_doSys[DTF]) SimpleDigi(engine, dtf_trk_data );
162  if(m_doSys[CTP]) SimpleDigi(engine, ctp_data );
163  if(m_doSys[CTF]) SimpleDigi(engine, ctf_data,2);
164  if(m_doSys[CTF]) SimpleDigi(engine, ctf_trk_data );
165  if(m_doSys[RPC]) SimpleDigi(engine, rpc_cen_data,1);
166  if(m_doSys[RPC]) SimpleDigi(engine, rpc_for_data,3);
167  if(m_doSys[LTC]) SimpleDigi(engine, ltc_data );
168  if(m_doSys[GMT]) SimpleDigi(engine, gmt_data );
169  if(m_doSys[GMT]) SimpleDigi(engine, gmt_rdt_data );
170  if(m_doSys[GLT]) SimpleDigi(engine, glt_rdt_data );
171  if(m_doSys[GLT]) SimpleDigi(engine, glt_evm_data );
172  if(m_doSys[GLT]) SimpleDigi(engine, glt_obj_data );
173 
175  if(m_doSys[ETP]) iEvent.put( ecal_tp_data,instName[ETP][0]);
176  if(m_doSys[HTP]) iEvent.put( hcal_tp_data,instName[HTP][0]);
177  if(m_doSys[RCT]) iEvent.put( rct_em_data,instName[RCT][0]);
178  if(m_doSys[RCT]) iEvent.put( rct_rgn_data,instName[RCT][0]);
179  if(m_doSys[GCT]) iEvent.put(gct_isolaem_data,instName[GCT][0]);
180  if(m_doSys[GCT]) iEvent.put(gct_noisoem_data,instName[GCT][1]);
181  if(m_doSys[GCT]) iEvent.put(gct_cenjets_data,instName[GCT][2]);
182  if(m_doSys[GCT]) iEvent.put(gct_forjets_data,instName[GCT][3]);
183  if(m_doSys[GCT]) iEvent.put(gct_taujets_data,instName[GCT][4]);
184  if(m_doSys[DTP]) iEvent.put( dtp_ph_data,instName[DTP][0]);
185  if(m_doSys[DTP]) iEvent.put( dtp_th_data,instName[DTP][0]);
186  if(m_doSys[DTF]) iEvent.put( dtf_data,instName[DTF][0]);
187  if(m_doSys[DTF]) iEvent.put( dtf_trk_data,instName[DTF][1]);
188  if(m_doSys[CTP]) iEvent.put( ctp_data,instName[CTP][0]);
189  if(m_doSys[CTF]) iEvent.put( ctf_data,instName[CTF][0]);
190  if(m_doSys[CTF]) iEvent.put( ctf_trk_data,instName[CTF][1]);
191  if(m_doSys[RPC]) iEvent.put( rpc_cen_data,instName[RPC][0]);
192  if(m_doSys[RPC]) iEvent.put( rpc_for_data,instName[RPC][1]);
193  if(m_doSys[LTC]) iEvent.put( ltc_data,instName[LTC][0]);
194  if(m_doSys[GMT]) iEvent.put( gmt_data,instName[GMT][0]);
195  if(m_doSys[GMT]) iEvent.put( gmt_rdt_data,instName[GMT][0]);
196  if(m_doSys[GLT]) iEvent.put( glt_rdt_data,instName[GLT][0]);
197  if(m_doSys[GLT]) iEvent.put( glt_evm_data,instName[GLT][0]);
198  if(m_doSys[GLT]) iEvent.put( glt_obj_data,instName[GLT][0]);
199 
200  nevt_++;
201 
202  if(verbose())
203  std::cout << "L1DummyProducer::produce end.\n" << std::flush;
204 
205 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< L1CaloEmCand > L1CaloEmCollection
const int DEnsys
Definition: DEtrait.h:38
bool verbose
assert(m_qm.get())
std::vector< L1CSCTrack > L1CSCTrackCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
int j
Definition: DBlmapReader.cc:9
L1DummyProducer(const edm::ParameterSet &)
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:106
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
StreamID streamID() const
Definition: Event.h:79
tuple cout
Definition: gather_cfg.py:121
std::vector< L1CaloRegion > L1CaloRegionCollection
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:78
std::vector< L1GctEmCand > L1GctEmCandCollection