CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1HLTJetsMatching Class Reference

#include <L1HLTJetsMatching.h>

Inheritance diagram for L1HLTJetsMatching:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1HLTJetsMatching (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L1HLTJetsMatching () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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)
 

Private Attributes

std::vector< l1extra::L1JetParticleRefjetCandRefVec
 
edm::EDGetTokenT< edm::View< reco::Candidate > > jetSrc
 
double mEt_Min
 
std::vector< l1extra::L1JetParticleRefobjL1CandRefVec
 
l1extra::L1JetParticleRef tauCandRef
 
std::vector< l1extra::L1JetParticleReftauCandRefVec
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstauTrigger
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 L1HLTJetsMatching.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file L1HLTJetsMatching.cc.

References edm::ParameterSet::getParameter(), and PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc.

16 {
17  jetSrc = consumes<edm::View<reco::Candidate> >(iConfig.getParameter<InputTag>("JetSrc") );
18  tauTrigger = consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<InputTag>("L1TauTrigger") );
19  mEt_Min = iConfig.getParameter<double>("EtMin");
20 
21  produces<CaloJetCollection>();
22 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauTrigger
edm::EDGetTokenT< edm::View< reco::Candidate > > jetSrc
L1HLTJetsMatching::~L1HLTJetsMatching ( )
override

Definition at line 24 of file L1HLTJetsMatching.cc.

24 { }

Member Function Documentation

void L1HLTJetsMatching::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
override

Definition at line 26 of file L1HLTJetsMatching.cc.

References a, HiRegitMuonDetachedTripletStep_cff::DeltaR, reco::deltaR(), f, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), PatBasicFWLiteJetAnalyzer_Selector_cfg::jetSrc, eostools::move(), reco::Candidate::p4(), reco::Candidate::pt(), edm::Event::put(), 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  typedef std::vector<LeafCandidate> LeafCandidateCollection;
36 
37  unique_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection);
38 
39  double deltaR = 1.0;
40  double matchingR = 0.5;
41  //Getting HLT jets to be matched
43  iEvent.getByToken( jetSrc, tauJets );
44 
45  // std::cout <<"Size of input jet collection "<<tauJets->size()<<std::endl;
46 
48  iEvent.getByToken(tauTrigger,l1TriggeredTaus);
49 
50 
51  tauCandRefVec.clear();
52  jetCandRefVec.clear();
53 
56  math::XYZPoint a(0.,0.,0.);
58 
59  for( unsigned int iL1Tau=0; iL1Tau <tauCandRefVec.size();iL1Tau++)
60  {
61  for(unsigned int iJet=0;iJet<tauJets->size();iJet++)
62  {
63  //Find the relative L2TauJets, to see if it has been reconstructed
64  const Candidate & myJet = (*tauJets)[iJet];
65  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (tauCandRefVec[iL1Tau]->p4()).Vect());
66  if(deltaR < matchingR ) {
67  // LeafCandidate myLC(myJet);
68  CaloJet myCaloJet(myJet.p4(),a,f);
69  if(myJet.pt() > mEt_Min) {
70  // tauL2LC->push_back(myLC);
71  tauL2jets->push_back(myCaloJet);
72  }
73  break;
74  }
75  }
76  }
77 
78  for(unsigned int iL1Tau=0; iL1Tau <jetCandRefVec.size();iL1Tau++)
79  {
80  for(unsigned int iJet=0;iJet<tauJets->size();iJet++)
81  {
82  const Candidate & myJet = (*tauJets)[iJet];
83  //Find the relative L2TauJets, to see if it has been reconstructed
84  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (jetCandRefVec[iL1Tau]->p4()).Vect());
85  if(deltaR < matchingR ) {
86  // LeafCandidate myLC(myJet);
87  CaloJet myCaloJet(myJet.p4(),a,f);
88  if(myJet.pt() > mEt_Min) {
89  //tauL2LC->push_back(myLC);
90  tauL2jets->push_back(myCaloJet);
91  }
92  break;
93  }
94  }
95  }
96 
97 
98  //std::cout <<"Size of L1HLT matched jets "<<tauL2jets->size()<<std::endl;
99 
100  iEvent.put(std::move(tauL2jets));
101  // iEvent.put(std::move(tauL2LC));
102 }
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:
Jets made from CaloTowers.
Definition: CaloJet.h:29
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauTrigger
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
std::vector< l1extra::L1JetParticleRef > tauCandRefVec
double f[11][100]
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
virtual double pt() const =0
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< edm::View< reco::Candidate > > jetSrc
fixed size matrix
HLT enums.
double a
Definition: hdecay.h:121
std::vector< l1extra::L1JetParticleRef > jetCandRefVec
def move(src, dest)
Definition: eostools.py:510
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

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

Definition at line 29 of file L1HLTJetsMatching.h.

edm::EDGetTokenT<edm::View<reco::Candidate> > L1HLTJetsMatching::jetSrc
private

Definition at line 33 of file L1HLTJetsMatching.h.

double L1HLTJetsMatching::mEt_Min
private

Definition at line 35 of file L1HLTJetsMatching.h.

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

Definition at line 30 of file L1HLTJetsMatching.h.

l1extra::L1JetParticleRef L1HLTJetsMatching::tauCandRef
private

Definition at line 31 of file L1HLTJetsMatching.h.

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

Definition at line 28 of file L1HLTJetsMatching.h.

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> L1HLTJetsMatching::tauTrigger
private

Definition at line 34 of file L1HLTJetsMatching.h.