CMS 3D CMS Logo

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

#include <HLTTauRefProducer.h>

Inheritance diagram for HLTTauRefProducer:
edm::global::EDProducer< edm::StreamCache< TauIDConfigCache > > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

std::unique_ptr< TauIDConfigCachebeginStream (edm::StreamID) const override
 
 HLTTauRefProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const override
 
- Public Member Functions inherited from edm::global::EDProducer< edm::StreamCache< TauIDConfigCache > >
 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Private Types

using LorentzVector = math::XYZTLorentzVectorD
 
using LorentzVectorCollection = std::vector< LorentzVector >
 

Private Member Functions

void doElectrons (edm::Event &) const
 
void doJets (edm::Event &) const
 
void doMET (edm::Event &) const
 
void doMuons (edm::Event &) const
 
void doPFTaus (edm::StreamID, edm::Event &) const
 
void doPhotons (edm::Event &) const
 
void doTowers (edm::Event &) const
 

Private Attributes

bool doElecFromZ_
 
bool doElectrons_
 
bool doJets_
 
bool doMET_
 
bool doMuons_
 
bool doPFTaus_
 
bool doPhotons_
 
bool doTowers_
 
edm::EDGetTokenT< reco::TrackCollectione_ctfTrackCollection_
 
edm::InputTag e_ctfTrackCollectionSrc_
 
bool e_doID_
 
bool e_doTrackIso_
 
double e_FromZet_
 
double e_isoMaxSumPt_
 
double e_lipCut_
 
double e_maxIsoDR_
 
double e_minIsoDR_
 
double e_trackMinPt_
 
double e_zMmax_
 
double e_zMmin_
 
edm::EDGetTokenT< reco::GsfElectronCollectionElectrons_
 
double etaMax_
 
double etaMaxPFTau_
 
double etaMin_
 
double etaMinPFTau_
 
edm::EDGetTokenT< reco::CaloJetCollectionJets_
 
edm::EDGetTokenT< reco::CaloMETCollectionMET_
 
edm::EDGetTokenT< reco::MuonCollectionMuons_
 
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > PFTauDis_
 
std::vector< edm::EDGetTokenT< reco::TauDiscriminatorContainer > > PFTauDisCont_
 
std::vector< std::string > PFTauDisContWPs_
 
edm::EDGetTokenT< reco::PFTauCollectionPFTaus_
 
edm::ProcessHistoryID phID_
 
double phiMax_
 
double phiMaxPFTau_
 
double phiMin_
 
double phiMinPFTau_
 
double photonEcalIso_
 
edm::EDGetTokenT< reco::PhotonCollectionPhotons_
 
double ptMinElectron_
 
double ptMinJet_
 
double ptMinMET_
 
double ptMinMuon_
 
double ptMinPFTau_
 
double ptMinPhoton_
 
double ptMinTower_
 
double towerIsol_
 
edm::EDGetTokenT< CaloTowerCollectionTowers_
 

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
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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

Definition at line 57 of file HLTTauRefProducer.h.

Member Typedef Documentation

◆ LorentzVector

Definition at line 68 of file HLTTauRefProducer.h.

◆ LorentzVectorCollection

Definition at line 69 of file HLTTauRefProducer.h.

Constructor & Destructor Documentation

◆ HLTTauRefProducer()

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

Definition at line 29 of file HLTTauRefProducer.cc.

