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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1HLTTauMatching (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L1HLTTauMatching ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

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(), and PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc.

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 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 27 of file L1HLTTauMatching.cc.

References a, reco::deltaR(), f, edm::Event::getByLabel(), edm::Ptr< T >::isNonnull(), PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc, 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
const PFCandidatePtr & leadPFChargedHadrCand() const
Definition: PFTau.cc:61
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double f[11][100]
edm::InputTag tauTrigger
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
edm::InputTag jetSrc
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double a
Definition: hdecay.h:121
virtual float pt() const GCC11_FINAL
transverse momentum
std::vector< l1extra::L1JetParticleRef > tauCandRefVec

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.