1 #ifndef L1_DUMMY_PRODUCER_H 2 #define L1_DUMMY_PRODUCER_H 37 #include "CLHEP/Random/RandomEngine.h" 38 #include "CLHEP/Random/RandGaussQ.h" 72 CLHEP::HepRandomEngine* engine,
73 std::unique_ptr<EcalTrigPrimDigiCollection>&
data,
76 std::cout <<
"L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection>....\n" << std::flush;
77 int side = (engine->flat() > 0.5) ? -1 : 1;
78 int ieta = (
int)(1 + 17 * engine->flat());
79 int iphi = (
int)(1 + 72 * engine->flat());
83 bool fg = (engine->flat() > 0.5);
84 int ttf = (
int)(8 * engine->flat());
88 data->push_back(e_digi);
92 std::cout <<
"L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection> end.\n" << std::flush;
97 CLHEP::HepRandomEngine* engine,
98 std::unique_ptr<HcalTrigPrimDigiCollection>&
data,
101 std::cout <<
"L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection>....\n" << std::flush;
102 int side = (engine->flat() > 0.5) ? -1 : 1;
103 int ieta = (
int)(1 + 17 * engine->flat());
104 int iphi = (
int)(1 + 72 * engine->flat());
111 data->push_back(h_digi);
115 std::cout <<
"L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection> end.\n" << std::flush;
120 CLHEP::HepRandomEngine* engine,
121 std::unique_ptr<L1CaloEmCollection>&
data,
124 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloEmCollection>....\n" << std::flush;
126 unsigned rank =
energy & 0x3f;
127 unsigned region = (engine->flat() > 0.5 ? 0 : 1);
128 unsigned card = (unsigned)(7 * engine->flat());
129 unsigned crate = (unsigned)(18 * engine->flat());
130 bool iso = (engine->flat() > 0.4);
131 uint16_t
index = (unsigned)(4 * engine->flat());
137 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloEmCollection> end.\n" << std::flush;
142 CLHEP::HepRandomEngine* engine,
143 std::unique_ptr<L1CaloRegionCollection>&
data,
146 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloRegionCollection>....\n" << std::flush;
149 bool overFlow =
false;
150 bool tauVeto =
false;
153 unsigned crate = (unsigned)(18 * engine->flat());
154 unsigned card = (unsigned)(7 * engine->flat());
155 unsigned rgn = crate % 2;
160 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloRegionCollection> end.\n" << std::flush;
165 CLHEP::HepRandomEngine* engine,
166 std::unique_ptr<L1GctEmCandCollection>&
data,
169 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctEmCandCollection>....\n" << std::flush;
180 <<
"L1DummyProducer::SimpleDigi production of L1GctEmCandCollection " 181 <<
" invalid type: " <<
type << std::endl;
184 unsigned rank =
energy & 0x3f;
185 unsigned phi = (unsigned)(18 * engine->flat());
186 unsigned eta = (unsigned)(7 * engine->flat());
187 if (engine->flat() > 0.5)
194 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctEmCandCollection> end.\n" << std::flush;
199 CLHEP::HepRandomEngine* engine,
200 std::unique_ptr<L1GctJetCandCollection>&
data,
203 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctJetCandCollection>....\n" << std::flush;
220 <<
"L1DummyProducer::SimpleDigi production of L1GctJetCandCollection " 221 <<
" invalid type: " <<
type << std::endl;
225 unsigned rank =
energy & 0x3f;
226 unsigned phi = (unsigned)(18 * engine->flat());
227 unsigned eta = (unsigned)(7 * engine->flat());
228 if (engine->flat() > 0.5)
234 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctJetCandCollection> end.\n" << std::flush;
239 CLHEP::HepRandomEngine* engine,
240 std::unique_ptr<L1MuRegionalCandCollection>&
data,
243 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection>....\n" << std::flush;
246 unsigned type_idx =
type;
249 float phiv(0.), etav(0.), ptv(0.);
250 for (
int i = 0;
i < 4;
i++) {
251 phi = (
int)(144 * engine->flat());
252 eta = (
int)(63 * engine->flat());
254 etav = 2.5 * (-1 + 2 *
eta / 63.);
255 pt = ((
int)(32 * engine->flat())) & 0x1f;
256 ptv = 100 * (
pt / 31.);
257 charge = (engine->flat() > 0.5 ? 0 : 1);
263 cand.setPhiValue(phiv);
264 cand.setEtaValue(etav);
265 cand.setPtValue(ptv);
271 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection> end.\n" << std::flush;
276 CLHEP::HepRandomEngine* engine,
277 std::unique_ptr<L1MuDTTrackContainer>&
data,
282 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTTrackContainer>....\n" << std::flush;
285 typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
286 std::unique_ptr<L1MuDTTrackCandCollection> tracksd(
new L1MuDTTrackCandCollection());
287 for (L1MuRegionalCandCollection::const_iterator it =
tracks->begin(); it !=
tracks->end(); it++) {
290 cnd->
setBx(it->bx());
292 tracksd->push_back(*cnd);
294 data->setContainer(*tracksd);
296 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTTrackContainer> end.\n" << std::flush;
303 CLHEP::HepRandomEngine* engine,
304 std::unique_ptr<L1MuDTChambPhContainer>&
data,
307 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer>....\n" << std::flush;
308 typedef std::vector<L1MuDTChambPhDigi> Phi_Container;
310 Phi_Container
tracks(ntrk);
311 int ubx, uwh, usc, ust, uphr, uphb, uqua, utag, ucnt;
312 for (
int i = 0;
i < ntrk;
i++) {
322 uwh = (
int)(-2 + 5 * engine->flat());
323 usc = (
int)(12 * engine->flat());
324 ust = (
int)(1. + 4 * engine->flat());
325 uqua = (
int)(8 * engine->flat());
333 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer> end.\n" << std::flush;
338 CLHEP::HepRandomEngine* engine,
339 std::unique_ptr<L1MuDTChambThContainer>&
data,
342 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambThContainer>....\n" << std::flush;
343 typedef std::vector<L1MuDTChambThDigi> The_Container;
345 The_Container
tracks(ntrk);
346 int ubx, uwh, usc, ust, uos[7], uqa[7];
347 for (
int i = 0;
i < ntrk;
i++) {
349 uwh = (
int)(-2 + 5 * engine->flat());
350 usc = (
int)(12 * engine->flat());
351 ust = (
int)(1. + 4 * engine->flat());
352 for (
int j = 0;
j < 7;
j++) {
353 uos[
j] = (engine->flat() > 0.5 ? 0 : 1);
354 uqa[
j] = (engine->flat() > 0.5 ? 0 : 1);
364 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambThContainer> end.\n" << std::flush;
369 CLHEP::HepRandomEngine* engine,
370 std::unique_ptr<L1MuGMTCandCollection>&
data,
373 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTCandCollection>....\n" << std::flush;
385 double eng =
EBase_ +
ESigm_ * CLHEP::RandGaussQ::shoot(engine);
387 double eta = 2.5 * (-1 + 2 * engine->flat());
388 cand.setPtValue(eng);
391 unsigned engp = (unsigned)(
EBase_ +
ESigm_ * CLHEP::RandGaussQ::shoot(engine));
392 unsigned phip = (unsigned)(255 * engine->flat());
393 unsigned etap = (unsigned)(63 * engine->flat());
394 cand.setPtPacked(engp & 0x1f);
395 cand.setPhiPacked(phip & 0x7f);
396 cand.setEtaPacked(etap & 0x3f);
397 double r = engine->flat();
398 cand.setIsolation(
r > 0.2);
399 cand.setMIP(
r > 0.7);
400 cand.setChargePacked(
r > 0.5 ? 0 : 1);
404 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTCandCollection> end.\n" << std::flush;
409 CLHEP::HepRandomEngine* engine,
410 std::unique_ptr<L1MuGMTReadoutCollection>&
data,
413 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection>....\n" << std::flush;
427 for (
int i = 0;
i < 4;
i++) {
433 for (
int nr = 0;
nr < 4;
nr++) {
438 int eta = (
int)(14 * engine->flat());
439 int phi = (
int)(18 * engine->flat());
443 data->addRecord(rec);
454 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection> end.\n" << std::flush;
459 CLHEP::HepRandomEngine*,
460 std::unique_ptr<LTCDigiCollection>&
data,
463 std::cout <<
"L1DummyProducer::SimpleDigi<LTCDigiCollection>....\n" << std::flush;
491 std::cout <<
"L1DummyProducer::SimpleDigi<LTCDigiCollection> end.\n" << std::flush;
496 CLHEP::HepRandomEngine* engine,
497 std::unique_ptr<CSCCorrelatedLCTDigiCollection>&
data,
500 std::cout <<
"L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection>....\n" << std::flush;
507 enum eMinNum {
MIN_ENDCAP = 1, MIN_STATION = 1, MIN_RING = 1, MIN_CHAMBER = 1, MIN_LAYER = 1 };
508 enum eMaxNum {
MAX_ENDCAP = 2, MAX_STATION = 4, MAX_RING = 4, MAX_CHAMBER = 36, MAX_LAYER = 6 };
509 float rnd = engine->flat();
511 int st = (
int)(MIN_STATION + (MAX_STATION - MIN_STATION) * rnd + 1);
512 int rg = (
int)(MIN_RING + (MAX_RING - MIN_RING) * rnd + 1);
513 int ch = (
int)(MIN_CHAMBER + (MAX_CHAMBER - MIN_CHAMBER) * rnd + 1);
514 int lr = (
int)(MIN_LAYER + (MAX_LAYER - MIN_LAYER) * rnd + 1);
518 data->insertDigi(did, dg);
520 std::cout <<
"L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection> end.\n" << std::flush;
525 CLHEP::HepRandomEngine* engine,
526 std::unique_ptr<L1CSCTrackCollection>&
data,
529 std::cout <<
"L1DummyProducer::SimpleDigi<L1CSCTrackCollection>...\n" << std::flush;
541 L1CSCTrack l1csctrk = std::make_pair(l1trk, *dgcoll);
542 data->push_back(l1csctrk);
548 std::cout <<
"L1DummyProducer::SimpleDigi<L1CSCTrackCollection> end.\n" << std::flush;
void setBxInEvent(int bxie)
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
bool m_doSys[dedefs::DEnsys]
std::pair< csc::L1Track, CSCCorrelatedLCTDigiCollection > L1CSCTrack
void setGMTBrlCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT barrel candidate
Level-1 Trigger jet candidate.
void setGMTFwdCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT forward candidate
Level-1 Region Calorimeter Trigger EM candidate.
void setInputCand(int nr, unsigned data)
set Input muon
unsigned getDataWord() const
return data word
void setPtValue(float ptVal)
Set Pt Value.
Level-1 Trigger EM candidate at output of GCT.
void setQuietbit(int eta, int phi)
set Quiet bit
float phiValue() const
get phi-value of muon candidate in radians (low edge of bin)
void setMIPbit(int eta, int phi)
set MIP bit
void setBx(int bx)
Set Bunch Crossing.
void setPhiValue(float phiVal)
Set Phi Value.
void setDataWord(unsigned dataword)
Set data word.
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
std::string instName[dedefs::DEnsys][5]
L1DummyProducer(const edm::ParameterSet &)
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void setBxNr(int bxnr)
set counters
void SimpleDigi(int nevt, CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0) const
~L1DummyProducer() override
char data[epos_bytes_allocation]
float ptValue() const
get pt-value of muon candidate in GeV
A calorimeter trigger region (sum of 4x4 trigger towers)
void setGMTCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT candidate (does not store rank)
float etaValue() const
get eta-value of muon candidate
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
int bx() const
return bunch crossing identifier
bool isTau(const Candidate &part)