29  {
30  //One Parameter Set per Collection
31  {
32  auto const& pfTau = iConfig.getUntrackedParameter<edm::ParameterSet>("PFTaus");
33  PFTaus_ = consumes<reco::PFTauCollection>(pfTau.getUntrackedParameter<InputTag>("PFTauProducer"));
34  auto discs = pfTau.getUntrackedParameter<vector<InputTag>>("PFTauDiscriminators");
35  auto discConts = pfTau.getUntrackedParameter<vector<InputTag>>("PFTauDiscriminatorContainers");
36  PFTauDisContWPs_ = pfTau.getUntrackedParameter<vector<std::string>>("PFTauDiscriminatorContainerWPs");
37  if (discConts.size() != PFTauDisContWPs_.size())
38  throw cms::Exception("Configuration") << "HLTTauRefProducer: Input parameters PFTauDiscriminatorContainers and "
39  "PFTauDiscriminatorContainerWPs must have the same number of entries!\n";
40  for (auto const& tag : discs) {
41  PFTauDis_.push_back(consumes<reco::PFTauDiscriminator>(tag));
42  }
43  for (auto const& tag : discConts) {
44  PFTauDisCont_.push_back(consumes<reco::TauDiscriminatorContainer>(tag));
45  }
46  doPFTaus_ = pfTau.getUntrackedParameter<bool>("doPFTaus", false);
47  ptMinPFTau_ = pfTau.getUntrackedParameter<double>("ptMin", 15.);
48  etaMinPFTau_ = pfTau.getUntrackedParameter<double>("etaMin", -2.5);
49  etaMaxPFTau_ = pfTau.getUntrackedParameter<double>("etaMax", 2.5);
50  phiMinPFTau_ = pfTau.getUntrackedParameter<double>("phiMin", -3.15);
51  phiMaxPFTau_ = pfTau.getUntrackedParameter<double>("phiMax", 3.15);
52  }
53 
54  {
55  auto const& electrons = iConfig.getUntrackedParameter<edm::ParameterSet>("Electrons");
56  Electrons_ = consumes<reco::GsfElectronCollection>(electrons.getUntrackedParameter<InputTag>("ElectronCollection"));
57  doElectrons_ = electrons.getUntrackedParameter<bool>("doElectrons", false);
58  e_ctfTrackCollectionSrc_ = electrons.getUntrackedParameter<InputTag>("TrackCollection");
59  e_ctfTrackCollection_ = consumes<reco::TrackCollection>(e_ctfTrackCollectionSrc_);
60  ptMinElectron_ = electrons.getUntrackedParameter<double>("ptMin", 15.);
61  e_doTrackIso_ = electrons.getUntrackedParameter<bool>("doTrackIso", false);
62  e_trackMinPt_ = electrons.getUntrackedParameter<double>("ptMinTrack", 1.5);
63  e_lipCut_ = electrons.getUntrackedParameter<double>("lipMinTrack", 1.5);
64  e_minIsoDR_ = electrons.getUntrackedParameter<double>("InnerConeDR", 0.02);
65  e_maxIsoDR_ = electrons.getUntrackedParameter<double>("OuterConeDR", 0.6);
66  e_isoMaxSumPt_ = electrons.getUntrackedParameter<double>("MaxIsoVar", 0.02);
67  }
68 
69  {
70  auto const& muons = iConfig.getUntrackedParameter<edm::ParameterSet>("Muons");
71  Muons_ = consumes<reco::MuonCollection>(muons.getUntrackedParameter<InputTag>("MuonCollection"));
72  doMuons_ = muons.getUntrackedParameter<bool>("doMuons", false);
73  ptMinMuon_ = muons.getUntrackedParameter<double>("ptMin", 15.);
74  }
75 
76  {
77  auto const& jets = iConfig.getUntrackedParameter<edm::ParameterSet>("Jets");
78  Jets_ = consumes<reco::CaloJetCollection>(jets.getUntrackedParameter<InputTag>("JetCollection"));
79  doJets_ = jets.getUntrackedParameter<bool>("doJets");
80  ptMinJet_ = jets.getUntrackedParameter<double>("etMin");
81  }
82 
83  {
84  auto const& towers = iConfig.getUntrackedParameter<edm::ParameterSet>("Towers");
85  Towers_ = consumes<CaloTowerCollection>(towers.getUntrackedParameter<InputTag>("TowerCollection"));
86  doTowers_ = towers.getUntrackedParameter<bool>("doTowers");
87  ptMinTower_ = towers.getUntrackedParameter<double>("etMin");
88  towerIsol_ = towers.getUntrackedParameter<double>("towerIsolation");
89  }
90 
91  {
92  auto const& photons = iConfig.getUntrackedParameter<edm::ParameterSet>("Photons");
93  Photons_ = consumes<reco::PhotonCollection>(photons.getUntrackedParameter<InputTag>("PhotonCollection"));
94  doPhotons_ = photons.getUntrackedParameter<bool>("doPhotons");
95  ptMinPhoton_ = photons.getUntrackedParameter<double>("etMin");
96  photonEcalIso_ = photons.getUntrackedParameter<double>("ECALIso");
97  }
98 
99  {
100  auto const& met = iConfig.getUntrackedParameter<edm::ParameterSet>("MET");
101  MET_ = consumes<reco::CaloMETCollection>(met.getUntrackedParameter<InputTag>("METCollection"));
102  doMET_ = met.getUntrackedParameter<bool>("doMET", false);
103  ptMinMET_ = met.getUntrackedParameter<double>("ptMin", 15.);
104  }
105 
106  etaMin_ = iConfig.getUntrackedParameter<double>("EtaMin", -2.5);
107  etaMax_ = iConfig.getUntrackedParameter<double>("EtaMax", 2.5);
108  phiMin_ = iConfig.getUntrackedParameter<double>("PhiMin", -3.15);
109  phiMax_ = iConfig.getUntrackedParameter<double>("PhiMax", 3.15);
110 
111  //recoCollections
112  produces<LorentzVectorCollection>("PFTaus");
113  produces<LorentzVectorCollection>("Electrons");
114  produces<LorentzVectorCollection>("Muons");
115  produces<LorentzVectorCollection>("Jets");
116  produces<LorentzVectorCollection>("Photons");
117  produces<LorentzVectorCollection>("Towers");
118  produces<LorentzVectorCollection>("MET");
119 }

