CMS 3D CMS Logo

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

#include <HLTElectronPFMTFilter.h>

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

Public Member Functions

 HLTElectronPFMTFilter (const edm::ParameterSet &)
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 ~HLTElectronPFMTFilter () 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 inputEleTag_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsinputEleToken_
 
edm::InputTag inputMetTag_
 
edm::EDGetTokenT< reco::METCollectioninputMetToken_
 
edm::InputTag l1EGTag_
 
double lowerMTCut_
 
double minMht_
 
int minN_
 
double upperMTCut_
 

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 HLTElectronPFMTFilter< T >

Definition at line 34 of file HLTElectronPFMTFilter.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file HLTElectronPFMTFilter.cc.

References edm::ParameterSet::getParameter(), HLTElectronPFMTFilter< T >::inputEleTag_, HLTElectronPFMTFilter< T >::inputEleToken_, HLTElectronPFMTFilter< T >::inputMetTag_, HLTElectronPFMTFilter< T >::inputMetToken_, HLTElectronPFMTFilter< T >::l1EGTag_, HLTElectronPFMTFilter< T >::lowerMTCut_, HLTElectronPFMTFilter< T >::minMht_, HLTElectronPFMTFilter< T >::minN_, HLTElectronPFMTFilter< T >::upperMTCut_, and HLTElectronPFMTFilter< T >::~HLTElectronPFMTFilter().

5  : HLTFilter(iConfig)
6 {
7  // MHT parameters
8  inputMetTag_ = iConfig.getParameter< edm::InputTag > ("inputMetTag");
9  minMht_ = iConfig.getParameter<double> ("minMht");
10 
11  // Electron parameters
12  inputEleTag_ = iConfig.getParameter< edm::InputTag > ("inputEleTag");
13  lowerMTCut_ = iConfig.getParameter<double> ("lowerMTCut");
14  upperMTCut_ = iConfig.getParameter<double> ("upperMTCut");
15  minN_ = iConfig.getParameter<int>("minN");
16  l1EGTag_ = iConfig.getParameter< edm::InputTag > ("l1EGCand");
17 
18  inputMetToken_ = consumes<reco::METCollection> (inputMetTag_);
19  inputEleToken_ = consumes<trigger::TriggerFilterObjectWithRefs> (inputEleTag_);
20 }
T getParameter(std::string const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputEleToken_
edm::EDGetTokenT< reco::METCollection > inputMetToken_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
template<typename T >
HLTElectronPFMTFilter< T >::~HLTElectronPFMTFilter ( )
overridedefault

Member Function Documentation

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

Definition at line 26 of file HLTElectronPFMTFilter.cc.

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

26  {
29  desc.add<edm::InputTag>("inputMetTag", edm::InputTag("hltPFMHT"));
30  desc.add<edm::InputTag>("inputEleTag", edm::InputTag("hltEle25CaloIdVTTrkIdTCaloIsoTTrkIsoTTrackIsolFilter"));
31  desc.add<edm::InputTag>("l1EGCand", edm::InputTag("hltL1IsoRecoEcalCandidate"));
32  desc.add<int>("minN", 0);
33  desc.add<double>("minMht", 0.0);
34  desc.add<double>("lowerMTCut", 0.0);
35  desc.add<double>("upperMTCut", 9999.0);
36  descriptions.add(defaultModuleLabel<HLTElectronPFMTFilter<T>>(), desc);
37 }
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 HLTElectronPFMTFilter< T >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 40 of file HLTElectronPFMTFilter.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, HLTElectronPFMTFilter< T >::inputEleToken_, HLTElectronPFMTFilter< T >::inputMetTag_, HLTElectronPFMTFilter< T >::inputMetToken_, edm::HandleBase::isValid(), HLTElectronPFMTFilter< T >::l1EGTag_, HLTElectronPFMTFilter< T >::lowerMTCut_, ResonanceBuilder::mass, RazorAnalyzer::met, HLTElectronPFMTFilter< T >::minMht_, HLTElectronPFMTFilter< T >::minN_, edm::Handle< T >::product(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), HLTFilter::saveTags(), mathSSE::sqrt(), trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerPhoton, and HLTElectronPFMTFilter< T >::upperMTCut_.

41 {
42  using namespace std;
43  using namespace edm;
44  using namespace reco;
45  using namespace trigger;
46  // The filter object
47  if (saveTags()) {
48  filterproduct.addCollectionTag(inputMetTag_);
49  filterproduct.addCollectionTag(l1EGTag_);
50  }
51 
52  // Get the Met collection
54  iEvent.getByToken(inputMetToken_,pfMHT);
55 
56  // Sanity check:
57  if(!pfMHT.isValid()) {
58  edm::LogError("HLTElectronPFMTFilter") << "missing input Met collection!";
59  }
60 
61  const METCollection *metcol = pfMHT.product();
62  const MET *met;
63  met = &(metcol->front());
64 
66  iEvent.getByToken (inputEleToken_,PrevFilterOutput);
67 
68  int nW = 0;
69 
70  vector< Ref< vector<T> > > refEleCollection ;
71 
72  PrevFilterOutput->getObjects(TriggerElectron, refEleCollection);
73  int trigger_type = trigger::TriggerElectron;
74  if(refEleCollection.empty()){
75  PrevFilterOutput->getObjects(TriggerCluster, refEleCollection);
76  trigger_type = trigger::TriggerCluster;
77  if(refEleCollection.empty()){
78  PrevFilterOutput->getObjects(TriggerPhoton, refEleCollection);
79  trigger_type = trigger::TriggerPhoton;
80  }
81  }
82 
83 
84  TLorentzVector pMET(met->px(), met->py(),0.0,sqrt(met->px()*met->px() + met->py()*met->py()));
85 
86  for (unsigned int i=0; i<refEleCollection.size(); i++) {
87  TLorentzVector pThisEle(refEleCollection.at(i)->px(), refEleCollection.at(i)->py(),
88  0.0, refEleCollection.at(i)->et() );
89  TLorentzVector pTot = pMET + pThisEle;
90  double mass = pTot.M();
91 
92  if(mass>=lowerMTCut_ && mass<=upperMTCut_ && pMET.E()>= minMht_){
93  nW++;
94  filterproduct.addObject(trigger_type, refEleCollection.at(i));
95  }
96  }
97 
98  // filter decision
99  const bool accept(nW>=minN_);
100  return accept;
101 
102 }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputEleToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
double px() const final
x coordinate of momentum vector
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>)
Definition: MET.h:42
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< reco::METCollection > inputMetToken_
Collection of MET.
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:74
met
===> hadronic RAZOR
double py() const final
y coordinate of momentum vector
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.

Member Data Documentation

template<typename T >
edm::InputTag HLTElectronPFMTFilter< T >::inputEleTag_
private
template<typename T >
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTElectronPFMTFilter< T >::inputEleToken_
private
template<typename T >
edm::InputTag HLTElectronPFMTFilter< T >::inputMetTag_
private
template<typename T >
edm::EDGetTokenT<reco::METCollection> HLTElectronPFMTFilter< T >::inputMetToken_
private
template<typename T >
edm::InputTag HLTElectronPFMTFilter< T >::l1EGTag_
private
template<typename T >
double HLTElectronPFMTFilter< T >::lowerMTCut_
private
template<typename T >
double HLTElectronPFMTFilter< T >::minMht_
private
template<typename T >
int HLTElectronPFMTFilter< T >::minN_
private
template<typename T >
double HLTElectronPFMTFilter< T >::upperMTCut_
private