CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

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

Author
: B. Winer OSU

Modeled after FakeInputProducer

Definition at line 44 of file FakeInputProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 100 of file FakeInputProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

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

154 {}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 224 of file FakeInputProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 231 of file FakeInputProducer.cc.

References LogDebug.

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

Reimplemented from edm::EDProducer.

Definition at line 227 of file FakeInputProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 236 of file FakeInputProducer.cc.

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

Definition at line 239 of file FakeInputProducer.cc.

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

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

Implements edm::EDProducer.

Definition at line 161 of file FakeInputProducer.cc.

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

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

Member Data Documentation

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

Definition at line 65 of file FakeInputProducer.cc.

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

Definition at line 68 of file FakeInputProducer.cc.

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

Definition at line 67 of file FakeInputProducer.cc.

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

Definition at line 66 of file FakeInputProducer.cc.

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

Definition at line 69 of file FakeInputProducer.cc.

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

Definition at line 92 of file FakeInputProducer.cc.

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

Definition at line 94 of file FakeInputProducer.cc.

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

Definition at line 93 of file FakeInputProducer.cc.

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

Definition at line 86 of file FakeInputProducer.cc.

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

Definition at line 89 of file FakeInputProducer.cc.

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

Definition at line 88 of file FakeInputProducer.cc.

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

Definition at line 87 of file FakeInputProducer.cc.

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

Definition at line 72 of file FakeInputProducer.cc.

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

Definition at line 75 of file FakeInputProducer.cc.

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

Definition at line 74 of file FakeInputProducer.cc.

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

Definition at line 73 of file FakeInputProducer.cc.

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

Definition at line 76 of file FakeInputProducer.cc.

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

Definition at line 79 of file FakeInputProducer.cc.

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

Definition at line 82 of file FakeInputProducer.cc.

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

Definition at line 81 of file FakeInputProducer.cc.

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

Definition at line 80 of file FakeInputProducer.cc.

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

Definition at line 83 of file FakeInputProducer.cc.

unsigned long long l1t::FakeInputProducer::m_paramsCacheId
private

Definition at line 59 of file FakeInputProducer.cc.