References pwdgSkimBPark_cfi::electrons, edm::ParameterSet::getUntrackedParameter(), singleTopDQM_cfi::jets, BTaggingMonitor_cfi::met, PDWG_BPHSkim_cff::muons, BPHMonitor_cfi::photons, makeGlobalPositionRcd_cfg::tag, and HLT_FULL_cff::towers.

Member Function Documentation

◆ beginStream()

std::unique_ptr<TauIDConfigCache> HLTTauRefProducer::beginStream ( edm::StreamID  ) const
inlineoverride

Definition at line 63 of file HLTTauRefProducer.h.

63  {
64  return std::make_unique<TauIDConfigCache>();
65  }

◆ doElectrons()

void HLTTauRefProducer::doElectrons ( edm::Event iEvent) const
private

Definition at line 227 of file HLTTauRefProducer.cc.

227  {
228  auto product_Electrons = make_unique<LorentzVectorCollection>();
229 
231  if (!iEvent.getByToken(e_ctfTrackCollection_, pCtfTracks)) {
232  edm::LogInfo("") << "Error! Can't get " << e_ctfTrackCollectionSrc_.label() << " by label. ";
233  iEvent.put(move(product_Electrons), "Electrons");
234  return;
235  }
236 
238  if (iEvent.getByToken(Electrons_, electrons)) {
239  for (size_t i = 0; i < electrons->size(); ++i) {
241  auto const& electron = (*electrons)[i];
242  if (electron.pt() > ptMinElectron_ && fabs(electron.eta()) < etaMax_) {
243  if (e_doTrackIso_) {
244  double sum_of_pt_ele{};
245  for (auto const& tr : *pCtfTracks) {
246  double const lip{electron.gsfTrack()->dz() - tr.dz()};
247  if (tr.pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_) {
248  double dphi{fabs(tr.phi() - electron.trackMomentumAtVtx().phi())};
249  if (dphi > acos(-1.)) {
250  dphi = 2 * acos(-1.) - dphi;
251  }
252  double const deta{fabs(tr.eta() - electron.trackMomentumAtVtx().eta())};
253  double const dr_ctf_ele{sqrt(deta * deta + dphi * dphi)};
254  if ((dr_ctf_ele > e_minIsoDR_) && (dr_ctf_ele < e_maxIsoDR_)) {
255  double const cft_pt_2{tr.pt() * tr.pt()};
256  sum_of_pt_ele += cft_pt_2;
257  }
258  }
259  }
260  double const isolation_value_ele{sum_of_pt_ele /
261  (electron.trackMomentumAtVtx().Rho() * electron.trackMomentumAtVtx().Rho())};
262  if (isolation_value_ele < e_isoMaxSumPt_) {
263  product_Electrons->emplace_back(electron.px(), electron.py(), electron.pz(), electron.energy());
264  }
265  } else {
266  product_Electrons->emplace_back(electron.px(), electron.py(), electron.pz(), electron.energy());
267  }
268  }
269  }
270  }
271  iEvent.put(move(product_Electrons), "Electrons");
272 }

References HPSPFTauProducerPuppi_cfi::electron, pwdgSkimBPark_cfi::electrons, mps_fire::i, iEvent, qcdUeDQM_cfi::lip, eostools::move(), and mathSSE::sqrt().

◆ doJets()

void HLTTauRefProducer::doJets ( edm::Event iEvent) const
private

Definition at line 289 of file HLTTauRefProducer.cc.

289  {
290  auto product_Jets = make_unique<LorentzVectorCollection>();
291 
293  if (iEvent.getByToken(Jets_, jets)) {
294  for (auto const& jet : *jets) {
295  if (jet.et() > ptMinJet_ && jet.eta() > etaMin_ && jet.eta() < etaMax_ && jet.phi() > phiMin_ &&
296  jet.phi() < phiMax_) {
297  product_Jets->emplace_back(jet.px(), jet.py(), jet.pz(), jet.energy());
298  }
299  }
300  }
301  iEvent.put(move(product_Jets), "Jets");
302 }

