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 &)
 
virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~L1TJetsMatching ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > 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
 
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
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 135 of file L1TJetsMatching.h.

135  :
136  jetSrc_ ( consumes<std::vector<T>> (iConfig.getParameter<InputTag>("JetSrc" ) ) ),
137  jetTrigger_( consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<InputTag>("L1JetTrigger") ) ),
138  pt1Min_ ( iConfig.getParameter<double>("pt1Min")),
139  pt2Min_ ( iConfig.getParameter<double>("pt2Min")),
140  mjjMin_ ( iConfig.getParameter<double>("mjjMin")),
141  matchingR_ ( iConfig.getParameter<double>("matchingR")),
143  {
144  produces<std::vector<T>>("TwoJets");
145  produces<std::vector<T>>("ThreeJets");
146 
147  }
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 ( )

Definition at line 149 of file L1TJetsMatching.h.

149 { }

Member Function Documentation

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

Definition at line 195 of file L1TJetsMatching.h.

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

196  {
198  desc.add<edm::InputTag>("L1JetTrigger", edm::InputTag("hltL1DiJetVBF"))->setComment("Name of trigger filter" );
199  desc.add<edm::InputTag>("JetSrc" , edm::InputTag("hltAK4PFJetsTightIDCorrected"))->setComment("Input collection of PFJets");
200  desc.add<double> ("pt1Min",95.0)->setComment("Minimal pT1 of PFJets to match");
201  desc.add<double> ("pt2Min",35.0)->setComment("Minimal pT2 of PFJets to match");
202  desc.add<double> ("mjjMin",650.0)->setComment("Minimal mjj of matched PFjets");
203  desc.add<double> ("matchingR",0.5)->setComment("dR value used for matching");
204  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).");
205  descriptions.add(defaultModuleLabel<L1TJetsMatching<T>>(), desc);
206  }
std::string defaultModuleLabel()
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)
template<typename T >
void L1TJetsMatching< T >::produce ( edm::StreamID  iSId,
edm::Event iEvent,
const edm::EventSetup iES 
) const
overridevirtual

Definition at line 152 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.

153  {
154 
155  unique_ptr<std::vector<T>> pfMatchedJets(new std::vector<T>);
156  std::pair<std::vector<T>,std::vector<T>> output;
157 
158 
159 
160  // Getting HLT jets to be matched
162  iEvent.getByToken( jetSrc_, pfJets );
163 
165  iEvent.getByToken(jetTrigger_,l1TriggeredJets);
166 
167  //l1t::TauVectorRef jetCandRefVec;
168  l1t::JetVectorRef jetCandRefVec;
169  l1TriggeredJets->getObjects( trigger::TriggerL1Jet,jetCandRefVec);
170 
171  math::XYZPoint a(0.,0.,0.);
172 
173  //std::cout<<"PFsize= "<<pfJets->size()<<endl<<" L1size= "<<jetCandRefVec.size()<<std::endl;
174  for(unsigned int iJet = 0; iJet < pfJets->size(); iJet++){
175  const T & myJet = (*pfJets)[iJet];
176  for(unsigned int iL1Jet = 0; iL1Jet < jetCandRefVec.size(); iL1Jet++){
177  // Find the relative L2pfJets, to see if it has been reconstructed
178  // if ((iJet<3) && (iL1Jet==0)) std::cout<<myJet.p4().Pt()<<" ";
179  if ((reco::deltaR2(myJet.p4(), jetCandRefVec[iL1Jet]->p4()) < matchingR2_ ) && (myJet.pt()>pt2Min_)) {
180  pfMatchedJets->push_back(myJet);
181  break;
182  }
183  }
184  }
185 
186  output= categorise(*pfMatchedJets,pt1Min_,pt2Min_, mjjMin_);
187  unique_ptr<std::vector<T>> output1(new std::vector<T>(output.first));
188  unique_ptr<std::vector<T>> output2(new std::vector<T>(output.second));
189 
190  iEvent.put(std::move(output1),"TwoJets");
191  iEvent.put(std::move(output2),"ThreeJets");
192 
193  }
const double mjjMin_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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().