CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HeavyChHiggsToTauNuSkim Class Reference

#include <HeavyChHiggsToTauNuSkim.h>

Inheritance diagram for HeavyChHiggsToTauNuSkim:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 
 HeavyChHiggsToTauNuSkim (const edm::ParameterSet &)
 
 ~HeavyChHiggsToTauNuSkim () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Member Functions

double deltaPhi (double phi1, double phi2)
 
double deltaR (double eta1, double eta2, double phi1, double phi2)
 

Private Attributes

bool debug
 
edm::EDGetTokenT< reco::IsolatedTauTagInfoCollectionhltTauToken
 
double jetEtaMax
 
double jetEtaMin
 
double jetEtMin
 
edm::EDGetTokenT< reco::CaloJetCollectionjetToken
 
double minDRFromTau
 
int minNumberOfjets
 
int nEvents
 
int nSelectedEvents
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter 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
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Filter to select events passing L1 single tau HLT tau+MET 3 offline jets

Author
Sami Lehti - HIP Helsinki

This class is an EDFilter for heavy H+->taunu events

Author
Sami Lehti - HIP Helsinki

Definition at line 32 of file HeavyChHiggsToTauNuSkim.h.

Constructor & Destructor Documentation

◆ HeavyChHiggsToTauNuSkim()

HeavyChHiggsToTauNuSkim::HeavyChHiggsToTauNuSkim ( const edm::ParameterSet iConfig)
explicit

Definition at line 25 of file HeavyChHiggsToTauNuSkim.cc.

25  {
26  // Local Debug flag
27  debug = iConfig.getParameter<bool>("DebugHeavyChHiggsToTauNuSkim");
28 
29  hltTauToken = consumes<IsolatedTauTagInfoCollection>(iConfig.getParameter<InputTag>("HLTTauCollection"));
30  jetToken = consumes<CaloJetCollection>(iConfig.getParameter<InputTag>("JetTagCollection"));
31  minNumberOfjets = iConfig.getParameter<int>("minNumberOfJets");
32  jetEtMin = iConfig.getParameter<double>("jetEtMin");
33  jetEtaMin = iConfig.getParameter<double>("jetEtaMin");
34  jetEtaMax = iConfig.getParameter<double>("jetEtaMax");
35  minDRFromTau = iConfig.getParameter<double>("minDRFromTau");
36 
37  nEvents = 0;
38  nSelectedEvents = 0;
39 }

References debug, edm::ParameterSet::getParameter(), MssmHbbBtagTriggerMonitor_cfi::jetEtaMax, heavyChHiggsToTauNu_Filter_cfi::jetEtaMin, heavyChHiggsToTauNu_Filter_cfi::jetEtMin, unpackData-CaloStage1::jetToken, heavyChHiggsToTauNu_Filter_cfi::minDRFromTau, and nEvents.

◆ ~HeavyChHiggsToTauNuSkim()

HeavyChHiggsToTauNuSkim::~HeavyChHiggsToTauNuSkim ( )
override

Definition at line 41 of file HeavyChHiggsToTauNuSkim.cc.

41  {
42  edm::LogVerbatim("HeavyChHiggsToTauNuSkim")
43  << " Number_events_read " << nEvents << " Number_events_kept " << nSelectedEvents << " Efficiency "
44  << ((double)nSelectedEvents) / ((double)nEvents + 0.01) << std::endl;
45 }

References nEvents.

Member Function Documentation

◆ deltaPhi()

double HeavyChHiggsToTauNuSkim::deltaPhi ( double  phi1,
double  phi2 
)
inlineprivate

Definition at line 40 of file HeavyChHiggsToTauNuSkim.h.

40  {
41  const double PI = 3.1415926535;
42  // in ORCA phi = [0,2pi], in TLorentzVector phi = [-pi,pi].
43  // With the conversion below deltaPhi works ok despite the
44  // 2*pi difference in phi definitions.
45  if (phi1 < 0)
46  phi1 += 2 * PI;
47  if (phi2 < 0)
48  phi2 += 2 * PI;
49 
50  double dphi = fabs(phi1 - phi2);
51 
52  if (dphi > PI)
53  dphi = 2 * PI - dphi;
54  return dphi;
55  }