References iEvent, metsig::jet, singleTopDQM_cfi::jets, and eostools::move().

◆ doMET()

void HLTTauRefProducer::doMET ( edm::Event iEvent) const
private

Definition at line 344 of file HLTTauRefProducer.cc.

344  {
345  auto product_MET = make_unique<LorentzVectorCollection>();
346 
348  if (iEvent.getByToken(MET_, met) && !met->empty()) {
349  auto const& metMom = met->front().p4();
350  product_MET->emplace_back(metMom.Px(), metMom.Py(), 0, metMom.Pt());
351  }
352  iEvent.put(move(product_MET), "MET");
353 }

References iEvent, BTaggingMonitor_cfi::met, and eostools::move().

◆ doMuons()

void HLTTauRefProducer::doMuons ( edm::Event iEvent) const
private

Definition at line 274 of file HLTTauRefProducer.cc.

274  {
275  auto product_Muons = make_unique<LorentzVectorCollection>();
276 
278  if (iEvent.getByToken(Muons_, muons)) {
279  for (auto const& muon : *muons) {
280  if (muon.pt() > ptMinMuon_ && muon.eta() > etaMin_ && muon.eta() < etaMax_ && muon.phi() > phiMin_ &&
281  muon.phi() < phiMax_) {
282  product_Muons->emplace_back(muon.px(), muon.py(), muon.pz(), muon.energy());
283  }
284  }
285  }
286  iEvent.put(move(product_Muons), "Muons");
287 }

References iEvent, eostools::move(), and PDWG_BPHSkim_cff::muons.

◆ doPFTaus()

void HLTTauRefProducer::doPFTaus ( edm::StreamID  iID,
edm::Event iEvent 
) const
private

Definition at line 138 of file HLTTauRefProducer.cc.

138  {
139  auto product_PFTaus = make_unique<LorentzVectorCollection>();
140 
142  if (iEvent.getByToken(PFTaus_, pftaus)) {
143  // Retrieve ID container indices if config history changes, in particular for the first event.
144  if (streamCache(iID)->first != iEvent.processHistoryID()) {
145  streamCache(iID)->first = iEvent.processHistoryID();
146  streamCache(iID)->second.resize(PFTauDisContWPs_.size());
147  for (size_t i = 0; i < PFTauDisCont_.size(); ++i) {
148  auto const aHandle = iEvent.getHandle(PFTauDisCont_[i]);
149  auto const aProv = aHandle.provenance();
150  if (aProv == nullptr)
151  aHandle.whyFailed()->raise();
152  const auto& psetsFromProvenance = edm::parameterSet(aProv->stable(), iEvent.processHistory());
153  if (psetsFromProvenance.exists("workingPoints")) {
154  auto const idlist = psetsFromProvenance.getParameter<std::vector<std::string>>("workingPoints");
155  bool found = false;
156  for (size_t j = 0; j < idlist.size(); ++j) {
157  if (PFTauDisContWPs_[i] == idlist[j]) {
158  found = true;
159  streamCache(iID)->second[i] = j;
160  }
161  }
162  if (!found)
163  throw cms::Exception("Configuration")
164  << "HLTTauRefProducer: Requested working point '" << PFTauDisContWPs_[i] << "' not found!\n";
165  } else if (psetsFromProvenance.exists("IDWPdefinitions")) {
166  auto const idlist = psetsFromProvenance.getParameter<std::vector<edm::ParameterSet>>("IDWPdefinitions");
167  bool found = false;
168  for (size_t j = 0; j < idlist.size(); ++j) {
169  if (PFTauDisContWPs_[i] == idlist[j].getParameter<std::string>("IDname")) {
170  found = true;
171  streamCache(iID)->second[i] = j;
172  }
173  }
174  if (!found)
175  throw cms::Exception("Configuration")
176  << "HLTTauRefProducer: Requested working point '" << PFTauDisContWPs_[i] << "' not found!\n";
177  } else
178  throw cms::Exception("Configuration")
179  << "HLTTauRefProducer: No suitable ID list found in provenace config!\n";
180  }
181  }
182  for (unsigned int i = 0; i < pftaus->size(); ++i) {
183  auto const& pftau = (*pftaus)[i];
184  if (pftau.pt() > ptMinPFTau_ && pftau.eta() > etaMinPFTau_ && pftau.eta() < etaMaxPFTau_ &&
185  pftau.phi() > phiMinPFTau_ && pftau.phi() < phiMaxPFTau_) {
186  reco::PFTauRef thePFTau{pftaus, i};
187  bool passAll{true};
188 
189  for (auto const& token : PFTauDis_) {
191  if (iEvent.getByToken(token, pftaudis)) {
192  if ((*pftaudis)[thePFTau] < 0.5) {
193  passAll = false;
194  break;
195  }
196  } else {
197  passAll = false;
198  break;
199  }
200  }
201 
202  int idx = 0;
203  for (auto const& token : PFTauDisCont_) {
205  if (iEvent.getByToken(token, pftaudis)) {
206  //WP vector not filled if prediscriminator in RecoTauDiscriminator failed.
207  if ((*pftaudis)[thePFTau].workingPoints.empty() ||
208  !(*pftaudis)[thePFTau].workingPoints.at(streamCache(iID)->second[idx])) {
209  passAll = false;
210  break;
211  }
212  } else {
213  passAll = false;
214  break;
215  }
216  idx++;
217  }
218  if (passAll) {
219  product_PFTaus->emplace_back(pftau.px(), pftau.py(), pftau.pz(), pftau.energy());
220  }
221  }
222  }
223  }
224  iEvent.put(move(product_PFTaus), "PFTaus");
225 }

