CMS 3D CMS Logo

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

#include <HLTJetTagWithMatching.h>

Inheritance diagram for HLTJetTagWithMatching< T >:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool hltFilter (edm::Event &event, const edm::EventSetup &setup, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTJetTagWithMatching (const edm::ParameterSet &config)
 
 ~HLTJetTagWithMatching () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=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::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static float findCSV (const typename std::vector< T >::const_iterator &jet, const reco::JetTagCollection &jetTags, float minDr=0.1)
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

double m_deltaR
 
edm::InputTag m_Jets
 
edm::EDGetTokenT< std::vector< T > > m_JetsToken
 
edm::InputTag m_JetTags
 
edm::EDGetTokenT< reco::JetTagCollectionm_JetTagsToken
 
double m_MaxTag
 
int m_MinJets
 
double m_MinTag
 
int m_TriggerType
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 HLTJetTagWithMatching< T >

This class is an HLTFilter (a spcialized EDFilter) implementing tagged multi-jet trigger for b and tau. It should be run after the normal multi-jet trigger. It is like HLTJetTag, but it loop on jets collection instead of jetTag collection.

Definition at line 30 of file HLTJetTagWithMatching.h.

Constructor & Destructor Documentation

template<typename T >
HLTJetTagWithMatching< T >::HLTJetTagWithMatching ( const edm::ParameterSet config)
explicit

Definition at line 33 of file HLTJetTagWithMatching.cc.

References edm::InputTag::encode(), HLTJetTagWithMatching< T >::m_Jets, HLTJetTagWithMatching< T >::m_JetsToken, HLTJetTagWithMatching< T >::m_JetTags, HLTJetTagWithMatching< T >::m_JetTagsToken, HLTJetTagWithMatching< T >::m_MaxTag, HLTJetTagWithMatching< T >::m_MinJets, HLTJetTagWithMatching< T >::m_MinTag, HLTJetTagWithMatching< T >::m_TriggerType, and HLTJetTagWithMatching< T >::~HLTJetTagWithMatching().

33  : HLTFilter(config),
34  m_Jets (config.getParameter<edm::InputTag>("Jets") ),
35  m_JetTags(config.getParameter<edm::InputTag>("JetTags") ),
36  m_MinTag (config.getParameter<double> ("MinTag") ),
37  m_MaxTag (config.getParameter<double> ("MaxTag") ),
38  m_MinJets(config.getParameter<int> ("MinJets") ),
39  m_TriggerType(config.getParameter<int> ("TriggerType") ),
40  m_deltaR (config.getParameter<double> ("deltaR") )
41 {
42  m_JetsToken = consumes<std::vector<T> >(m_Jets),
43  m_JetTagsToken = consumes<reco::JetTagCollection>(m_JetTags),
44 
45  edm::LogInfo("") << " (HLTJetTagWithMatching) trigger cuts: " << std::endl
46  << "\ttype of jets used: " << m_Jets.encode() << std::endl
47  << "\ttype of tagged jets used: " << m_JetTags.encode() << std::endl
48  << "\tmin/max tag value: [" << m_MinTag << ".." << m_MaxTag << "]" << std::endl
49  << "\tmin no. tagged jets: " << m_MinJets
50  << "\tTriggerType: " << m_TriggerType << std::endl;
51 }
T getParameter(std::string const &) const
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< std::vector< T > > m_JetsToken
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< reco::JetTagCollection > m_JetTagsToken
template<typename T >
HLTJetTagWithMatching< T >::~HLTJetTagWithMatching ( )
overridedefault

Member Function Documentation

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

Definition at line 74 of file HLTJetTagWithMatching.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), and HLTFilter::makeHLTFilterDescription().

74  {
77  desc.add<edm::InputTag>("Jets",edm::InputTag("hltJetCollection"));
78  desc.add<edm::InputTag>("JetTags",edm::InputTag("HLTJetTagWithMatchingCollection"));
79  desc.add<double>("MinTag",2.0);
80  desc.add<double>("MaxTag",999999.0);
81  desc.add<int>("MinJets",1);
82  desc.add<int>("TriggerType",0);
83  desc.add<double>("deltaR",0.1);
84  descriptions.add(defaultModuleLabel<HLTJetTagWithMatching<T>>(), desc);
85 }
std::string defaultModuleLabel()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
float HLTJetTagWithMatching< T >::findCSV ( const typename std::vector< T >::const_iterator &  jet,
const reco::JetTagCollection jetTags,
float  minDr = 0.1 
)
static

Definition at line 56 of file HLTJetTagWithMatching.cc.

