CMS 3D CMS Logo

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

#include <HLTJetTag.h>

Inheritance diagram for HLTJetTag< 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
 
 HLTJetTag (const edm::ParameterSet &config)
 
 ~HLTJetTag () 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 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

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 HLTJetTag< 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.

Author
Arnaud Gay, Ian Tomalin Andrea Bocci

Definition at line 32 of file HLTJetTag.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file HLTJetTag.cc.

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

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

Member Function Documentation

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

Definition at line 59 of file HLTJetTag.cc.

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

59  {
62  desc.add<edm::InputTag>("Jets",edm::InputTag("hltJetCollection"));
63  desc.add<edm::InputTag>("JetTags",edm::InputTag("hltJetTagCollection"));
64  desc.add<double>("MinTag",2.0);
65  desc.add<double>("MaxTag",999999.0);
66  desc.add<int>("MinJets",1);
67  desc.add<int>("TriggerType",0);
68  descriptions.add(defaultModuleLabel<HLTJetTag<T>>(), desc);
69 }
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 >
bool HLTJetTag< T >::hltFilter ( edm::Event event,
const edm::EventSetup setup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 79 of file HLTJetTag.cc.

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

80 {
81  using namespace std;
82  using namespace edm;
83  using namespace reco;
84 
85  typedef vector<T> TCollection;
86  typedef Ref<TCollection> TRef;
87 
89  event.getByToken(m_JetsToken, h_Jets);
90  if (saveTags()) filterproduct.addCollectionTag(m_Jets);
91 
93  event.getByToken(m_JetTagsToken, h_JetTags);
94 
95  // check if the product this one depends on is available
96  auto const & handle = h_JetTags;
97  auto const & dependent = handle->keyProduct();
98  if (not dependent.isNull() and not dependent.hasCache()) {
99  // only an empty AssociationVector can have a invalid dependent collection
100  edm::Provenance const & dependent_provenance = event.getProvenance(dependent.id());
101  if (dependent_provenance.branchDescription().dropped())
102  // FIXME the error message should be made prettier
103  throw edm::Exception(edm::errors::ProductNotFound) << "Product " << handle.provenance()->branchName() << " requires product " << dependent_provenance.branchName() << ", which has been dropped";
104  }
105 
106  TRef jetRef;
107 
108  // Look at all jets in decreasing order of Et.
109  int nJet = 0;
110  int nTag = 0;
111  for (auto const & jet : *h_JetTags) {
112  jetRef = TRef(h_Jets,jet.first.key());
113  LogTrace("") << "Jet " << nJet
114  << " : Et = " << jet.first->et()
115  << " , tag value = " << jet.second;
116  ++nJet;
117  // Check if jet is tagged.
118  if ( (m_MinTag <= jet.second) and (jet.second <= m_MaxTag) ) {
119  ++nTag;
120 
121  // Store a reference to the jets which passed tagging cuts
122  filterproduct.addObject(m_TriggerType,jetRef);
123  }
124  }
125 
126  // filter decision
127  bool accept = (nTag >= m_MinJets);
128 
129  edm::LogInfo("") << " trigger accept ? = " << accept
130  << " nTag/nJet = " << nTag << "/" << nJet << std::endl;
131 
132  return accept;
133 }
edm::EDGetTokenT< reco::JetTagCollection > m_JetTagsToken
Definition: HLTJetTag.h:44
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
edm::InputTag m_Jets
Definition: HLTJetTag.h:41
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
int m_TriggerType
Definition: HLTJetTag.h:47
#define LogTrace(id)
double m_MaxTag
Definition: HLTJetTag.h:45
BranchDescription const & branchDescription() const
Definition: Provenance.h:45
int m_MinJets
Definition: HLTJetTag.h:46
edm::EDGetTokenT< std::vector< T > > m_JetsToken
Definition: HLTJetTag.h:42
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
double m_MinTag
Definition: HLTJetTag.h:45
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.
std::string const & branchName() const
Definition: Provenance.h:51

Member Data Documentation

template<typename T >
edm::InputTag HLTJetTag< T >::m_Jets
private

Definition at line 41 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
edm::EDGetTokenT<std::vector<T> > HLTJetTag< T >::m_JetsToken
private

Definition at line 42 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
edm::InputTag HLTJetTag< T >::m_JetTags
private

Definition at line 43 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::HLTJetTag().

template<typename T >
edm::EDGetTokenT<reco::JetTagCollection> HLTJetTag< T >::m_JetTagsToken
private

Definition at line 44 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
double HLTJetTag< T >::m_MaxTag
private

Definition at line 45 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
int HLTJetTag< T >::m_MinJets
private

Definition at line 46 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
double HLTJetTag< T >::m_MinTag
private

Definition at line 45 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().

template<typename T >
int HLTJetTag< T >::m_TriggerType
private

Definition at line 47 of file HLTJetTag.h.

Referenced by HLTJetTag< T >::hltFilter(), and HLTJetTag< T >::HLTJetTag().