CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1DummyProducer Class Reference

#include <L1DummyProducer.h>

Inheritance diagram for L1DummyProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1DummyProducer (const edm::ParameterSet &)
 
template<class T >
void SimpleDigi (CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< EcalTrigPrimDigiCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< HcalTrigPrimDigiCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1CaloEmCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1CaloRegionCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1GctEmCandCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1GctJetCandCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuRegionalCandCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuDTTrackContainer > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuDTChambPhContainer > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuDTChambThContainer > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuGMTCandCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1MuGMTReadoutCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *, std::unique_ptr< LTCDigiCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< CSCCorrelatedLCTDigiCollection > &data, int type)
 
template<>
void SimpleDigi (CLHEP::HepRandomEngine *engine, std::unique_ptr< L1CSCTrackCollection > &data, int type)
 
 ~L1DummyProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void beginJob (void)
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
int verbose ()
 

Private Attributes

double EBase_
 
double ESigm_
 
std::string instName [dedefs::DEnsys][5]
 
bool m_doSys [dedefs::DEnsys]
 
int nevt_
 
int verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 38 of file L1DummyProducer.h.

Constructor & Destructor Documentation

L1DummyProducer::L1DummyProducer ( const edm::ParameterSet iConfig)
explicit

assertions/temporary

list of collections to be produced

rnd # settings

Definition at line 9 of file L1DummyProducer.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, dedefs::ETP, Exception, dedefs::GCT, edm::ParameterSet::getUntrackedParameter(), dedefs::GLT, dedefs::GMT, dedefs::HTP, mps_fire::i, dedefs::LTC, dedefs::RCT, dedefs::RPC, AlCaHLTBitMon_QueryRunRegistry::string, dedefs::SystLabel, and verbose.

9  {
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 }
T getUntrackedParameter(std::string const &, T const &) const
bool m_doSys[dedefs::DEnsys]
const int DEnsys
Definition: DEtrait.h:38
std::string instName[dedefs::DEnsys][5]
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
L1DummyProducer::~L1DummyProducer ( )

Definition at line 110 of file L1DummyProducer.cc.

110  {
111 }

Member Function Documentation

virtual void L1DummyProducer::beginJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 47 of file L1DummyProducer.h.

References produce().

47 {};
virtual void L1DummyProducer::endJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 50 of file L1DummyProducer.h.

References data, and SimpleDigi().

50 {};
void L1DummyProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

define the data collections

fill candidate collections

put collection

Definition at line 114 of file L1DummyProducer.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DTF, dedefs::DTP, dedefs::ETP, dedefs::GCT, edm::RandomNumberGenerator::getEngine(), dedefs::GLT, dedefs::GMT, dedefs::HTP, dedefs::LTC, eostools::move(), edm::Event::put(), dedefs::RCT, dedefs::RPC, edm::Event::streamID(), and verbose.

Referenced by beginJob().