References PI.

Referenced by deltaR().

◆ deltaR()

double HeavyChHiggsToTauNuSkim::deltaR ( double  eta1,
double  eta2,
double  phi1,
double  phi2 
)
inlineprivate

Definition at line 57 of file HeavyChHiggsToTauNuSkim.h.

57  {
58  double dphi = deltaPhi(phi1, phi2);
59  double deta = fabs(eta1 - eta2);
60  return sqrt(dphi * dphi + deta * deta);
61  }

References deltaPhi(), HLT_2018_cff::eta1, HLT_2018_cff::eta2, and mathSSE::sqrt().

◆ filter()

bool HeavyChHiggsToTauNuSkim::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 47 of file HeavyChHiggsToTauNuSkim.cc.

47  {
48  nEvents++;
49 
51  iEvent.getByToken(hltTauToken, tauTagL3Handle);
52 
53  if (!tauTagL3Handle.isValid())
54  return false;
55 
56  Jet theTau;
57  double maxEt = 0;
58  if (tauTagL3Handle.isValid()) {
59  const IsolatedTauTagInfoCollection& L3Taus = *(tauTagL3Handle.product());
60  IsolatedTauTagInfoCollection::const_iterator i;
61  for (i = L3Taus.begin(); i != L3Taus.end(); i++) {
62  if (i->discriminator() == 0)
63  continue;
64  Jet taujet = *(i->jet().get());
65  if (taujet.et() > maxEt) {
66  maxEt = taujet.et();
67  theTau = taujet;
68  }
69  }
70  }
71 
72  if (maxEt == 0)
73  return false;
74 
75  // jets
76 
77  Handle<CaloJetCollection> jetHandle;
78  iEvent.getByToken(jetToken, jetHandle);
79 
80  if (!jetHandle.isValid())
81  return false;
82 
83  bool accepted = false;
84 
85  if (jetHandle.isValid()) {
86  int nJets = 0;
87  const reco::CaloJetCollection& jets = *(jetHandle.product());
88  CaloJetCollection::const_iterator iJet;
89  for (iJet = jets.begin(); iJet != jets.end(); iJet++) {
90  if (iJet->et() > jetEtMin && iJet->eta() > jetEtaMin && iJet->eta() < jetEtaMax) {
91  double DR = deltaR(theTau.eta(), iJet->eta(), theTau.phi(), iJet->phi());
92  if (DR > minDRFromTau)
93  nJets++;
94  }
95  }
96  if (nJets >= minNumberOfjets) {
97  accepted = true;
99  }
100  }
101  return accepted;
102 }

References cms::dd::accepted(), PbPb_ZMuSkimMuonDPG_cff::deltaR, reco::LeafCandidate::et(), reco::LeafCandidate::eta(), mps_fire::i, iEvent, edm::HandleBase::isValid(), MssmHbbBtagTriggerMonitor_cfi::jetEtaMax, heavyChHiggsToTauNu_Filter_cfi::jetEtaMin, heavyChHiggsToTauNu_Filter_cfi::jetEtMin, singleTopDQM_cfi::jets, unpackData-CaloStage1::jetToken, heavyionUCCDQM_cfi::maxEt, heavyChHiggsToTauNu_Filter_cfi::minDRFromTau, nEvents, reco::LeafCandidate::phi(), and edm::Handle< T >::product().

Member Data Documentation

◆ debug

bool HeavyChHiggsToTauNuSkim::debug
private

◆ hltTauToken

edm::EDGetTokenT<reco::IsolatedTauTagInfoCollection> HeavyChHiggsToTauNuSkim::hltTauToken
private

Definition at line 65 of file HeavyChHiggsToTauNuSkim.h.

◆ jetEtaMax

double HeavyChHiggsToTauNuSkim::jetEtaMax
private

Definition at line 70 of file HeavyChHiggsToTauNuSkim.h.

◆ jetEtaMin

