CMS 3D CMS Logo

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

#include <L1GctInternJetProducer.h>

Inheritance diagram for L1GctInternJetProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1GctInternJetProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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)
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecordcaloGeomToken_
 
bool centralBxOnly_
 
edm::InputTag internalJetSource_
 
edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcdjetScaleToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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< Bconsumes (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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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

EventFilter/GctRawToDigi/plugins/L1GctInternJetProducer.cc

EventFilter/GctRawToDigi/plugins/L1GctInternJetProducer.h

Author
Alex Tapper

Description: producer of L1Extra style internal GCT jets from Level-1 hardware objects.

Definition at line 34 of file L1GctInternJetProducer.h.

Constructor & Destructor Documentation

◆ L1GctInternJetProducer()

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

Definition at line 26 of file L1GctInternJetProducer.cc.

27  : internalJetSource_(iConfig.getParameter<edm::InputTag>("internalJetSource")),
28  caloGeomToken_(esConsumes<L1CaloGeometry, L1CaloGeometryRecord>()),
29  jetScaleToken_(esConsumes<L1CaloEtScale, L1JetEtScaleRcd>()),
30  centralBxOnly_(iConfig.getParameter<bool>("centralBxOnly")) {
31  using namespace l1extra;
32 
33  produces<L1JetParticleCollection>("Internal");
34 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > caloGeomToken_
edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcd > jetScaleToken_

Member Function Documentation

◆ produce()

void L1GctInternJetProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 36 of file L1GctInternJetProducer.cc.

References caloGeomToken_, centralBxOnly_, gather_cfg::cout, MillePedeFileConverter_cfg::e, L1CaloGeometry::emJetPhiBinCenter(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, L1CaloGeometry::etaBinCenter(), edm::EventSetup::getHandle(), mps_fire::i, iEvent, internalJetSource_, edm::HandleBase::isValid(), wplusjetsAnalysis_cfi::jetScale, jetScaleToken_, LogDebug, eostools::move(), and phi.

36  {
37  //std::cout << "ARGGHHH!" << std::endl;
38  using namespace edm;
39  using namespace l1extra;
40  using namespace std;
41 
42  unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
43 
45  const L1CaloGeometry* caloGeom = &(*caloGeomESH);
46 
48 
49  double etSumLSB = jetScale->linearLsb();
50  //std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
51 
53  iEvent.getByLabel(internalJetSource_, hwIntJetCands);
54  //std::cout << "At leas Something is happening" <<std::endl;
55  if (!hwIntJetCands.isValid()) {
56  std::cout << "These aren't the Jets you're looking for" << std::endl;
57 
58  LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
59  << "\nrequested in configuration, but not found in the event." << std::endl;
60 
61  } else {
62  //std::cout << "apparently the collection was found" <<std::endl;
63  L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
64  L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
65  int i;
66  for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
67  //std::cout << " JetS a plenty" <<std::endl;
68  if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
69  double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
70 
71  //double et = 10.;
72  //std::cout << "jetET: " << jetItr->et() <<std::endl;
73  //std::cout << "ET was: " << et << std::endl;
74  double eta = caloGeom->etaBinCenter(jetItr->regionId());
75  double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
76 
77  internJetColl->push_back(
79  }
80  }
81  }
82 
83  OrphanHandle<L1JetParticleCollection> internalJetHandle = iEvent.put(std::move(internJetColl), "Internal");
84 }
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > caloGeomToken_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
int iEvent
Definition: GenABIO.cc:224
edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcd > jetScaleToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
double emJetPhiBinCenter(unsigned int phiIndex) const
double etaBinCenter(unsigned int etaIndex, bool central=true) const
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ caloGeomToken_

edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> L1GctInternJetProducer::caloGeomToken_
private

Definition at line 42 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ centralBxOnly_

bool L1GctInternJetProducer::centralBxOnly_
private

Definition at line 44 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ internalJetSource_

edm::InputTag L1GctInternJetProducer::internalJetSource_
private

Definition at line 41 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ jetScaleToken_

edm::ESGetToken<L1CaloEtScale, L1JetEtScaleRcd> L1GctInternJetProducer::jetScaleToken_
private

Definition at line 43 of file L1GctInternJetProducer.h.

Referenced by produce().