114  {
115 
117  CLHEP::HepRandomEngine* engine = &rng->getEngine(iEvent.streamID());
118 
119  if(verbose())
120  std::cout << "L1DummyProducer::produce...\n" << std::flush;
121 
123  std::unique_ptr<EcalTrigPrimDigiCollection> ecal_tp_data(new EcalTrigPrimDigiCollection );
124  std::unique_ptr<HcalTrigPrimDigiCollection> hcal_tp_data(new HcalTrigPrimDigiCollection );
125  std::unique_ptr<L1CaloEmCollection> rct_em_data(new L1CaloEmCollection );
126  std::unique_ptr<L1CaloRegionCollection> rct_rgn_data(new L1CaloRegionCollection );
127  std::unique_ptr<L1GctEmCandCollection> gct_isolaem_data(new L1GctEmCandCollection );
128  std::unique_ptr<L1GctEmCandCollection> gct_noisoem_data(new L1GctEmCandCollection );
129  std::unique_ptr<L1GctJetCandCollection> gct_cenjets_data(new L1GctJetCandCollection );
130  std::unique_ptr<L1GctJetCandCollection> gct_forjets_data(new L1GctJetCandCollection );
131  std::unique_ptr<L1GctJetCandCollection> gct_taujets_data(new L1GctJetCandCollection );
132  std::unique_ptr<L1MuDTChambPhContainer> dtp_ph_data(new L1MuDTChambPhContainer );
133  std::unique_ptr<L1MuDTChambThContainer> dtp_th_data(new L1MuDTChambThContainer );
134  std::unique_ptr<L1MuRegionalCandCollection> dtf_data(new L1MuRegionalCandCollection );
135  std::unique_ptr<L1MuDTTrackContainer> dtf_trk_data(new L1MuDTTrackContainer );
136  std::unique_ptr<CSCCorrelatedLCTDigiCollection> ctp_data(new CSCCorrelatedLCTDigiCollection );
137  std::unique_ptr<L1MuRegionalCandCollection> ctf_data(new L1MuRegionalCandCollection );
138  std::unique_ptr<L1CSCTrackCollection> ctf_trk_data(new L1CSCTrackCollection );
139  std::unique_ptr<L1MuRegionalCandCollection> rpc_cen_data(new L1MuRegionalCandCollection );
140  std::unique_ptr<L1MuRegionalCandCollection> rpc_for_data(new L1MuRegionalCandCollection );
141  std::unique_ptr<LTCDigiCollection> ltc_data(new LTCDigiCollection );
142  std::unique_ptr<L1MuGMTCandCollection> gmt_data(new L1MuGMTCandCollection );
143  std::unique_ptr<L1MuGMTReadoutCollection> gmt_rdt_data(new L1MuGMTReadoutCollection );
144  std::unique_ptr<L1GlobalTriggerReadoutRecord> glt_rdt_data(new L1GlobalTriggerReadoutRecord );
145  std::unique_ptr<L1GlobalTriggerEvmReadoutRecord> glt_evm_data(new L1GlobalTriggerEvmReadoutRecord);
146  std::unique_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(std::move(ecal_tp_data),instName[ETP][0]);
176  if(m_doSys[HTP]) iEvent.put(std::move(hcal_tp_data),instName[HTP][0]);
177  if(m_doSys[RCT]) iEvent.put(std::move(rct_em_data),instName[RCT][0]);
178  if(m_doSys[RCT]) iEvent.put(std::move(rct_rgn_data),instName[RCT][0]);
179  if(m_doSys[GCT]) iEvent.put(std::move(gct_isolaem_data),instName[GCT][0]);
180  if(m_doSys[GCT]) iEvent.put(std::move(gct_noisoem_data),instName[GCT][1]);
181  if(m_doSys[GCT]) iEvent.put(std::move(gct_cenjets_data),instName[GCT][2]);
182  if(m_doSys[GCT]) iEvent.put(std::move(gct_forjets_data),instName[GCT][3]);
183  if(m_doSys[GCT]) iEvent.put(std::move(gct_taujets_data),instName[GCT][4]);
184  if(m_doSys[DTP]) iEvent.put(std::move(dtp_ph_data),instName[DTP][0]);
185  if(m_doSys[DTP]) iEvent.put(std::move(dtp_th_data),instName[DTP][0]);
186  if(m_doSys[DTF]) iEvent.put(std::move(dtf_data),instName[DTF][0]);
187  if(m_doSys[DTF]) iEvent.put(std::move(dtf_trk_data),instName[DTF][1]);
188  if(m_doSys[CTP]) iEvent.put(std::move(ctp_data),instName[CTP][0]);
189  if(m_doSys[CTF]) iEvent.put(std::move(ctf_data),instName[CTF][0]);
190  if(m_doSys[CTF]) iEvent.put(std::move(ctf_trk_data),instName[CTF][1]);
191  if(m_doSys[RPC]) iEvent.put(std::move(rpc_cen_data),instName[RPC][0]);
192  if(m_doSys[RPC]) iEvent.put(std::move(rpc_for_data),instName[RPC][1]);
193  if(m_doSys[LTC]) iEvent.put(std::move(ltc_data),instName[LTC][0]);
194  if(m_doSys[GMT]) iEvent.put(std::move(gmt_data),instName[GMT][0]);
195  if(m_doSys[GMT]) iEvent.put(std::move(gmt_rdt_data),instName[GMT][0]);
196  if(m_doSys[GLT]) iEvent.put(std::move(glt_rdt_data),instName[GLT][0]);
197  if(m_doSys[GLT]) iEvent.put(std::move(glt_evm_data),instName[GLT][0]);
198  if(m_doSys[GLT]) iEvent.put(std::move(glt_obj_data),instName[GLT][0]);
199 
200  nevt_++;
201 
202  if(verbose())
203  std::cout << "L1DummyProducer::produce end.\n" << std::flush;
204 
205 }
std::vector< L1CaloEmCand > L1CaloEmCollection
bool m_doSys[dedefs::DEnsys]
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
std::vector< L1CSCTrack > L1CSCTrackCollection
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::vector< L1GctJetCand > L1GctJetCandCollection
std::string instName[dedefs::DEnsys][5]
std::vector< LTCDigi > LTCDigiCollection
Definition: LTCDigi.h:106
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void SimpleDigi(CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0)
StreamID streamID() const
Definition: Event.h:86
std::vector< L1CaloRegion > L1CaloRegionCollection
def move(src, dest)
Definition: eostools.py:510
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:78
std::vector< L1GctEmCand > L1GctEmCandCollection
template<class T >
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  ,
std::unique_ptr< T > &  data,
int  type = 0 
)

Definition at line 73 of file L1DummyProducer.h.

Referenced by endJob(), and SimpleDigi().

73  {
74  /*collections generated in specializations below*/
75 }
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< EcalTrigPrimDigiCollection > &  data,
int  type 
)
inline

