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
L1HLTTauMatching Class Reference

#include <L1HLTTauMatching.h>

Inheritance diagram for L1HLTTauMatching:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 L1HLTTauMatching (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~L1HLTTauMatching ()
 
- 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

std::vector
< l1extra::L1JetParticleRef
jetCandRefVec
 
edm::InputTag jetSrc
 
double mEt_Min
 
std::vector
< l1extra::L1JetParticleRef
objL1CandRefVec
 
l1extra::L1JetParticleRef tauCandRef
 
std::vector
< l1extra::L1JetParticleRef
tauCandRefVec
 
edm::InputTag tauTrigger
 

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)
 
static void prevalidate (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 21 of file L1HLTTauMatching.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file L1HLTTauMatching.cc.

References edm::ParameterSet::getParameter().

18 {
19  jetSrc = iConfig.getParameter<InputTag>("JetSrc");
20  tauTrigger = iConfig.getParameter<InputTag>("L1TauTrigger");
21  mEt_Min = iConfig.getParameter<double>("EtMin");
22 
23  produces<PFTauCollection>();
24 }
T getParameter(std::string const &) const
edm::InputTag tauTrigger
edm::InputTag jetSrc
L1HLTTauMatching::~L1HLTTauMatching ( )

Definition at line 25 of file L1HLTTauMatching.cc.

25 { }

Member Function Documentation

void L1HLTTauMatching::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
virtual

Implements edm::EDProducer.

Definition at line 27 of file L1HLTTauMatching.cc.

References a, reco::deltaR(), f, edm::Event::getByLabel(), edm::Ref< C, T, F >::isNonnull(), reco::PFTau::leadPFChargedHadrCand(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, trigger::TriggerL1CenJet, and trigger::TriggerL1TauJet.

28 {
29 
30  using namespace edm;
31  using namespace std;
32  using namespace reco;
33  using namespace trigger;
34  using namespace l1extra;
35 
36  auto_ptr<PFTauCollection> tauL2jets(new PFTauCollection);
37 
38  double deltaR = 1.0;
39  double matchingR = 0.5;
40  //Getting HLT jets to be matched
42  iEvent.getByLabel( jetSrc, tauJets );
43 
44 // std::cout <<"Size of input jet collection "<<tauJets->size()<<std::endl;
45 
47  iEvent.getByLabel(tauTrigger,l1TriggeredTaus);
48 
49 
50  tauCandRefVec.clear();
51  jetCandRefVec.clear();
52 
53  l1TriggeredTaus->getObjects( trigger::TriggerL1TauJet,tauCandRefVec);
54  l1TriggeredTaus->getObjects( trigger::TriggerL1CenJet,jetCandRefVec);
55  math::XYZPoint a(0.,0.,0.);
57 
58  for( unsigned int iL1Tau=0; iL1Tau <tauCandRefVec.size();iL1Tau++)
59  {
60  for(unsigned int iJet=0;iJet<tauJets->size();iJet++)
61  {
62  //Find the relative L2TauJets, to see if it has been reconstructed
63  const PFTau & myJet = (*tauJets)[iJet];
64  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (tauCandRefVec[iL1Tau]->p4()).Vect());
65  if(deltaR < matchingR ) {
66  // LeafCandidate myLC(myJet);
67  if(myJet.leadPFChargedHadrCand().isNonnull()){
68  a = myJet.leadPFChargedHadrCand()->vertex();
69  }
70  PFTau myPFTau(std::numeric_limits<int>::quiet_NaN(), myJet.p4(), a);
71  if(myJet.pt() > mEt_Min) {
72  // tauL2LC->push_back(myLC);
73  tauL2jets->push_back(myPFTau);
74  }
75  break;
76  }
77  }
78  }
79 
80  for(unsigned int iL1Tau=0; iL1Tau <jetCandRefVec.size();iL1Tau++)
81  {
82  for(unsigned int iJet=0;iJet<tauJets->size();iJet++)
83  {
84  const PFTau & myJet = (*tauJets)[iJet];
85  //Find the relative L2TauJets, to see if it has been reconstructed
86  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (jetCandRefVec[iL1Tau]->p4()).Vect());
87  if(deltaR < matchingR ) {
88  // LeafCandidate myLC(myJet);
89  if(myJet.leadPFChargedHadrCand().isNonnull()){
90  a = myJet.leadPFChargedHadrCand()->vertex();
91  }
92 
93  PFTau myPFTau(std::numeric_limits<int>::quiet_NaN(), myJet.p4(),a);
94  if(myJet.pt() > mEt_Min) {
95  //tauL2LC->push_back(myLC);
96  tauL2jets->push_back(myPFTau);
97  }
98  break;
99  }
100  }
101  }
102 
103 
104 //std::cout <<"Size of L1HLT matched jets "<<tauL2jets->size()<<std::endl;
105 
106 iEvent.put(tauL2jets);
107 // iEvent.put(tauL2LC);
108 }
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
std::vector< l1extra::L1JetParticleRef > jetCandRefVec
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
double f[11][100]
edm::InputTag tauTrigger
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
edm::InputTag jetSrc
const PFCandidateRef & leadPFChargedHadrCand() const
Definition: PFTau.cc:62
virtual double pt() const
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
double a
Definition: hdecay.h:121
std::vector< l1extra::L1JetParticleRef > tauCandRefVec
virtual const LorentzVector & p4() const
four-momentum Lorentz vector

Member Data Documentation

std::vector<l1extra::L1JetParticleRef> L1HLTTauMatching::jetCandRefVec
private

Definition at line 29 of file L1HLTTauMatching.h.

edm::InputTag L1HLTTauMatching::jetSrc
private

Definition at line 33 of file L1HLTTauMatching.h.

double L1HLTTauMatching::mEt_Min
private

Definition at line 35 of file L1HLTTauMatching.h.

std::vector<l1extra::L1JetParticleRef> L1HLTTauMatching::objL1CandRefVec
private

Definition at line 30 of file L1HLTTauMatching.h.

l1extra::L1JetParticleRef L1HLTTauMatching::tauCandRef
private

Definition at line 31 of file L1HLTTauMatching.h.

std::vector<l1extra::L1JetParticleRef> L1HLTTauMatching::tauCandRefVec
private

Definition at line 28 of file L1HLTTauMatching.h.

edm::InputTag L1HLTTauMatching::tauTrigger
private

Definition at line 34 of file L1HLTTauMatching.h.