References Exception, newFWLiteAna::found, edm::ParameterSet::getParameter(), mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, dqmiolumiharvest::j, eostools::move(), edm::parameterSet(), edm::second(), and unpackBuffers-CaloStage2::token.

◆ doPhotons()

void HLTTauRefProducer::doPhotons ( edm::Event iEvent) const
private

Definition at line 329 of file HLTTauRefProducer.cc.

329  {
330  auto product_Gammas = make_unique<LorentzVectorCollection>();
331 
333  if (iEvent.getByToken(Photons_, photons)) {
334  for (auto const& photon : *photons) {
335  if (photon.ecalRecHitSumEtConeDR04() < photonEcalIso_ && photon.et() > ptMinPhoton_ && photon.eta() > etaMin_ &&
336  photon.eta() < etaMax_ && photon.phi() > phiMin_ && photon.phi() < phiMax_) {
337  product_Gammas->emplace_back(photon.px(), photon.py(), photon.pz(), photon.energy());
338  }
339  }
340  }
341  iEvent.put(move(product_Gammas), "Photons");
342 }

References iEvent, eostools::move(), muons2muons_cfi::photon, and BPHMonitor_cfi::photons.

◆ doTowers()

void HLTTauRefProducer::doTowers ( edm::Event iEvent) const
private

Definition at line 304 of file HLTTauRefProducer.cc.

304  {
305  auto product_Towers = make_unique<LorentzVectorCollection>();
306 
308  if (iEvent.getByToken(Towers_, towers)) {
309  for (auto const& tower1 : *towers) {
310  if (tower1.pt() > ptMinTower_ && tower1.eta() > etaMin_ && tower1.eta() < etaMax_ && tower1.phi() > phiMin_ &&
311  tower1.phi() < phiMax_) {
312  //calculate isolation
313  double isolET{};
314  for (auto const& tower2 : *towers) {
315  if (ROOT::Math::VectorUtil::DeltaR(tower1.p4(), tower2.p4()) < 0.5) {
316  isolET += tower2.pt();
317  }
318  isolET -= tower1.pt();
319  }
320  if (isolET < towerIsol_) {
321  product_Towers->emplace_back(tower1.px(), tower1.py(), tower1.pz(), tower1.energy());
322  }
323  }
324  }
325  }
326  iEvent.put(move(product_Towers), "Towers");
327 }

References electronAnalyzer_cfi::DeltaR, iEvent, eostools::move(), and HLT_FULL_cff::towers.

◆ produce()

void HLTTauRefProducer::produce ( edm::StreamID  iID,
edm::Event iEvent,
edm::EventSetup const &   
) const
overridevirtual

Member Data Documentation

◆ doElecFromZ_

bool HLTTauRefProducer::doElecFromZ_
private

Definition at line 91 of file HLTTauRefProducer.h.

◆ doElectrons_

bool HLTTauRefProducer::doElectrons_
private

Definition at line 80 of file HLTTauRefProducer.h.

◆ doJets_

bool HLTTauRefProducer::doJets_
private

Definition at line 106 of file HLTTauRefProducer.h.

◆ doMET_

bool HLTTauRefProducer::doMET_
private

Definition at line 115 of file HLTTauRefProducer.h.

◆ doMuons_

bool HLTTauRefProducer::doMuons_
private

Definition at line 102 of file HLTTauRefProducer.h.

◆ doPFTaus_

bool HLTTauRefProducer::doPFTaus_
private

Definition at line 76 of file HLTTauRefProducer.h.

◆ doPhotons_

bool HLTTauRefProducer::doPhotons_
private

