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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1GctInternJetProducer (const edm::ParameterSet &)
 
 ~L1GctInternJetProducer () 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
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
math::PtEtaPhiMLorentzVector gctLorentzVector (const double &et, const L1GctCand &cand, const L1CaloGeometry *geom, bool central)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

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

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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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 }

◆ ~L1GctInternJetProducer()

L1GctInternJetProducer::~L1GctInternJetProducer ( )
override

Definition at line 36 of file L1GctInternJetProducer.cc.

36 {}

Member Function Documentation

◆ beginJob()

void L1GctInternJetProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 88 of file L1GctInternJetProducer.cc.

88 {}

◆ endJob()

void L1GctInternJetProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 90 of file L1GctInternJetProducer.cc.

90 {}

◆ gctLorentzVector()

math::PtEtaPhiMLorentzVector L1GctInternJetProducer::gctLorentzVector ( const double &  et,
const L1GctCand cand,
const L1CaloGeometry geom,
bool  central 
)
private

◆ produce()

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

Implements edm::EDProducer.

Definition at line 38 of file L1GctInternJetProducer.cc.

38  {
39  //std::cout << "ARGGHHH!" << std::endl;
40  using namespace edm;
41  using namespace l1extra;
42  using namespace std;
43 
44  unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
45 
47  const L1CaloGeometry* caloGeom = &(*caloGeomESH);
48 
50 
51  double etSumLSB = jetScale->linearLsb();
52  //std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
53 
55  iEvent.getByLabel(internalJetSource_, hwIntJetCands);
56  //std::cout << "At leas Something is happening" <<std::endl;
57  if (!hwIntJetCands.isValid()) {
58  std::cout << "These aren't the Jets you're looking for" << std::endl;
59 
60  LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
61  << "\nrequested in configuration, but not found in the event." << std::endl;
62 
63  } else {
64  //std::cout << "apparently the collection was found" <<std::endl;
65  L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
66  L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
67  int i;
68  for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
69  //std::cout << " JetS a plenty" <<std::endl;
70  if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
71  double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
72 
73  //double et = 10.;
74  //std::cout << "jetET: " << jetItr->et() <<std::endl;
75  //std::cout << "ET was: " << et << std::endl;
76  double eta = caloGeom->etaBinCenter(jetItr->regionId());
77  double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
78 
79  internJetColl->push_back(
81  }
82  }
83  }
84 
85  OrphanHandle<L1JetParticleCollection> internalJetHandle = iEvent.put(std::move(internJetColl), "Internal");
86 }

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.

Member Data Documentation

◆ caloGeomToken_

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

Definition at line 50 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ centralBxOnly_

bool L1GctInternJetProducer::centralBxOnly_
private

Definition at line 52 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ internalJetSource_

edm::InputTag L1GctInternJetProducer::internalJetSource_
private

Definition at line 49 of file L1GctInternJetProducer.h.

Referenced by produce().

◆ jetScaleToken_

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

Definition at line 51 of file L1GctInternJetProducer.h.

Referenced by produce().

L1JetParticleCollection
mps_fire.i
i
Definition: mps_fire.py:428
L1CaloGeometry::emJetPhiBinCenter
double emJetPhiBinCenter(unsigned int phiIndex) const
Definition: L1CaloGeometry.cc:224
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< L1GctJetCandCollection >
PVValHelper::eta
Definition: PVValidationHelpers.h:70
edm::ESHandle
Definition: DTSurvey.h:22
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
L1CaloGeometry
Definition: L1CaloGeometry.h:33
L1GctInternJetProducer::centralBxOnly_
bool centralBxOnly_
Definition: L1GctInternJetProducer.h:52
l1extra::L1JetParticle
Definition: L1JetParticle.h:28
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1GctInternJetProducer::internalJetSource_
edm::InputTag internalJetSource_
Definition: L1GctInternJetProducer.h:49
DDAxes::phi
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle
Definition: EDProductfwd.h:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1GctInternJetProducer::caloGeomToken_
edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > caloGeomToken_
Definition: L1GctInternJetProducer.h:50
wplusjetsAnalysis_cfi.jetScale
jetScale
Definition: wplusjetsAnalysis_cfi.py:88
L1GctInternJetProducer::jetScaleToken_
edm::ESGetToken< L1CaloEtScale, L1JetEtScaleRcd > jetScaleToken_
Definition: L1GctInternJetProducer.h:51
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
l1extra
Definition: L1EmParticle.h:26
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
L1CaloGeometry::etaBinCenter
double etaBinCenter(unsigned int etaIndex, bool central=true) const
Definition: L1CaloGeometry.cc:167
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37