CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
pat::PATTauProducer Class Reference

Produces pat::Tau's. More...

#include "PhysicsTools/PatAlgos/interface/PATTauProducer.h"

Inheritance diagram for pat::PATTauProducer:
edm::stream::EDProducer<>

Public Member Functions

 PATTauProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~PATTauProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::pair< edm::InputTag, std::vector< NameWPIdx > > IDContainerData
 
typedef std::pair< std::string, edm::InputTagNameTag
 
typedef std::pair< std::string, WPIdxNameWPIdx
 
typedef std::pair< std::string, std::string > WPCfg
 
typedef std::pair< WPCfg, int > WPIdx
 

Private Member Functions

template<typename TauCollectionType , typename TauDiscrType >
float getTauIdDiscriminator (const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
 
float getTauIdDiscriminatorFromContainer (const edm::Handle< reco::PFTauCollection > &, size_t, const edm::Handle< reco::TauDiscriminatorContainer > &, int)
 

Private Attributes

bool addEfficiencies_
 
bool addGenJetMatch_
 
bool addGenMatch_
 
bool addResolutions_
 
bool addTauID_
 
bool addTauJetCorrFactors_
 
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
 
pat::helper::EfficiencyLoader efficiencyLoader_
 
bool embedGenJetMatch_
 
bool embedGenMatch_
 
bool embedIsolationPFCands_
 
bool embedIsolationPFChargedHadrCands_
 
bool embedIsolationPFGammaCands_
 
bool embedIsolationPFNeutralHadrCands_
 
bool embedIsolationTracks_
 
bool embedLeadPFCand_
 
bool embedLeadPFChargedHadrCand_
 
bool embedLeadPFNeutralCand_
 
bool embedLeadTrack_
 
bool embedSignalPFCands_
 
bool embedSignalPFChargedHadrCands_
 
bool embedSignalPFGammaCands_
 
bool embedSignalPFNeutralHadrCands_
 
bool embedSignalTracks_
 
bool firstOccurence_
 
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
 
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
 
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
 
pat::helper::MultiIsolator isolator_
 
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
 
std::vector< edm::EDGetTokenT< reco::TauDiscriminatorContainer > > pfTauIDContainerTokens_
 
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
 
edm::EDGetTokenT< reco::PFTauCollectionpfTauToken_
 
edm::ProcessHistoryID phID_
 
PositionAtECalEntranceComputer posAtECalEntranceComputer_
 
GreaterByPt< TaupTTauComparator_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
bool skipMissingTauID_
 
std::vector< std::vector< NameWPIdx > > tauIDSrcContainers_
 
std::vector< NameTagtauIDSrcs_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
 
edm::InputTag tauTransverseImpactParameterSrc_
 
edm::EDGetTokenT< PFTauTIPAssociationByReftauTransverseImpactParameterToken_
 
pat::PATUserDataHelper< pat::TauuserDataHelper_
 
bool useUserData_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Produces pat::Tau's.

The PATTauProducer produces analysis-level pat::Tau's starting from a collection of objects of TauType.

Author
Steven Lowette, Christophe Delaere

Definition at line 51 of file PATTauProducer.h.

Member Typedef Documentation

◆ IDContainerData

typedef std::pair<edm::InputTag, std::vector<NameWPIdx> > pat::PATTauProducer::IDContainerData
private

Definition at line 100 of file PATTauProducer.h.

◆ NameTag

typedef std::pair<std::string, edm::InputTag> pat::PATTauProducer::NameTag
private

Definition at line 95 of file PATTauProducer.h.

◆ NameWPIdx

typedef std::pair<std::string, WPIdx> pat::PATTauProducer::NameWPIdx
private

Definition at line 98 of file PATTauProducer.h.

◆ WPCfg

typedef std::pair<std::string, std::string> pat::PATTauProducer::WPCfg
private

Definition at line 96 of file PATTauProducer.h.

◆ WPIdx

typedef std::pair<WPCfg, int> pat::PATTauProducer::WPIdx
private

Definition at line 97 of file PATTauProducer.h.

Constructor & Destructor Documentation

◆ PATTauProducer()

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

Definition at line 30 of file PATTauProducer.cc.

31  : isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation")
33  consumesCollector(),
34  false),
35  useUserData_(iConfig.exists("userData")),
36  posAtECalEntranceComputer_(consumesCollector()) {
37  firstOccurence_ = true;
38  // initialize the configurables
39  baseTauToken_ = consumes<edm::View<reco::BaseTau>>(iConfig.getParameter<edm::InputTag>("tauSource"));
40  tauTransverseImpactParameterSrc_ = iConfig.getParameter<edm::InputTag>("tauTransverseImpactParameterSource");
41  tauTransverseImpactParameterToken_ = consumes<PFTauTIPAssociationByRef>(tauTransverseImpactParameterSrc_);
42  pfTauToken_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>("tauSource"));
43  embedIsolationTracks_ = iConfig.getParameter<bool>("embedIsolationTracks");
44  embedLeadTrack_ = iConfig.getParameter<bool>("embedLeadTrack");
45  embedSignalTracks_ = iConfig.getParameter<bool>("embedSignalTracks");
46  embedLeadPFCand_ = iConfig.getParameter<bool>("embedLeadPFCand");
47  embedLeadPFChargedHadrCand_ = iConfig.getParameter<bool>("embedLeadPFChargedHadrCand");
48  embedLeadPFNeutralCand_ = iConfig.getParameter<bool>("embedLeadPFNeutralCand");
49  embedSignalPFCands_ = iConfig.getParameter<bool>("embedSignalPFCands");
50  embedSignalPFChargedHadrCands_ = iConfig.getParameter<bool>("embedSignalPFChargedHadrCands");
51  embedSignalPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedSignalPFNeutralHadrCands");
52  embedSignalPFGammaCands_ = iConfig.getParameter<bool>("embedSignalPFGammaCands");
53  embedIsolationPFCands_ = iConfig.getParameter<bool>("embedIsolationPFCands");
54  embedIsolationPFChargedHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFChargedHadrCands");
55  embedIsolationPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFNeutralHadrCands");
56  embedIsolationPFGammaCands_ = iConfig.getParameter<bool>("embedIsolationPFGammaCands");
57  addGenMatch_ = iConfig.getParameter<bool>("addGenMatch");
58  if (addGenMatch_) {
59  embedGenMatch_ = iConfig.getParameter<bool>("embedGenMatch");
60  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
62  iConfig.getParameter<edm::InputTag>("genParticleMatch")));
63  } else {
65  iConfig.getParameter<std::vector<edm::InputTag>>("genParticleMatch"),
66  [this](edm::InputTag const& tag) { return consumes<edm::Association<reco::GenParticleCollection>>(tag); });
67  }
68  }
69  addGenJetMatch_ = iConfig.getParameter<bool>("addGenJetMatch");
70  if (addGenJetMatch_) {
71  embedGenJetMatch_ = iConfig.getParameter<bool>("embedGenJetMatch");
73  consumes<edm::Association<reco::GenJetCollection>>(iConfig.getParameter<edm::InputTag>("genJetMatch"));
74  }
75  addTauJetCorrFactors_ = iConfig.getParameter<bool>("addTauJetCorrFactors");
77  iConfig.getParameter<std::vector<edm::InputTag>>("tauJetCorrFactorsSource"),
78  [this](edm::InputTag const& tag) { return mayConsume<edm::ValueMap<TauJetCorrFactors>>(tag); });
79  // tau ID configurables
80  addTauID_ = iConfig.getParameter<bool>("addTauID");
81  if (addTauID_) {
82  // read the different tau ID names
83  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
84  std::vector<std::string> names = idps.getParameterNamesForType<edm::ParameterSet>();
85  std::map<std::string, IDContainerData> idContainerMap;
86  for (auto const& name : names) {
87  auto const& idp = idps.getParameter<edm::ParameterSet>(name);
88  std::string prov_cfg_label = idp.getParameter<std::string>("provenanceConfigLabel");
89  std::string prov_ID_label = idp.getParameter<std::string>("idLabel");
90  edm::InputTag tag = idp.getParameter<edm::InputTag>("inputTag");
91  if (prov_cfg_label.empty()) {
92  tauIDSrcs_.push_back(NameTag(name, tag));
93  } else {
94  if (prov_cfg_label != "rawValues" && prov_cfg_label != "workingPoints" && prov_cfg_label != "IDdefinitions" &&
95  prov_cfg_label != "IDWPdefinitions" && prov_cfg_label != "direct_rawValues" &&
96  prov_cfg_label != "direct_workingPoints")
97  throw cms::Exception("Configuration")
98  << "PATTauProducer: Parameter 'provenanceConfigLabel' does only accept 'rawValues', 'workingPoints', "
99  "'IDdefinitions', 'IDWPdefinitions', 'direct_rawValues', 'direct_workingPoints'\n";
100  std::map<std::string, IDContainerData>::iterator it;
101  it = idContainerMap.insert({tag.label() + tag.instance(), {tag, std::vector<NameWPIdx>()}}).first;
102  it->second.second.push_back(NameWPIdx(name, WPIdx(WPCfg(prov_cfg_label, prov_ID_label), -99)));
103  }
104  }
105  // but in any case at least once
106  if (tauIDSrcs_.empty() && idContainerMap.empty())
107  throw cms::Exception("Configuration") << "PATTauProducer: id addTauID is true, you must specify either:\n"
108  << "\tPSet tauIDSources = { \n"
109  << "\t\tInputTag <someName> = <someTag> // as many as you want \n "
110  << "\t}\n";
111 
112  for (auto const& mapEntry : idContainerMap) {
113  tauIDSrcContainers_.push_back(mapEntry.second.second);
114  pfTauIDContainerTokens_.push_back(mayConsume<reco::TauDiscriminatorContainer>(mapEntry.second.first));
115  }
116  }
118  tauIDSrcs_, [this](NameTag const& tag) { return mayConsume<reco::PFTauDiscriminator>(tag.second); });
119  skipMissingTauID_ = iConfig.getParameter<bool>("skipMissingTauID");
120  // IsoDeposit configurables
121  if (iConfig.exists("isoDeposits")) {
122  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
123  if (depconf.exists("tracker"))
124  isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
125  if (depconf.exists("ecal"))
126  isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
127  if (depconf.exists("hcal"))
128  isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
129  if (depconf.exists("pfAllParticles"))
130  isoDepositLabels_.push_back(
131  std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
132  if (depconf.exists("pfChargedHadron"))
133  isoDepositLabels_.push_back(
134  std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
135  if (depconf.exists("pfNeutralHadron"))
136  isoDepositLabels_.push_back(
137  std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
138  if (depconf.exists("pfGamma"))
139  isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
140 
141  if (depconf.exists("user")) {
142  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag>>("user");
143  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
144  int key = UserBaseIso;
145  for (; it != ed; ++it, ++key) {
146  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
147  }
148  }
149  }
151  edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys, edm::InputTag> const& label) {
152  return consumes<edm::ValueMap<IsoDeposit>>(label.second);
153  });
154  // Efficiency configurables
155  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
156  if (addEfficiencies_) {
158  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
159  }
160  // Resolution configurables
161  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
162  if (addResolutions_) {
164  }
165  // Check to see if the user wants to add user data
166  if (useUserData_) {
167  userDataHelper_ = PATUserDataHelper<Tau>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
168  }
169  // produces vector of taus
170  produces<std::vector<Tau>>();
171 }

