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
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 &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L1HLTJetsMatching ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

Private Attributes

std::vector
< l1extra::L1JetParticleRef
jetCandRefVec
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
jetSrc
 
double mEt_Min
 
std::vector
< l1extra::L1JetParticleRef
objL1CandRefVec
 
l1extra::L1JetParticleRef tauCandRef
 
std::vector
< l1extra::L1JetParticleRef
tauCandRefVec
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tauTrigger
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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)
 
- 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 HLT_25ns10e33_v2_cff::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 ( )

Definition at line 24 of file L1HLTJetsMatching.cc.

24 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 26 of file L1HLTJetsMatching.cc.

References a, reco::deltaR(), HLT_25ns10e33_v2_cff::DeltaR, f, edm::Event::getByToken(), HLT_25ns10e33_v2_cff::jetSrc, reco::Candidate::p4(), reco::Candidate::pt(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, 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  auto_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 
54  l1TriggeredTaus->getObjects( trigger::TriggerL1TauJet,tauCandRefVec);
55  l1TriggeredTaus->getObjects( trigger::TriggerL1CenJet,jetCandRefVec);
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(tauL2jets);
101  // iEvent.put(tauL2LC);
102 }
Jets made from CaloTowers.
Definition: CaloJet.h:29
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauTrigger
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
virtual double pt() const =0
transverse momentum
std::vector< l1extra::L1JetParticleRef > tauCandRefVec
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
double f[11][100]
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
edm::EDGetTokenT< edm::View< reco::Candidate > > jetSrc
double a
Definition: hdecay.h:121
std::vector< l1extra::L1JetParticleRef > jetCandRefVec
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector

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.