CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
l1t::FakeInputProducer Class Reference
Inheritance diagram for l1t::FakeInputProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FakeInputProducer (const ParameterSet &)
 
 ~FakeInputProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void beginJob () override
 
void beginRun (Run const &iR, EventSetup const &iE) override
 
void endJob () override
 
void endRun (Run const &iR, EventSetup const &iE) override
 
void produce (Event &, EventSetup const &) override
 

Private Attributes

std::vector< int > fEgBx
 
std::vector< int > fEgHwEta
 
std::vector< int > fEgHwPhi
 
std::vector< int > fEgHwPt
 
std::vector< int > fEgIso
 
std::vector< int > fEtSumBx
 
std::vector< int > fEtSumHwPhi
 
std::vector< int > fEtSumHwPt
 
std::vector< int > fJetBx
 
std::vector< int > fJetHwEta
 
std::vector< int > fJetHwPhi
 
std::vector< int > fJetHwPt
 
std::vector< int > fMuBx
 
std::vector< int > fMuHwEta
 
std::vector< int > fMuHwPhi
 
std::vector< int > fMuHwPt
 
std::vector< int > fMuIso
 
std::vector< int > fTauBx
 
std::vector< int > fTauHwEta
 
std::vector< int > fTauHwPhi
 
std::vector< int > fTauHwPt
 
std::vector< int > fTauIso
 
unsigned long long m_paramsCacheId
 

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
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Description: Create Fake Input Collections for the GT. Allows testing of emulation

Author
: B. Winer OSU

Modeled after FakeInputProducer

Definition at line 45 of file FakeInputProducer.cc.

Constructor & Destructor Documentation

l1t::FakeInputProducer::FakeInputProducer ( const ParameterSet iConfig)
explicit

Definition at line 101 of file FakeInputProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

101  {
102  // register what you produce
103  produces<BXVector<l1t::EGamma>>();
104  produces<BXVector<l1t::Muon>>();
105  produces<BXVector<l1t::Tau>>();
106  produces<BXVector<l1t::Jet>>();
107  produces<BXVector<l1t::EtSum>>();
108 
109  // Setup Parameter Set for EG
110  ParameterSet eg_params = iConfig.getUntrackedParameter<ParameterSet>("egParams");
111 
112  fEgBx = eg_params.getUntrackedParameter<vector<int>>("egBx");
113  fEgHwPt = eg_params.getUntrackedParameter<vector<int>>("egHwPt");
114  fEgHwPhi = eg_params.getUntrackedParameter<vector<int>>("egHwPhi");
115  fEgHwEta = eg_params.getUntrackedParameter<vector<int>>("egHwEta");
116  fEgIso = eg_params.getUntrackedParameter<vector<int>>("egIso");
117 
118  // Setup Parameter Set for Muon
119  ParameterSet mu_params = iConfig.getUntrackedParameter<ParameterSet>("muParams");
120 
121  fMuBx = mu_params.getUntrackedParameter<vector<int>>("muBx");
122  fMuHwPt = mu_params.getUntrackedParameter<vector<int>>("muHwPt");
123  fMuHwPhi = mu_params.getUntrackedParameter<vector<int>>("muHwPhi");
124  fMuHwEta = mu_params.getUntrackedParameter<vector<int>>("muHwEta");
125  fMuIso = mu_params.getUntrackedParameter<vector<int>>("muIso");
126 
127  // Setup Parameter Set for taus
128  ParameterSet tau_params = iConfig.getUntrackedParameter<ParameterSet>("tauParams");
129 
130  fTauBx = tau_params.getUntrackedParameter<vector<int>>("tauBx");
131  fTauHwPt = tau_params.getUntrackedParameter<vector<int>>("tauHwPt");
132  fTauHwPhi = tau_params.getUntrackedParameter<vector<int>>("tauHwPhi");
133  fTauHwEta = tau_params.getUntrackedParameter<vector<int>>("tauHwEta");
134  fTauIso = tau_params.getUntrackedParameter<vector<int>>("tauIso");
135 
136  // Setup Parameter Set for jet
137  ParameterSet jet_params = iConfig.getUntrackedParameter<ParameterSet>("jetParams");
138 
139  fJetBx = jet_params.getUntrackedParameter<vector<int>>("jetBx");
140  fJetHwPt = jet_params.getUntrackedParameter<vector<int>>("jetHwPt");
141  fJetHwPhi = jet_params.getUntrackedParameter<vector<int>>("jetHwPhi");
142  fJetHwEta = jet_params.getUntrackedParameter<vector<int>>("jetHwEta");
143 
144  // Setup Parameter Set for EtSums
145  ParameterSet etsum_params = iConfig.getUntrackedParameter<ParameterSet>("etsumParams");
146 
147  fEtSumBx = etsum_params.getUntrackedParameter<vector<int>>("etsumBx");
148  fEtSumHwPt = etsum_params.getUntrackedParameter<vector<int>>("etsumHwPt");
149  fEtSumHwPhi = etsum_params.getUntrackedParameter<vector<int>>("etsumHwPhi");
150 
151  // set cache id to zero, will be set at first beginRun:
152  m_paramsCacheId = 0;
153  }
std::vector< int > fJetHwPt
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > fJetHwPhi
std::vector< int > fMuHwPt
std::vector< int > fMuBx
std::vector< int > fTauHwPt
std::vector< int > fJetBx
std::vector< int > fTauHwEta
std::vector< int > fTauBx
std::vector< int > fEgHwEta
std::vector< int > fMuHwPhi
std::vector< int > fEgBx
std::vector< int > fEtSumHwPhi
std::vector< int > fEgHwPt
std::vector< int > fEgHwPhi
std::vector< int > fTauIso
std::vector< int > fJetHwEta
std::vector< int > fEgIso
std::vector< int > fTauHwPhi
std::vector< int > fMuIso
std::vector< int > fEtSumBx
unsigned long long m_paramsCacheId
std::vector< int > fEtSumHwPt
std::vector< int > fMuHwEta
l1t::FakeInputProducer::~FakeInputProducer ( )
override