References addEfficiencies_, addGenJetMatch_, addGenMatch_, addResolutions_, addTauID_, addTauJetCorrFactors_, baseTauToken_, pat::EcalIso, efficiencyLoader_, embedGenJetMatch_, embedGenMatch_, embedIsolationPFCands_, embedIsolationPFChargedHadrCands_, embedIsolationPFGammaCands_, embedIsolationPFNeutralHadrCands_, embedIsolationTracks_, embedLeadPFCand_, embedLeadPFChargedHadrCand_, embedLeadPFNeutralCand_, embedLeadTrack_, embedSignalPFCands_, embedSignalPFChargedHadrCands_, embedSignalPFGammaCands_, embedSignalPFNeutralHadrCands_, embedSignalTracks_, Exception, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), first, firstOccurence_, genJetMatchToken_, genMatchTokens_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), pat::HcalIso, isoDepositLabels_, isoDepositTokens_, crabWrapper::key, label, Skims_PA_cff::name, names, pat::PfAllParticleIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, pfTauIDContainerTokens_, pfTauIDTokens_, pfTauToken_, resolutionLoader_, skipMissingTauID_, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, tauIDSrcContainers_, tauIDSrcs_, tauJetCorrFactorsTokens_, tauTransverseImpactParameterSrc_, tauTransverseImpactParameterToken_, pat::TrackIso, pat::UserBaseIso, userDataHelper_, useUserData_, and edm::vector_transform().

◆ ~PATTauProducer()

PATTauProducer::~PATTauProducer ( )
override

Definition at line 173 of file PATTauProducer.cc.

173 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 731 of file PATTauProducer.cc.

731  {
733  iDesc.setComment("PAT tau producer module");
734 
735  // input source
736  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
737 
738  // embedding
739  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
740  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
741  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
742 
743  // MC matching configurables
744  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
745  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
746  std::vector<edm::InputTag> emptySourceVector;
747  iDesc
748  .addNode(edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
749  edm::ParameterDescription<std::vector<edm::InputTag>>("genParticleMatch", emptySourceVector, true))
750  ->setComment("input with MC match information");
751 
752  // MC jet matching variables
753  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
754  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
755  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
756 
758 
759  // tau ID configurables
760  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
761  edm::ParameterSetDescription tauIDSourcesPSet;
762  tauIDSourcesPSet.setAllowAnything();
763  iDesc
765  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true))
766  ->setComment("input with tau ID variables");
767  // (Dis)allow to skip missing tauId sources
768  iDesc.add<bool>("skipMissingTauID", false)
769  ->setComment("allow to skip a tau ID variable when not present in the event");
770 
771  // IsoDeposit configurables
772  edm::ParameterSetDescription isoDepositsPSet;
773  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
774  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
775  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
776  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
777  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
778  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
779  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
780  isoDepositsPSet.addOptional<std::vector<edm::InputTag>>("user");
781  iDesc.addOptional("isoDeposits", isoDepositsPSet);
782 
783  // Efficiency configurables
784  edm::ParameterSetDescription efficienciesPSet;
785  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
786  iDesc.add("efficiencies", efficienciesPSet);
787  iDesc.add<bool>("addEfficiencies", false);
788 
789  // Check to see if the user wants to add user data
790  edm::ParameterSetDescription userDataPSet;
792  iDesc.addOptional("userData", userDataPSet);
793 
794  edm::ParameterSetDescription isolationPSet;
795  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
796  iDesc.add("userIsolation", isolationPSet);
797 }

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addOptional(), pat::helper::KinResolutionsLoader::fillDescription(), pat::PATUserDataHelper< ObjectType >::fillDescription(), HLT_FULL_cff::InputTag, edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

◆ getTauIdDiscriminator()

template<typename TauCollectionType , typename TauDiscrType >
float PATTauProducer::getTauIdDiscriminator ( const edm::Handle< TauCollectionType > &  tauCollection,
size_t  tauIdx,
const edm::Handle< TauDiscrType > &  tauIdDiscr 
)
private

Definition at line 705 of file PATTauProducer.cc.

707  {
709  return (*tauIdDiscr)[tauRef];
710 }

References RecoTauValidationMiniAOD_cfi::tauCollection.

Referenced by produce().

◆ getTauIdDiscriminatorFromContainer()

float PATTauProducer::getTauIdDiscriminatorFromContainer ( const edm::Handle< reco::PFTauCollection > &  tauCollection,
size_t  tauIdx,
const edm::Handle< reco::TauDiscriminatorContainer > &  tauIdDiscr,
int  wpIdx 
)
private

Definition at line 711 of file PATTauProducer.cc.

714  {
716  if (wpIdx < 0) {
717  //Only 0th component filled with default value if prediscriminor in RecoTauDiscriminator failed.
718  if ((*tauIdDiscr)[tauRef].rawValues.size() == 1)
719  return (*tauIdDiscr)[tauRef].rawValues.at(0);
720  //uses negative indices to access rawValues. In most cases only one rawValue at wpIdx=-1 exists.
721  return (*tauIdDiscr)[tauRef].rawValues.at(-1 - wpIdx);
722  } else {
723  //WP vector not filled if prediscriminor in RecoTauDiscriminator failed. Set PAT output to false in this case
724  if ((*tauIdDiscr)[tauRef].workingPoints.empty())
725  return 0.0;
726  return (*tauIdDiscr)[tauRef].workingPoints.at(wpIdx);
727  }
728 }