Definition at line 78 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, EcalBarrel, ESigm_, createfilelist::int, EcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), and verbose().

79  {
80  if(verbose())
81  std::cout << "L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection>....\n" << std::flush;
82  int side = (engine->flat()>0.5)?-1:1;
83  int ieta = (int) (1 + 17*engine->flat()); //1-17
84  int iphi = (int) (1 + 72*engine->flat()); //1-72
85  const EcalTrigTowerDetId e_id( side , EcalBarrel, ieta, iphi, 0);
86  EcalTriggerPrimitiveDigi e_digi(e_id);
87  int energy = (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
88  bool fg = (engine->flat()>0.5);
89  int ttf = (int)(8*engine->flat()); //0-7
90  EcalTriggerPrimitiveSample e_sample(energy, fg, ttf);
91  e_digi.setSize(1); //set sampleOfInterest to 0
92  e_digi.setSample(0,e_sample);
93  data->push_back(e_digi);
94  //EcalTriggerPrimitiveSample(int encodedEt, bool finegrain, int triggerFlag);
95  //const EcalTrigTowerDetId e_id( zside , EcalBarrel, etaTT, phiTT, 0);
96  if(verbose())
97  std::cout << "L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection> end.\n" << std::flush;
98 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< HcalTrigPrimDigiCollection > &  data,
int  type 
)
inline

Definition at line 101 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, createfilelist::int, HcalTriggerPrimitiveDigi::setSample(), HcalTriggerPrimitiveDigi::setSize(), and verbose().

102  {
103  if(verbose())
104  std::cout << "L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection>....\n" << std::flush;
105  int side = (engine->flat()>0.5)?-1:1;
106  int ieta = (int) (1 + 17*engine->flat());
107  int iphi = (int) (1 + 72*engine->flat());
108  const HcalTrigTowerDetId h_id(side*ieta, iphi);
109  HcalTriggerPrimitiveDigi h_digi(h_id);
110  int energy = (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
111  HcalTriggerPrimitiveSample h_sample(energy, 0, 0, 0);
112  h_digi.setSize(1); //set sampleOfInterest to 0
113  h_digi.setSample(0,h_sample);
114  data->push_back(h_digi);
115  //HcalTriggerPrimitiveSample(int encodedEt, bool finegrain, int slb, int slbchan);
116  //HcalTrigTowerDetId(int ieta, int iphi);
117  if(verbose())
118  std::cout << "L1DummyProducer::SimpleDigi<HcalTrigPrimDigiCollection> end.\n" << std::flush;
119 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1CaloEmCollection > &  data,
int  type 
)
inline

Definition at line 122 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, diffTreeTool::index, createfilelist::int, nevt_, and verbose().

123  {
124  if(verbose())
125  std::cout << "L1DummyProducer::SimpleDigi<L1CaloEmCollection>....\n" << std::flush;
126  int energy= (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
127  unsigned rank = energy & 0x3f;
128  unsigned region= (engine->flat()>0.5?0:1);
129  unsigned card = (unsigned)(7*engine->flat());
130  unsigned crate = (unsigned)(18*engine->flat());
131  bool iso = (engine->flat()>0.4);
132  uint16_t index = (unsigned)(4*engine->flat());
133  int16_t bx = nevt_;
134  L1CaloEmCand cand(rank, region, card, crate, iso, index, bx);
135  data->push_back(cand);
136  //L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx);
137  if(verbose())
138  std::cout << "L1DummyProducer::SimpleDigi<L1CaloEmCollection> end.\n" << std::flush;
139  }
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:18
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1CaloRegionCollection > &  data,
int  type 
)
inline

Definition at line 142 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, stringResolutionProvider_cfi::et, createfilelist::int, and verbose().

143  {
144  if(verbose())
145  std::cout << "L1DummyProducer::SimpleDigi<L1CaloRegionCollection>....\n" << std::flush;
146  int energy= (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
147  unsigned et = energy & 0x3ff;
148  bool overFlow = 0; //(engine->flat()>0.4);
149  bool tauVeto = 0; //(engine->flat()>0.3);
150  bool mip = 0; //(engine->flat()>0.1);
151  bool quiet = 0; //(engine->flat()>0.6);
152  unsigned crate= (unsigned)(18*engine->flat());
153  unsigned card = (unsigned)(7*engine->flat());
154  unsigned rgn = crate%2; //(engine->flat()>0.5?0:1);
155  L1CaloRegion cand( et, overFlow, tauVeto, mip, quiet, crate, card, rgn );
156  data->push_back(cand);
157  //L1CaloRegion(unsigned et, bool overFlow, bool tauVeto, bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn);
158  if(verbose())
159  std::cout << "L1DummyProducer::SimpleDigi<L1CaloRegionCollection> end.\n" << std::flush;
160 }
et
define resolution functions of each parameter
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1GctEmCandCollection > &  data,
int  type 
)
inline

Definition at line 163 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, PVValHelper::eta, Exception, createfilelist::int, phi, verbose(), and globals_cff::x1.

164  {
165  if(verbose())
166  std::cout << "L1DummyProducer::SimpleDigi<L1GctEmCandCollection>....\n" << std::flush;
167  bool iso; //= type==0;
168  switch(type) { // 0 iso, 1 noniso
169  case 0:
170  iso = true;
171  break;
172  case 1:
173  iso = false;
174  break;
175  default:
176  throw cms::Exception("L1DummyProducerInvalidType")
177  << "L1DummyProducer::SimpleDigi production of L1GctEmCandCollection "
178  << " invalid type: " << type << std::endl;
179  }
180  int energy= (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
181  unsigned rank = energy & 0x3f;
182  unsigned phi = (unsigned)(18*engine->flat());
183  unsigned eta = (unsigned)( 7*engine->flat());
184  if(engine->flat()>0.5) //-z (eta sign)
185  eta = (eta&0x7) + (0x1<<3);
186  L1GctEmCand cand(rank, phi, eta, iso);
187  data->push_back(cand);
188  // eta = -6 to -0, +0 to +6. Sign is bit 3, 1 means -ve Z, 0 means +ve Z
189  //L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso);
190  if(verbose())
191  std::cout << "L1DummyProducer::SimpleDigi<L1GctEmCandCollection> end.\n" << std::flush;
192 }
type
Definition: HCALResponse.h:21
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1GctJetCandCollection > &  data,
int  type 
)
inline

Definition at line 195 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, PVValHelper::eta, Exception, createfilelist::int, reco::isTau(), phi, verbose(), and globals_cff::x1.

196  {
197  if(verbose())
198  std::cout << "L1DummyProducer::SimpleDigi<L1GctJetCandCollection>....\n" << std::flush;
199  bool isFor, isTau;
200  switch(type) { // 0 cen, 1 for, 2 tau
201  case 0:
202  isFor = false;
203  isTau = false;
204  break;
205  case 1:
206  isFor = true;
207  isTau = false;
208  break;
209  case 2:
210  isFor = false;
211  isTau = true;
212  break;
213  default:
214  throw cms::Exception("L1DummyProducerInvalidType")
215  << "L1DummyProducer::SimpleDigi production of L1GctJetCandCollection "
216  << " invalid type: " << type << std::endl;
217  }
218 
219  int energy= (int) (EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
220  unsigned rank = energy & 0x3f;
221  unsigned phi = (unsigned)(18*engine->flat());
222  unsigned eta = (unsigned)( 7*engine->flat());
223  if(engine->flat()>0.5) //-z (eta sign)
224  eta = (eta&0x7) + (0x1<<3);
225  L1GctJetCand cand(rank, phi, eta, isTau, isFor);
226  data->push_back(cand);
227  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor);
228  if(verbose())
229  std::cout << "L1DummyProducer::SimpleDigi<L1GctJetCandCollection> end.\n" << std::flush;
230 }
type
Definition: HCALResponse.h:21
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool isTau(const Candidate &part)
Definition: pdgIdUtils.h:15
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuRegionalCandCollection > &  data,
int  type 
)
inline

Definition at line 233 of file L1DummyProducer.h.

References ALCARECOTkAlJpsiMuMu_cff::charge, gather_cfg::cout, PVValHelper::eta, mps_fire::i, createfilelist::int, phi, Pi, EnergyCorrector::pt, jets_cff::quality, L1MuRegionalCand::setEtaValue(), L1MuRegionalCand::setPhiValue(), L1MuRegionalCand::setPtValue(), and verbose().

234  {
235  if(verbose())
236  std::cout << "L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection>....\n" << std::flush;
237  //typedef std::vector<L1MuRegionalCand> L1MuRegionalCandCollection;
238  assert(type>=0 && type<4);
239  unsigned type_idx=type; //tType: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
240  int bx = 0;
241  unsigned phi, eta, pt, charge, ch_valid, finehalo, quality;
242  float phiv(0.), etav(0.), ptv(0.); //linear translation? 0.2pi,-2.5..2.5,0..100
243  for(int i=0; i<4; i++) {
244  phi = (int)(144*engine->flat()); //8bits, 0..143
245  eta = (int)( 63*engine->flat()); //6bits code
246  phiv = phi*2*TMath::Pi()/144.;
247  etav = 2.5*(-1+2*eta/63.);
248  pt = ((int)(32*engine->flat())) & 0x1f; //5bits: 0..31
249  ptv = 100*(pt/31.);
250  charge = (engine->flat()>0.5?0:1);;
251  ch_valid=0;
252  finehalo=0;
253  quality = (int)(8*engine->flat()); //3bits: 0..7
254  L1MuRegionalCand cand(type_idx, phi, eta, pt, charge,
255  ch_valid, finehalo, quality, bx);
256  cand.setPhiValue(phiv);
257  cand.setEtaValue(etav);
258  cand.setPtValue (ptv);
259  data->push_back(cand);
260  }
261  //L1MuRegionalCand(unsigned type_idx, unsigned phi, unsigned eta, unsigned pt,
262  //unsigned charge, unsigned ch_valid, unsigned finehalo, unsigned quality, int bx);
263  if(verbose())
264  std::cout << "L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection> end.\n" << std::flush;
265 }
const double Pi
type
Definition: HCALResponse.h:21
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuDTTrackContainer > &  data,
int  type 
)
inline

