CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTDiPFJetPlusTausCandidatePFJetProducer Class Reference
Inheritance diagram for HLTDiPFJetPlusTausCandidatePFJetProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTDiPFJetPlusTausCandidatePFJetProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const double dRmin2_
 
const double dRmin_
 
const double extraTauPtCut_
 
const double m2jjMin_
 
const double mjjMin_
 
const edm::EDGetTokenT< reco::PFJetCollectionpfJetSrc_
 
GreaterByPt< reco::PFJetpTComparator_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstauSrc_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Check correlation between PFJet pairs and filtered PFTau pairs and store the PFJet pairs. For (j1, j2, t1, t2) where j1, j2 from the PFJet collection and t1, t2 from the filtered PFTau collection, the module checks if there is no overlap (within dRmin) between j1, j2, t1, t2, i.e. there are 4 different objects. In addition, the module imposes the following cuts: mjjMin: the min invariant mass cut on (j1, j2) extraTauPtCut: the leading tau pt cut on (t1, t2) (under the assumption t1, t2 are products of a subleading pt filter with minN = 2) The module stores j1, j2 of any (j1, j2, t1, t2) that satisfies the conditions above.

Definition at line 31 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Constructor & Destructor Documentation

◆ HLTDiPFJetPlusTausCandidatePFJetProducer()

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

Definition at line 46 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

References dRmin_, and Exception.