References PDWG_TauSkim_cff::rawValues, RecoTauValidationMiniAOD_cfi::tauCollection, and PDWG_TauSkim_cff::workingPoints.

Referenced by produce().

◆ produce()

void PATTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 175 of file PATTauProducer.cc.

175  {
176  // switch off embedding (in unschedules mode)
177  if (iEvent.isRealData()) {
178  addGenMatch_ = false;
179  embedGenMatch_ = false;
180  addGenJetMatch_ = false;
181  }
182 
183  // Get the collection of taus from the event
185  try {
186  iEvent.getByToken(baseTauToken_, anyTaus);
187  } catch (const edm::Exception& e) {
188  edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. "
189  "Instead, an empty tau collection is being be produced.";
190  auto patTaus = std::make_unique<std::vector<Tau>>();
191  iEvent.put(std::move(patTaus));
192  return;
193  }
194 
196 
197  if (isolator_.enabled())
198  isolator_.beginEvent(iEvent, iSetup);
199 
204 
205  std::vector<edm::Handle<edm::ValueMap<IsoDeposit>>> deposits(isoDepositTokens_.size());
206  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
207  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
208  }
209 
210  // prepare the MC matching
211  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(genMatchTokens_.size());
212  if (addGenMatch_) {
213  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
214  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
215  }
216  }
217 
219  if (addGenJetMatch_)
220  iEvent.getByToken(genJetMatchToken_, genJetMatch);
221 
222  // read in the jet correction factors ValueMap
223  std::vector<edm::ValueMap<TauJetCorrFactors>> tauJetCorrs;
224  if (addTauJetCorrFactors_) {
225  for (size_t i = 0; i < tauJetCorrFactorsTokens_.size(); ++i) {
227  iEvent.getByToken(tauJetCorrFactorsTokens_[i], tauJetCorr);
228  tauJetCorrs.push_back(*tauJetCorr);
229  }
230  }
231 
232  auto patTaus = std::make_unique<std::vector<Tau>>();
233 
234  bool first = true; // this is introduced to issue warnings only for the first tau-jet
235  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
236  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
237  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
238 
239  Tau aTau(tausRef);
240  if (embedLeadTrack_)
241  aTau.embedLeadTrack();
242  if (embedSignalTracks_)
243  aTau.embedSignalTracks();
245  aTau.embedIsolationTracks();
246  if (embedLeadPFCand_) {
247  if (aTau.isPFTau())
248  aTau.embedLeadPFCand();
249  else
250  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
251  "from a reco::PFTau is impossible.\n";
252  }
254  if (aTau.isPFTau())
255  aTau.embedLeadPFChargedHadrCand();
256  else
257  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
258  "from a reco::PFTau is impossible.\n";
259  }
261  if (aTau.isPFTau())
262  aTau.embedLeadPFNeutralCand();
263  else
264  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
265  "from a reco::PFTau is impossible.\n";
266  }
267  if (embedSignalPFCands_) {
268  if (aTau.isPFTau())
269  aTau.embedSignalPFCands();
270  else
271  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
272  "from a reco::PFTau is impossible.\n";
273  }
275  if (aTau.isPFTau())
276  aTau.embedSignalPFChargedHadrCands();
277  else
278  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
279  "from a reco::PFTau is impossible.\n";
280  }
282  if (aTau.isPFTau())
283  aTau.embedSignalPFNeutralHadrCands();
284  else
285  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
286  "from a reco::PFTau is impossible.\n";
287  }
289  if (aTau.isPFTau())
290  aTau.embedSignalPFGammaCands();
291  else
292  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
293  "from a reco::PFTau is impossible.\n";
294  }
296  if (aTau.isPFTau())
297  aTau.embedIsolationPFCands();
298  else
299  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
300  "from a reco::PFTau is impossible.\n";
301  }
303  if (aTau.isPFTau())
304  aTau.embedIsolationPFChargedHadrCands();
305  else
306  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
307  "from a reco::PFTau is impossible.\n";
308  }
310  if (aTau.isPFTau())
311  aTau.embedIsolationPFNeutralHadrCands();
312  else
313  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
314  "from a reco::PFTau is impossible.\n";
315  }
317  if (aTau.isPFTau())
318  aTau.embedIsolationPFGammaCands();
319  else
320  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
321  "from a reco::PFTau is impossible.\n";
322  }
323 
324  if (addTauJetCorrFactors_) {
325  // add additional JetCorrs to the jet
326  for (unsigned int i = 0; i < tauJetCorrs.size(); ++i) {
327  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
328  // uncomment for debugging
329  // tauJetCorr.print();
330  aTau.addJECFactors(tauJetCorr);
331  }
332  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
333  if (std::find(levels.begin(), levels.end(), "L2L3Residual") != levels.end()) {
334  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
335  } else if (std::find(levels.begin(), levels.end(), "L3Absolute") != levels.end()) {
336  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
337  } else {
338  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
339  if (first) {
340  edm::LogWarning("L3Absolute not found")
341  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
342  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
343  << " uncorrected.";
344  first = false;
345  }
346  }
347  }
348 
349  // store the match to the generated final state muons
350  if (addGenMatch_) {
351  for (size_t i = 0, n = genMatches.size(); i < n; ++i) {
352  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
353  aTau.addGenParticleRef(genTau);
354  }
355  if (embedGenMatch_)
356  aTau.embedGenParticle();
357  }
358 
359  // store the match to the visible part of the generated tau
360  if (addGenJetMatch_) {
361  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
362  if (genJetTau.isNonnull() && genJetTau.isAvailable()) {
363  aTau.setGenJet(genJetTau);
364  } // leave empty if no match found
365  }
366 
367  // prepare ID extraction
368  if (addTauID_) {
369  size_t numberPlainTauIds = tauIDSrcs_.size();
370  size_t numberTauIds = numberPlainTauIds;
371  for (auto const& it : tauIDSrcContainers_) {
372  numberTauIds += it.size();
373  }
374  // if ID containers exist, product incices need to be retrieved from provenanceConfigLabel.
375  // This is done if config history changes, in particular for the first event.
376  if (numberPlainTauIds != numberTauIds && phID_ != iEvent.processHistoryID()) {
377  phID_ = iEvent.processHistoryID();
378  for (size_t idx = 0; idx < tauIDSrcContainers_.size(); ++idx) {
379  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[idx]);
380  if (!pfTauIdDiscr.isValid())
381  continue; // missing IDs will be skipped lateron or crash there depending on skipMissingTauID_
382  const edm::Provenance* prov = pfTauIdDiscr.provenance();
383  for (NameWPIdx& idcfg : tauIDSrcContainers_[idx]) {
384  std::string prov_cfg_label = idcfg.second.first.first;
385  std::string prov_ID_label = idcfg.second.first.second;
386  bool found = false;
387  if (prov_cfg_label == "rawValues" || prov_cfg_label == "workingPoints") {
388  const std::vector<std::string> psetsFromProvenance =
389  edm::parameterSet(prov->stable(), iEvent.processHistory())
390  .getParameter<std::vector<std::string>>(prov_cfg_label);
391  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
392  if (psetsFromProvenance[i] == prov_ID_label) {
393  // using negative indices for raw values
394  if (prov_cfg_label == "rawValues")
395  idcfg.second.second = -1 - i;
396  else
397  idcfg.second.second = i;
398  found = true;
399  }
400  }
401  } else if (prov_cfg_label == "IDdefinitions" || prov_cfg_label == "IDWPdefinitions") {
402  const std::vector<edm::ParameterSet> psetsFromProvenance =
403  edm::parameterSet(prov->stable(), iEvent.processHistory())
404  .getParameter<std::vector<edm::ParameterSet>>(prov_cfg_label);
405  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
406  if (psetsFromProvenance[i].getParameter<std::string>("IDname") == prov_ID_label) {
407  // using negative indices for raw values
408  if (prov_cfg_label == "IDdefinitions")
409  idcfg.second.second = -1 - i;
410  else
411  idcfg.second.second = i;
412  found = true;
413  }
414  }
415  } else {
416  // checked prov_cfg_label before, so it must be a direct access via indices
417  try {
418  int i = std::stoi(prov_ID_label);
419  if (prov_cfg_label == "direct_rawValues")
420  idcfg.second.second = -1 - i;
421  else
422  idcfg.second.second = i;
423  found = true;
424  } catch (std::invalid_argument const& e) {
425  throw cms::Exception("Configuration") << "PATTauProducer: Direct access to ID container requested, so "
426  "argument of 'idLabel' must be convertable to int!\n";
427  }
428  }
429  if (!found) {
430  throw cms::Exception("Configuration") << "PATTauProducer: Requested working point '" << prov_ID_label
431  << "' for ID '" << idcfg.first << "' not found!\n";
432  }
433  }
434  }
435  }
436  std::string missingDiscriminators;
437  std::vector<pat::Tau::IdPair> ids(numberTauIds);
438  auto const& tausDeref = *tausRef;
439  if (typeid(tausDeref) == typeid(reco::PFTau)) {
440  edm::Handle<reco::PFTauCollection> pfTauCollection;
441  iEvent.getByToken(pfTauToken_, pfTauCollection);
442  for (size_t i = 0; i < numberPlainTauIds; ++i) {
443  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
444 
445  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDTokens_[i]);
446 
447  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
448  if (!missingDiscriminators.empty()) {
449  missingDiscriminators += ", ";
450  }
451  missingDiscriminators += tauIDSrcs_[i].first;
452  continue;
453  }
454  ids[i].first = tauIDSrcs_[i].first;
455  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
456  }
457  for (size_t i = 0; i < tauIDSrcContainers_.size(); ++i) {
458  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[i]);
459  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
460  for (auto const& it : tauIDSrcContainers_[i]) {
461  if (!missingDiscriminators.empty()) {
462  missingDiscriminators += ", ";
463  }
464  missingDiscriminators += it.first;
465  }
466  continue;
467  }
468  for (size_t j = 0; j < tauIDSrcContainers_[i].size(); ++j) {
469  ids[numberPlainTauIds + j].first = tauIDSrcContainers_[i][j].first;
470  ids[numberPlainTauIds + j].second = getTauIdDiscriminatorFromContainer(
471  pfTauCollection, idx, pfTauIdDiscr, tauIDSrcContainers_[i][j].second.second);
472  }
473  numberPlainTauIds += tauIDSrcContainers_[i].size();
474  }
475  } else {
476  throw cms::Exception("Type Mismatch")
477  << "PATTauProducer: unsupported datatype '" << typeid(tausDeref).name() << "' for tauSource\n";
478  }
479  if (!missingDiscriminators.empty() && firstOccurence_) {
480  edm::LogWarning("DataSource") << "The following tau discriminators have not been found in the event:\n"
481  << missingDiscriminators << "\n"
482  << "They will not be embedded into the pat::Tau object.\n"
483  << "Note: this message will be printed only at first occurence.";
484  firstOccurence_ = false;
485  }
486  aTau.setTauIDs(ids);
487  }
488 
489  // extraction of reconstructed tau decay mode
490  // (only available for PFTaus)
491  if (aTau.isPFTau()) {
493  iEvent.getByToken(pfTauToken_, pfTaus);
494  reco::PFTauRef pfTauRef(pfTaus, idx);
495 
496  aTau.setDecayMode(pfTauRef->decayMode());
497  }
498 
499  // extraction of variables needed to rerun MVA isolation and anti-electron discriminator on MiniAOD
500  if (!aTau.pfEssential_.empty()) {
502  iEvent.getByToken(pfTauToken_, pfTaus);
503  reco::PFTauRef pfTauRef(pfTaus, idx);
504  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
505  float ecalEnergy = 0;
506  float hcalEnergy = 0;
507  float sumPhiTimesEnergy = 0.;
508  float sumEtaTimesEnergy = 0.;
509  float sumEnergy = 0.;
510  float leadChargedCandPt = -99;
511  float leadChargedCandEtaAtEcalEntrance = -99;
512  const std::vector<reco::CandidatePtr>& signalCands = pfTauRef->signalCands();
513  for (const auto& it : signalCands) {
514  const reco::PFCandidate* ipfcand = dynamic_cast<const reco::PFCandidate*>(it.get());
515  if (ipfcand != nullptr) {
516  ecalEnergy += ipfcand->ecalEnergy();
517  hcalEnergy += ipfcand->hcalEnergy();
518  sumPhiTimesEnergy += ipfcand->positionAtECALEntrance().phi() * ipfcand->energy();
519  sumEtaTimesEnergy += ipfcand->positionAtECALEntrance().eta() * ipfcand->energy();
520  sumEnergy += ipfcand->energy();
521  const reco::Track* track = nullptr;
522  if (ipfcand->trackRef().isNonnull())
523  track = ipfcand->trackRef().get();
524  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->innerTrack().isNonnull())
525  track = ipfcand->muonRef()->innerTrack().get();
526  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->globalTrack().isNonnull())
527  track = ipfcand->muonRef()->globalTrack().get();
528  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->outerTrack().isNonnull())
529  track = ipfcand->muonRef()->outerTrack().get();
530  else if (ipfcand->gsfTrackRef().isNonnull())
531  track = ipfcand->gsfTrackRef().get();
532  if (track) {
533  if (track->pt() > leadChargedCandPt) {
534  leadChargedCandEtaAtEcalEntrance = ipfcand->positionAtECALEntrance().eta();
535  leadChargedCandPt = track->pt();
536  }
537  }
538  } else {
539  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
540  // and position at ECAL entrance computed on-the-fly
541  const pat::PackedCandidate* ipatcand = dynamic_cast<const pat::PackedCandidate*>(it.get());
542  if (ipatcand != nullptr) {
543  ecalEnergy += ipatcand->caloFraction() * ipatcand->energy() * (1. - ipatcand->hcalFraction());
544  hcalEnergy += ipatcand->caloFraction() * ipatcand->energy() * ipatcand->hcalFraction();
545  double posAtECal_phi = ipatcand->phi();
546  double posAtECal_eta = ipatcand->eta();
547  bool success = false;
548  reco::Candidate::Point posAtECalEntrance = posAtECalEntranceComputer_(ipatcand, success);
549  if (success) {
550  posAtECal_phi = posAtECalEntrance.phi();
551  posAtECal_eta = posAtECalEntrance.eta();
552  }
553  sumPhiTimesEnergy += posAtECal_phi * ipatcand->energy();
554  sumEtaTimesEnergy += posAtECal_eta * ipatcand->energy();
555  sumEnergy += ipatcand->energy();
556  const reco::Track* track = ipatcand->bestTrack();
557  if (track != nullptr) {
558  if (track->pt() > leadChargedCandPt) {
559  leadChargedCandEtaAtEcalEntrance = posAtECal_eta;
560  leadChargedCandPt = track->pt();
561  }
562  }
563  }
564  }
565  }
566  aTauPFEssential.ecalEnergy_ = ecalEnergy;
567  aTauPFEssential.hcalEnergy_ = hcalEnergy;
568  aTauPFEssential.ptLeadChargedCand_ = leadChargedCandPt;
569  aTauPFEssential.etaAtEcalEntranceLeadChargedCand_ = leadChargedCandEtaAtEcalEntrance;
570  if (sumEnergy != 0.) {
571  aTauPFEssential.phiAtEcalEntrance_ = sumPhiTimesEnergy / sumEnergy;
572  aTauPFEssential.etaAtEcalEntrance_ = sumEtaTimesEnergy / sumEnergy;
573  } else {
574  aTauPFEssential.phiAtEcalEntrance_ = -99.;
575  aTauPFEssential.etaAtEcalEntrance_ = -99.;
576  }
577  float leadingTrackNormChi2 = 0;
578  float ecalEnergyLeadChargedHadrCand = -99.;
579  float hcalEnergyLeadChargedHadrCand = -99.;
580  float emFraction = -1.;
581  float myHCALenergy = 0.;
582  float myECALenergy = 0.;
583  const reco::CandidatePtr& leadingPFCharged = pfTauRef->leadChargedHadrCand();
584  if (leadingPFCharged.isNonnull()) {
585  const reco::PFCandidate* pfCandPtr = dynamic_cast<const reco::PFCandidate*>(leadingPFCharged.get());
586  if (pfCandPtr != nullptr) { // PFTau made from PFCandidates
587  ecalEnergyLeadChargedHadrCand = pfCandPtr->ecalEnergy();
588  hcalEnergyLeadChargedHadrCand = pfCandPtr->hcalEnergy();
589  reco::TrackRef trackRef = pfCandPtr->trackRef();
590  if (trackRef.isNonnull()) {
591  leadingTrackNormChi2 = trackRef->normalizedChi2();
592  for (const auto& isoPFCand : pfTauRef->isolationPFCands()) {
593  myHCALenergy += isoPFCand->hcalEnergy();
594  myECALenergy += isoPFCand->ecalEnergy();
595  }
596  for (const auto& signalPFCand : pfTauRef->signalPFCands()) {
597  myHCALenergy += signalPFCand->hcalEnergy();
598  myECALenergy += signalPFCand->ecalEnergy();
599  }
600  if (myHCALenergy + myECALenergy != 0.) {
601  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
602  }
603  }
604  } else {
605  const pat::PackedCandidate* packedCandPtr = dynamic_cast<const pat::PackedCandidate*>(leadingPFCharged.get());
606  if (packedCandPtr != nullptr) {
607  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
608  // and position at ECAL entrance computed on-the-fly
609  ecalEnergyLeadChargedHadrCand =
610  packedCandPtr->caloFraction() * packedCandPtr->energy() * (1. - packedCandPtr->hcalFraction());
611  hcalEnergyLeadChargedHadrCand =
612  packedCandPtr->caloFraction() * packedCandPtr->energy() * packedCandPtr->hcalFraction();
613  const reco::Track* track = packedCandPtr->bestTrack();
614  if (track != nullptr) {
615  leadingTrackNormChi2 = track->normalizedChi2();
616  for (const auto& isoCand : pfTauRef->isolationCands()) {
617  //can safely use static_cast as it is ensured that this PFTau is
618  //built with packedCands as its leadingCanidate
619  const pat::PackedCandidate* isoPackedCand = static_cast<const pat::PackedCandidate*>(isoCand.get());
620  myHCALenergy += isoPackedCand->caloFraction() * isoPackedCand->energy() * isoPackedCand->hcalFraction();
621  myECALenergy +=
622  isoPackedCand->caloFraction() * isoPackedCand->energy() * (1. - isoPackedCand->hcalFraction());
623  }
624  for (const auto& signalCand : pfTauRef->signalCands()) {
625  //can safely use static_cast as it is ensured that this PFTau is
626  //built with packedCands as its leadingCanidate
627  const pat::PackedCandidate* sigPackedCand = static_cast<const pat::PackedCandidate*>(signalCand.get());
628  myHCALenergy += sigPackedCand->caloFraction() * sigPackedCand->energy() * sigPackedCand->hcalFraction();
629  myECALenergy +=
630  sigPackedCand->caloFraction() * sigPackedCand->energy() * (1. - sigPackedCand->hcalFraction());
631  }
632  if (myHCALenergy + myECALenergy != 0.) {
633  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
634  }
635  }
636  }
637  }
638  }
639 
640  aTauPFEssential.emFraction_ = emFraction;
641  aTauPFEssential.leadingTrackNormChi2_ = leadingTrackNormChi2;
642  aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand;
643  aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand;
644  // extraction of tau lifetime information
645  if (!tauTransverseImpactParameterSrc_.label().empty()) {
646  edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
647  iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
648  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
649  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
650  aTauPFEssential.dxy_PCA_ = tauLifetimeInfo.dxy_PCA();
651  aTauPFEssential.dxy_ = tauLifetimeInfo.dxy();
652  aTauPFEssential.dxy_error_ = tauLifetimeInfo.dxy_error();
653  aTauPFEssential.hasSV_ = tauLifetimeInfo.hasSecondaryVertex();
654  aTauPFEssential.flightLength_ = tauLifetimeInfo.flightLength();
655  aTauPFEssential.flightLengthSig_ = tauLifetimeInfo.flightLengthSig();
656  aTauPFEssential.ip3d_ = tauLifetimeInfo.ip3d();
657  aTauPFEssential.ip3d_error_ = tauLifetimeInfo.ip3d_error();
658  }
659  }
660 
661  // Isolation
662  if (isolator_.enabled()) {
664  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
665  // better to loop backwards, so the vector is resized less times
666  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
667  ed = isolatorTmpStorage_.rend();
668  it != ed;
669  ++it) {
670  aTau.setIsolation(it->first, it->second);
671  }
672  }
673 
674  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
675  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
676  }
677 
678  if (efficiencyLoader_.enabled()) {
679  efficiencyLoader_.setEfficiencies(aTau, tausRef);
680  }
681 
682  if (resolutionLoader_.enabled()) {
684  }
685 
686  if (useUserData_) {
687  userDataHelper_.add(aTau, iEvent, iSetup);
688  }
689 
690  patTaus->push_back(aTau);
691  }
692 
693  // sort taus in pT
694  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
695 
696  // put genEvt object in Event
697  iEvent.put(std::move(patTaus));
698 
699  // clean up
700  if (isolator_.enabled())
702 }

