CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HLTJetL1MatchProducer Class Reference

#include <HLTJetL1MatchProducer.h>

Inheritance diagram for HLTJetL1MatchProducer:
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 ()
 

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

Definition at line 9 of file HLTJetL1MatchProducer.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file HLTJetL1MatchProducer.cc.

References DeltaR_, edm::ParameterSet::getParameter(), jetsInput_, L1CenJets_, L1ForJets_, and L1TauJets_.

10 {
11  jetsInput_ = iConfig.getParameter<edm::InputTag>("jetsInput");
12  L1TauJets_ = iConfig.getParameter<edm::InputTag>("L1TauJets");
13  L1CenJets_ = iConfig.getParameter<edm::InputTag>("L1CenJets");
14  L1ForJets_ = iConfig.getParameter<edm::InputTag>("L1ForJets");
15  DeltaR_ = iConfig.getParameter<double>("DeltaR");
16 
17  produces< reco::CaloJetCollection > ();
18 
19 }
T getParameter(std::string const &) const
HLTJetL1MatchProducer::~HLTJetL1MatchProducer ( )

Definition at line 26 of file HLTJetL1MatchProducer.cc.

27 {
28 
29 }

Member Function Documentation

void HLTJetL1MatchProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 21 of file HLTJetL1MatchProducer.cc.

22 {
23 
24 }
void HLTJetL1MatchProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 31 of file HLTJetL1MatchProducer.cc.

References Geom::deltaPhi(), DeltaR_, edm::Event::getByLabel(), jetsInput_, L1CenJets_, L1ForJets_, L1TauJets_, edm::Event::put(), query::result, and mathSSE::sqrt().

32 {
33 
35  iEvent.getByLabel(jetsInput_, calojets);
36 
37  std::auto_ptr<reco::CaloJetCollection> result (new reco::CaloJetCollection);
38 
39 
41  iEvent.getByLabel(L1TauJets_,l1TauJets);
42 
44  iEvent.getByLabel(L1CenJets_,l1CenJets);
45 
47  iEvent.getByLabel(L1ForJets_,l1ForJets);
48 
49 
50  for (reco::CaloJetCollection::const_iterator calojetc = calojets->begin();
51  calojetc != calojets->end(); ++calojetc) {
52 
53  bool isMatched=false;
54 
55  //std::cout << "FL: l1TauJets.size = " << l1TauJets->size() << std::endl;
56  for (unsigned int jetc=0;jetc<l1TauJets->size();++jetc)
57  {
58  const double deltaeta=calojetc->eta()-(*l1TauJets)[jetc].eta();
59  const double deltaphi=deltaPhi(calojetc->phi(),(*l1TauJets)[jetc].phi());
60  //std::cout << "FL: sqrt(2) = " << sqrt(2) << std::endl;
61  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
62  }
63 
64  for (unsigned int jetc=0;jetc<l1CenJets->size();++jetc)
65  {
66  const double deltaeta=calojetc->eta()-(*l1CenJets)[jetc].eta();
67  const double deltaphi=deltaPhi(calojetc->phi(),(*l1CenJets)[jetc].phi());
68  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
69  }
70 
71  for (unsigned int jetc=0;jetc<l1ForJets->size();++jetc)
72  {
73  const double deltaeta=calojetc->eta()-(*l1ForJets)[jetc].eta();
74  const double deltaphi=deltaPhi(calojetc->phi(),(*l1ForJets)[jetc].phi());
75  if (sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=true;
76  }
77 
78 
79  if (isMatched==true) result->push_back(*calojetc);
80 
81  } // calojetc
82 
83  iEvent.put( result);
84 
85 }
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

double HLTJetL1MatchProducer::DeltaR_
private

Definition at line 20 of file HLTJetL1MatchProducer.h.

Referenced by HLTJetL1MatchProducer(), and produce().

edm::InputTag HLTJetL1MatchProducer::jetsInput_
private

Definition at line 16 of file HLTJetL1MatchProducer.h.

Referenced by HLTJetL1MatchProducer(), and produce().

edm::InputTag HLTJetL1MatchProducer::L1CenJets_
private

Definition at line 18 of file HLTJetL1MatchProducer.h.

Referenced by HLTJetL1MatchProducer(), and produce().

edm::InputTag HLTJetL1MatchProducer::L1ForJets_
private

Definition at line 19 of file HLTJetL1MatchProducer.h.

Referenced by HLTJetL1MatchProducer(), and produce().

edm::InputTag HLTJetL1MatchProducer::L1TauJets_
private

Definition at line 17 of file HLTJetL1MatchProducer.h.

Referenced by HLTJetL1MatchProducer(), and produce().