Definition at line 268 of file L1DummyProducer.h.

References gather_cfg::cout, L1MuRegionalCand::setBx(), L1MuRegionalCand::setDataWord(), SimpleDigi(), l1t::tracks, and verbose().

269  {
270  assert(type==0);
271  int type_idx = type; //choose data type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
272  if(verbose())
273  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTTrackContainer>....\n" << std::flush;
274  std::unique_ptr<L1MuRegionalCandCollection> tracks(new L1MuRegionalCandCollection());
275  SimpleDigi(engine, tracks, type_idx);
276  typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
277  std::unique_ptr<L1MuDTTrackCandCollection> tracksd (new L1MuDTTrackCandCollection());
278  for(L1MuRegionalCandCollection::const_iterator it=tracks->begin(); it!=tracks->end(); it++) {
279  L1MuDTTrackCand * cnd = new L1MuDTTrackCand();
280  cnd->setDataWord(it->getDataWord());
281  cnd->setBx(it->bx());
282  tracksd->push_back(L1MuDTTrackCand());
283  tracksd->push_back(*cnd);
284  }
285  data->setContainer(*tracksd);
286  if(verbose())
287  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTTrackContainer> end.\n" << std::flush;
288  //L1MuDTTrackCand( unsigned dataword, int bx, int uwh, int usc, int utag,
289  // int adr1, int adr2, int adr3, int adr4, int utc );
290 
291 }
type
Definition: HCALResponse.h:21
void setBx(int bx)
Set Bunch Crossing.
void setDataWord(unsigned dataword)
Set data word.
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void SimpleDigi(CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuDTChambPhContainer > &  data,
int  type 
)
inline