double HeavyChHiggsToTauNuSkim::jetEtaMin
private

Definition at line 69 of file HeavyChHiggsToTauNuSkim.h.

◆ jetEtMin

double HeavyChHiggsToTauNuSkim::jetEtMin
private

Definition at line 68 of file HeavyChHiggsToTauNuSkim.h.

◆ jetToken

edm::EDGetTokenT<reco::CaloJetCollection> HeavyChHiggsToTauNuSkim::jetToken
private

Definition at line 66 of file HeavyChHiggsToTauNuSkim.h.

◆ minDRFromTau

double HeavyChHiggsToTauNuSkim::minDRFromTau
private

Definition at line 71 of file HeavyChHiggsToTauNuSkim.h.

◆ minNumberOfjets

int HeavyChHiggsToTauNuSkim::minNumberOfjets
private

Definition at line 67 of file HeavyChHiggsToTauNuSkim.h.

◆ nEvents

int HeavyChHiggsToTauNuSkim::nEvents
private

Definition at line 73 of file HeavyChHiggsToTauNuSkim.h.

Referenced by looper.Looper::loop().

◆ nSelectedEvents

int HeavyChHiggsToTauNuSkim::nSelectedEvents
private

Definition at line 73 of file HeavyChHiggsToTauNuSkim.h.

PI
Definition: PayloadInspector.h:19
mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HeavyChHiggsToTauNuSkim::jetEtMin
double jetEtMin
Definition: HeavyChHiggsToTauNuSkim.h:68
HeavyChHiggsToTauNuSkim::minNumberOfjets
int minNumberOfjets
Definition: HeavyChHiggsToTauNuSkim.h:67
HeavyChHiggsToTauNuSkim::debug
bool debug
Definition: HeavyChHiggsToTauNuSkim.h:63
PI
#define PI
Definition: QcdUeDQM.h:37
reco::IsolatedTauTagInfoCollection
std::vector< IsolatedTauTagInfo > IsolatedTauTagInfoCollection
Definition: IsolatedTauTagInfo.h:95
HeavyChHiggsToTauNuSkim::minDRFromTau
double minDRFromTau
Definition: HeavyChHiggsToTauNuSkim.h:71
HLT_2018_cff.eta1
eta1
Definition: HLT_2018_cff.py:8220
HeavyChHiggsToTauNuSkim::deltaR
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: HeavyChHiggsToTauNuSkim.h:57
HeavyChHiggsToTauNuSkim::jetToken
edm::EDGetTokenT< reco::CaloJetCollection > jetToken
Definition: HeavyChHiggsToTauNuSkim.h:66
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::Handle
Definition: AssociativeIterator.h:50
HeavyChHiggsToTauNuSkim::nEvents
int nEvents
Definition: HeavyChHiggsToTauNuSkim.h:73
Jet
Definition: Jet.py:1
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
cms::dd::accepted
bool accepted(std::vector< std::regex > const &, std::string_view)
HLT_2018_cff.eta2
eta2
Definition: HLT_2018_cff.py:8221
HeavyChHiggsToTauNuSkim::deltaPhi
double deltaPhi(double phi1, double phi2)
Definition: HeavyChHiggsToTauNuSkim.h:40
HeavyChHiggsToTauNuSkim::jetEtaMin
double jetEtaMin
Definition: HeavyChHiggsToTauNuSkim.h:69
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
HeavyChHiggsToTauNuSkim::hltTauToken
edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > hltTauToken
Definition: HeavyChHiggsToTauNuSkim.h:65
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::CaloJetCollection
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Definition: CaloJetCollection.h:15
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
heavyionUCCDQM_cfi.maxEt
maxEt
Definition: heavyionUCCDQM_cfi.py:14
HeavyChHiggsToTauNuSkim::nSelectedEvents
int nSelectedEvents
Definition: HeavyChHiggsToTauNuSkim.h:73
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HeavyChHiggsToTauNuSkim::jetEtaMax
double jetEtaMax
Definition: HeavyChHiggsToTauNuSkim.h:70
edm::InputTag
Definition: InputTag.h:15