CMS 3D CMS Logo

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

Public Member Functions

 HLTPFDiJetCorrCheckerWithDiTau (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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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 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
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 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<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. they 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 27 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Constructor & Destructor Documentation

◆ HLTPFDiJetCorrCheckerWithDiTau()

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

Definition at line 46 of file HLTPFDiJetCorrCheckerWithDiTau.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")),
51  dRmin_(iConfig.getParameter<double>("dRmin")),
52  dRmin2_(dRmin_ * dRmin_) {
53  if (dRmin_ <= 0.) {
54  throw cms::Exception("HLTPFDiJetCorrCheckerWithDiTau")
55  << "invalid value for parameter \"dRmin\" (must be > 0): " << dRmin_;
56  }
57  produces<reco::PFJetCollection>();
58 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauSrc_
const edm::EDGetTokenT< reco::PFJetCollection > pfJetSrc_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 118 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

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

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

◆ produce()

void HLTPFDiJetCorrCheckerWithDiTau::produce ( edm::StreamID  iSId,
edm::Event iEvent,
const edm::EventSetup iES 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 60 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

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

60  {
61  auto const& pfJets = iEvent.get(pfJetSrc_);
62 
63  auto cleanedPFJets = std::make_unique<reco::PFJetCollection>();
64  cleanedPFJets->reserve(pfJets.size());
65 
67  iEvent.get(tauSrc_).getObjects(trigger::TriggerTau, taus);
68 
69  std::set<unsigned int> indices;
70 
71  if (pfJets.size() > 1 && taus.size() > 1) {
72  for (unsigned int iJet1 = 0; iJet1 < pfJets.size(); iJet1++) {
73  for (unsigned int iJet2 = iJet1 + 1; iJet2 < pfJets.size(); iJet2++) {
74  bool correctComb = false;
75  const reco::PFJet& myPFJet1 = pfJets[iJet1];
76  const reco::PFJet& myPFJet2 = pfJets[iJet2];
77 
78  if ((myPFJet1.p4() + myPFJet2.p4()).M() < mjjMin_)
79  continue;
80 
81  for (unsigned int iTau1 = 0; iTau1 < taus.size(); iTau1++) {
82  if (reco::deltaR2(taus[iTau1]->p4(), myPFJet1.p4()) < dRmin2_)
83  continue;
84  if (reco::deltaR2(taus[iTau1]->p4(), myPFJet2.p4()) < dRmin2_)
85  continue;
86 
87  for (unsigned int iTau2 = iTau1 + 1; iTau2 < taus.size(); iTau2++) {
88  if (taus[iTau1]->pt() < extraTauPtCut_ && taus[iTau2]->pt() < extraTauPtCut_)
89  continue;
90 
91  if (reco::deltaR2(taus[iTau2]->p4(), myPFJet1.p4()) < dRmin2_)
92  continue;
93  if (reco::deltaR2(taus[iTau2]->p4(), myPFJet2.p4()) < dRmin2_)
94  continue;
95 
96  correctComb = true;
97  break;
98  }
99  if (correctComb)
100  break;
101  }
102 
103  if (correctComb) {
104  indices.insert(iJet1);
105  indices.insert(iJet2);
106  }
107  }
108  }
109 
110  for (const auto& i : indices)
111  cleanedPFJets->emplace_back(pfJets[i]);
112  }
113  // sort jets in pt
114  std::sort(cleanedPFJets->begin(), cleanedPFJets->end(), pTComparator_);
115  iEvent.put(std::move(cleanedPFJets));
116 }
Jets made from PFObjects.
Definition: PFJet.h:20
const LorentzVector & p4() const final
four-momentum Lorentz vector
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tauSrc_
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 HLTPFDiJetCorrCheckerWithDiTau::dRmin2_
private

Definition at line 38 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().

◆ dRmin_

const double HLTPFDiJetCorrCheckerWithDiTau::dRmin_
private

Definition at line 38 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by HLTPFDiJetCorrCheckerWithDiTau().

◆ extraTauPtCut_

const double HLTPFDiJetCorrCheckerWithDiTau::extraTauPtCut_
private

Definition at line 36 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().

◆ mjjMin_

const double HLTPFDiJetCorrCheckerWithDiTau::mjjMin_
private

Definition at line 37 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().

◆ pfJetSrc_

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

Definition at line 35 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().

◆ pTComparator_

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

Definition at line 40 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().

◆ tauSrc_

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

Definition at line 34 of file HLTPFDiJetCorrCheckerWithDiTau.cc.

Referenced by produce().