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::EDProducer edm::ProducerBase 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::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
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_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

template<typename T>
class HLTJetL1MatchProducer< T >

Definition at line 13 of file HLTJetL1MatchProducer.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file HLTJetL1MatchProducer.cc.

22 {
23  jetsInput_ = iConfig.template getParameter<edm::InputTag>("jetsInput");
24  L1TauJets_ = iConfig.template getParameter<edm::InputTag>("L1TauJets");
25  L1CenJets_ = iConfig.template getParameter<edm::InputTag>("L1CenJets");
26  L1ForJets_ = iConfig.template getParameter<edm::InputTag>("L1ForJets");
27  DeltaR_ = iConfig.template getParameter<double>("DeltaR");
28 
29  typedef std::vector<T> TCollection;
30  produces<TCollection> ();
31 
32 }
template<typename T >
HLTJetL1MatchProducer< T >::~HLTJetL1MatchProducer ( )

Definition at line 41 of file HLTJetL1MatchProducer.cc.

42 {
43 
44 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 35 of file HLTJetL1MatchProducer.cc.

36 {
37 
38 }
template<typename T >
void HLTJetL1MatchProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 47 of file HLTJetL1MatchProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and mergeVDriftHistosByStation::name.

47  {
49  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
50  desc.add<edm::InputTag>("L1TauJets",edm::InputTag("hltL1extraParticles","Tau"));
51  desc.add<edm::InputTag>("L1CenJets",edm::InputTag("hltL1extraParticles","Central"));
52  desc.add<edm::InputTag>("L1ForJets",edm::InputTag("hltL1extraParticles","Forward"));
53  desc.add<double>("DeltaR",0.5);
54  descriptions.add(std::string("hlt")+std::string(typeid(HLTJetL1MatchProducer<T>).name()),desc);
55 }
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::EDProducer.

Definition at line 58 of file HLTJetL1MatchProducer.cc.

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

59 {
60 
61  typedef std::vector<T> TCollection;
62 
64  iEvent.getByLabel(jetsInput_, jets);
65 
66  std::auto_ptr<TCollection> result (new TCollection);
67 
68 
70  iEvent.getByLabel(L1TauJets_,l1TauJets);
71 
73  iEvent.getByLabel(L1CenJets_,l1CenJets);
74 
76  iEvent.getByLabel(L1ForJets_,l1ForJets);
77 
78  typename TCollection::const_iterator jet_iter;
79  for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
80 
81  bool isMatched=false;
82 
83  //std::cout << "FL: l1TauJets.size = " << l1TauJets->size() << std::endl;
84  for (unsigned int jetc=0;jetc<l1TauJets->size();++jetc)
85  {
86  const double deltaeta=jet_iter->eta()-(*l1TauJets)[jetc].eta();
87  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1TauJets)[jetc].phi());
88  //std::cout << "FL: sqrt(2) = " << sqrt(2) << std::endl;
89  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
90  }
91 
92  for (unsigned int jetc=0;jetc<l1CenJets->size();++jetc)
93  {
94  const double deltaeta=jet_iter->eta()-(*l1CenJets)[jetc].eta();
95  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1CenJets)[jetc].phi());
96  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
97  }
98 
99  for (unsigned int jetc=0;jetc<l1ForJets->size();++jetc)
100  {
101  const double deltaeta=jet_iter->eta()-(*l1ForJets)[jetc].eta();
102  const double deltaphi=deltaPhi(jet_iter->phi(),(*l1ForJets)[jetc].phi());
103  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
104  }
105 
106 
107  if (isMatched==true) result->push_back(*jet_iter);
108 
109  } // jet_iter
110 
111  iEvent.put( result);
112 
113 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
T sqrt(T t)
Definition: SSEVec.h:46
vector< PseudoJet > jets
tuple result
Definition: query.py:137
bool isMatched(TrackingRecHit const &hit)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356

Member Data Documentation

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

Definition at line 26 of file HLTJetL1MatchProducer.h.

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

Definition at line 21 of file HLTJetL1MatchProducer.h.

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

Definition at line 23 of file HLTJetL1MatchProducer.h.

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

Definition at line 24 of file HLTJetL1MatchProducer.h.

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

Definition at line 22 of file HLTJetL1MatchProducer.h.