Definition at line 294 of file L1DummyProducer.h.

References gather_cfg::cout, mps_fire::i, createfilelist::int, l1t::tracks, and verbose().

295  {
296  if(verbose())
297  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer>....\n" << std::flush;
298  typedef std::vector<L1MuDTChambPhDigi> Phi_Container;
299  int ntrk = 4;
300  Phi_Container tracks(ntrk);
301  int ubx, uwh, usc, ust,uphr, uphb, uqua, utag, ucnt;
302  for (int i=0; i<ntrk; i++) {
303  ubx = 0; //bxNum() - bx
304  uwh = 0; //whNum() - wheel
305  usc = 0; //scNum() - sector
306  ust = 0; //stNum() - station
307  uphr = 0; //phi() - radialAngle
308  uphb = 0; //phiB() - bendingAngle
309  uqua = 0; //code() - qualityCode
310  utag = 0; //Ts2Tag() - Ts2TagCode
311  ucnt = 0; //BxCnt() - BxCntCode
312  uwh = (int)(-2+5*engine->flat());
313  usc = (int)( 12*engine->flat());
314  ust = (int)(1.+4*engine->flat());
315  uqua= (int)( 8*engine->flat());
316  L1MuDTChambPhDigi cand(ubx, uwh, usc, ust, uphr, uphb, uqua, utag, ucnt);
317  tracks.push_back(cand);
318  }
319  data->setContainer(tracks);
320  //L1MuDTChambPhDigi( int ubx, int uwh, int usc, int ust,
321  // int uphr, int uphb, int uqua, int utag, int ucnt );
322  if(verbose())
323  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer> end.\n" << std::flush;
324 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuDTChambThContainer > &  data,
int  type 
)
inline

Definition at line 327 of file L1DummyProducer.h.

References gather_cfg::cout, mps_fire::i, createfilelist::int, l1t::tracks, and verbose().

328  {
329  if(verbose())
330  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambThContainer>....\n" << std::flush;
331  typedef std::vector<L1MuDTChambThDigi> The_Container;
332  int ntrk = 4;
333  The_Container tracks(ntrk);
334  int ubx, uwh, usc, ust, uos[7], uqa[7];
335  for (int i=0; i<ntrk; i++) {
336  ubx = 0;
337  uwh = (int)(-2+5*engine->flat());
338  usc = (int)( 12*engine->flat());
339  ust = (int)(1.+4*engine->flat());
340  for(int j=0; j<7; j++) {
341  uos[j]=(engine->flat()>0.5?0:1);
342  uqa[j]=(engine->flat()>0.5?0:1);
343  }
344  L1MuDTChambThDigi cand(ubx, uwh, usc, ust, uos, uqa);
345  tracks.push_back(cand);
346  }
347  data->setContainer(tracks);
348  //L1MuDTChambThDigi( int ubx, int uwh, int usc, int ust,
349  // int* uos, [int* uqual] );
350  //"DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
351  if(verbose())
352  std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambThContainer> end.\n" << std::flush;
353 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuGMTCandCollection > &  data,
int  type 
)
inline