Definition at line 155 of file FakeInputProducer.cc.

155 {}

Member Function Documentation

void l1t::FakeInputProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 225 of file FakeInputProducer.cc.

225 {}
void l1t::FakeInputProducer::beginRun ( Run const &  iR,
EventSetup const &  iE 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 232 of file FakeInputProducer.cc.

References LogDebug.

232  {
233  LogDebug("l1t|Global") << "FakeInputProducer::beginRun function called...\n";
234  }
#define LogDebug(id)
void l1t::FakeInputProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 228 of file FakeInputProducer.cc.

228 {}
void l1t::FakeInputProducer::endRun ( Run const &  iR,
EventSetup const &  iE 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 237 of file FakeInputProducer.cc.

237 {}
void l1t::FakeInputProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 240 of file FakeInputProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

240  {
241  //The following says we do not know what parameters are allowed so do no validation
242  // Please change this to state exactly what you do use, even if it is no parameters
244  desc.setUnknown();
245  descriptions.addDefault(desc);
246  }
void addDefault(ParameterSetDescription const &psetDescription)
void l1t::FakeInputProducer::produce ( Event ,
EventSetup const &   
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 162 of file FakeInputProducer.cc.

References simCaloStage2Layer1Digis_cfi::bxFirst, simCaloStage2Layer1Digis_cfi::bxLast, singleTopDQM_cfi::jets, L1Analysis::kMissingEt, LogDebug, eostools::move(), PDWG_BPHSkim_cff::muons, edm::Event::put(), and Tau3MuMonitor_cff::taus.

162  {
163  LogDebug("l1t|Global") << "FakeInputProducer::produce function called...\n";
164 
165  // Set the range of BX....TO DO...move to Params or determine from param set.
166  int bxFirst = -2;
167  int bxLast = 2;
168 
169  //outputs
170  std::unique_ptr<l1t::EGammaBxCollection> egammas(new l1t::EGammaBxCollection(0, bxFirst, bxLast));
171  std::unique_ptr<l1t::MuonBxCollection> muons(new l1t::MuonBxCollection(0, bxFirst, bxLast));
172  std::unique_ptr<l1t::TauBxCollection> taus(new l1t::TauBxCollection(0, bxFirst, bxLast));
173  std::unique_ptr<l1t::JetBxCollection> jets(new l1t::JetBxCollection(0, bxFirst, bxLast));
174  std::unique_ptr<l1t::EtSumBxCollection> etsums(new l1t::EtSumBxCollection(0, bxFirst, bxLast));
175 
176  // Put EG into Collections
177  for (unsigned int it = 0; it < fEgBx.size(); it++) {
178  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* egLorentz =
179  new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
180  l1t::EGamma fakeEG(*egLorentz, fEgHwPt.at(it), fEgHwEta.at(it), fEgHwPhi.at(it), 0, fEgIso.at(it));
181  egammas->push_back(fEgBx.at(it), fakeEG);
182  }
183 
184  // Put Muons into Collections
185  for (unsigned int it = 0; it < fMuBx.size(); it++) {
186  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* muLorentz =
187  new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
188  l1t::Muon fakeMU(*muLorentz, fMuHwPt.at(it), fMuHwEta.at(it), fMuHwPhi.at(it), 4, 0, 0, fMuIso.at(it));
189  muons->push_back(fMuBx.at(it), fakeMU);
190  }
191 
192  // Put Taus into Collections
193  for (unsigned int it = 0; it < fTauBx.size(); it++) {
194  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* tauLorentz =
195  new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
196  l1t::Tau fakeTAU(*tauLorentz, fTauHwPt.at(it), fTauHwEta.at(it), fTauHwPhi.at(it), 0, fTauIso.at(it));
197  taus->push_back(fTauBx.at(it), fakeTAU);
198  }
199 
200  // Put Jets into Collections
201  for (unsigned int it = 0; it < fJetBx.size(); it++) {
202  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* jetLorentz =
203  new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
204  l1t::Jet fakeJET(*jetLorentz, fJetHwPt.at(it), fJetHwEta.at(it), fJetHwPhi.at(it), 0);
205  jets->push_back(fJetBx.at(it), fakeJET);
206  }
207 
208  // Put EtSums into Collections
209  for (unsigned int it = 0; it < fEtSumBx.size(); it++) {
210  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>* etsumLorentz =
211  new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>();
212  l1t::EtSum fakeETSUM(
213  *etsumLorentz, l1t::EtSum::EtSumType::kMissingEt, fEtSumHwPt.at(it), 0, fEtSumHwPhi.at(it), 0);
214  etsums->push_back(fEtSumBx.at(it), fakeETSUM);
215  }
216 
217  iEvent.put(std::move(egammas));
218  iEvent.put(std::move(muons));
219  iEvent.put(std::move(taus));
220  iEvent.put(std::move(jets));
221  iEvent.put(std::move(etsums));
222  }
#define LogDebug(id)
std::vector< int > fJetHwPt
std::vector< int > fJetHwPhi
std::vector< int > fMuHwPt
std::vector< int > fMuBx
Definition: Tau.h:20
std::vector< int > fTauHwPt
std::vector< int > fJetBx
Definition: Jet.h:20
int iEvent
Definition: GenABIO.cc:224
std::vector< int > fTauHwEta
std::vector< int > fTauBx
std::vector< int > fEgHwEta
Definition: Muon.h:21
std::vector< int > fMuHwPhi
std::vector< int > fEgBx
std::vector< int > fEtSumHwPhi
std::vector< int > fEgHwPt
std::vector< int > fEgHwPhi
std::vector< int > fTauIso
std::vector< int > fJetHwEta
std::vector< int > fEgIso
std::vector< int > fTauHwPhi
std::vector< int > fMuIso
std::vector< int > fEtSumBx
def move(src, dest)
Definition: eostools.py:511
std::vector< int > fEtSumHwPt
std::vector< int > fMuHwEta

Member Data Documentation

std::vector<int> l1t::FakeInputProducer::fEgBx
private

Definition at line 66 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEgHwEta
private

Definition at line 69 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEgHwPhi
private

Definition at line 68 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEgHwPt
private

Definition at line 67 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEgIso
private

Definition at line 70 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEtSumBx
private

Definition at line 93 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEtSumHwPhi
private

Definition at line 95 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fEtSumHwPt
private

Definition at line 94 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fJetBx
private

Definition at line 87 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fJetHwEta
private

Definition at line 90 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fJetHwPhi
private

Definition at line 89 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fJetHwPt
private

Definition at line 88 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fMuBx
private

Definition at line 73 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fMuHwEta
private

Definition at line 76 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fMuHwPhi
private

Definition at line 75 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fMuHwPt
private

Definition at line 74 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fMuIso
private

Definition at line 77 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fTauBx
private

Definition at line 80 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fTauHwEta
private

Definition at line 83 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fTauHwPhi
private

Definition at line 82 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fTauHwPt
private

Definition at line 81 of file FakeInputProducer.cc.

std::vector<int> l1t::FakeInputProducer::fTauIso
private

Definition at line 84 of file FakeInputProducer.cc.

unsigned long long l1t::FakeInputProducer::m_paramsCacheId
private

Definition at line 60 of file FakeInputProducer.cc.