References pat::PATUserDataHelper< ObjectType >::add(), addGenJetMatch_, addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), pat::Tau::addJECFactors(), addTauID_, addTauJetCorrFactors_, baseTauToken_, PositionAtECalEntranceComputer::beginEvent(), pat::helper::MultiIsolator::beginEvent(), pat::PackedCandidate::bestTrack(), pat::PackedCandidate::caloFraction(), CandIsolatorFromDeposits_cfi::deposits, reco::PFTauTransverseImpactParameter::dxy(), pat::tau::TauPFEssential::dxy_, reco::PFTauTransverseImpactParameter::dxy_error(), pat::tau::TauPFEssential::dxy_error_, reco::PFTauTransverseImpactParameter::dxy_PCA(), pat::tau::TauPFEssential::dxy_PCA_, MillePedeFileConverter_cfg::e, reco::PFCandidate::ecalEnergy(), pat::tau::TauPFEssential::ecalEnergy_, pat::tau::TauPFEssential::ecalEnergyLeadChargedHadrCand_, efficiencyLoader_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Tau::embedIsolationPFCands(), embedIsolationPFCands_, pat::Tau::embedIsolationPFChargedHadrCands(), embedIsolationPFChargedHadrCands_, pat::Tau::embedIsolationPFGammaCands(), embedIsolationPFGammaCands_, pat::Tau::embedIsolationPFNeutralHadrCands(), embedIsolationPFNeutralHadrCands_, pat::Tau::embedIsolationTracks(), embedIsolationTracks_, pat::Tau::embedLeadPFCand(), embedLeadPFCand_, pat::Tau::embedLeadPFChargedHadrCand(), embedLeadPFChargedHadrCand_, pat::Tau::embedLeadPFNeutralCand(), embedLeadPFNeutralCand_, pat::Tau::embedLeadTrack(), embedLeadTrack_, pat::Tau::embedSignalPFCands(), embedSignalPFCands_, pat::Tau::embedSignalPFChargedHadrCands(), embedSignalPFChargedHadrCands_, pat::Tau::embedSignalPFGammaCands(), embedSignalPFGammaCands_, pat::Tau::embedSignalPFNeutralHadrCands(), embedSignalPFNeutralHadrCands_, pat::Tau::embedSignalTracks(), embedSignalTracks_, pat::tau::TauPFEssential::emFraction_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), reco::LeafCandidate::energy(), pat::PackedCandidate::energy(), pat::PackedCandidate::eta(), pat::tau::TauPFEssential::etaAtEcalEntrance_, pat::tau::TauPFEssential::etaAtEcalEntranceLeadChargedCand_, Exception, pat::helper::MultiIsolator::fill(), spr::find(), first, firstOccurence_, reco::PFTauTransverseImpactParameter::flightLength(), pat::tau::TauPFEssential::flightLength_, reco::PFTauTransverseImpactParameter::flightLengthSig(), pat::tau::TauPFEssential::flightLengthSig_, newFWLiteAna::found, jetProducer_cfi::genJetMatch, genJetMatchToken_, genMatchTokens_, edm::Ptr< T >::get(), edm::Ref< C, T, F >::get(), getTauIdDiscriminator(), getTauIdDiscriminatorFromContainer(), reco::PFCandidate::gsfTrackRef(), reco::PFTauTransverseImpactParameter::hasSecondaryVertex(), pat::tau::TauPFEssential::hasSV_, reco::PFCandidate::hcalEnergy(), pat::tau::TauPFEssential::hcalEnergy_, pat::tau::TauPFEssential::hcalEnergyLeadChargedHadrCand_, pat::PackedCandidate::hcalFraction(), mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, pat::Tau::initializeJEC(), reco::PFTauTransverseImpactParameter::ip3d(), pat::tau::TauPFEssential::ip3d_, reco::PFTauTransverseImpactParameter::ip3d_error(), pat::tau::TauPFEssential::ip3d_error_, edm::Ref< C, T, F >::isAvailable(), edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), isoDepositLabels_, isoDepositTokens_, isolator_, isolatorTmpStorage_, pat::Tau::isPFTau(), dqmiolumiharvest::j, edm::InputTag::label(), pat::tau::TauPFEssential::leadingTrackNormChi2_, jets_cff::levels, eostools::move(), reco::PFCandidate::muonRef(), dqmiodumpmetadata::n, Skims_PA_cff::name, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), TauSpinnerFilter_cfi::ntaus, edm::parameterSet(), hemisphereProducer_cfi::patTaus, pat::Tau::pfEssential_, pfTauIDContainerTokens_, pfTauIDTokens_, pfTauToken_, pat::PackedCandidate::phi(), pat::tau::TauPFEssential::phiAtEcalEntrance_, phID_, posAtECalEntranceComputer_, reco::PFCandidate::positionAtECALEntrance(), pat::tau::TauPFEssential::ptLeadChargedCand_, pTTauComparator_, resolutionLoader_, edm::second(), pat::Tau::setDecayMode(), pat::helper::EfficiencyLoader::setEfficiencies(), pat::Tau::setGenJet(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), pat::helper::KinResolutionsLoader::setResolutions(), pat::Tau::setTauIDs(), skipMissingTauID_, jetUpdater_cfi::sort, edm::Provenance::stable(), AlCaHLTBitMon_QueryRunRegistry::string, summarizeEdmComparisonLogfiles::success, tauIDSrcContainers_, tauIDSrcs_, tauJetCorrFactorsTokens_, tauTransverseImpactParameterSrc_, tauTransverseImpactParameterToken_, HLT_FULL_cff::track, reco::PFCandidate::trackRef(), userDataHelper_, and useUserData_.

