test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTJetL1TMatchProducer< T > Class Template Reference

#include <HLTJetL1TMatchProducer.h>

Inheritance diagram for HLTJetL1TMatchProducer< T >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
 HLTJetL1TMatchProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTJetL1TMatchProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

double DeltaR_
 
edm::InputTag jetsInput_
 
edm::InputTag L1Jets_
 
edm::EDGetTokenT< std::vector
< T > > 
m_theJetToken
 
edm::EDGetTokenT
< l1t::JetBxCollection
m_theL1JetToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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 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

template<typename T>
class HLTJetL1TMatchProducer< T >

Definition at line 21 of file HLTJetL1TMatchProducer.h.

Constructor & Destructor Documentation

template<typename T >
HLTJetL1TMatchProducer< T >::HLTJetL1TMatchProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 14 of file HLTJetL1TMatchProducer.cc.

15 {
16  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
17  L1Jets_ = iConfig.template getParameter<edm::InputTag>("L1Jets");
18  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
19 
20  typedef std::vector<T> TCollection;
21  m_theJetToken = consumes<TCollection>(jetsInput_);
22  m_theL1JetToken = consumes<l1t::JetBxCollection>(L1Jets_);
23  produces<TCollection> ();
24 
25 }
edm::EDGetTokenT< std::vector< T > > m_theJetToken
edm::EDGetTokenT< l1t::JetBxCollection > m_theL1JetToken
template<typename T >
HLTJetL1TMatchProducer< T >::~HLTJetL1TMatchProducer ( )

Definition at line 34 of file HLTJetL1TMatchProducer.cc.

35 {
36 
37 }

Member Function Documentation

template<typename T >
void HLTJetL1TMatchProducer< T >::beginJob ( void  )
virtual

Definition at line 28 of file HLTJetL1TMatchProducer.cc.

29 {
30 
31 }
template<typename T >
void HLTJetL1TMatchProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 40 of file HLTJetL1TMatchProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), and HLT_25ns10e33_v2_cff::InputTag.

40  {
42  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
43  desc.add<edm::InputTag>("L1Jets",edm::InputTag("hltCaloStage2Digis"));
44  desc.add<double>("DeltaR",0.5);
45  descriptions.add(defaultModuleLabel<HLTJetL1TMatchProducer<T>>(), desc);
46 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void HLTJetL1TMatchProducer< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 49 of file HLTJetL1TMatchProducer.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, edm::Event::getByToken(), trackerHitRTTI::isMatched(), edm::HandleBase::isValid(), fwrapper::jets, edm::Event::put(), mps_fire::result, and mathSSE::sqrt().

50 {
51 
52  typedef std::vector<T> TCollection;
53 
55  iEvent.getByToken(m_theJetToken, jets);
56 
57  std::auto_ptr<TCollection> result (new TCollection);
58 
59 
61  iEvent.getByToken(m_theL1JetToken,l1Jets);
62  bool trigger_bx_only = true; // selection of BX not implemented
63 
64  if (l1Jets.isValid()){
65  typename TCollection::const_iterator jet_iter;
66  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
67  bool isMatched=false;
68  for (int ibx = l1Jets->getFirstBX(); ibx <= l1Jets->getLastBX(); ++ibx) {
69  if (trigger_bx_only && (ibx != 0)) continue;
70  for (auto it=l1Jets->begin(ibx); it!=l1Jets->end(ibx); it++){
71  if (it->et() == 0) continue; // if you don't care about L1T candidates with zero ET.
72  const double deltaeta=jet_iter->eta()-it->eta();
73  const double deltaphi=deltaPhi(jet_iter->phi(),it->phi());
74  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
75  //cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
76  }
77  }
78  if (isMatched==true) result->push_back(*jet_iter);
79  } // jet_iter
80  } else {
81  edm::LogWarning("MissingProduct") << "L1Upgrade l1Jets bx collection not found." << std::endl;
82  }
83 
84  iEvent.put( result);
85 
86 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< std::vector< T > > m_theJetToken
tuple result
Definition: mps_fire.py:83
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
T sqrt(T t)
Definition: SSEVec.h:18
vector< PseudoJet > jets
bool isMatched(TrackingRecHit const &hit)
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< l1t::JetBxCollection > m_theL1JetToken

Member Data Documentation

template<typename T >
double HLTJetL1TMatchProducer< T >::DeltaR_
private

Definition at line 34 of file HLTJetL1TMatchProducer.h.

template<typename T >
edm::InputTag HLTJetL1TMatchProducer< T >::jetsInput_
private

Definition at line 31 of file HLTJetL1TMatchProducer.h.

template<typename T >
edm::InputTag HLTJetL1TMatchProducer< T >::L1Jets_
private

Definition at line 32 of file HLTJetL1TMatchProducer.h.

template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetL1TMatchProducer< T >::m_theJetToken
private

Definition at line 29 of file HLTJetL1TMatchProducer.h.

template<typename T >
edm::EDGetTokenT<l1t::JetBxCollection> HLTJetL1TMatchProducer< T >::m_theL1JetToken
private

Definition at line 30 of file HLTJetL1TMatchProducer.h.