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::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 46 of file FakeInputProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 104 of file FakeInputProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

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

166  {
167  }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 248 of file FakeInputProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 259 of file FakeInputProducer.cc.

References LogDebug.

259  {
260 
261  LogDebug("l1t|Global") << "FakeInputProducer::beginRun function called...\n";
262 
263 
264 }
#define LogDebug(id)
void l1t::FakeInputProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 254 of file FakeInputProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 267 of file FakeInputProducer.cc.

267  {
268 
269 }
void l1t::FakeInputProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 274 of file FakeInputProducer.cc.

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

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

Implements edm::EDProducer.

Definition at line 177 of file FakeInputProducer.cc.

References fwrapper::jets, L1Analysis::kMissingEt, LogDebug, eostools::move(), extraflags_cff::muons, edm::Event::put(), and nano_cff::taus.

178 {
179 
180  LogDebug("l1t|Global") << "FakeInputProducer::produce function called...\n";
181 
182  // Set the range of BX....TO DO...move to Params or determine from param set.
183  int bxFirst = -2;
184  int bxLast = 2;
185 
186  //outputs
187  std::unique_ptr<l1t::EGammaBxCollection> egammas (new l1t::EGammaBxCollection(0, bxFirst, bxLast));
188  std::unique_ptr<l1t::MuonBxCollection> muons (new l1t::MuonBxCollection(0, bxFirst, bxLast));
189  std::unique_ptr<l1t::TauBxCollection> taus (new l1t::TauBxCollection(0, bxFirst, bxLast));
190  std::unique_ptr<l1t::JetBxCollection> jets (new l1t::JetBxCollection(0, bxFirst, bxLast));
191  std::unique_ptr<l1t::EtSumBxCollection> etsums (new l1t::EtSumBxCollection(0, bxFirst, bxLast));
192 
193 // Put EG into Collections
194  for(unsigned int it=0; it<fEgBx.size(); it++) {
195 
196  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *egLorentz = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
197  l1t::EGamma fakeEG(*egLorentz, fEgHwPt.at(it), fEgHwEta.at(it),fEgHwPhi.at(it), 0, fEgIso.at(it));
198  egammas->push_back(fEgBx.at(it), fakeEG);
199 
200  }
201 
202 // Put Muons into Collections
203  for(unsigned int it=0; it<fMuBx.size(); it++) {
204 
205  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *muLorentz = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
206  l1t::Muon fakeMU(*muLorentz, fMuHwPt.at(it), fMuHwEta.at(it),fMuHwPhi.at(it), 4, 0, 0, fMuIso.at(it));
207  muons->push_back(fMuBx.at(it), fakeMU);
208 
209  }
210 
211 // Put Taus into Collections
212  for(unsigned int it=0; it<fTauBx.size(); it++) {
213 
214  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *tauLorentz = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
215  l1t::Tau fakeTAU(*tauLorentz, fTauHwPt.at(it), fTauHwEta.at(it),fTauHwPhi.at(it), 0, fTauIso.at(it));
216  taus->push_back(fTauBx.at(it), fakeTAU);
217 
218  }
219 
220 // Put Jets into Collections
221  for(unsigned int it=0; it<fJetBx.size(); it++) {
222 
223  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *jetLorentz = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
224  l1t::Jet fakeJET(*jetLorentz, fJetHwPt.at(it), fJetHwEta.at(it),fJetHwPhi.at(it), 0);
225  jets->push_back(fJetBx.at(it), fakeJET);
226 
227  }
228 
229 // Put EtSums into Collections
230  for(unsigned int it=0; it<fEtSumBx.size(); it++) {
231 
232  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > *etsumLorentz = new ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >();
233  l1t::EtSum fakeETSUM(*etsumLorentz, l1t::EtSum::EtSumType::kMissingEt,fEtSumHwPt.at(it), 0,fEtSumHwPhi.at(it), 0);
234  etsums->push_back(fEtSumBx.at(it), fakeETSUM);
235 
236  }
237 
238  iEvent.put(std::move(egammas));
239  iEvent.put(std::move(muons));
240  iEvent.put(std::move(taus));
241  iEvent.put(std::move(jets));
242  iEvent.put(std::move(etsums));
243 
244 }
#define LogDebug(id)
std::vector< int > fJetHwPt
std::vector< int > fJetHwPhi
std::vector< int > fMuHwPt
std::vector< int > fMuBx
Definition: Tau.h:21
std::vector< int > fTauHwPt
std::vector< int > fJetBx
Definition: Jet.h:21
int iEvent
Definition: GenABIO.cc:224
std::vector< int > fTauHwEta
vector< PseudoJet > jets
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 67 of file FakeInputProducer.cc.

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

Definition at line 70 of file FakeInputProducer.cc.

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

Definition at line 69 of file FakeInputProducer.cc.

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

Definition at line 68 of file FakeInputProducer.cc.

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

Definition at line 71 of file FakeInputProducer.cc.

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

Definition at line 94 of file FakeInputProducer.cc.

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

Definition at line 96 of file FakeInputProducer.cc.

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

Definition at line 95 of file FakeInputProducer.cc.

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

Definition at line 88 of file FakeInputProducer.cc.

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

Definition at line 91 of file FakeInputProducer.cc.

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

Definition at line 90 of file FakeInputProducer.cc.

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

Definition at line 89 of file FakeInputProducer.cc.

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

Definition at line 74 of file FakeInputProducer.cc.

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

Definition at line 77 of file FakeInputProducer.cc.

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

Definition at line 76 of file FakeInputProducer.cc.

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

Definition at line 75 of file FakeInputProducer.cc.

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

Definition at line 78 of file FakeInputProducer.cc.

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

Definition at line 81 of file FakeInputProducer.cc.

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

Definition at line 84 of file FakeInputProducer.cc.

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

Definition at line 83 of file FakeInputProducer.cc.

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

Definition at line 82 of file FakeInputProducer.cc.

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

Definition at line 85 of file FakeInputProducer.cc.

unsigned long long l1t::FakeInputProducer::m_paramsCacheId
private

Definition at line 61 of file FakeInputProducer.cc.