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
HLTJetL1MatchProducer< T > Class Template Reference

#include <HLTJetL1MatchProducer.h>

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

Public Member Functions

virtual void beginJob ()
 
 HLTJetL1MatchProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTJetL1MatchProducer ()
 
- 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 L1CenJets_
 
edm::InputTag L1ForJets_
 
edm::InputTag L1TauJets_
 
edm::EDGetTokenT< std::vector
< T > > 
m_theJetToken
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
m_theL1CenJetToken
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
m_theL1ForJetToken
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
m_theL1TauJetToken
 

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 HLTJetL1MatchProducer< T >

Definition at line 20 of file HLTJetL1MatchProducer.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file HLTJetL1MatchProducer.cc.

14 {
15  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
16  L1TauJets_ = iConfig.template getParameter<edm::InputTag>("L1TauJets");
17  L1CenJets_ = iConfig.template getParameter<edm::InputTag>("L1CenJets");
18  L1ForJets_ = iConfig.template getParameter<edm::InputTag>("L1ForJets");
19  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
20 
21  typedef std::vector<T> TCollection;
22  m_theJetToken = consumes<TCollection>(jetsInput_);
23  m_theL1TauJetToken = consumes<l1extra::L1JetParticleCollection>(L1TauJets_);
24  m_theL1CenJetToken = consumes<l1extra::L1JetParticleCollection>(L1CenJets_);
25  m_theL1ForJetToken = consumes<l1extra::L1JetParticleCollection>(L1ForJets_);
26  produces<TCollection> ();
27 
28 }
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1TauJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken
template<typename T >
HLTJetL1MatchProducer< T >::~HLTJetL1MatchProducer ( )

Definition at line 37 of file HLTJetL1MatchProducer.cc.

38 {
39 
40 }

Member Function Documentation

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

Definition at line 31 of file HLTJetL1MatchProducer.cc.

32 {
33 
34 }
template<typename T >
void HLTJetL1MatchProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 43 of file HLTJetL1MatchProducer.cc.

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

43  {
45  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
46  desc.add<edm::InputTag>("L1TauJets",edm::InputTag("hltL1extraParticles","Tau"));
47  desc.add<edm::InputTag>("L1CenJets",edm::InputTag("hltL1extraParticles","Central"));
48  desc.add<edm::InputTag>("L1ForJets",edm::InputTag("hltL1extraParticles","Forward"));
49  desc.add<double>("DeltaR",0.5);
50  descriptions.add(defaultModuleLabel<HLTJetL1MatchProducer<T>>(), desc);
51 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void HLTJetL1MatchProducer< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 54 of file HLTJetL1MatchProducer.cc.

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

55 {
56 
57  typedef std::vector<T> TCollection;
58 
60  iEvent.getByToken(m_theJetToken, jets);
61 
62  std::auto_ptr<TCollection> result (new TCollection);
63 
64 
66  iEvent.getByToken(m_theL1TauJetToken,l1TauJets);
67 
69  iEvent.getByToken(m_theL1CenJetToken,l1CenJets);
70 
72  iEvent.getByToken(m_theL1ForJetToken,l1ForJets);
73 
74  typename TCollection::const_iterator jet_iter;
75  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
76 
77  bool isMatched=false;
78 
79  //std::cout << "FL: l1TauJets.size = " << l1TauJets->size() << std::endl;
80  for (unsigned int jetc=0;jetc<l1TauJets->size();++jetc)
81  {
82  const double deltaeta=jet_iter->eta()-(*l1TauJets)[jetc].eta();
83  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1TauJets)[jetc].phi());
84  //std::cout << "FL: sqrt(2) = " << sqrt(2) << std::endl;
85  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
86  }
87 
88  for (unsigned int jetc=0;jetc<l1CenJets->size();++jetc)
89  {
90  const double deltaeta=jet_iter->eta()-(*l1CenJets)[jetc].eta();
91  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1CenJets)[jetc].phi());
92  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
93  }
94 
95  for (unsigned int jetc=0;jetc<l1ForJets->size();++jetc)
96  {
97  const double deltaeta=jet_iter->eta()-(*l1ForJets)[jetc].eta();
98  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1ForJets)[jetc].phi());
99  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
100  }
101 
102 
103  if (isMatched==true) result->push_back(*jet_iter);
104 
105  } // jet_iter
106 
107  iEvent.put( result);
108 
109 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1ForJetToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1CenJetToken
T sqrt(T t)
Definition: SSEVec.h:18
vector< PseudoJet > jets
tuple result
Definition: query.py:137
bool isMatched(TrackingRecHit const &hit)
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_theL1TauJetToken
edm::EDGetTokenT< std::vector< T > > m_theJetToken

Member Data Documentation

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

Definition at line 37 of file HLTJetL1MatchProducer.h.

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

Definition at line 32 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1CenJets_
private

Definition at line 34 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1ForJets_
private

Definition at line 35 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::InputTag HLTJetL1MatchProducer< T >::L1TauJets_
private

Definition at line 33 of file HLTJetL1MatchProducer.h.

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

Definition at line 28 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1CenJetToken
private

Definition at line 30 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1ForJetToken
private

Definition at line 31 of file HLTJetL1MatchProducer.h.

template<typename T >
edm::EDGetTokenT<l1extra::L1JetParticleCollection> HLTJetL1MatchProducer< T >::m_theL1TauJetToken
private

Definition at line 29 of file HLTJetL1MatchProducer.h.