Definition at line 356 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, PVValHelper::eta, nevt_, phi, Pi, alignCSCRings::r, L1MuGMTCand::setBx(), L1MuGMTCand::setChargePacked(), L1MuGMTCand::setEtaPacked(), L1MuGMTCand::setEtaValue(), L1MuGMTCand::setIsolation(), L1MuGMTCand::setMIP(), L1MuGMTCand::setPhiPacked(), L1MuGMTCand::setPhiValue(), L1MuGMTCand::setPtPacked(), L1MuGMTCand::setPtValue(), and verbose().

357  {
358  if(verbose())
359  std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTCandCollection>....\n" << std::flush;
360  //typedef std::vector<L1MuGMTCand> L1MuGMTCandCollection;
362  //cand.setPhiPacked();//8bits
363  //cand.setPtPacked ();//5bits
364  //cand.setQuality ();//3bits
365  //cand.setEtaPacked();//6bits
366  //cand.setIsolation();//1bit
367  //cand.setMIP ();//1bit
368  //cand.setChargePacked();//0:+, 1:-, 2:undef, 3:sync
369  //cand.setBx (nevt_);
370  //set physical values
371  double eng = EBase_+ESigm_*CLHEP::RandGaussQ::shoot(engine);
372  double phi = 2*TMath::Pi()*engine->flat();
373  double eta = 2.5*(-1+2*engine->flat());
374  cand.setPtValue (eng);
375  cand.setPhiValue(phi);
376  cand.setEtaValue(eta);
377  unsigned engp = (unsigned)(EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
378  unsigned phip = (unsigned)(255*engine->flat());
379  unsigned etap = (unsigned)( 63*engine->flat());
380  cand.setPtPacked (engp&0x1f);
381  cand.setPhiPacked(phip&0x7f);
382  cand.setEtaPacked(etap&0x3f);
383  double r = engine->flat();
384  cand.setIsolation(r>0.2);
385  cand.setMIP(r>0.7);
386  cand.setChargePacked(r>0.5?0:1);
387  cand.setBx(0);
388  data->push_back(cand);
389  if(verbose())
390  std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTCandCollection> end.\n" << std::flush;
391 
392 }
const double Pi
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1MuGMTReadoutCollection > &  data,
int  type 
)
inline

tbd: add GMT extended cand(!)

Definition at line 395 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, PVValHelper::eta, mps_fire::i, createfilelist::int, nevt_, phi, L1MuGMTReadoutRecord::setBxInEvent(), L1MuGMTReadoutRecord::setBxNr(), L1MuGMTReadoutRecord::setEvNr(), L1MuGMTReadoutRecord::setGMTBrlCand(), L1MuGMTReadoutRecord::setGMTCand(), L1MuGMTReadoutRecord::setGMTFwdCand(), L1MuGMTReadoutRecord::setInputCand(), L1MuGMTReadoutRecord::setMIPbit(), L1MuGMTReadoutRecord::setQuietbit(), SimpleDigi(), and verbose().

396  {
397  if(verbose())
398  std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection>....\n" << std::flush;
399  L1MuGMTReadoutRecord rec(0);
400  int bxn = nevt_;
401  rec.setBxNr(bxn);
402  rec.setEvNr(bxn);
403  rec.setBxInEvent(0);
404  std::unique_ptr<L1MuRegionalCandCollection> trks_dttf(new L1MuRegionalCandCollection);
405  std::unique_ptr<L1MuRegionalCandCollection> trks_rpcb(new L1MuRegionalCandCollection);
406  std::unique_ptr<L1MuRegionalCandCollection> trks_csc (new L1MuRegionalCandCollection);
407  std::unique_ptr<L1MuRegionalCandCollection> trks_rpcf(new L1MuRegionalCandCollection);
408  SimpleDigi(engine, trks_dttf,0);
409  SimpleDigi(engine, trks_rpcb,1);
410  SimpleDigi(engine, trks_csc ,2);
411  SimpleDigi(engine, trks_rpcf,3);
412  for(int i=0; i<4; i++) {
413  rec.setInputCand(i ,trks_dttf->at(i));//dt : 0..3
414  rec.setInputCand(i+ 4,trks_rpcb->at(i));//rpcb: 4..7
415  rec.setInputCand(i+ 8,trks_csc ->at(i));//csc : 8..11
416  rec.setInputCand(i+12,trks_rpcf->at(i));//rpcf:12..15
417  }
418  for(int nr=0; nr<4; nr++) {
419  int eng = (int)(EBase_ + ESigm_*CLHEP::RandGaussQ::shoot(engine));
420  rec.setGMTBrlCand(nr, eng&0x11, eng&0x11); //set GMT barrel candidate
421  rec.setGMTFwdCand(nr, eng&0x11, eng&0x11); //set GMT forward candidate
422  rec.setGMTCand (nr, eng&0x11); //set GMT candidate (does not store rank)
423  int eta = (int)(14*engine->flat()); //0..13
424  int phi = (int)(18*engine->flat()); //0..17
425  rec.setMIPbit (eta, phi);
426  rec.setQuietbit(eta, phi);
427  }
428  data->addRecord(rec);
430  //rec.setBCERR(int bcerr);
431  //rec.setGMTBrlCand(int nr, L1MuGMTExtendedCand const& cand);
432  //rec.setGMTFwdCand(int nr, L1MuGMTExtendedCand const& cand);
433  //rec.setGMTCand (int nr, L1MuGMTExtendedCand const& cand);
434  //rec.setInputCand (int nr, L1MuRegionalCand const& cand);
435  //L1MuGMTReadoutCollection :: std::vector<L1MuGMTReadoutRecord> m_Records;
436  //L1MuGMTReadoutCollection(int nbx) { m_Records.reserve(nbx); };
437  //L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx=0) : L1MuGMTCand (data, bx), m_rank(rank) {}
438  if(verbose())
439  std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection> end.\n" << std::flush;
440 }
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void SimpleDigi(CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  ,
std::unique_ptr< LTCDigiCollection > &  data,
int  type 
)
inline

