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
 
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)
 

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::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

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file HeavyChHiggsToTauNuSkim.cc.

References debug, edm::ParameterSet::getParameter(), mhtProducer_cfi::jetEtaMax, and nEvents.

26  {
27 
28  // Local Debug flag
29  debug = iConfig.getParameter<bool>("DebugHeavyChHiggsToTauNuSkim");
30 
31  hltTauToken = consumes<IsolatedTauTagInfoCollection>(iConfig.getParameter<InputTag>("HLTTauCollection"));
32  jetToken = consumes<CaloJetCollection>(iConfig.getParameter<InputTag>("JetTagCollection"));
33  minNumberOfjets = iConfig.getParameter<int>("minNumberOfJets");
34  jetEtMin = iConfig.getParameter<double>("jetEtMin");
35  jetEtaMin = iConfig.getParameter<double>("jetEtaMin");
36  jetEtaMax = iConfig.getParameter<double>("jetEtaMax");
37  minDRFromTau = iConfig.getParameter<double>("minDRFromTau");
38 
39  nEvents = 0;
40  nSelectedEvents = 0;
41 
42 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::CaloJetCollection > jetToken
edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > hltTauToken
HeavyChHiggsToTauNuSkim::~HeavyChHiggsToTauNuSkim ( )
override

Definition at line 45 of file HeavyChHiggsToTauNuSkim.cc.

References nEvents.

45  {
46  edm::LogVerbatim("HeavyChHiggsToTauNuSkim")
47  << " Number_events_read " << nEvents
48  << " Number_events_kept " << nSelectedEvents
49  << " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
50 
51 }

Member Function Documentation

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

Definition at line 41 of file HeavyChHiggsToTauNuSkim.h.

References PI.

Referenced by deltaR().

41  {
42  const double PI = 3.1415926535;
43  // in ORCA phi = [0,2pi], in TLorentzVector phi = [-pi,pi].
44  // With the conversion below deltaPhi works ok despite the
45  // 2*pi difference in phi definitions.
46  if(phi1 < 0) phi1 += 2*PI;
47  if(phi2 < 0) phi2 += 2*PI;
48 
49  double dphi = fabs(phi1-phi2);
50 
51  if(dphi > PI) dphi = 2*PI - dphi;
52  return dphi;
53  }
#define PI
Definition: QcdUeDQM.h:36
double HeavyChHiggsToTauNuSkim::deltaR ( double  eta1,
double  eta2,
double  phi1,
double  phi2 
)
inlineprivate

Definition at line 55 of file HeavyChHiggsToTauNuSkim.h.

References deltaPhi(), and mathSSE::sqrt().

55  {
56  double dphi = deltaPhi(phi1,phi2);
57  double deta = fabs(eta1-eta2);
58  return sqrt(dphi*dphi + deta*deta);
59  }
double deltaPhi(double phi1, double phi2)
T sqrt(T t)
Definition: SSEVec.h:18
bool HeavyChHiggsToTauNuSkim::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 54 of file HeavyChHiggsToTauNuSkim.cc.

References cms::dd::accepted(), boostedElectronIsolation_cff::deltaR, reco::LeafCandidate::et(), reco::LeafCandidate::eta(), edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), mhtProducer_cfi::jetEtaMax, fwrapper::jets, nEvents, reco::LeafCandidate::phi(), and edm::Handle< T >::product().

54  {
55 
56  nEvents++;
57 
59  iEvent.getByToken(hltTauToken, tauTagL3Handle);
60 
61  if ( !tauTagL3Handle.isValid() ) return false;
62 
63 
64  Jet theTau;
65  double maxEt = 0;
66  if (tauTagL3Handle.isValid() ) {
67  const IsolatedTauTagInfoCollection & L3Taus = *(tauTagL3Handle.product());
68  IsolatedTauTagInfoCollection::const_iterator i;
69  for ( i = L3Taus.begin(); i != L3Taus.end(); i++ ) {
70  if (i->discriminator() == 0) continue;
71  Jet taujet = *(i->jet().get());
72  if (taujet.et() > maxEt) {
73  maxEt = taujet.et();
74  theTau = taujet;
75  }
76  }
77  }
78 
79  if (maxEt == 0) return false;
80 
81  // jets
82 
83  Handle<CaloJetCollection> jetHandle;
84  iEvent.getByToken(jetToken,jetHandle);
85 
86  if ( !jetHandle.isValid() ) return false;
87 
88  bool accepted = false;
89 
90  if (jetHandle.isValid() ) {
91  int nJets = 0;
92  const reco::CaloJetCollection & jets = *(jetHandle.product());
93  CaloJetCollection::const_iterator iJet;
94  for (iJet = jets.begin(); iJet!= jets.end(); iJet++ ) {
95  if (iJet->et() > jetEtMin &&
96  iJet->eta() > jetEtaMin &&
97  iJet->eta() < jetEtaMax ) {
98  double DR = deltaR(theTau.eta(),iJet->eta(),theTau.phi(),iJet->phi());
99  if (DR > minDRFromTau) nJets++;
100  }
101  }
102  if (nJets >= minNumberOfjets) {
103  accepted = true;
104  nSelectedEvents++;
105  }
106  }
107  return accepted;
108 }
double eta() const final
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::CaloJetCollection > jetToken
Definition: Jet.py:1
double et() const final
transverse energy
std::vector< IsolatedTauTagInfo > IsolatedTauTagInfoCollection
vector< PseudoJet > jets
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > hltTauToken
T const * product() const
Definition: Handle.h:74
bool accepted(std::vector< std::string_view > const &, std::string_view)
double phi() const final
momentum azimuthal angle
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

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

Definition at line 63 of file HeavyChHiggsToTauNuSkim.h.

double HeavyChHiggsToTauNuSkim::jetEtaMax
private

Definition at line 68 of file HeavyChHiggsToTauNuSkim.h.

double HeavyChHiggsToTauNuSkim::jetEtaMin
private

Definition at line 67 of file HeavyChHiggsToTauNuSkim.h.

double HeavyChHiggsToTauNuSkim::jetEtMin
private

Definition at line 66 of file HeavyChHiggsToTauNuSkim.h.

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

Definition at line 64 of file HeavyChHiggsToTauNuSkim.h.

double HeavyChHiggsToTauNuSkim::minDRFromTau
private

Definition at line 69 of file HeavyChHiggsToTauNuSkim.h.

int HeavyChHiggsToTauNuSkim::minNumberOfjets
private

Definition at line 65 of file HeavyChHiggsToTauNuSkim.h.

int HeavyChHiggsToTauNuSkim::nEvents
private

Definition at line 71 of file HeavyChHiggsToTauNuSkim.h.

Referenced by looper.Looper::loop().

int HeavyChHiggsToTauNuSkim::nSelectedEvents
private

Definition at line 71 of file HeavyChHiggsToTauNuSkim.h.