Definition at line 97 of file HLTTauRefProducer.h.

◆ doTowers_

bool HLTTauRefProducer::doTowers_
private

Definition at line 110 of file HLTTauRefProducer.h.

◆ e_ctfTrackCollection_

edm::EDGetTokenT<reco::TrackCollection> HLTTauRefProducer::e_ctfTrackCollection_
private

Definition at line 81 of file HLTTauRefProducer.h.

◆ e_ctfTrackCollectionSrc_

edm::InputTag HLTTauRefProducer::e_ctfTrackCollectionSrc_
private

Definition at line 82 of file HLTTauRefProducer.h.

◆ e_doID_

bool HLTTauRefProducer::e_doID_
private

Definition at line 84 of file HLTTauRefProducer.h.

◆ e_doTrackIso_

bool HLTTauRefProducer::e_doTrackIso_
private

Definition at line 85 of file HLTTauRefProducer.h.

◆ e_FromZet_

double HLTTauRefProducer::e_FromZet_
private

Definition at line 94 of file HLTTauRefProducer.h.

◆ e_isoMaxSumPt_

double HLTTauRefProducer::e_isoMaxSumPt_
private

Definition at line 90 of file HLTTauRefProducer.h.

◆ e_lipCut_

double HLTTauRefProducer::e_lipCut_
private

Definition at line 87 of file HLTTauRefProducer.h.

◆ e_maxIsoDR_

double HLTTauRefProducer::e_maxIsoDR_
private

Definition at line 89 of file HLTTauRefProducer.h.

◆ e_minIsoDR_

double HLTTauRefProducer::e_minIsoDR_
private

Definition at line 88 of file HLTTauRefProducer.h.

◆ e_trackMinPt_

double HLTTauRefProducer::e_trackMinPt_
private

Definition at line 86 of file HLTTauRefProducer.h.

◆ e_zMmax_

double HLTTauRefProducer::e_zMmax_
private

Definition at line 93 of file HLTTauRefProducer.h.

◆ e_zMmin_

double HLTTauRefProducer::e_zMmin_
private

Definition at line 92 of file HLTTauRefProducer.h.

◆ Electrons_

edm::EDGetTokenT<reco::GsfElectronCollection> HLTTauRefProducer::Electrons_
private

Definition at line 79 of file HLTTauRefProducer.h.

◆ etaMax_

double HLTTauRefProducer::etaMax_
private

Definition at line 118 of file HLTTauRefProducer.h.

◆ etaMaxPFTau_

double HLTTauRefProducer::etaMaxPFTau_
private

Definition at line 77 of file HLTTauRefProducer.h.

◆ etaMin_

double HLTTauRefProducer::etaMin_
private

Definition at line 118 of file HLTTauRefProducer.h.

◆ etaMinPFTau_

double HLTTauRefProducer::etaMinPFTau_
private

Definition at line 77 of file HLTTauRefProducer.h.

◆ Jets_

edm::EDGetTokenT<reco::CaloJetCollection> HLTTauRefProducer::Jets_
private

Definition at line 105 of file HLTTauRefProducer.h.

◆ MET_

edm::EDGetTokenT<reco::CaloMETCollection> HLTTauRefProducer::MET_
private

Definition at line 114 of file HLTTauRefProducer.h.

◆ Muons_

edm::EDGetTokenT<reco::MuonCollection> HLTTauRefProducer::Muons_
private

Definition at line 101 of file HLTTauRefProducer.h.

◆ PFTauDis_

std::vector<edm::EDGetTokenT<reco::PFTauDiscriminator> > HLTTauRefProducer::PFTauDis_
private

Definition at line 72 of file HLTTauRefProducer.h.

◆ PFTauDisCont_

std::vector<edm::EDGetTokenT<reco::TauDiscriminatorContainer> > HLTTauRefProducer::PFTauDisCont_
private

Definition at line 73 of file HLTTauRefProducer.h.

◆ PFTauDisContWPs_

std::vector<std::string> HLTTauRefProducer::PFTauDisContWPs_
private

Definition at line 74 of file HLTTauRefProducer.h.

◆ PFTaus_

edm::EDGetTokenT<reco::PFTauCollection> HLTTauRefProducer::PFTaus_
private

Definition at line 71 of file HLTTauRefProducer.h.

◆ phID_

edm::ProcessHistoryID HLTTauRefProducer::phID_
private

Definition at line 75 of file HLTTauRefProducer.h.

◆ phiMax_

double HLTTauRefProducer::phiMax_
private

Definition at line 118 of file HLTTauRefProducer.h.

◆ phiMaxPFTau_

double HLTTauRefProducer::phiMaxPFTau_
private

