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
 
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)
 

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

bool centralBxOnly_
 
edm::InputTag internalJetSource_
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

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 29 of file L1GctInternJetProducer.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file L1GctInternJetProducer.cc.

33  : internalJetSource_(iConfig.getParameter<edm::InputTag>("internalJetSource")),
34  centralBxOnly_(iConfig.getParameter<bool>("centralBxOnly")) {
35  using namespace l1extra;
36 
37  produces<L1JetParticleCollection>("Internal");
38 }
T getParameter(std::string const &) const
L1GctInternJetProducer::~L1GctInternJetProducer ( )
override

Definition at line 40 of file L1GctInternJetProducer.cc.

40 {}

Member Function Documentation

void L1GctInternJetProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 94 of file L1GctInternJetProducer.cc.

94 {}
void L1GctInternJetProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 96 of file L1GctInternJetProducer.cc.

References DEFINE_FWK_MODULE.

96 {}
math::PtEtaPhiMLorentzVector L1GctInternJetProducer::gctLorentzVector ( const double &  et,
const L1GctCand cand,
const L1CaloGeometry geom,
bool  central 
)
private
void L1GctInternJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 42 of file L1GctInternJetProducer.cc.

References centralBxOnly_, gather_cfg::cout, MillePedeFileConverter_cfg::e, L1CaloGeometry::emJetPhiBinCenter(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, L1CaloGeometry::etaBinCenter(), edm::EventSetup::get(), edm::Event::getByLabel(), mps_fire::i, internalJetSource_, edm::HandleBase::isValid(), wplusjetsAnalysis_cfi::jetScale, L1CaloEtScale::linearLsb(), LogDebug, eostools::move(), phi, and edm::Event::put().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

42  {
43  //std::cout << "ARGGHHH!" << std::endl;
44  using namespace edm;
45  using namespace l1extra;
46  using namespace std;
47 
48  unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
49 
50  ESHandle<L1CaloGeometry> caloGeomESH;
51  iSetup.get<L1CaloGeometryRecord>().get(caloGeomESH);
52  const L1CaloGeometry* caloGeom = &(*caloGeomESH);
53 
55  iSetup.get<L1JetEtScaleRcd>().get(jetScale);
56 
57  double etSumLSB = jetScale->linearLsb();
58  //std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
59 
61  iEvent.getByLabel(internalJetSource_, hwIntJetCands);
62  //std::cout << "At leas Something is happening" <<std::endl;
63  if (!hwIntJetCands.isValid()) {
64  std::cout << "These aren't the Jets you're looking for" << std::endl;
65 
66  LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
67  << "\nrequested in configuration, but not found in the event." << std::endl;
68 
69  } else {
70  //std::cout << "apparently the collection was found" <<std::endl;
71  L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
72  L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
73  int i;
74  for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
75  //std::cout << " JetS a plenty" <<std::endl;
76  if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
77  double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
78 
79  //double et = 10.;
80  //std::cout << "jetET: " << jetItr->et() <<std::endl;
81  //std::cout << "ET was: " << et << std::endl;
82  double eta = caloGeom->etaBinCenter(jetItr->regionId());
83  double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
84 
85  internJetColl->push_back(
86  L1JetParticle(math::PtEtaPhiMLorentzVector(et, eta, phi, 0.), Ref<L1GctJetCandCollection>(), jetItr->bx()));
87  }
88  }
89  }
90 
91  OrphanHandle<L1JetParticleCollection> internalJetHandle = iEvent.put(std::move(internJetColl), "Internal");
92 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
double etaBinCenter(unsigned int etaIndex, bool central=true) const
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
HLT enums.
T get() const
Definition: EventSetup.h:73
double emJetPhiBinCenter(unsigned int phiIndex) const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

bool L1GctInternJetProducer::centralBxOnly_
private

Definition at line 46 of file L1GctInternJetProducer.h.

Referenced by produce().

edm::InputTag L1GctInternJetProducer::internalJetSource_
private

Definition at line 44 of file L1GctInternJetProducer.h.

Referenced by produce().