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 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< std::vector< T > > jetSrc_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsjetTrigger_
 
const double matchingR2_
 
const double matchingR_
 
const double mjjMin_
 
const double pt1Min_
 
const double pt2Min_
 
const double pt3Min_
 

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 130 of file L1TJetsMatching.h.

130  :
131  jetSrc_ ( consumes<std::vector<T>> (iConfig.getParameter<edm::InputTag>("JetSrc" ) ) ),
132  jetTrigger_( consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("L1JetTrigger") ) ),
133  pt1Min_ ( iConfig.getParameter<double>("pt1Min")),
134  pt2Min_ ( iConfig.getParameter<double>("pt2Min")),
135  pt3Min_ ( iConfig.getParameter<double>("pt3Min")),
136  mjjMin_ ( iConfig.getParameter<double>("mjjMin")),
137  matchingR_ ( iConfig.getParameter<double>("matchingR")),
139  {
140  produces<std::vector<T>>("TwoJets");
141  produces<std::vector<T>>("ThreeJets");
142 
143  }
T getParameter(std::string const &) const
const double mjjMin_
const edm::EDGetTokenT< std::vector< T > > jetSrc_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double pt3Min_
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 145 of file L1TJetsMatching.h.

145 { }

Member Function Documentation

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

Definition at line 191 of file L1TJetsMatching.h.

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

192  {
194  desc.add<edm::InputTag>("L1JetTrigger", edm::InputTag("hltL1DiJetVBF"))->setComment("Name of trigger filter" );
195  desc.add<edm::InputTag>("JetSrc" , edm::InputTag("hltAK4PFJetsTightIDCorrected"))->setComment("Input collection of PFJets");
196  desc.add<double> ("pt1Min",110.0)->setComment("Minimal pT1 of PFJets to match");
197  desc.add<double> ("pt2Min",35.0)->setComment("Minimal pT2 of PFJets to match");
198  desc.add<double> ("pt3Min",110.0)->setComment("Minimum pT3 of PFJets to match");
199  desc.add<double> ("mjjMin",650.0)->setComment("Minimal mjj of matched PFjets");
200  desc.add<double> ("matchingR",0.5)->setComment("dR value used for matching");
201  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).");
202  descriptions.add(defaultModuleLabel<L1TJetsMatching<T>>(), desc);
203  }
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 148 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_, L1TJetsMatching< T >::pt3Min_, edm::Event::put(), and trigger::TriggerL1Jet.

149  {
150 
151  unique_ptr<std::vector<T>> pfMatchedJets(new std::vector<T>);
152  std::pair<std::vector<T>,std::vector<T>> output;
153 
154 
155 
156  // Getting HLT jets to be matched
158  iEvent.getByToken( jetSrc_, pfJets );
159 
161  iEvent.getByToken(jetTrigger_,l1TriggeredJets);
162 
163  //l1t::TauVectorRef jetCandRefVec;
164  l1t::JetVectorRef jetCandRefVec;
165  l1TriggeredJets->getObjects( trigger::TriggerL1Jet,jetCandRefVec);
166 
167  math::XYZPoint a(0.,0.,0.);
168 
169  //std::cout<<"PFsize= "<<pfJets->size()<<endl<<" L1size= "<<jetCandRefVec.size()<<std::endl;
170  for(unsigned int iJet = 0; iJet < pfJets->size(); iJet++){
171  const T & myJet = (*pfJets)[iJet];
172  for(unsigned int iL1Jet = 0; iL1Jet < jetCandRefVec.size(); iL1Jet++){
173  // Find the relative L2pfJets, to see if it has been reconstructed
174  // if ((iJet<3) && (iL1Jet==0)) std::cout<<myJet.p4().Pt()<<" ";
175  if ((reco::deltaR2(myJet.p4(), jetCandRefVec[iL1Jet]->p4()) < matchingR2_ ) && (myJet.pt()>pt2Min_)) {
176  pfMatchedJets->push_back(myJet);
177  break;
178  }
179  }
180  }
181 
182  output= categorise(*pfMatchedJets,pt1Min_, pt2Min_, pt3Min_, mjjMin_);
183  unique_ptr<std::vector<T>> output1(new std::vector<T>(output.first));
184  unique_ptr<std::vector<T>> output2(new std::vector<T>(output.second));
185 
186  iEvent.put(std::move(output1),"TwoJets");
187  iEvent.put(std::move(output2),"ThreeJets");
188 
189  }
const double mjjMin_
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:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< JetRef > JetVectorRef
Definition: Jet.h:15
const edm::EDGetTokenT< std::vector< T > > jetSrc_
const double pt3Min_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > jetTrigger_
const double matchingR2_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const double pt1Min_
double a
Definition: hdecay.h:121
std::pair< std::vector< T >, std::vector< T > > categorise(const std::vector< T > &pfMatchedJets, double pt1, double pt2, double pt3, double Mjj)
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 69 of file L1TJetsMatching.h.

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

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

Definition at line 68 of file L1TJetsMatching.h.

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

Definition at line 67 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().

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

Definition at line 66 of file L1TJetsMatching.h.

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