Member Data Documentation

◆ addEfficiencies_

bool pat::PATTauProducer::addEfficiencies_
private

Definition at line 115 of file PATTauProducer.h.

Referenced by PATTauProducer().

◆ addGenJetMatch_

bool pat::PATTauProducer::addGenJetMatch_
private

Definition at line 87 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ addGenMatch_

bool pat::PATTauProducer::addGenMatch_
private

Definition at line 83 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ addResolutions_

bool pat::PATTauProducer::addResolutions_
private

Definition at line 118 of file PATTauProducer.h.

Referenced by PATTauProducer().

◆ addTauID_

bool pat::PATTauProducer::addTauID_
private

Definition at line 94 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ addTauJetCorrFactors_

bool pat::PATTauProducer::addTauJetCorrFactors_
private

Definition at line 91 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ baseTauToken_

edm::EDGetTokenT<edm::View<reco::BaseTau> > pat::PATTauProducer::baseTauToken_
private

Definition at line 64 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ efficiencyLoader_

pat::helper::EfficiencyLoader pat::PATTauProducer::efficiencyLoader_
private

Definition at line 116 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedGenJetMatch_

bool pat::PATTauProducer::embedGenJetMatch_
private

Definition at line 88 of file PATTauProducer.h.

Referenced by PATTauProducer().

