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 
3 using namespace dedefs;
4 
6 
7  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag",0);
8 
9  if(verbose())
10  std::cout << "L1DummyProducer::L1DummyProducer...\n" << std::flush;
11 
12  std::vector<unsigned int> compColls
13  = iConfig.getUntrackedParameter<std::vector<unsigned int> >("DO_SYSTEM");
14 
15  for(int i=0; i<DEnsys; i++)
16  m_doSys[i] = compColls[i];
17 
18  if(verbose()) {
19  std::cout << "[L1DummyProducer] do sys? ";
20  for(int i=0; i<DEnsys; i++)
21  std::cout << m_doSys[i];
22  std::cout << std::endl;
23  for(int i=0; i<DEnsys; i++)
24  if(m_doSys[i])
25  std::cout << SystLabel[i] << " ";
26  std::cout << std::endl;
27  }
28 
29  std::string CollInstName[DEnsys][5];
30  for(int i=0; i<DEnsys; i++)
31  for(int j=0; j<5; j++)
32  CollInstName[i][j]=std::string("");
33 
34  CollInstName[GCT][0]+="isoEm" ;
35  CollInstName[GCT][1]+="nonIsoEm";
36  CollInstName[GCT][2]+="cenJets" ;
37  CollInstName[GCT][3]+="forJets" ;
38  CollInstName[GCT][4]+="tauJets" ;
39  CollInstName[DTF][0]+="DT" ;
40  CollInstName[DTF][1]+="DTTF" ;
41  CollInstName[CTF][0]+="CSC" ;
42  CollInstName[CTF][1]+="" ;
43  CollInstName[RPC][0]+="RPCb" ;
44  CollInstName[RPC][1]+="RPCf" ;
45 
46  for(int i=0; i<DEnsys; i++)
47  for(int j=0; j<5; j++)
48  instName[i][j] = CollInstName[i][j];
49 
50  if(verbose()) {
51  std::cout << "[L1DummyProducer] instName:\n";
52  for(int i=0; i<DEnsys; i++)
53  for(int j=0; j<5; j++)
54  if(instName[i][j] != "")
55  std::cout << i << " " << SystLabel[i] << " " << j << " "
56  << instName[i][j] << std::endl;
57  std::cout << std::flush;
58  }
59 
61  assert(ETP==0); assert(HTP==1); assert(RCT== 2); assert(GCT== 3);
62  assert(DTP==4); assert(DTF==5); assert(CTP== 6); assert(CTF== 7);
63  assert(RPC==8); assert(LTC==9); assert(GMT==10); assert(GLT==11);
64 
66  if(m_doSys[ETP]) produces<EcalTrigPrimDigiCollection> (instName[ETP][0]);
67  if(m_doSys[HTP]) produces<HcalTrigPrimDigiCollection> (instName[HTP][0]);
68  if(m_doSys[RCT]) produces<L1CaloEmCollection> (instName[RCT][0]);
69  if(m_doSys[RCT]) produces<L1CaloRegionCollection> (instName[RCT][0]);
70  if(m_doSys[GCT]) produces<L1GctEmCandCollection> (instName[GCT][0]);
71  if(m_doSys[GCT]) produces<L1GctEmCandCollection> (instName[GCT][1]);
72  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][2]);
73  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][3]);
74  if(m_doSys[GCT]) produces<L1GctJetCandCollection> (instName[GCT][4]);
75  if(m_doSys[DTP]) produces<L1MuDTChambPhContainer> (instName[DTP][0]);
76  if(m_doSys[DTP]) produces<L1MuDTChambThContainer> (instName[DTP][0]);
77  if(m_doSys[DTF]) produces<L1MuRegionalCandCollection> (instName[DTF][0]);
78  if(m_doSys[DTF]) produces<L1MuDTTrackContainer> (instName[DTF][1]);
79  if(m_doSys[CTP]) produces<CSCCorrelatedLCTDigiCollection> (instName[CTP][0]);
80  if(m_doSys[CTF]) produces<L1MuRegionalCandCollection> (instName[CTF][0]);
81  if(m_doSys[CTF]) produces<L1CSCTrackCollection> (instName[CTF][1]);
82  if(m_doSys[RPC]) produces<L1MuRegionalCandCollection> (instName[RPC][0]);
83  if(m_doSys[RPC]) produces<L1MuRegionalCandCollection> (instName[RPC][1]);
84  if(m_doSys[LTC]) produces<LTCDigiCollection> (instName[LTC][0]);
85  if(m_doSys[GMT]) produces<L1MuGMTCandCollection> (instName[GMT][0]);
86  if(m_doSys[GMT]) produces<L1MuGMTReadoutCollection> (instName[GMT][0]);
87  if(m_doSys[GLT]) produces<L1GlobalTriggerReadoutRecord> (instName[GLT][0]);
88  if(m_doSys[GLT]) produces<L1GlobalTriggerEvmReadoutRecord>(instName[GLT][0]);
89  if(m_doSys[GLT]) produces<L1GlobalTriggerObjectMapRecord> (instName[GLT][0]);
90 
93  CLHEP::HepRandomEngine& engine = rng->getEngine();
94  rndFlat_ = new CLHEP::RandFlat (engine, 0., 1.);
95  rndGaus_ = new CLHEP::RandGaussQ(engine, 0., 1.);
96  EBase_ = iConfig.getUntrackedParameter<double>("EnergyBase",100.);
97  ESigm_ = iConfig.getUntrackedParameter<double>("EnergySigm",10.);
98 
99  nevt_=0;
100 
101 }
102 
104  delete rndFlat_;
105  delete rndGaus_;
106 }
107 
108 void
110 
111  if(verbose())
112  std::cout << "L1DummyProducer::produce...\n" << std::flush;
113 
115  std::auto_ptr<EcalTrigPrimDigiCollection> ecal_tp_data(new EcalTrigPrimDigiCollection );
116  std::auto_ptr<HcalTrigPrimDigiCollection> hcal_tp_data(new HcalTrigPrimDigiCollection );
117  std::auto_ptr<L1CaloEmCollection> rct_em_data(new L1CaloEmCollection );
118  std::auto_ptr<L1CaloRegionCollection> rct_rgn_data(new L1CaloRegionCollection );
119  std::auto_ptr<L1GctEmCandCollection> gct_isolaem_data(new L1GctEmCandCollection );
120  std::auto_ptr<L1GctEmCandCollection> gct_noisoem_data(new L1GctEmCandCollection );
121  std::auto_ptr<L1GctJetCandCollection> gct_cenjets_data(new L1GctJetCandCollection );
122  std::auto_ptr<L1GctJetCandCollection> gct_forjets_data(new L1GctJetCandCollection );
123  std::auto_ptr<L1GctJetCandCollection> gct_taujets_data(new L1GctJetCandCollection );
124  std::auto_ptr<L1MuDTChambPhContainer> dtp_ph_data(new L1MuDTChambPhContainer );
125  std::auto_ptr<L1MuDTChambThContainer> dtp_th_data(new L1MuDTChambThContainer );
126  std::auto_ptr<L1MuRegionalCandCollection> dtf_data(new L1MuRegionalCandCollection );
127  std::auto_ptr<L1MuDTTrackContainer> dtf_trk_data(new L1MuDTTrackContainer );
128  std::auto_ptr<CSCCorrelatedLCTDigiCollection> ctp_data(new CSCCorrelatedLCTDigiCollection );
129  std::auto_ptr<L1MuRegionalCandCollection> ctf_data(new L1MuRegionalCandCollection );
130  std::auto_ptr<L1CSCTrackCollection> ctf_trk_data(new L1CSCTrackCollection );
131  std::auto_ptr<L1MuRegionalCandCollection> rpc_cen_data(new L1MuRegionalCandCollection );
132  std::auto_ptr<L1MuRegionalCandCollection> rpc_for_data(new L1MuRegionalCandCollection );
133  std::auto_ptr<LTCDigiCollection> ltc_data(new LTCDigiCollection );
134  std::auto_ptr<L1MuGMTCandCollection> gmt_data(new L1MuGMTCandCollection );
135  std::auto_ptr<L1MuGMTReadoutCollection> gmt_rdt_data(new L1MuGMTReadoutCollection );
136  std::auto_ptr<L1GlobalTriggerReadoutRecord> glt_rdt_data(new L1GlobalTriggerReadoutRecord );
137  std::auto_ptr<L1GlobalTriggerEvmReadoutRecord> glt_evm_data(new L1GlobalTriggerEvmReadoutRecord);
138  std::auto_ptr<L1GlobalTriggerObjectMapRecord> glt_obj_data(new L1GlobalTriggerObjectMapRecord );
139 
141  if(m_doSys[ETP]) SimpleDigi( ecal_tp_data );
142  if(m_doSys[HTP]) SimpleDigi( hcal_tp_data );
143  if(m_doSys[RCT]) SimpleDigi( rct_em_data );
144  if(m_doSys[RCT]) SimpleDigi( rct_rgn_data );
145  if(m_doSys[GCT]) SimpleDigi(gct_isolaem_data,0);
146  if(m_doSys[GCT]) SimpleDigi(gct_noisoem_data,1);
147  if(m_doSys[GCT]) SimpleDigi(gct_cenjets_data,0);
148  if(m_doSys[GCT]) SimpleDigi(gct_forjets_data,1);
149  if(m_doSys[GCT]) SimpleDigi(gct_taujets_data,2);
150  if(m_doSys[DTP]) SimpleDigi( dtp_ph_data );
151  if(m_doSys[DTP]) SimpleDigi( dtp_th_data );
152  if(m_doSys[DTF]) SimpleDigi( dtf_data,0);
153  if(m_doSys[DTF]) SimpleDigi( dtf_trk_data );
154  if(m_doSys[CTP]) SimpleDigi( ctp_data );
155  if(m_doSys[CTF]) SimpleDigi( ctf_data,2);
156  if(m_doSys[CTF]) SimpleDigi( ctf_trk_data );
157  if(m_doSys[RPC]) SimpleDigi( rpc_cen_data,1);
158  if(m_doSys[RPC]) SimpleDigi( rpc_for_data,3);
159  if(m_doSys[LTC]) SimpleDigi( ltc_data );
160  if(m_doSys[GMT]) SimpleDigi( gmt_data );
161  if(m_doSys[GMT]) SimpleDigi( gmt_rdt_data );
162  if(m_doSys[GLT]) SimpleDigi( glt_rdt_data );
163  if(m_doSys[GLT]) SimpleDigi( glt_evm_data );
164  if(m_doSys[GLT]) SimpleDigi( glt_obj_data );
165 
167  if(m_doSys[ETP]) iEvent.put( ecal_tp_data,instName[ETP][0]);
168  if(m_doSys[HTP]) iEvent.put( hcal_tp_data,instName[HTP][0]);
169  if(m_doSys[RCT]) iEvent.put( rct_em_data,instName[RCT][0]);
170  if(m_doSys[RCT]) iEvent.put( rct_rgn_data,instName[RCT][0]);
171  if(m_doSys[GCT]) iEvent.put(gct_isolaem_data,instName[GCT][0]);
172  if(m_doSys[GCT]) iEvent.put(gct_noisoem_data,instName[GCT][1]);
173  if(m_doSys[GCT]) iEvent.put(gct_cenjets_data,instName[GCT][2]);
174  if(m_doSys[GCT]) iEvent.put(gct_forjets_data,instName[GCT][3]);
175  if(m_doSys[GCT]) iEvent.put(gct_taujets_data,instName[GCT][4]);
176  if(m_doSys[DTP]) iEvent.put( dtp_ph_data,instName[DTP][0]);
177  if(m_doSys[DTP]) iEvent.put( dtp_th_data,instName[DTP][0]);
178  if(m_doSys[DTF]) iEvent.put( dtf_data,instName[DTF][0]);
179  if(m_doSys[DTF]) iEvent.put( dtf_trk_data,instName[DTF][1]);
180  if(m_doSys[CTP]) iEvent.put( ctp_data,instName[CTP][0]);
181  if(m_doSys[CTF]) iEvent.put( ctf_data,instName[CTF][0]);
182  if(m_doSys[CTF]) iEvent.put( ctf_trk_data,instName[CTF][1]);
183  if(m_doSys[RPC]) iEvent.put( rpc_cen_data,instName[RPC][0]);
184  if(m_doSys[RPC]) iEvent.put( rpc_for_data,instName[RPC][1]);
185  if(m_doSys[LTC]) iEvent.put( ltc_data,instName[LTC][0]);
186  if(m_doSys[GMT]) iEvent.put( gmt_data,instName[GMT][0]);
187  if(m_doSys[GMT]) iEvent.put( gmt_rdt_data,instName[GMT][0]);
188  if(m_doSys[GLT]) iEvent.put( glt_rdt_data,instName[GLT][0]);
189  if(m_doSys[GLT]) iEvent.put( glt_evm_data,instName[GLT][0]);
190  if(m_doSys[GLT]) iEvent.put( glt_obj_data,instName[GLT][0]);
191 
192  nevt_++;
193 
194  if(verbose())
195  std::cout << "L1DummyProducer::produce end.\n" << std::flush;
196 
197 }
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
std::vector< L1CSCTrack > L1CSCTrackCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
int j
Definition: DBlmapReader.cc:9
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
L1DummyProducer(const edm::ParameterSet &)
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:107
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
virtual void produce(edm::Event &, const edm::EventSetup &)
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
tuple cout
Definition: gather_cfg.py:121
std::vector< L1CaloRegion > L1CaloRegionCollection
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:77
std::vector< L1GctEmCand > L1GctEmCandCollection