47  : tauSrc_(consumes(iConfig.getParameter<edm::InputTag>("tauSrc"))),
48  pfJetSrc_(consumes(iConfig.getParameter<edm::InputTag>("pfJetSrc"))),
49  extraTauPtCut_(iConfig.getParameter<double>("extraTauPtCut")),
50  mjjMin_(iConfig.getParameter<double>("mjjMin")),
52  dRmin_(iConfig.getParameter<double>("dRmin")),
53  dRmin2_(dRmin_ * dRmin_) {
54  if (dRmin_ <= 0.) {
55  throw cms::Exception("HLTDiPFJetPlusTausCandidatePFJetProducer")
56  << "invalid value for parameter \"dRmin\" (must be > 0): " << dRmin_;
57  }
58  produces<reco::PFJetCollection>();
59 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauSrc_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< reco::PFJetCollection > pfJetSrc_

Member Function Documentation

◆ fillDescriptions()

void HLTDiPFJetPlusTausCandidatePFJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 126 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and edm::ConfigurationDescriptions::setComment().

126  {
128  desc.add<edm::InputTag>("pfJetSrc", edm::InputTag("hltAK4PFJetsCorrected"))->setComment("Input collection of PFJets");
129  desc.add<edm::InputTag>("tauSrc", edm::InputTag("hltSinglePFTau20TrackPt1LooseChargedIsolationReg"))
130  ->setComment("Input collection of PFTaus that have passed ID and isolation requirements");
131  desc.add<double>("extraTauPtCut", 45)->setComment("In case of asymmetric tau pt cuts");
132  desc.add<double>("mjjMin", 500)->setComment("VBF dijet mass condition");
133  desc.add<double>("dRmin", 0.5)->setComment("Minimum dR between PFJets and filtered PFTaus");
134  descriptions.setComment(
135  "This module produces a collection of PFJets that are cross-cleaned with respect to PFTaus passing a HLT "
136  "filter.");
137  descriptions.addWithDefaultLabel(desc);
138 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void setComment(std::string const &value)

◆ produce()

void HLTDiPFJetPlusTausCandidatePFJetProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup  
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 61 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

References reco::deltaR2(), dRmin2_, extraTauPtCut_, mps_fire::i, iEvent, dqmdumpme::indices, m2jjMin_, mjjMin_, eostools::move(), reco::LeafCandidate::p4(), pfJetBenchmark_cfi::pfJets, pfJetSrc_, DiDispStaMuonMonitor_cfi::pt, pTComparator_, jetUpdater_cfi::sort, Tau3MuMonitor_cff::taus, tauSrc_, and trigger::TriggerTau.

63  {
64  auto const& pfJets = iEvent.get(pfJetSrc_);
65 
66  auto cleanedPFJets = std::make_unique<reco::PFJetCollection>();
67  cleanedPFJets->reserve(pfJets.size());
68 
70  iEvent.get(tauSrc_).getObjects(trigger::TriggerTau, taus);
71 
72  std::set<unsigned int> indices;
73 
74  for (unsigned int iJet1 = 0; iJet1 < pfJets.size(); iJet1++) {
75  for (unsigned int iJet2 = iJet1 + 1; iJet2 < pfJets.size(); iJet2++) {
76  bool correctComb = false;
77  const reco::PFJet& myPFJet1 = pfJets[iJet1];
78  const reco::PFJet& myPFJet2 = pfJets[iJet2];
79 
80  if (mjjMin_ >= 0. && (myPFJet1.p4() + myPFJet2.p4()).M2() < m2jjMin_)
81  continue;
82 
83  for (unsigned int iTau1 = 0; iTau1 < taus.size(); iTau1++) {
84  if (reco::deltaR2(taus[iTau1]->p4(), myPFJet1.p4()) < dRmin2_)
85  continue;
86  if (reco::deltaR2(taus[iTau1]->p4(), myPFJet2.p4()) < dRmin2_)
87  continue;
88 
89  if (taus.size() == 1) {
90  if (taus[iTau1]->pt() < extraTauPtCut_)
91  continue;
92 
93  correctComb = true;
94  } else {
95  for (unsigned int iTau2 = iTau1 + 1; iTau2 < taus.size(); iTau2++) {
96  if (taus[iTau1]->pt() < extraTauPtCut_ && taus[iTau2]->pt() < extraTauPtCut_)
97  continue;
98 
99  if (reco::deltaR2(taus[iTau2]->p4(), myPFJet1.p4()) < dRmin2_)
100  continue;
101  if (reco::deltaR2(taus[iTau2]->p4(), myPFJet2.p4()) < dRmin2_)
102  continue;
103 
104  correctComb = true;
105  break;
106  }
107  }
108  if (correctComb)
109  break;
110  }
111 
112  if (correctComb) {
113  indices.insert(iJet1);
114  indices.insert(iJet2);
115  }
116  }
117 
118  for (const auto& i : indices)
119  cleanedPFJets->emplace_back(pfJets[i]);
120  }
121  // sort jets in pt
122  std::sort(cleanedPFJets->begin(), cleanedPFJets->end(), pTComparator_);
123  iEvent.put(std::move(cleanedPFJets));
124 }
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauSrc_
Jets made from PFObjects.
Definition: PFJet.h:20
const LorentzVector & p4() const final
four-momentum Lorentz vector
int iEvent
Definition: GenABIO.cc:224
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const edm::EDGetTokenT< reco::PFJetCollection > pfJetSrc_
std::vector< reco::PFTauRef > VRpftau
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ dRmin2_

const double HLTDiPFJetPlusTausCandidatePFJetProducer::dRmin2_
private

Definition at line 42 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ dRmin_

const double HLTDiPFJetPlusTausCandidatePFJetProducer::dRmin_
private

◆ extraTauPtCut_

const double HLTDiPFJetPlusTausCandidatePFJetProducer::extraTauPtCut_
private

Definition at line 40 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ m2jjMin_

const double HLTDiPFJetPlusTausCandidatePFJetProducer::m2jjMin_
private

Definition at line 41 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ mjjMin_

const double HLTDiPFJetPlusTausCandidatePFJetProducer::mjjMin_
private

Definition at line 41 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ pfJetSrc_

const edm::EDGetTokenT<reco::PFJetCollection> HLTDiPFJetPlusTausCandidatePFJetProducer::pfJetSrc_
private

Definition at line 39 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ pTComparator_

GreaterByPt<reco::PFJet> HLTDiPFJetPlusTausCandidatePFJetProducer::pTComparator_
private

Definition at line 43 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().

◆ tauSrc_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTDiPFJetPlusTausCandidatePFJetProducer::tauSrc_
private

Definition at line 38 of file HLTDiPFJetPlusTausCandidatePFJetProducer.cc.

Referenced by produce().