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

#include <L1HLTTauMatching.h>

Inheritance diagram for L1HLTTauMatching:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1HLTTauMatching (const edm::ParameterSet &)
 
virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~L1HLTTauMatching ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::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 (const std::string &iProcessName, std::vector< const char * > &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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT
< reco::PFTauCollection
jetSrc
 
const double mEt_Min
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tauTrigger
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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

Definition at line 22 of file L1HLTTauMatching.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file L1HLTTauMatching.cc.

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

Definition at line 24 of file L1HLTTauMatching.cc.

24 { }

Member Function Documentation

void L1HLTTauMatching::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 107 of file L1HLTTauMatching.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns14e33_v1_cff::InputTag, edm::ConfigurationDescriptions::setComment(), and edm::ParameterDescriptionNode::setComment().

108 {
110  desc.add<edm::InputTag>("L1TauTrigger",edm::InputTag("hltL1sDoubleIsoTau40er"))->setComment("Name of trigger filter");
111  desc.add<edm::InputTag>("JetSrc",edm::InputTag("hltSelectedPFTausTrackPt1MediumIsolationReg"))->setComment("Input collection of PFTaus");
112  desc.add<double>("EtMin",0.0)->setComment("Minimal pT of PFTau to match");
113  descriptions.setComment("This module produces collection of PFTaus matched to L1ExtraTaus/Jets passing a HLT filter (Only p4 and vertex of returned PFTaus are set).");
114  descriptions.add("L1HLTJetsMatching",desc);
115 }
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void L1HLTTauMatching::produce ( edm::StreamID  iSId,
edm::Event iEvent,
const edm::EventSetup iES 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 26 of file L1HLTTauMatching.cc.

References a, deltaR(), HLT_25ns14e33_v1_cff::DeltaR, edm::Event::getByToken(), edm::Ptr< T >::isNonnull(), jetSrc, reco::PFTau::leadPFChargedHadrCand(), mEt_Min, reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, tauTrigger, trigger::TriggerL1CenJet, and trigger::TriggerL1TauJet.

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

Member Data Documentation

const edm::EDGetTokenT<reco::PFTauCollection> L1HLTTauMatching::jetSrc
private

Definition at line 31 of file L1HLTTauMatching.h.

Referenced by produce().

const double L1HLTTauMatching::mEt_Min
private

Definition at line 33 of file L1HLTTauMatching.h.

Referenced by produce().

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> L1HLTTauMatching::tauTrigger
private

Definition at line 32 of file L1HLTTauMatching.h.

Referenced by produce().