CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
L1TJetsMatching< T > Class Template Reference

#include <L1TJetsMatching.h>

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

Public Member Functions

 L1TJetsMatching (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~L1TJetsMatching () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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< std::vector< T > > jetSrc_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsjetTrigger_
 
const double matchingR2_
 
const double matchingR_
 
const double mjjMin_
 
const double pt1Min_
 
const double pt2Min_
 

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

template<typename T>
class L1TJetsMatching< T >

RecoTauTag/HLTProducers/interface/L1TJetsMatching.h Description: Matching L1 to PF/Calo Jets. Used for HLT_VBF paths. Matches PF/Calo Jets to L1 jets from the dedicated seed Adds selection criteria to the leading/subleading jets as well as the maximum dijet mass Separates collections of PF/Calo jets into two categories

Definition at line 53 of file L1TJetsMatching.h.

Constructor & Destructor Documentation

template<typename T >
L1TJetsMatching< T >::L1TJetsMatching ( const edm::ParameterSet iConfig)
explicit

Definition at line 129 of file L1TJetsMatching.h.

129  :
130  jetSrc_ ( consumes<std::vector<T>> (iConfig.getParameter<edm::InputTag>("JetSrc" ) ) ),
131  jetTrigger_( consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("L1JetTrigger") ) ),
132  pt1Min_ ( iConfig.getParameter<double>("pt1Min")),
133  pt2Min_ ( iConfig.getParameter<double>("pt2Min")),
134  mjjMin_ ( iConfig.getParameter<double>("mjjMin")),
135  matchingR_ ( iConfig.getParameter<double>("matchingR")),
137  {
138  produces<std::vector<T>>("TwoJets");
139  produces<std::vector<T>>("ThreeJets");
140 
141  }
T getParameter(std::string const &) const
const double mjjMin_
const edm::EDGetTokenT< std::vector< T > > jetSrc_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > jetTrigger_
const double matchingR2_
const double pt1Min_
const double matchingR_
const double pt2Min_
template<typename T >
L1TJetsMatching< T >::~L1TJetsMatching ( )
override

Definition at line 143 of file L1TJetsMatching.h.

143 { }

Member Function Documentation

template<typename T >
void L1TJetsMatching< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 189 of file L1TJetsMatching.h.

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

190  {
192  desc.add<edm::InputTag>("L1JetTrigger", edm::InputTag("hltL1DiJetVBF"))->setComment("Name of trigger filter" );
193  desc.add<edm::InputTag>("JetSrc" , edm::InputTag("hltAK4PFJetsTightIDCorrected"))->setComment("Input collection of PFJets");
194  desc.add<double> ("pt1Min",95.0)->setComment("Minimal pT1 of PFJets to match");
195  desc.add<double> ("pt2Min",35.0)->setComment("Minimal pT2 of PFJets to match");
196  desc.add<double> ("mjjMin",650.0)->setComment("Minimal mjj of matched PFjets");
197  desc.add<double> ("matchingR",0.5)->setComment("dR value used for matching");
198  descriptions.setComment("This module produces collection of PFJetss matched to L1 Taus / Jets passing a HLT filter (Only p4 and vertex of returned PFJetss are set).");
199  descriptions.add(defaultModuleLabel<L1TJetsMatching<T>>(), desc);
200  }
void setComment(std::string const &value)
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
void L1TJetsMatching< T >::produce ( edm::StreamID  iSId,
edm::Event iEvent,
const edm::EventSetup iES 
) const
override

Definition at line 146 of file L1TJetsMatching.h.

References a, categorise(), reco::deltaR2(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), L1TJetsMatching< T >::jetSrc_, L1TJetsMatching< T >::jetTrigger_, L1TJetsMatching< T >::matchingR2_, L1TJetsMatching< T >::mjjMin_, eostools::move(), convertSQLitetoXML_cfg::output, pfJetBenchmark_cfi::pfJets, L1TJetsMatching< T >::pt1Min_, L1TJetsMatching< T >::pt2Min_, edm::Event::put(), and trigger::TriggerL1Jet.

147  {
148 
149  unique_ptr<std::vector<T>> pfMatchedJets(new std::vector<T>);
150  std::pair<std::vector<T>,std::vector<T>> output;
151 
152 
153 
154  // Getting HLT jets to be matched
156  iEvent.getByToken( jetSrc_, pfJets );
157 
159  iEvent.getByToken(jetTrigger_,l1TriggeredJets);
160 
161  //l1t::TauVectorRef jetCandRefVec;
162  l1t::JetVectorRef jetCandRefVec;
163  l1TriggeredJets->getObjects( trigger::TriggerL1Jet,jetCandRefVec);
164 
165  math::XYZPoint a(0.,0.,0.);
166 
167  //std::cout<<"PFsize= "<<pfJets->size()<<endl<<" L1size= "<<jetCandRefVec.size()<<std::endl;
168  for(unsigned int iJet = 0; iJet < pfJets->size(); iJet++){
169  const T & myJet = (*pfJets)[iJet];
170  for(unsigned int iL1Jet = 0; iL1Jet < jetCandRefVec.size(); iL1Jet++){
171  // Find the relative L2pfJets, to see if it has been reconstructed
172  // if ((iJet<3) && (iL1Jet==0)) std::cout<<myJet.p4().Pt()<<" ";
173  if ((reco::deltaR2(myJet.p4(), jetCandRefVec[iL1Jet]->p4()) < matchingR2_ ) && (myJet.pt()>pt2Min_)) {
174  pfMatchedJets->push_back(myJet);
175  break;
176  }
177  }
178  }
179 
180  output= categorise(*pfMatchedJets,pt1Min_,pt2Min_, mjjMin_);
181  unique_ptr<std::vector<T>> output1(new std::vector<T>(output.first));
182  unique_ptr<std::vector<T>> output2(new std::vector<T>(output.second));
183 
184  iEvent.put(std::move(output1),"TwoJets");
185  iEvent.put(std::move(output2),"ThreeJets");
186 
187  }
const double mjjMin_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< JetRef > JetVectorRef
Definition: Jet.h:14
const edm::EDGetTokenT< std::vector< T > > jetSrc_
std::pair< std::vector< T >, std::vector< T > > categorise(const std::vector< T > &pfMatchedJets, double pt1, double pt2, double Mjj)
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > jetTrigger_
const double matchingR2_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const double pt1Min_
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
double a
Definition: hdecay.h:121
long double T
const double pt2Min_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename T >
const edm::EDGetTokenT<std::vector<T> > L1TJetsMatching< T >::jetSrc_
private

Definition at line 62 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().

template<typename T >
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> L1TJetsMatching< T >::jetTrigger_
private

Definition at line 63 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().

template<typename T >
const double L1TJetsMatching< T >::matchingR2_
private

Definition at line 68 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().

template<typename T >
const double L1TJetsMatching< T >::matchingR_
private

Definition at line 67 of file L1TJetsMatching.h.

template<typename T >
const double L1TJetsMatching< T >::mjjMin_
private

Definition at line 66 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().

template<typename T >
const double L1TJetsMatching< T >::pt1Min_
private

Definition at line 64 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().

template<typename T >
const double L1TJetsMatching< T >::pt2Min_
private

Definition at line 65 of file L1TJetsMatching.h.

Referenced by L1TJetsMatching< T >::produce().