CMS 3D CMS Logo

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 &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~L1HLTTauMatching () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::PFTauCollectionjetSrc
 
const double mEt_Min
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstauTrigger
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 ( )
override

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(), 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
override

Definition at line 26 of file L1HLTTauMatching.cc.

References a, deltaR(), HiRegitMuonDetachedTripletStep_cff::DeltaR, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), edm::Ptr< T >::isNonnull(), jetSrc, reco::PFTau::leadPFChargedHadrCand(), mEt_Min, eostools::move(), reco::LeafCandidate::p4(), reco::LeafCandidate::pt(), edm::Event::put(), tauTrigger, trigger::TriggerL1CenJet, trigger::TriggerL1TauJet, and reco::PFCandidate::vertex().

27 {
28 
29  using namespace edm;
30  using namespace std;
31  using namespace reco;
32  using namespace trigger;
33  using namespace l1extra;
34 
35  unique_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(std::move(tauL2jets));
104  // iEvent.put(std::move(tauL2LC));
105 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
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:579
double pt() const final
transverse momentum
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:656
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauTrigger
const edm::EDGetTokenT< reco::PFTauCollection > jetSrc
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
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
fixed size matrix
HLT enums.
double a
Definition: hdecay.h:121
const double mEt_Min
def move(src, dest)
Definition: eostools.py:510

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().