References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::begin(), reco::deltaR(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::end().

Referenced by HLTJetTagWithMatching< T >::hltFilter().

56  {
57  float tmpCSV = -20 ;
58  for (auto jetb = jetTags.begin(); (jetb!=jetTags.end()); ++jetb) {
59  float tmpDr = reco::deltaR(*jet,*(jetb->first));
60 
61  if (tmpDr < minDr) {
62  minDr = tmpDr ;
63  tmpCSV= jetb->second;
64  }
65 
66  }
67  return tmpCSV;
68 
69  }
const_iterator end() const
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
const_iterator begin() const
template<typename T >
bool HLTJetTagWithMatching< T >::hltFilter ( edm::Event event,
const edm::EventSetup setup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 95 of file HLTJetTagWithMatching.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Provenance::branchDescription(), edm::Provenance::branchName(), edm::BranchDescription::dropped(), HLTJetTagWithMatching< T >::findCSV(), cmsBatch::handle, metsig::jet, LogTrace, HLTJetTagWithMatching< T >::m_deltaR, HLTJetTagWithMatching< T >::m_Jets, HLTJetTagWithMatching< T >::m_JetsToken, HLTJetTagWithMatching< T >::m_JetTagsToken, HLTJetTagWithMatching< T >::m_MaxTag, HLTJetTagWithMatching< T >::m_MinJets, HLTJetTagWithMatching< T >::m_MinTag, HLTJetTagWithMatching< T >::m_TriggerType, edm::errors::ProductNotFound, and HLTFilter::saveTags().

96 {
97  using namespace std;
98  using namespace edm;
99  using namespace reco;
100 
101  typedef vector<T> TCollection;
102  typedef Ref<TCollection> TRef;
103 
105  event.getByToken(m_JetsToken, h_Jets);
106  if (saveTags()) filterproduct.addCollectionTag(m_Jets);
107 
109  event.getByToken(m_JetTagsToken, h_JetTags);
110 
111  // check if the product this one depends on is available
112  auto const & handle = h_JetTags;
113  auto const & dependent = handle->keyProduct();
114  if (not dependent.isNull() and not dependent.hasCache()) {
115  // only an empty AssociationVector can have a invalid dependent collection
116  edm::Provenance const & dependent_provenance = event.getProvenance(dependent.id());
117  if (dependent_provenance.branchDescription().dropped())
118  // FIXME the error message should be made prettier
119  throw edm::Exception(edm::errors::ProductNotFound) << "Product " << handle.provenance()->branchName() << " requires product " << dependent_provenance.branchName() << ", which has been dropped";
120  }
121 
122  TRef jetRef;
123 
124  // Look at all jets in decreasing order of Et.
125  int nJet = 0;
126  int nTag = 0;
127  for (typename TCollection::const_iterator jet = h_Jets->begin(); jet != h_Jets->end(); ++jet) {
128  jetRef = TRef(h_Jets,nJet);
129  LogTrace("") << "Jet " << nJet
130  << " : Et = " << jet->et()
131  << " , tag value = " << findCSV(jet,*h_JetTags,m_deltaR);
132  ++nJet;
133  // Check if jet is tagged.
134  if ( (m_MinTag <= findCSV(jet,*h_JetTags,m_deltaR)) and (findCSV(jet,*h_JetTags,m_deltaR) <= m_MaxTag) ) {
135  ++nTag;
136 
137  // Store a reference to the jets which passed tagging cuts
138  filterproduct.addObject(m_TriggerType,jetRef);
139  }
140  }
141 
142  // filter decision
143  bool accept = (nTag >= m_MinJets);
144 
145  edm::LogInfo("") << " trigger accept ? = " << accept
146  << " nTag/nJet = " << nTag << "/" << nJet << std::endl;
147 
148  return accept;
149 }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::EDGetTokenT< std::vector< T > > m_JetsToken
static float findCSV(const typename std::vector< T >::const_iterator &jet, const reco::JetTagCollection &jetTags, float minDr=0.1)
#define LogTrace(id)
BranchDescription const & branchDescription() const
Definition: Provenance.h:45
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.
edm::EDGetTokenT< reco::JetTagCollection > m_JetTagsToken
std::string const & branchName() const
Definition: Provenance.h:51

Member Data Documentation

template<typename T >
double HLTJetTagWithMatching< T >::m_deltaR
private

Definition at line 47 of file HLTJetTagWithMatching.h.

Referenced by HLTJetTagWithMatching< T >::hltFilter().

template<typename T >
edm::InputTag HLTJetTagWithMatching< T >::m_Jets
private
template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetTagWithMatching< T >::m_JetsToken
private
template<typename T >
edm::InputTag HLTJetTagWithMatching< T >::m_JetTags
private
template<typename T >
edm::EDGetTokenT<reco::JetTagCollection> HLTJetTagWithMatching< T >::m_JetTagsToken
private
template<typename T >
double HLTJetTagWithMatching< T >::m_MaxTag
private
template<typename T >
int HLTJetTagWithMatching< T >::m_MinJets
private
template<typename T >
double HLTJetTagWithMatching< T >::m_MinTag
private
template<typename T >
int HLTJetTagWithMatching< T >::m_TriggerType
private