◆ embedGenMatch_

bool pat::PATTauProducer::embedGenMatch_
private

Definition at line 84 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFCands_

bool pat::PATTauProducer::embedIsolationPFCands_
private

Definition at line 78 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFChargedHadrCands_

bool pat::PATTauProducer::embedIsolationPFChargedHadrCands_
private

Definition at line 79 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFGammaCands_

bool pat::PATTauProducer::embedIsolationPFGammaCands_
private

Definition at line 81 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFNeutralHadrCands_

bool pat::PATTauProducer::embedIsolationPFNeutralHadrCands_
private

Definition at line 80 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationTracks_

bool pat::PATTauProducer::embedIsolationTracks_
private

Definition at line 68 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFCand_

bool pat::PATTauProducer::embedLeadPFCand_
private

Definition at line 71 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFChargedHadrCand_

bool pat::PATTauProducer::embedLeadPFChargedHadrCand_
private

Definition at line 72 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFNeutralCand_

bool pat::PATTauProducer::embedLeadPFNeutralCand_
private

Definition at line 73 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedLeadTrack_

bool pat::PATTauProducer::embedLeadTrack_
private

Definition at line 69 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFCands_

bool pat::PATTauProducer::embedSignalPFCands_
private

Definition at line 74 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFChargedHadrCands_

bool pat::PATTauProducer::embedSignalPFChargedHadrCands_
private

Definition at line 75 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFGammaCands_

bool pat::PATTauProducer::embedSignalPFGammaCands_
private

Definition at line 77 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFNeutralHadrCands_

bool pat::PATTauProducer::embedSignalPFNeutralHadrCands_
private

Definition at line 76 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ embedSignalTracks_

bool pat::PATTauProducer::embedSignalTracks_
private

Definition at line 70 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ firstOccurence_

bool pat::PATTauProducer::firstOccurence_
private

Definition at line 61 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ genJetMatchToken_

edm::EDGetTokenT<edm::Association<reco::GenJetCollection> > pat::PATTauProducer::genJetMatchToken_
private

Definition at line 89 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ genMatchTokens_

std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection> > > pat::PATTauProducer::genMatchTokens_
private

Definition at line 85 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ isoDepositLabels_

std::vector<std::pair<pat::IsolationKeys, edm::InputTag> > pat::PATTauProducer::isoDepositLabels_
private

Definition at line 112 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ isoDepositTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<IsoDeposit> > > pat::PATTauProducer::isoDepositTokens_
private

Definition at line 113 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ isolator_

pat::helper::MultiIsolator pat::PATTauProducer::isolator_
private

Definition at line 110 of file PATTauProducer.h.

Referenced by produce().

◆ isolatorTmpStorage_

pat::helper::MultiIsolator::IsolationValuePairs pat::PATTauProducer::isolatorTmpStorage_
private

Definition at line 111 of file PATTauProducer.h.

Referenced by produce().

◆ pfTauIDContainerTokens_

std::vector<edm::EDGetTokenT<reco::TauDiscriminatorContainer> > pat::PATTauProducer::pfTauIDContainerTokens_
private

Definition at line 104 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ pfTauIDTokens_

std::vector<edm::EDGetTokenT<reco::PFTauDiscriminator> > pat::PATTauProducer::pfTauIDTokens_
private

Definition at line 103 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ pfTauToken_

edm::EDGetTokenT<reco::PFTauCollection> pat::PATTauProducer::pfTauToken_
private

Definition at line 66 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ phID_

edm::ProcessHistoryID pat::PATTauProducer::phID_
private

Definition at line 106 of file PATTauProducer.h.

Referenced by produce().

◆ posAtECalEntranceComputer_

PositionAtECalEntranceComputer pat::PATTauProducer::posAtECalEntranceComputer_
private

Definition at line 131 of file PATTauProducer.h.

Referenced by produce().

◆ pTTauComparator_

GreaterByPt<Tau> pat::PATTauProducer::pTTauComparator_
private

Definition at line 108 of file PATTauProducer.h.

Referenced by produce().

◆ resolutionLoader_

pat::helper::KinResolutionsLoader pat::PATTauProducer::resolutionLoader_
private

Definition at line 119 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ skipMissingTauID_

bool pat::PATTauProducer::skipMissingTauID_
private

Definition at line 105 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ tauIDSrcContainers_

std::vector<std::vector<NameWPIdx> > pat::PATTauProducer::tauIDSrcContainers_
private

Definition at line 102 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ tauIDSrcs_

std::vector<NameTag> pat::PATTauProducer::tauIDSrcs_
private