Definition at line 77 of file HLTTauRefProducer.h.

◆ phiMin_

double HLTTauRefProducer::phiMin_
private

Definition at line 118 of file HLTTauRefProducer.h.

◆ phiMinPFTau_

double HLTTauRefProducer::phiMinPFTau_
private

Definition at line 77 of file HLTTauRefProducer.h.

◆ photonEcalIso_

double HLTTauRefProducer::photonEcalIso_
private

Definition at line 98 of file HLTTauRefProducer.h.

◆ Photons_

edm::EDGetTokenT<reco::PhotonCollection> HLTTauRefProducer::Photons_
private

Definition at line 96 of file HLTTauRefProducer.h.

◆ ptMinElectron_

double HLTTauRefProducer::ptMinElectron_
private

Definition at line 83 of file HLTTauRefProducer.h.

◆ ptMinJet_

double HLTTauRefProducer::ptMinJet_
private

Definition at line 107 of file HLTTauRefProducer.h.

◆ ptMinMET_

double HLTTauRefProducer::ptMinMET_
private

Definition at line 116 of file HLTTauRefProducer.h.

◆ ptMinMuon_

double HLTTauRefProducer::ptMinMuon_
private

Definition at line 103 of file HLTTauRefProducer.h.

◆ ptMinPFTau_

double HLTTauRefProducer::ptMinPFTau_
private

Definition at line 77 of file HLTTauRefProducer.h.

◆ ptMinPhoton_

double HLTTauRefProducer::ptMinPhoton_
private

Definition at line 99 of file HLTTauRefProducer.h.

◆ ptMinTower_

double HLTTauRefProducer::ptMinTower_
private

Definition at line 111 of file HLTTauRefProducer.h.

◆ towerIsol_

double HLTTauRefProducer::towerIsol_
private

Definition at line 112 of file HLTTauRefProducer.h.

◆ Towers_

edm::EDGetTokenT<CaloTowerCollection> HLTTauRefProducer::Towers_
private

Definition at line 109 of file HLTTauRefProducer.h.