Definition at line 443 of file L1DummyProducer.h.

References gather_cfg::cout, and verbose().

444  {
445  if(verbose())
446  std::cout << "L1DummyProducer::SimpleDigi<LTCDigiCollection>....\n" << std::flush;
447  //LTCs are FED id 816-823
448  /*
449  6 64-bit words
450  uint64_t *ld = (uint64_t*)data;
451 
452  word0: 59:56 4 bit ld[0]>>56 & 0xf trigType
453  55:32 24 bit ld[0]>>32 & 0x00ffffff eventID
454  31:20 12 bit ld[0]>>20 & 0xfff bunchNumber
455  19: 8 12 bit ld[0]>> 8 & 0x00000fff sourceID (816-823?)
456 
457  word1: 63:32 32 bit ld[1]>>32 & 0xffffffff orbitNumber
458  31:24 8 bit ld[1]>>24 & 0xff versionNumber
459  3: 0 4 bit ld[1 & 0xf daqPartition
460 
461  word2: 63:32 32 bit ld[0]>>32 & 0xffffffff runNumber
462  31: 0 32 bit ld[0] & 0xffffffff eventNumber
463 
464  word3: 63:32 32 bit ld[3]>>32 & 0xffffffff trigInhibitNumber
465  31: 0 32 bit ld[3] & 0xffffffff trigInputStat
466 
467  word4: 63:0 64 bit ld[4] bstGpsTime
468 
469  word5: (empty)
470  */
471  //need to make up something meaningfull to produce here..
472  //LTCDigi(const unsigned char* data);
473  if(verbose())
474  std::cout << "L1DummyProducer::SimpleDigi<LTCDigiCollection> end.\n" << std::flush;
475 }
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< CSCCorrelatedLCTDigiCollection > &  data,
int  type 
)
inline

Definition at line 477 of file L1DummyProducer.h.

References CSCCorrelatedLCTDigi::clear(), gather_cfg::cout, RecoEcal_EventContent_cff::ec, createfilelist::int, emtf::MAX_ENDCAP, emtf::MIN_ENDCAP, and verbose().

478  {
479  if(verbose())
480  std::cout << "L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection>....\n" << std::flush;
481  //typedef MuonDigiCollection<CSCDetId,CSCCorrelatedLCTDigi> CSCCorrelatedLCTDigiCollection;
482  //CSCCorrelatedLCTDigi(const int trknmb, const int valid, const int quality, const int keywire, const int strip, const int clct_pattern, const int bend, const int bx, const int& mpclink = 0, const uint16_t & bx0=0, const uint16_t & syncErr = 0, const uint16_t & cscID=0);
484  //tbd: set non-trivial random values
485  dg.clear(); // set contents to zero
486  //CSCDetId( int iendcap, int istation, int iring, int ichamber, int ilayer = 0 );
487  enum eMinNum{ MIN_ENDCAP=1, MIN_STATION=1, MIN_RING=1, MIN_CHAMBER= 1, MIN_LAYER=1 };
488  enum eMaxNum{ MAX_ENDCAP=2, MAX_STATION=4, MAX_RING=4, MAX_CHAMBER=36, MAX_LAYER=6 };
489  float rnd = engine->flat();
490  int ec = (int)( MIN_ENDCAP + (MAX_ENDCAP -MIN_ENDCAP )*rnd +1);
491  int st = (int)( MIN_STATION + (MAX_STATION-MIN_STATION)*rnd +1);
492  int rg = (int)( MIN_RING + (MAX_RING -MIN_RING )*rnd +1);
493  int ch = (int)( MIN_CHAMBER + (MAX_CHAMBER-MIN_CHAMBER)*rnd +1);
494  int lr = (int)( MIN_LAYER + (MAX_LAYER -MIN_LAYER )*rnd +1);
495  CSCDetId did = CSCDetId(ec,st,rg,ch,lr);
496  //CSCDetId did = CSCDetId(); //DetId(DetId::Muon, MuonSubdetId::CSC)
497  //MuonDigiCollection::insertDigi(const IndexType& index, const DigiType& digi)
498  data->insertDigi(did,dg);
499  if(verbose())
500  std::cout << "L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection> end.\n" << std::flush;
501 }
int MIN_ENDCAP
Definition: Common.h:47
int MAX_ENDCAP
Definition: Common.h:48
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<>
void L1DummyProducer::SimpleDigi ( CLHEP::HepRandomEngine *  engine,
std::unique_ptr< L1CSCTrackCollection > &  data,
int  type 
)
inline