Definition at line 101 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ tauJetCorrFactorsTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<TauJetCorrFactors> > > pat::PATTauProducer::tauJetCorrFactorsTokens_
private

Definition at line 92 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ tauTransverseImpactParameterSrc_

edm::InputTag pat::PATTauProducer::tauTransverseImpactParameterSrc_
private

Definition at line 67 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ tauTransverseImpactParameterToken_

edm::EDGetTokenT<PFTauTIPAssociationByRef> pat::PATTauProducer::tauTransverseImpactParameterToken_
private

Definition at line 65 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ userDataHelper_

pat::PATUserDataHelper<pat::Tau> pat::PATTauProducer::userDataHelper_
private

Definition at line 122 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

◆ useUserData_

bool pat::PATTauProducer::useUserData_
private

Definition at line 121 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
pat::PATTauProducer::firstOccurence_
bool firstOccurence_
Definition: PATTauProducer.h:61
hemisphereProducer_cfi.patTaus
patTaus
Definition: hemisphereProducer_cfi.py:8
pat::tau::TauPFEssential::hasSV_
bool hasSV_
Definition: TauPFEssential.h:46
pat::PATTauProducer::pfTauToken_
edm::EDGetTokenT< reco::PFTauCollection > pfTauToken_
Definition: PATTauProducer.h:66
PDWG_TauSkim_cff.rawValues
rawValues
Definition: PDWG_TauSkim_cff.py:13
pat::PATUserDataHelper
Assists in assimilating all pat::UserData into pat objects.
Definition: PATUserDataHelper.h:49
mps_fire.i
i
Definition: mps_fire.py:428
pat::EcalIso
Definition: Isolation.h:11
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
reco::PFTauTransverseImpactParameter::dxy_error
double dxy_error() const
Definition: PFTauTransverseImpactParameter.h:52
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
pat::PATTauProducer::addGenJetMatch_
bool addGenJetMatch_
Definition: PATTauProducer.h:87
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
pat::tau::TauPFEssential::dxy_error_
float dxy_error_
Definition: TauPFEssential.h:41
pat::tau::TauPFEssential::flightLengthSig_
float flightLengthSig_
Definition: TauPFEssential.h:48
pat::PATTauProducer::tauIDSrcContainers_
std::vector< std::vector< NameWPIdx > > tauIDSrcContainers_
Definition: PATTauProducer.h:102
pat::tau::TauPFEssential::etaAtEcalEntranceLeadChargedCand_
float etaAtEcalEntranceLeadChargedCand_
Definition: TauPFEssential.h:61
pat::helper::EfficiencyLoader
Definition: EfficiencyLoader.h:16
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
pat::PATTauProducer::WPIdx
std::pair< WPCfg, int > WPIdx
Definition: PATTauProducer.h:97
pat::helper::MultiIsolator::fill
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:84
pat::PATTauProducer::embedIsolationPFNeutralHadrCands_
bool embedIsolationPFNeutralHadrCands_
Definition: PATTauProducer.h:80
pat::PATTauProducer::embedSignalTracks_
bool embedSignalTracks_
Definition: PATTauProducer.h:70
pat::PATUserDataHelper::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Definition: PATUserDataHelper.h:135
pat::PackedCandidate::caloFraction
float caloFraction() const
Set the fraction of ECAL+HCAL energy over candidate energy.
Definition: PackedCandidate.h:929
pat::tau::TauPFEssential::ptLeadChargedCand_
float ptLeadChargedCand_
Definition: TauPFEssential.h:62
pat::PATTauProducer::embedIsolationTracks_
bool embedIsolationTracks_
Definition: PATTauProducer.h:68
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
pat::PATTauProducer::embedGenMatch_
bool embedGenMatch_
Definition: PATTauProducer.h:84
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::PFCandidate::positionAtECALEntrance
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFCandidate.h:363
pat::tau::TauPFEssential::flightLength_
Vector flightLength_
Definition: TauPFEssential.h:47
pat::helper::EfficiencyLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: EfficiencyLoader.h:25
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
pat::PfAllParticleIso
Definition: Isolation.h:13
reco::PFTau
Definition: PFTau.h:36
pat::PATTauProducer::embedLeadPFCand_
bool embedLeadPFCand_
Definition: PATTauProducer.h:71
pat::PATTauProducer::embedIsolationPFGammaCands_
bool embedIsolationPFGammaCands_
Definition: PATTauProducer.h:81
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
pat::PATTauProducer::embedLeadPFChargedHadrCand_
bool embedLeadPFChargedHadrCand_
Definition: PATTauProducer.h:72
pat::PATTauProducer::isolator_
pat::helper::MultiIsolator isolator_
Definition: PATTauProducer.h:110
pat::tau::TauPFEssential::ip3d_
float ip3d_
Definition: TauPFEssential.h:52
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
Tau
Definition: Tau.py:1
pat::PATTauProducer::pfTauIDContainerTokens_
std::vector< edm::EDGetTokenT< reco::TauDiscriminatorContainer > > pfTauIDContainerTokens_
Definition: PATTauProducer.h:104
pat::PATTauProducer::addGenMatch_
bool addGenMatch_
Definition: PATTauProducer.h:83
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
pat::helper::MultiIsolator::IsolationValuePairs
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:17
pat::helper::KinResolutionsLoader::enabled
bool enabled() const
'true' if this there is at least one efficiency configured
Definition: KinResolutionsLoader.h:27
pat::PATTauProducer::phID_
edm::ProcessHistoryID phID_
Definition: PATTauProducer.h:106
pat::helper::MultiIsolator::enabled
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:55
edm::Ref
Definition: AssociativeIterator.h:58
RecoTauValidationMiniAOD_cfi.tauCollection
tauCollection
Definition: RecoTauValidationMiniAOD_cfi.py:5
pat::PATTauProducer::addResolutions_
bool addResolutions_
Definition: PATTauProducer.h:118
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::Exception
Definition: EDMException.h:77
pat::helper::MultiIsolator::endEvent
void endEvent()
Definition: MultiIsolator.cc:85
pat::PATTauProducer::embedSignalPFGammaCands_
bool embedSignalPFGammaCands_
Definition: PATTauProducer.h:77
reco::PFTauTransverseImpactParameter::dxy
double dxy() const
Definition: PFTauTransverseImpactParameter.h:51
PositionAtECalEntranceComputer::beginEvent
void beginEvent(const edm::EventSetup &)
Definition: PositionAtECalEntranceComputer.cc:25
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
pat::PATTauProducer::posAtECalEntranceComputer_
PositionAtECalEntranceComputer posAtECalEntranceComputer_
Definition: PATTauProducer.h:131
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
pat::tau::TauPFEssential::dxy_
float dxy_
Definition: TauPFEssential.h:40
pat::PATTauProducer::genMatchTokens_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
Definition: PATTauProducer.h:85
reco::PFCandidate::muonRef
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:421
pat::PackedCandidate::energy
double energy() const override
energy
Definition: PackedCandidate.h:469
pat::PATTauProducer::NameTag
std::pair< std::string, edm::InputTag > NameTag
Definition: PATTauProducer.h:95
pat::PATTauProducer::embedLeadTrack_
bool embedLeadTrack_
Definition: PATTauProducer.h:69
pat::PackedCandidate::bestTrack
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
Definition: PackedCandidate.h:780
pat::PATTauProducer::isoDepositLabels_
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
Definition: PATTauProducer.h:112
reco::PFTauTransverseImpactParameter::flightLengthSig
double flightLengthSig() const
Definition: PFTauTransverseImpactParameter.cc:71
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
pat::PfChargedHadronIso
Definition: Isolation.h:14
pat::PATUserDataHelper::add
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
Definition: PATUserDataHelper.h:114
pat::PATTauProducer::isolatorTmpStorage_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
Definition: PATTauProducer.h:111
pat::helper::EfficiencyLoader::newEvent
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
Definition: EfficiencyLoader.cc:21
pat::tau::TauPFEssential::ip3d_error_
float ip3d_error_
Definition: TauPFEssential.h:53
pat::PATTauProducer::NameWPIdx
std::pair< std::string, WPIdx > NameWPIdx
Definition: PATTauProducer.h:98
reco::Track
Definition: Track.h:27
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
TauSpinnerFilter_cfi.ntaus
ntaus
Definition: TauSpinnerFilter_cfi.py:5
pat::PATTauProducer::tauIDSrcs_
std::vector< NameTag > tauIDSrcs_
Definition: PATTauProducer.h:101
pat::PATTauProducer::genJetMatchToken_
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
Definition: PATTauProducer.h:89
pat::PATTauProducer::addTauJetCorrFactors_
bool addTauJetCorrFactors_
Definition: PATTauProducer.h:91
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
pat::tau::TauPFEssential::hcalEnergy_
float hcalEnergy_
Definition: TauPFEssential.h:55
reco::PFTauTransverseImpactParameter
Definition: PFTauTransverseImpactParameter.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
reco::PFTauTransverseImpactParameter::hasSecondaryVertex
bool hasSecondaryVertex() const
Definition: PFTauTransverseImpactParameter.h:61
pat::helper::KinResolutionsLoader::setResolutions
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: KinResolutionsLoader.h:49
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
pat::PATTauProducer::WPCfg
std::pair< std::string, std::string > WPCfg
Definition: PATTauProducer.h:96
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ParameterSetDescription::setComment
void setComment(std::string const &value)
Definition: ParameterSetDescription.cc:33
reco::PFCandidate::gsfTrackRef
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
pat::tau::TauPFEssential
Definition: TauPFEssential.h:22
pat::PATTauProducer::embedSignalPFChargedHadrCands_
bool embedSignalPFChargedHadrCands_
Definition: PATTauProducer.h:75
jetProducer_cfi.genJetMatch
genJetMatch
switch on/off embedding of matched genJet's
Definition: jetProducer_cfi.py:85
PDWG_TauSkim_cff.workingPoints
workingPoints
Definition: PDWG_TauSkim_cff.py:15
pat::PATTauProducer::efficiencyLoader_
pat::helper::EfficiencyLoader efficiencyLoader_
Definition: PATTauProducer.h:116
pat::PfGammaIso
Definition: Isolation.h:16
pat::helper::KinResolutionsLoader::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
Definition: KinResolutionsLoader.cc:34
pat::PATTauProducer::pfTauIDTokens_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
Definition: PATTauProducer.h:103
pat::PackedCandidate
Definition: PackedCandidate.h:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::tau::TauPFEssential::emFraction_
float emFraction_
Definition: TauPFEssential.h:63
pat::UserBaseIso
Definition: Isolation.h:22
pat::PATTauProducer::baseTauToken_
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
Definition: PATTauProducer.h:64
pat::PATTauProducer::skipMissingTauID_
bool skipMissingTauID_
Definition: PATTauProducer.h:105
pat::TrackIso
Definition: Isolation.h:10
pat::PackedCandidate::phi
double phi() const override
momentum azimuthal angle
Definition: PackedCandidate.h:529
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
iEvent
int iEvent
Definition: GenABIO.cc:224
pat::PATTauProducer::isoDepositTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
Definition: PATTauProducer.h:113
pat::PATTauProducer::embedSignalPFNeutralHadrCands_
bool embedSignalPFNeutralHadrCands_
Definition: PATTauProducer.h:76
pat::PATTauProducer::embedIsolationPFCands_
bool embedIsolationPFCands_
Definition: PATTauProducer.h:78
pat::HcalIso
Definition: Isolation.h:12
reco::PFTauTransverseImpactParameter::ip3d
double ip3d() const
Definition: PFTauTransverseImpactParameter.h:55
pat::PfNeutralHadronIso
Definition: Isolation.h:15
reco::PFTauTransverseImpactParameter::ip3d_error
double ip3d_error() const
Definition: PFTauTransverseImpactParameter.h:56
edm::Association
Definition: Association.h:18
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
pat::tau::TauPFEssential::leadingTrackNormChi2_
float leadingTrackNormChi2_
Definition: TauPFEssential.h:56
reco::PFTauTransverseImpactParameter::dxy_PCA
const Point & dxy_PCA() const
Definition: PFTauTransverseImpactParameter.h:50
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
pat::PATTauProducer::embedGenJetMatch_
bool embedGenJetMatch_
Definition: PATTauProducer.h:88
pat::helper::KinResolutionsLoader::newEvent
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
Definition: KinResolutionsLoader.cc:27
reco::PFCandidate::ecalEnergy
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
pat::TauJetCorrFactors
Definition: TauJetCorrFactors.h:31
edm::Ptr
Definition: AssociationVector.h:31
pat::PATTauProducer::pTTauComparator_
GreaterByPt< Tau > pTTauComparator_
Definition: PATTauProducer.h:108
pat::tau::TauPFEssential::ecalEnergyLeadChargedHadrCand_
float ecalEnergyLeadChargedHadrCand_
Definition: TauPFEssential.h:59
eostools.move
def move(src, dest)
Definition: eostools.py:511
pat::PackedCandidate::hcalFraction
float hcalFraction() const
Definition: PackedCandidate.h:934
pat::IsolationKeys
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
pat::helper::MultiIsolator::beginEvent
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
Definition: MultiIsolator.cc:79
pat::helper::EfficiencyLoader::setEfficiencies
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
Definition: EfficiencyLoader.h:41
reco::PFCandidate::hcalEnergy
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:233
pat::PATTauProducer::userDataHelper_
pat::PATUserDataHelper< pat::Tau > userDataHelper_
Definition: PATTauProducer.h:122
pat::PATTauProducer::embedIsolationPFChargedHadrCands_
bool embedIsolationPFChargedHadrCands_
Definition: PATTauProducer.h:79
edm::Provenance::stable
StableProvenance const & stable() const
Definition: Provenance.h:42
pat::PATTauProducer::addTauID_
bool addTauID_
Definition: PATTauProducer.h:94
Exception
Definition: hltDiff.cc:245
pat::PATTauProducer::embedLeadPFNeutralCand_
bool embedLeadPFNeutralCand_
Definition: PATTauProducer.h:73
pat::PATTauProducer::getTauIdDiscriminator
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
Definition: PATTauProducer.cc:705
pat::tau::TauPFEssential::etaAtEcalEntrance_
float etaAtEcalEntrance_
Definition: TauPFEssential.h:58
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
pat::PATTauProducer::getTauIdDiscriminatorFromContainer
float getTauIdDiscriminatorFromContainer(const edm::Handle< reco::PFTauCollection > &, size_t, const edm::Handle< reco::TauDiscriminatorContainer > &, int)
Definition: PATTauProducer.cc:711
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase
Definition: AssociativeIterator.h:54
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
pat::PATTauProducer::tauJetCorrFactorsTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
Definition: PATTauProducer.h:92
pat::PATTauProducer::resolutionLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
Definition: PATTauProducer.h:119
pat::PATTauProducer::tauTransverseImpactParameterToken_
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
Definition: PATTauProducer.h:65
pat::PATTauProducer::embedSignalPFCands_
bool embedSignalPFCands_
Definition: PATTauProducer.h:74
cms::Exception
Definition: Exception.h:70
pat::PATTauProducer::tauTransverseImpactParameterSrc_
edm::InputTag tauTransverseImpactParameterSrc_
Definition: PATTauProducer.h:67
pat::PATTauProducer::useUserData_
bool useUserData_
Definition: PATTauProducer.h:121
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Provenance
Definition: Provenance.h:34
crabWrapper.key
key
Definition: crabWrapper.py:19
pat::PATTauProducer::addEfficiencies_
bool addEfficiencies_
Definition: PATTauProducer.h:115
edm::ParameterDescription
Definition: ParameterDescription.h:110
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
jets_cff.levels
levels
Definition: jets_cff.py:21
pat::tau::TauPFEssential::ecalEnergy_
float ecalEnergy_
Definition: TauPFEssential.h:54
pat::tau::TauPFEssential::dxy_PCA_
Point dxy_PCA_
Definition: TauPFEssential.h:39
pat::tau::TauPFEssential::phiAtEcalEntrance_
float phiAtEcalEntrance_
Definition: TauPFEssential.h:57
pat::PackedCandidate::eta
double eta() const override
momentum pseudorapidity
Definition: PackedCandidate.h:563
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::PFTauTransverseImpactParameter::flightLength
const Vector & flightLength() const
Definition: PFTauTransverseImpactParameter.cc:67
pat::tau::TauPFEssential::hcalEnergyLeadChargedHadrCand_
float hcalEnergyLeadChargedHadrCand_
Definition: TauPFEssential.h:60