HLTTauRefProducer::e_maxIsoDR_
double e_maxIsoDR_
Definition: HLTTauRefProducer.h:89
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
HLT_FULL_cff.towers
towers
Definition: HLT_FULL_cff.py:36379
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
mps_fire.i
i
Definition: mps_fire.py:428
muon
Definition: MuonCocktails.h:17
HLTTauRefProducer::Muons_
edm::EDGetTokenT< reco::MuonCollection > Muons_
Definition: HLTTauRefProducer.h:101
HLTTauRefProducer::e_lipCut_
double e_lipCut_
Definition: HLTTauRefProducer.h:87
HLTTauRefProducer::doTowers_
bool doTowers_
Definition: HLTTauRefProducer.h:110
HLTTauRefProducer::doElectrons
void doElectrons(edm::Event &) const
Definition: HLTTauRefProducer.cc:227
HLTTauRefProducer::ptMinPhoton_
double ptMinPhoton_
Definition: HLTTauRefProducer.h:99
HLTTauRefProducer::MET_
edm::EDGetTokenT< reco::CaloMETCollection > MET_
Definition: HLTTauRefProducer.h:114
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HLTTauRefProducer::doPhotons
void doPhotons(edm::Event &) const
Definition: HLTTauRefProducer.cc:329
HLTTauRefProducer::doTowers
void doTowers(edm::Event &) const
Definition: HLTTauRefProducer.cc:304
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< reco::TrackCollection >
edm::Ref
Definition: AssociativeIterator.h:58
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
HLTTauRefProducer::etaMinPFTau_
double etaMinPFTau_
Definition: HLTTauRefProducer.h:77
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
HLTTauRefProducer::etaMaxPFTau_
double etaMaxPFTau_
Definition: HLTTauRefProducer.h:77
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
HLTTauRefProducer::ptMinElectron_
double ptMinElectron_
Definition: HLTTauRefProducer.h:83
HLTTauRefProducer::doMuons
void doMuons(edm::Event &) const
Definition: HLTTauRefProducer.cc:274
HLTTauRefProducer::e_ctfTrackCollection_
edm::EDGetTokenT< reco::TrackCollection > e_ctfTrackCollection_
Definition: HLTTauRefProducer.h:81
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLTTauRefProducer::e_doTrackIso_
bool e_doTrackIso_
Definition: HLTTauRefProducer.h:85
HLTTauRefProducer::phiMax_
double phiMax_
Definition: HLTTauRefProducer.h:118
HLTTauRefProducer::Electrons_
edm::EDGetTokenT< reco::GsfElectronCollection > Electrons_
Definition: HLTTauRefProducer.h:79
HLTTauRefProducer::etaMin_
double etaMin_
Definition: HLTTauRefProducer.h:118
HLTTauRefProducer::photonEcalIso_
double photonEcalIso_
Definition: HLTTauRefProducer.h:98
HLTTauRefProducer::ptMinMET_
double ptMinMET_
Definition: HLTTauRefProducer.h:116
HLTTauRefProducer::etaMax_
double etaMax_
Definition: HLTTauRefProducer.h:118
HLTTauRefProducer::doMET_
bool doMET_
Definition: HLTTauRefProducer.h:115
edm::ParameterSet
Definition: ParameterSet.h:47
HLTTauRefProducer::e_isoMaxSumPt_
double e_isoMaxSumPt_
Definition: HLTTauRefProducer.h:90
HLTTauRefProducer::PFTaus_
edm::EDGetTokenT< reco::PFTauCollection > PFTaus_
Definition: HLTTauRefProducer.h:71
HLTTauRefProducer::doPFTaus_
bool doPFTaus_
Definition: HLTTauRefProducer.h:76
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
HLTTauRefProducer::ptMinPFTau_
double ptMinPFTau_
Definition: HLTTauRefProducer.h:77
HLTTauRefProducer::ptMinTower_
double ptMinTower_
Definition: HLTTauRefProducer.h:111
HLTTauRefProducer::ptMinMuon_
double ptMinMuon_
Definition: HLTTauRefProducer.h:103
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTTauRefProducer::Towers_
edm::EDGetTokenT< CaloTowerCollection > Towers_
Definition: HLTTauRefProducer.h:109
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
HLTTauRefProducer::e_minIsoDR_
double e_minIsoDR_
Definition: HLTTauRefProducer.h:88
HLTTauRefProducer::doJets
void doJets(edm::Event &) const
Definition: HLTTauRefProducer.cc:289
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
HLTTauRefProducer::e_trackMinPt_
double e_trackMinPt_
Definition: HLTTauRefProducer.h:86
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
HLTTauRefProducer::doMET
void doMET(edm::Event &) const
Definition: HLTTauRefProducer.cc:344
HLTTauRefProducer::doMuons_
bool doMuons_
Definition: HLTTauRefProducer.h:102
HLTTauRefProducer::PFTauDisCont_
std::vector< edm::EDGetTokenT< reco::TauDiscriminatorContainer > > PFTauDisCont_
Definition: HLTTauRefProducer.h:73
HLTTauRefProducer::ptMinJet_
double ptMinJet_
Definition: HLTTauRefProducer.h:107
HLTTauRefProducer::PFTauDisContWPs_
std::vector< std::string > PFTauDisContWPs_
Definition: HLTTauRefProducer.h:74
HLTTauRefProducer::PFTauDis_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > PFTauDis_
Definition: HLTTauRefProducer.h:72
HLTTauRefProducer::Photons_
edm::EDGetTokenT< reco::PhotonCollection > Photons_
Definition: HLTTauRefProducer.h:96
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLTTauRefProducer::doPhotons_
bool doPhotons_
Definition: HLTTauRefProducer.h:97
HLTTauRefProducer::doPFTaus
void doPFTaus(edm::StreamID, edm::Event &) const
Definition: HLTTauRefProducer.cc:138
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
metsig::jet
Definition: SignAlgoResolutions.h:47
HLTTauRefProducer::phiMin_
double phiMin_
Definition: HLTTauRefProducer.h:118
Exception
Definition: hltDiff.cc:245
HLTTauRefProducer::phiMinPFTau_
double phiMinPFTau_
Definition: HLTTauRefProducer.h:77
HLTTauRefProducer::e_ctfTrackCollectionSrc_
edm::InputTag e_ctfTrackCollectionSrc_
Definition: HLTTauRefProducer.h:82
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTTauRefProducer::phiMaxPFTau_
double phiMaxPFTau_
Definition: HLTTauRefProducer.h:77
HLTTauRefProducer::Jets_
edm::EDGetTokenT< reco::CaloJetCollection > Jets_
Definition: HLTTauRefProducer.h:105
cms::Exception
Definition: Exception.h:70
HLTTauRefProducer::doJets_
bool doJets_
Definition: HLTTauRefProducer.h:106
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HLTTauRefProducer::doElectrons_
bool doElectrons_
Definition: HLTTauRefProducer.h:80
edm::InputTag
Definition: InputTag.h:15
HLTTauRefProducer::towerIsol_
double towerIsol_
Definition: HLTTauRefProducer.h:112
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316