1 #ifndef L1_DUMMY_PRODUCER_H
2 #define L1_DUMMY_PRODUCER_H
36 #include "CLHEP/Random/RandFlat.h"
37 #include "CLHEP/Random/RandGaussQ.h"
76 template <
class T>
void
81 template <>
inline void
85 std::cout <<
"L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection>....\n" << std::flush;
86 int side = (
rndFlat_->fire()>0.5)?-1:1;
87 int ieta = (int) (1 + 17*
rndFlat_->fire());
88 int iphi = (int) (1 + 72*
rndFlat_->fire());
97 data->push_back(e_digi);
101 std::cout <<
"L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection> end.\n" << std::flush;
104 template <>
inline void
108 std::cout <<
"L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection>....\n" << std::flush;
109 int side = (
rndFlat_->fire()>0.5)?-1:1;
110 int ieta = (int) (1 + 17*
rndFlat_->fire());
111 int iphi = (int) (1 + 72*
rndFlat_->fire());
118 data->push_back(h_digi);
122 std::cout <<
"L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection> end.\n" << std::flush;
125 template <>
inline void
129 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloEmCollection>....\n" << std::flush;
131 unsigned rank = energy & 0x3f;
132 unsigned region= (
rndFlat_->fire()>0.5?0:1);
133 unsigned card = (unsigned)(7*
rndFlat_->fire());
134 unsigned crate = (unsigned)(18*
rndFlat_->fire());
138 L1CaloEmCand cand(rank, region, card, crate, iso, index, bx);
139 data->push_back(cand);
142 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloEmCollection> end.\n" << std::flush;
145 template <>
inline void
149 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloRegionCollection>....\n" << std::flush;
151 unsigned et = energy & 0x3ff;
156 unsigned crate= (unsigned)(18*
rndFlat_->fire());
157 unsigned card = (unsigned)(7*
rndFlat_->fire());
158 unsigned rgn = crate%2;
159 L1CaloRegion cand( et, overFlow, tauVeto, mip, quiet, crate, card, rgn );
160 data->push_back(cand);
163 std::cout <<
"L1DummyProducer::SimpleDigi<L1CaloRegionCollection> end.\n" << std::flush;
166 template <>
inline void
170 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctEmCandCollection>....\n" << std::flush;
181 <<
"L1DummyProducer::SimpleDigi production of L1GctEmCandCollection "
182 <<
" invalid type: " << type << std::endl;
185 unsigned rank = energy & 0x3f;
189 eta = (eta&0x7) + (0x1<<3);
191 data->push_back(cand);
195 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctEmCandCollection> end.\n" << std::flush;
198 template <>
inline void
202 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctJetCandCollection>....\n" << std::flush;
219 <<
"L1DummyProducer::SimpleDigi production of L1GctJetCandCollection "
220 <<
" invalid type: " << type << std::endl;
224 unsigned rank = energy & 0x3f;
228 eta = (eta&0x7) + (0x1<<3);
230 data->push_back(cand);
233 std::cout <<
"L1DummyProducer::SimpleDigi<L1GctJetCandCollection> end.\n" << std::flush;
236 template <>
inline void
240 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection>....\n" << std::flush;
242 assert(type>=0 && type<4);
243 unsigned type_idx=
type;
245 unsigned phi,
eta, pt,
charge, ch_valid, finehalo, quality;
246 float phiv(0.), etav(0.), ptv(0.);
247 for(
int i=0;
i<4;
i++) {
251 etav = 2.5*(-1+2*eta/63.);
252 pt = ((int)(32*
rndFlat_->fire())) & 0x1f;
254 charge = (
rndFlat_->fire()>0.5?0:1);;
257 quality = (int)(8*
rndFlat_->fire());
259 ch_valid, finehalo, quality, bx);
263 data->push_back(cand);
268 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection> end.\n" << std::flush;
271 template <>
inline void
277 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTTrackContainer>....\n" << std::flush;
280 typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
281 std::auto_ptr<L1MuDTTrackCandCollection> tracksd (
new L1MuDTTrackCandCollection());
282 for(L1MuRegionalCandCollection::const_iterator it=tracks->begin(); it!=tracks->end(); it++) {
285 cnd->
setBx(it->bx());
287 tracksd->push_back(*cnd);
289 data->setContainer(*tracksd);
291 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTTrackContainer> end.\n" << std::flush;
297 template <>
inline void
301 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer>....\n" << std::flush;
302 typedef std::vector<L1MuDTChambPhDigi> Phi_Container;
304 Phi_Container
tracks(ntrk);
305 int ubx, uwh, usc, ust,uphr, uphb, uqua, utag, ucnt;
306 for (
int i=0;
i<ntrk;
i++) {
321 tracks.push_back(cand);
323 data->setContainer(tracks);
327 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer> end.\n" << std::flush;
330 template <>
inline void
334 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambThContainer>....\n" << std::flush;
335 typedef std::vector<L1MuDTChambThDigi> The_Container;
337 The_Container
tracks(ntrk);
338 int ubx, uwh, usc, ust, uos[7], uqa[7];
339 for (
int i=0;
i<ntrk;
i++) {
344 for(
int j=0;
j<7;
j++) {
349 tracks.push_back(cand);
351 data->setContainer(tracks);
356 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuDTChambThContainer> end.\n" << std::flush;
359 template <>
inline void
363 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTCandCollection>....\n" << std::flush;
382 unsigned phip = (unsigned)(255*
rndFlat_->fire());
383 unsigned etap = (unsigned)( 63*
rndFlat_->fire());
392 data->push_back(cand);
394 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTCandCollection> end.\n" << std::flush;
398 template <>
inline void
402 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection>....\n" << std::flush;
416 for(
int i=0;
i<4;
i++) {
422 for(
int nr=0; nr<4; nr++) {
432 data->addRecord(rec);
443 std::cout <<
"L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection> end.\n" << std::flush;
446 template <>
inline void
450 std::cout <<
"L1DummyProducer::SimpleDigi<LTCDigiCollection>....\n" << std::flush;
478 std::cout <<
"L1DummyProducer::SimpleDigi<LTCDigiCollection> end.\n" << std::flush;
484 std::cout <<
"L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection>....\n" << std::flush;
491 enum eMinNum{ MIN_ENDCAP=1, MIN_STATION=1, MIN_RING=1, MIN_CHAMBER= 1, MIN_LAYER=1 };
492 enum eMaxNum{ MAX_ENDCAP=2, MAX_STATION=4, MAX_RING=4, MAX_CHAMBER=36, MAX_LAYER=6 };
494 int ec = (int)( MIN_ENDCAP + (MAX_ENDCAP -MIN_ENDCAP )*rnd +1);
495 int st = (int)( MIN_STATION + (MAX_STATION-MIN_STATION)*rnd +1);
496 int rg = (int)( MIN_RING + (MAX_RING -MIN_RING )*rnd +1);
497 int ch = (int)( MIN_CHAMBER + (MAX_CHAMBER-MIN_CHAMBER)*rnd +1);
498 int lr = (int)( MIN_LAYER + (MAX_LAYER -MIN_LAYER )*rnd +1);
502 data->insertDigi(did,dg);
504 std::cout <<
"L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection> end.\n" << std::flush;
510 std::cout <<
"L1DummyProducer::SimpleDigi<L1CSCTrackCollection>...\n" << std::flush;
522 L1CSCTrack l1csctrk = std::make_pair(l1trk,*dgcoll);
523 data->push_back(l1csctrk);
529 std::cout <<
"L1DummyProducer::SimpleDigi<L1CSCTrackCollection> end.\n" << std::flush;
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
void setBxInEvent(int bxie)
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
bool m_doSys[dedefs::DEnsys]
void setMIP(bool mip)
set min ionizing bit for muon candidate
float etaValue() const
get eta-value of muon candidate
void setGMTBrlCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT barrel candidate
virtual void beginJob(void)
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
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
void setMIPbit(int eta, int phi)
set MIP bit
void setBx(int bx)
Set Bunch Crossing.
CLHEP::RandFlat * rndFlat_
float ptValue() const
get pt-value of muon candidate in GeV
void setPhiValue(float phiVal)
Set Phi Value.
void setDataWord(unsigned dataword)
Set data word.
CLHEP::RandGaussQ * rndGaus_
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
void setPhiValue(float phiVal)
Setters for physical values.
unsigned getDataWord() const
return data word
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
std::string instName[dedefs::DEnsys][5]
void setBx(int bx)
set bunch crossing identifier
L1DummyProducer(const edm::ParameterSet &)
float phiValue() const
get phi-value of muon candidate in radians (low edge of bin)
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void setChargePacked(unsigned ch)
set packed charge/synchronization word of muon candidate (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) ...
virtual void produce(edm::Event &, const edm::EventSetup &)
void SimpleDigi(std::auto_ptr< T > &data, int type=0)
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
void setBxNr(int bxnr)
set counters
int bx() const
return bunch crossing identifier
std::pair< csc::L1Track, CSCCorrelatedLCTDigiCollection > L1CSCTrack
A calorimeter trigger region (sum of 4x4 trigger towers)
void setGMTCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT candidate (does not store rank)
void setPtValue(float ptVal)
Set Pt Value.
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
void setIsolation(bool isol)
set isolation of muon candidate
bool isTau(const Candidate &part)