Definition at line 503 of file L1DummyProducer.h.

References L1MuRegionalCand::bx(), gather_cfg::cout, L1MuRegionalCand::etaValue(), L1MuRegionalCand::getDataWord(), L1MuRegionalCand::phiValue(), L1MuRegionalCand::ptValue(), L1MuRegionalCand::setBx(), L1MuRegionalCand::setDataWord(), L1MuRegionalCand::setEtaValue(), L1MuRegionalCand::setPhiValue(), L1MuRegionalCand::setPtValue(), SimpleDigi(), and verbose().

504  {
505  if(verbose())
506  std::cout << "L1DummyProducer::SimpleDigi<L1CSCTrackCollection>...\n" << std::flush;
507  std::unique_ptr<CSCCorrelatedLCTDigiCollection> dgcoll(new CSCCorrelatedLCTDigiCollection);
508  SimpleDigi(engine, dgcoll,0);
509  csc::L1Track l1trk = csc::L1Track();
510  std::unique_ptr<L1MuRegionalCandCollection> regcoll(new L1MuRegionalCandCollection);
511  SimpleDigi(engine, regcoll,2);
512  L1MuRegionalCand regcand = *(regcoll->begin());
513  l1trk.setDataWord(regcand.getDataWord());
514  l1trk.setBx(regcand.bx());
515  l1trk.setPhiValue(regcand.phiValue());
516  l1trk.setEtaValue(regcand.etaValue());
517  l1trk.setPtValue (regcand.ptValue());
518  L1CSCTrack l1csctrk = std::make_pair(l1trk,*dgcoll);
519  data->push_back(l1csctrk);
520  //typedef std::vector<L1CSCTrack> L1CSCTrackCollection;
521  //typedef std::pair<csc::L1Track,CSCCorrelatedLCTDigiCollection> L1CSCTrack;
522  //L1Track() : L1MuRegionalCand(), m_name("csc::L1Track") { setType(2); setPtPacked(0); }
523  //L1MuRegionalCand(unsigned dataword = 0, int bx = 0);
524  if(verbose())
525  std::cout << "L1DummyProducer::SimpleDigi<L1CSCTrackCollection> end.\n" << std::flush;
526  }
float etaValue() const
get eta-value of muon candidate
void setPtValue(float ptVal)
Set Pt Value.
void setBx(int bx)
Set Bunch Crossing.
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.
unsigned getDataWord() const
return data word
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
float phiValue() const
get phi-value of muon candidate in radians (low edge of bin)
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
void SimpleDigi(CLHEP::HepRandomEngine *, std::unique_ptr< T > &data, int type=0)
int bx() const
return bunch crossing identifier
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::pair< csc::L1Track, CSCCorrelatedLCTDigiCollection > L1CSCTrack
int L1DummyProducer::verbose ( )
inlineprivate

Definition at line 60 of file L1DummyProducer.h.

References verbose_.

Referenced by SimpleDigi().

60 {return verbose_;}

Member Data Documentation

double L1DummyProducer::EBase_
private

Definition at line 66 of file L1DummyProducer.h.

Referenced by SimpleDigi().

double L1DummyProducer::ESigm_
private

Definition at line 67 of file L1DummyProducer.h.

Referenced by SimpleDigi().

std::string L1DummyProducer::instName[dedefs::DEnsys][5]
private

Definition at line 64 of file L1DummyProducer.h.

bool L1DummyProducer::m_doSys[dedefs::DEnsys]
private

Definition at line 63 of file L1DummyProducer.h.

int L1DummyProducer::nevt_
private

Definition at line 61 of file L1DummyProducer.h.

Referenced by SimpleDigi().

int L1DummyProducer::verbose_
private

Definition at line 59 of file L1DummyProducer.h.

Referenced by verbose().