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

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
 
 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
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 56 of file PATTauProducer.cc.

Member Typedef Documentation

◆ IDContainerData

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

Definition at line 105 of file PATTauProducer.cc.

◆ NameTag

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

Definition at line 100 of file PATTauProducer.cc.

◆ NameWPIdx

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

Definition at line 103 of file PATTauProducer.cc.

◆ WPCfg

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

Definition at line 101 of file PATTauProducer.cc.

◆ WPIdx

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

Definition at line 102 of file PATTauProducer.cc.

Constructor & Destructor Documentation

◆ PATTauProducer()

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

Definition at line 143 of file PATTauProducer.cc.

144  : isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation")
145  : edm::ParameterSet(),
146  consumesCollector(),
147  false),
148  useUserData_(iConfig.exists("userData")),
149  posAtECalEntranceComputer_(consumesCollector()) {
150  firstOccurence_ = true;
151  // initialize the configurables
152  baseTauToken_ = consumes<edm::View<reco::BaseTau>>(iConfig.getParameter<edm::InputTag>("tauSource"));
153  tauTransverseImpactParameterSrc_ = iConfig.getParameter<edm::InputTag>("tauTransverseImpactParameterSource");
154  tauTransverseImpactParameterToken_ = consumes<PFTauTIPAssociationByRef>(tauTransverseImpactParameterSrc_);
155  pfTauToken_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>("tauSource"));
156  embedIsolationTracks_ = iConfig.getParameter<bool>("embedIsolationTracks");
157  embedLeadTrack_ = iConfig.getParameter<bool>("embedLeadTrack");
158  embedSignalTracks_ = iConfig.getParameter<bool>("embedSignalTracks");
159  embedLeadPFCand_ = iConfig.getParameter<bool>("embedLeadPFCand");
160  embedLeadPFChargedHadrCand_ = iConfig.getParameter<bool>("embedLeadPFChargedHadrCand");
161  embedLeadPFNeutralCand_ = iConfig.getParameter<bool>("embedLeadPFNeutralCand");
162  embedSignalPFCands_ = iConfig.getParameter<bool>("embedSignalPFCands");
163  embedSignalPFChargedHadrCands_ = iConfig.getParameter<bool>("embedSignalPFChargedHadrCands");
164  embedSignalPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedSignalPFNeutralHadrCands");
165  embedSignalPFGammaCands_ = iConfig.getParameter<bool>("embedSignalPFGammaCands");
166  embedIsolationPFCands_ = iConfig.getParameter<bool>("embedIsolationPFCands");
167  embedIsolationPFChargedHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFChargedHadrCands");
168  embedIsolationPFNeutralHadrCands_ = iConfig.getParameter<bool>("embedIsolationPFNeutralHadrCands");
169  embedIsolationPFGammaCands_ = iConfig.getParameter<bool>("embedIsolationPFGammaCands");
170  addGenMatch_ = iConfig.getParameter<bool>("addGenMatch");
171  if (addGenMatch_) {
172  embedGenMatch_ = iConfig.getParameter<bool>("embedGenMatch");
173  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
175  iConfig.getParameter<edm::InputTag>("genParticleMatch")));
176  } else {
178  iConfig.getParameter<std::vector<edm::InputTag>>("genParticleMatch"),
179  [this](edm::InputTag const& tag) { return consumes<edm::Association<reco::GenParticleCollection>>(tag); });
180  }
181  }
182  addGenJetMatch_ = iConfig.getParameter<bool>("addGenJetMatch");
183  if (addGenJetMatch_) {
184  embedGenJetMatch_ = iConfig.getParameter<bool>("embedGenJetMatch");
186  consumes<edm::Association<reco::GenJetCollection>>(iConfig.getParameter<edm::InputTag>("genJetMatch"));
187  }
188  addTauJetCorrFactors_ = iConfig.getParameter<bool>("addTauJetCorrFactors");
190  iConfig.getParameter<std::vector<edm::InputTag>>("tauJetCorrFactorsSource"),
191  [this](edm::InputTag const& tag) { return mayConsume<edm::ValueMap<TauJetCorrFactors>>(tag); });
192  // tau ID configurables
193  addTauID_ = iConfig.getParameter<bool>("addTauID");
194  if (addTauID_) {
195  // read the different tau ID names
196  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
197  std::vector<std::string> names = idps.getParameterNamesForType<edm::ParameterSet>();
198  std::map<std::string, IDContainerData> idContainerMap;
199  for (auto const& name : names) {
200  auto const& idp = idps.getParameter<edm::ParameterSet>(name);
201  std::string prov_cfg_label = idp.getParameter<std::string>("provenanceConfigLabel");
202  std::string prov_ID_label = idp.getParameter<std::string>("idLabel");
203  edm::InputTag tag = idp.getParameter<edm::InputTag>("inputTag");
204  if (prov_cfg_label.empty()) {
205  tauIDSrcs_.push_back(NameTag(name, tag));
206  } else {
207  if (prov_cfg_label != "rawValues" && prov_cfg_label != "workingPoints" && prov_cfg_label != "IDdefinitions" &&
208  prov_cfg_label != "IDWPdefinitions" && prov_cfg_label != "direct_rawValues" &&
209  prov_cfg_label != "direct_workingPoints")
210  throw cms::Exception("Configuration")
211  << "PATTauProducer: Parameter 'provenanceConfigLabel' does only accept 'rawValues', 'workingPoints', "
212  "'IDdefinitions', 'IDWPdefinitions', 'direct_rawValues', 'direct_workingPoints'\n";
213  std::map<std::string, IDContainerData>::iterator it;
214  it = idContainerMap.insert({tag.label() + tag.instance(), {tag, std::vector<NameWPIdx>()}}).first;
215  it->second.second.push_back(NameWPIdx(name, WPIdx(WPCfg(prov_cfg_label, prov_ID_label), -99)));
216  }
217  }
218  // but in any case at least once
219  if (tauIDSrcs_.empty() && idContainerMap.empty())
220  throw cms::Exception("Configuration") << "PATTauProducer: id addTauID is true, you must specify either:\n"
221  << "\tPSet tauIDSources = { \n"
222  << "\t\tInputTag <someName> = <someTag> // as many as you want \n "
223  << "\t}\n";
224 
225  for (auto const& mapEntry : idContainerMap) {
226  tauIDSrcContainers_.push_back(mapEntry.second.second);
227  pfTauIDContainerTokens_.push_back(mayConsume<reco::TauDiscriminatorContainer>(mapEntry.second.first));
228  }
229  }
231  tauIDSrcs_, [this](NameTag const& tag) { return mayConsume<reco::PFTauDiscriminator>(tag.second); });
232  skipMissingTauID_ = iConfig.getParameter<bool>("skipMissingTauID");
233  // IsoDeposit configurables
234  if (iConfig.exists("isoDeposits")) {
235  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
236  if (depconf.exists("tracker"))
237  isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
238  if (depconf.exists("ecal"))
239  isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
240  if (depconf.exists("hcal"))
241  isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
242  if (depconf.exists("pfAllParticles"))
243  isoDepositLabels_.push_back(
244  std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
245  if (depconf.exists("pfChargedHadron"))
246  isoDepositLabels_.push_back(
247  std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
248  if (depconf.exists("pfNeutralHadron"))
249  isoDepositLabels_.push_back(
250  std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
251  if (depconf.exists("pfGamma"))
252  isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
253 
254  if (depconf.exists("user")) {
255  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag>>("user");
256  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
257  int key = UserBaseIso;
258  for (; it != ed; ++it, ++key) {
259  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
260  }
261  }
262  }
264  edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys, edm::InputTag> const& label) {
265  return consumes<edm::ValueMap<IsoDeposit>>(label.second);
266  });
267  // Efficiency configurables
268  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
269  if (addEfficiencies_) {
271  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
272  }
273  // Resolution configurables
274  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
275  if (addResolutions_) {
277  }
278  // Check to see if the user wants to add user data
279  if (useUserData_) {
280  userDataHelper_ = PATUserDataHelper<Tau>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
281  }
282  // produces vector of taus
283  produces<std::vector<Tau>>();
284 }

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, makeGlobalPositionRcd_cfg::tag, tauIDSrcContainers_, tauIDSrcs_, tauJetCorrFactorsTokens_, tauTransverseImpactParameterSrc_, tauTransverseImpactParameterToken_, pat::TrackIso, pat::UserBaseIso, userDataHelper_, useUserData_, and edm::vector_transform().

◆ ~PATTauProducer()

PATTauProducer::~PATTauProducer ( )
override

Definition at line 286 of file PATTauProducer.cc.

286 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 844 of file PATTauProducer.cc.

844  {
846  iDesc.setComment("PAT tau producer module");
847 
848  // input source
849  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
850 
851  // embedding
852  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
853  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
854  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
855 
856  // MC matching configurables
857  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
858  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
859  std::vector<edm::InputTag> emptySourceVector;
860  iDesc
861  .addNode(edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
862  edm::ParameterDescription<std::vector<edm::InputTag>>("genParticleMatch", emptySourceVector, true))
863  ->setComment("input with MC match information");
864 
865  // MC jet matching variables
866  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
867  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
868  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
869 
871 
872  // tau ID configurables
873  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
874  edm::ParameterSetDescription tauIDSourcesPSet;
875  tauIDSourcesPSet.setAllowAnything();
876  iDesc
878  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true))
879  ->setComment("input with tau ID variables");
880  // (Dis)allow to skip missing tauId sources
881  iDesc.add<bool>("skipMissingTauID", false)
882  ->setComment("allow to skip a tau ID variable when not present in the event");
883 
884  // IsoDeposit configurables
885  edm::ParameterSetDescription isoDepositsPSet;
886  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
887  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
888  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
889  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
890  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
891  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
892  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
893  isoDepositsPSet.addOptional<std::vector<edm::InputTag>>("user");
894  iDesc.addOptional("isoDeposits", isoDepositsPSet);
895 
896  // Efficiency configurables
897  edm::ParameterSetDescription efficienciesPSet;
898  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
899  iDesc.add("efficiencies", efficienciesPSet);
900  iDesc.add<bool>("addEfficiencies", false);
901 
902  // Check to see if the user wants to add user data
903  edm::ParameterSetDescription userDataPSet;
905  iDesc.addOptional("userData", userDataPSet);
906 
907  edm::ParameterSetDescription isolationPSet;
908  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
909  iDesc.add("userIsolation", isolationPSet);
910 }

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 818 of file PATTauProducer.cc.

820  {
822  return (*tauIdDiscr)[tauRef];
823 }

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 824 of file PATTauProducer.cc.

827  {
829  if (wpIdx < 0) {
830  //Only 0th component filled with default value if prediscriminor in RecoTauDiscriminator failed.
831  if ((*tauIdDiscr)[tauRef].rawValues.size() == 1)
832  return (*tauIdDiscr)[tauRef].rawValues.at(0);
833  //uses negative indices to access rawValues. In most cases only one rawValue at wpIdx=-1 exists.
834  return (*tauIdDiscr)[tauRef].rawValues.at(-1 - wpIdx);
835  } else {
836  //WP vector not filled if prediscriminor in RecoTauDiscriminator failed. Set PAT output to false in this case
837  if ((*tauIdDiscr)[tauRef].workingPoints.empty())
838  return 0.0;
839  return (*tauIdDiscr)[tauRef].workingPoints.at(wpIdx);
840  }
841 }

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 288 of file PATTauProducer.cc.

288  {
289  // switch off embedding (in unschedules mode)
290  if (iEvent.isRealData()) {
291  addGenMatch_ = false;
292  embedGenMatch_ = false;
293  addGenJetMatch_ = false;
294  }
295 
296  // Get the collection of taus from the event
298  try {
299  iEvent.getByToken(baseTauToken_, anyTaus);
300  } catch (const edm::Exception& e) {
301  edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. "
302  "Instead, an empty tau collection is being be produced.";
303  auto patTaus = std::make_unique<std::vector<Tau>>();
304  iEvent.put(std::move(patTaus));
305  return;
306  }
307 
309 
310  if (isolator_.enabled())
311  isolator_.beginEvent(iEvent, iSetup);
312 
317 
318  std::vector<edm::Handle<edm::ValueMap<IsoDeposit>>> deposits(isoDepositTokens_.size());
319  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
320  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
321  }
322 
323  // prepare the MC matching
324  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(genMatchTokens_.size());
325  if (addGenMatch_) {
326  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
327  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
328  }
329  }
330 
332  if (addGenJetMatch_)
333  iEvent.getByToken(genJetMatchToken_, genJetMatch);
334 
335  // read in the jet correction factors ValueMap
336  std::vector<edm::ValueMap<TauJetCorrFactors>> tauJetCorrs;
337  if (addTauJetCorrFactors_) {
338  for (size_t i = 0; i < tauJetCorrFactorsTokens_.size(); ++i) {
340  iEvent.getByToken(tauJetCorrFactorsTokens_[i], tauJetCorr);
341  tauJetCorrs.push_back(*tauJetCorr);
342  }
343  }
344 
345  auto patTaus = std::make_unique<std::vector<Tau>>();
346 
347  bool first = true; // this is introduced to issue warnings only for the first tau-jet
348  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
349  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
350  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
351 
352  Tau aTau(tausRef);
353  if (embedLeadTrack_)
354  aTau.embedLeadTrack();
355  if (embedSignalTracks_)
356  aTau.embedSignalTracks();
358  aTau.embedIsolationTracks();
359  if (embedLeadPFCand_) {
360  if (aTau.isPFTau())
361  aTau.embedLeadPFCand();
362  else
363  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
364  "from a reco::PFTau is impossible.\n";
365  }
367  if (aTau.isPFTau())
368  aTau.embedLeadPFChargedHadrCand();
369  else
370  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
371  "from a reco::PFTau is impossible.\n";
372  }
374  if (aTau.isPFTau())
375  aTau.embedLeadPFNeutralCand();
376  else
377  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
378  "from a reco::PFTau is impossible.\n";
379  }
380  if (embedSignalPFCands_) {
381  if (aTau.isPFTau())
382  aTau.embedSignalPFCands();
383  else
384  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
385  "from a reco::PFTau is impossible.\n";
386  }
388  if (aTau.isPFTau())
389  aTau.embedSignalPFChargedHadrCands();
390  else
391  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
392  "from a reco::PFTau is impossible.\n";
393  }
395  if (aTau.isPFTau())
396  aTau.embedSignalPFNeutralHadrCands();
397  else
398  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
399  "from a reco::PFTau is impossible.\n";
400  }
402  if (aTau.isPFTau())
403  aTau.embedSignalPFGammaCands();
404  else
405  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
406  "from a reco::PFTau is impossible.\n";
407  }
409  if (aTau.isPFTau())
410  aTau.embedIsolationPFCands();
411  else
412  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
413  "from a reco::PFTau is impossible.\n";
414  }
416  if (aTau.isPFTau())
417  aTau.embedIsolationPFChargedHadrCands();
418  else
419  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
420  "from a reco::PFTau is impossible.\n";
421  }
423  if (aTau.isPFTau())
424  aTau.embedIsolationPFNeutralHadrCands();
425  else
426  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
427  "from a reco::PFTau is impossible.\n";
428  }
430  if (aTau.isPFTau())
431  aTau.embedIsolationPFGammaCands();
432  else
433  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made "
434  "from a reco::PFTau is impossible.\n";
435  }
436 
437  if (addTauJetCorrFactors_) {
438  // add additional JetCorrs to the jet
439  for (unsigned int i = 0; i < tauJetCorrs.size(); ++i) {
440  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
441  // uncomment for debugging
442  // tauJetCorr.print();
443  aTau.addJECFactors(tauJetCorr);
444  }
445  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
446  if (std::find(levels.begin(), levels.end(), "L2L3Residual") != levels.end()) {
447  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
448  } else if (std::find(levels.begin(), levels.end(), "L3Absolute") != levels.end()) {
449  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
450  } else {
451  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
452  if (first) {
453  edm::LogWarning("L3Absolute not found")
454  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
455  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
456  << " uncorrected.";
457  first = false;
458  }
459  }
460  }
461 
462  // store the match to the generated final state muons
463  if (addGenMatch_) {
464  for (size_t i = 0, n = genMatches.size(); i < n; ++i) {
465  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
466  aTau.addGenParticleRef(genTau);
467  }
468  if (embedGenMatch_)
469  aTau.embedGenParticle();
470  }
471 
472  // store the match to the visible part of the generated tau
473  if (addGenJetMatch_) {
474  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
475  if (genJetTau.isNonnull() && genJetTau.isAvailable()) {
476  aTau.setGenJet(genJetTau);
477  } // leave empty if no match found
478  }
479 
480  // prepare ID extraction
481  if (addTauID_) {
482  size_t numberPlainTauIds = tauIDSrcs_.size();
483  size_t numberTauIds = numberPlainTauIds;
484  for (auto const& it : tauIDSrcContainers_) {
485  numberTauIds += it.size();
486  }
487  // if ID containers exist, product incices need to be retrieved from provenanceConfigLabel.
488  // This is done if config history changes, in particular for the first event.
489  if (numberPlainTauIds != numberTauIds && phID_ != iEvent.processHistoryID()) {
490  phID_ = iEvent.processHistoryID();
491  for (size_t idx = 0; idx < tauIDSrcContainers_.size(); ++idx) {
492  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[idx]);
493  if (!pfTauIdDiscr.isValid())
494  continue; // missing IDs will be skipped lateron or crash there depending on skipMissingTauID_
495  const edm::Provenance* prov = pfTauIdDiscr.provenance();
496  for (NameWPIdx& idcfg : tauIDSrcContainers_[idx]) {
497  std::string prov_cfg_label = idcfg.second.first.first;
498  std::string prov_ID_label = idcfg.second.first.second;
499  bool found = false;
500  if (prov_cfg_label == "rawValues" || prov_cfg_label == "workingPoints") {
501  const std::vector<std::string> psetsFromProvenance =
502  edm::parameterSet(prov->stable(), iEvent.processHistory())
503  .getParameter<std::vector<std::string>>(prov_cfg_label);
504  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
505  if (psetsFromProvenance[i] == prov_ID_label) {
506  // using negative indices for raw values
507  if (prov_cfg_label == "rawValues")
508  idcfg.second.second = -1 - i;
509  else
510  idcfg.second.second = i;
511  found = true;
512  }
513  }
514  } else if (prov_cfg_label == "IDdefinitions" || prov_cfg_label == "IDWPdefinitions") {
515  const std::vector<edm::ParameterSet> psetsFromProvenance =
516  edm::parameterSet(prov->stable(), iEvent.processHistory())
517  .getParameter<std::vector<edm::ParameterSet>>(prov_cfg_label);
518  for (size_t i = 0; i < psetsFromProvenance.size(); ++i) {
519  if (psetsFromProvenance[i].getParameter<std::string>("IDname") == prov_ID_label) {
520  // using negative indices for raw values
521  if (prov_cfg_label == "IDdefinitions")
522  idcfg.second.second = -1 - i;
523  else
524  idcfg.second.second = i;
525  found = true;
526  }
527  }
528  } else {
529  // checked prov_cfg_label before, so it must be a direct access via indices
530  try {
531  int i = std::stoi(prov_ID_label);
532  if (prov_cfg_label == "direct_rawValues")
533  idcfg.second.second = -1 - i;
534  else
535  idcfg.second.second = i;
536  found = true;
537  } catch (std::invalid_argument const& e) {
538  throw cms::Exception("Configuration") << "PATTauProducer: Direct access to ID container requested, so "
539  "argument of 'idLabel' must be convertable to int!\n";
540  }
541  }
542  if (!found) {
543  throw cms::Exception("Configuration") << "PATTauProducer: Requested working point '" << prov_ID_label
544  << "' for ID '" << idcfg.first << "' not found!\n";
545  }
546  }
547  }
548  }
549  std::string missingDiscriminators;
550  std::vector<pat::Tau::IdPair> ids(numberTauIds);
551  auto const& tausDeref = *tausRef;
552  if (typeid(tausDeref) == typeid(reco::PFTau)) {
553  edm::Handle<reco::PFTauCollection> pfTauCollection;
554  iEvent.getByToken(pfTauToken_, pfTauCollection);
555  for (size_t i = 0; i < numberPlainTauIds; ++i) {
556  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
557 
558  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDTokens_[i]);
559 
560  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
561  if (!missingDiscriminators.empty()) {
562  missingDiscriminators += ", ";
563  }
564  missingDiscriminators += tauIDSrcs_[i].first;
565  continue;
566  }
567  ids[i].first = tauIDSrcs_[i].first;
568  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
569  }
570  for (size_t i = 0; i < tauIDSrcContainers_.size(); ++i) {
571  auto pfTauIdDiscr = iEvent.getHandle(pfTauIDContainerTokens_[i]);
572  if (skipMissingTauID_ && !pfTauIdDiscr.isValid()) {
573  for (auto const& it : tauIDSrcContainers_[i]) {
574  if (!missingDiscriminators.empty()) {
575  missingDiscriminators += ", ";
576  }
577  missingDiscriminators += it.first;
578  }
579  continue;
580  }
581  for (size_t j = 0; j < tauIDSrcContainers_[i].size(); ++j) {
582  ids[numberPlainTauIds + j].first = tauIDSrcContainers_[i][j].first;
583  ids[numberPlainTauIds + j].second = getTauIdDiscriminatorFromContainer(
584  pfTauCollection, idx, pfTauIdDiscr, tauIDSrcContainers_[i][j].second.second);
585  }
586  numberPlainTauIds += tauIDSrcContainers_[i].size();
587  }
588  } else {
589  throw cms::Exception("Type Mismatch")
590  << "PATTauProducer: unsupported datatype '" << typeid(tausDeref).name() << "' for tauSource\n";
591  }
592  if (!missingDiscriminators.empty() && firstOccurence_) {
593  edm::LogWarning("DataSource") << "The following tau discriminators have not been found in the event:\n"
594  << missingDiscriminators << "\n"
595  << "They will not be embedded into the pat::Tau object.\n"
596  << "Note: this message will be printed only at first occurence.";
597  firstOccurence_ = false;
598  }
599  aTau.setTauIDs(ids);
600  }
601 
602  // extraction of reconstructed tau decay mode
603  // (only available for PFTaus)
604  if (aTau.isPFTau()) {
606  iEvent.getByToken(pfTauToken_, pfTaus);
607  reco::PFTauRef pfTauRef(pfTaus, idx);
608 
609  aTau.setDecayMode(pfTauRef->decayMode());
610  }
611 
612  // extraction of variables needed to rerun MVA isolation and anti-electron discriminator on MiniAOD
613  if (!aTau.pfEssential_.empty()) {
615  iEvent.getByToken(pfTauToken_, pfTaus);
616  reco::PFTauRef pfTauRef(pfTaus, idx);
617  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
618  float ecalEnergy = 0;
619  float hcalEnergy = 0;
620  float sumPhiTimesEnergy = 0.;
621  float sumEtaTimesEnergy = 0.;
622  float sumEnergy = 0.;
623  float leadChargedCandPt = -99;
624  float leadChargedCandEtaAtEcalEntrance = -99;
625  const std::vector<reco::CandidatePtr>& signalCands = pfTauRef->signalCands();
626  for (const auto& it : signalCands) {
627  const reco::PFCandidate* ipfcand = dynamic_cast<const reco::PFCandidate*>(it.get());
628  if (ipfcand != nullptr) {
629  ecalEnergy += ipfcand->ecalEnergy();
630  hcalEnergy += ipfcand->hcalEnergy();
631  sumPhiTimesEnergy += ipfcand->positionAtECALEntrance().phi() * ipfcand->energy();
632  sumEtaTimesEnergy += ipfcand->positionAtECALEntrance().eta() * ipfcand->energy();
633  sumEnergy += ipfcand->energy();
634  const reco::Track* track = nullptr;
635  if (ipfcand->trackRef().isNonnull())
636  track = ipfcand->trackRef().get();
637  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->innerTrack().isNonnull())
638  track = ipfcand->muonRef()->innerTrack().get();
639  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->globalTrack().isNonnull())
640  track = ipfcand->muonRef()->globalTrack().get();
641  else if (ipfcand->muonRef().isNonnull() && ipfcand->muonRef()->outerTrack().isNonnull())
642  track = ipfcand->muonRef()->outerTrack().get();
643  else if (ipfcand->gsfTrackRef().isNonnull())
644  track = ipfcand->gsfTrackRef().get();
645  if (track) {
646  if (track->pt() > leadChargedCandPt) {
647  leadChargedCandEtaAtEcalEntrance = ipfcand->positionAtECALEntrance().eta();
648  leadChargedCandPt = track->pt();
649  }
650  }
651  } else {
652  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
653  // and position at ECAL entrance computed on-the-fly
654  const pat::PackedCandidate* ipatcand = dynamic_cast<const pat::PackedCandidate*>(it.get());
655  if (ipatcand != nullptr) {
656  ecalEnergy += ipatcand->caloFraction() * ipatcand->energy() * (1. - ipatcand->hcalFraction());
657  hcalEnergy += ipatcand->caloFraction() * ipatcand->energy() * ipatcand->hcalFraction();
658  double posAtECal_phi = ipatcand->phi();
659  double posAtECal_eta = ipatcand->eta();
660  bool success = false;
661  reco::Candidate::Point posAtECalEntrance = posAtECalEntranceComputer_(ipatcand, success);
662  if (success) {
663  posAtECal_phi = posAtECalEntrance.phi();
664  posAtECal_eta = posAtECalEntrance.eta();
665  }
666  sumPhiTimesEnergy += posAtECal_phi * ipatcand->energy();
667  sumEtaTimesEnergy += posAtECal_eta * ipatcand->energy();
668  sumEnergy += ipatcand->energy();
669  const reco::Track* track = ipatcand->bestTrack();
670  if (track != nullptr) {
671  if (track->pt() > leadChargedCandPt) {
672  leadChargedCandEtaAtEcalEntrance = posAtECal_eta;
673  leadChargedCandPt = track->pt();
674  }
675  }
676  }
677  }
678  }
679  aTauPFEssential.ecalEnergy_ = ecalEnergy;
680  aTauPFEssential.hcalEnergy_ = hcalEnergy;
681  aTauPFEssential.ptLeadChargedCand_ = leadChargedCandPt;
682  aTauPFEssential.etaAtEcalEntranceLeadChargedCand_ = leadChargedCandEtaAtEcalEntrance;
683  if (sumEnergy != 0.) {
684  aTauPFEssential.phiAtEcalEntrance_ = sumPhiTimesEnergy / sumEnergy;
685  aTauPFEssential.etaAtEcalEntrance_ = sumEtaTimesEnergy / sumEnergy;
686  } else {
687  aTauPFEssential.phiAtEcalEntrance_ = -99.;
688  aTauPFEssential.etaAtEcalEntrance_ = -99.;
689  }
690  float leadingTrackNormChi2 = 0;
691  float ecalEnergyLeadChargedHadrCand = -99.;
692  float hcalEnergyLeadChargedHadrCand = -99.;
693  float emFraction = -1.;
694  float myHCALenergy = 0.;
695  float myECALenergy = 0.;
696  const reco::CandidatePtr& leadingPFCharged = pfTauRef->leadChargedHadrCand();
697  if (leadingPFCharged.isNonnull()) {
698  const reco::PFCandidate* pfCandPtr = dynamic_cast<const reco::PFCandidate*>(leadingPFCharged.get());
699  if (pfCandPtr != nullptr) { // PFTau made from PFCandidates
700  ecalEnergyLeadChargedHadrCand = pfCandPtr->ecalEnergy();
701  hcalEnergyLeadChargedHadrCand = pfCandPtr->hcalEnergy();
702  reco::TrackRef trackRef = pfCandPtr->trackRef();
703  if (trackRef.isNonnull()) {
704  leadingTrackNormChi2 = trackRef->normalizedChi2();
705  for (const auto& isoPFCand : pfTauRef->isolationPFCands()) {
706  myHCALenergy += isoPFCand->hcalEnergy();
707  myECALenergy += isoPFCand->ecalEnergy();
708  }
709  for (const auto& signalPFCand : pfTauRef->signalPFCands()) {
710  myHCALenergy += signalPFCand->hcalEnergy();
711  myECALenergy += signalPFCand->ecalEnergy();
712  }
713  if (myHCALenergy + myECALenergy != 0.) {
714  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
715  }
716  }
717  } else {
718  const pat::PackedCandidate* packedCandPtr = dynamic_cast<const pat::PackedCandidate*>(leadingPFCharged.get());
719  if (packedCandPtr != nullptr) {
720  // TauReco@MiniAOD: individual ECAL and HCAL energies recovered from fractions,
721  // and position at ECAL entrance computed on-the-fly
722  ecalEnergyLeadChargedHadrCand =
723  packedCandPtr->caloFraction() * packedCandPtr->energy() * (1. - packedCandPtr->hcalFraction());
724  hcalEnergyLeadChargedHadrCand =
725  packedCandPtr->caloFraction() * packedCandPtr->energy() * packedCandPtr->hcalFraction();
726  const reco::Track* track = packedCandPtr->bestTrack();
727  if (track != nullptr) {
728  leadingTrackNormChi2 = track->normalizedChi2();
729  for (const auto& isoCand : pfTauRef->isolationCands()) {
730  //can safely use static_cast as it is ensured that this PFTau is
731  //built with packedCands as its leadingCanidate
732  const pat::PackedCandidate* isoPackedCand = static_cast<const pat::PackedCandidate*>(isoCand.get());
733  myHCALenergy += isoPackedCand->caloFraction() * isoPackedCand->energy() * isoPackedCand->hcalFraction();
734  myECALenergy +=
735  isoPackedCand->caloFraction() * isoPackedCand->energy() * (1. - isoPackedCand->hcalFraction());
736  }
737  for (const auto& signalCand : pfTauRef->signalCands()) {
738  //can safely use static_cast as it is ensured that this PFTau is
739  //built with packedCands as its leadingCanidate
740  const pat::PackedCandidate* sigPackedCand = static_cast<const pat::PackedCandidate*>(signalCand.get());
741  myHCALenergy += sigPackedCand->caloFraction() * sigPackedCand->energy() * sigPackedCand->hcalFraction();
742  myECALenergy +=
743  sigPackedCand->caloFraction() * sigPackedCand->energy() * (1. - sigPackedCand->hcalFraction());
744  }
745  if (myHCALenergy + myECALenergy != 0.) {
746  emFraction = myECALenergy / (myHCALenergy + myECALenergy);
747  }
748  }
749  }
750  }
751  }
752 
753  aTauPFEssential.emFraction_ = emFraction;
754  aTauPFEssential.leadingTrackNormChi2_ = leadingTrackNormChi2;
755  aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand;
756  aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand;
757  // extraction of tau lifetime information
758  if (!tauTransverseImpactParameterSrc_.label().empty()) {
759  edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
760  iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
761  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
762  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
763  aTauPFEssential.dxy_PCA_ = tauLifetimeInfo.dxy_PCA();
764  aTauPFEssential.dxy_ = tauLifetimeInfo.dxy();
765  aTauPFEssential.dxy_error_ = tauLifetimeInfo.dxy_error();
766  aTauPFEssential.hasSV_ = tauLifetimeInfo.hasSecondaryVertex();
767  aTauPFEssential.flightLength_ = tauLifetimeInfo.flightLength();
768  aTauPFEssential.flightLengthSig_ = tauLifetimeInfo.flightLengthSig();
769  aTauPFEssential.ip3d_ = tauLifetimeInfo.ip3d();
770  aTauPFEssential.ip3d_error_ = tauLifetimeInfo.ip3d_error();
771  }
772  }
773 
774  // Isolation
775  if (isolator_.enabled()) {
777  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
778  // better to loop backwards, so the vector is resized less times
779  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
780  ed = isolatorTmpStorage_.rend();
781  it != ed;
782  ++it) {
783  aTau.setIsolation(it->first, it->second);
784  }
785  }
786 
787  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
788  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
789  }
790 
791  if (efficiencyLoader_.enabled()) {
792  efficiencyLoader_.setEfficiencies(aTau, tausRef);
793  }
794 
795  if (resolutionLoader_.enabled()) {
797  }
798 
799  if (useUserData_) {
800  userDataHelper_.add(aTau, iEvent, iSetup);
801  }
802 
803  patTaus->push_back(aTau);
804  }
805 
806  // sort taus in pT
807  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
808 
809  // put genEvt object in Event
810  iEvent.put(std::move(patTaus));
811 
812  // clean up
813  if (isolator_.enabled())
815 }

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 120 of file PATTauProducer.cc.

Referenced by PATTauProducer().

◆ addGenJetMatch_

bool pat::PATTauProducer::addGenJetMatch_
private

Definition at line 92 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ addGenMatch_

bool pat::PATTauProducer::addGenMatch_
private

Definition at line 88 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ addResolutions_

bool pat::PATTauProducer::addResolutions_
private

Definition at line 123 of file PATTauProducer.cc.

Referenced by PATTauProducer().

◆ addTauID_

bool pat::PATTauProducer::addTauID_
private

Definition at line 99 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ addTauJetCorrFactors_

bool pat::PATTauProducer::addTauJetCorrFactors_
private

Definition at line 96 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ baseTauToken_

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

Definition at line 69 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ efficiencyLoader_

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

Definition at line 121 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedGenJetMatch_

bool pat::PATTauProducer::embedGenJetMatch_
private

Definition at line 93 of file PATTauProducer.cc.

Referenced by PATTauProducer().

◆ embedGenMatch_

bool pat::PATTauProducer::embedGenMatch_
private

Definition at line 89 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFCands_

bool pat::PATTauProducer::embedIsolationPFCands_
private

Definition at line 83 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFChargedHadrCands_

bool pat::PATTauProducer::embedIsolationPFChargedHadrCands_
private

Definition at line 84 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFGammaCands_

bool pat::PATTauProducer::embedIsolationPFGammaCands_
private

Definition at line 86 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationPFNeutralHadrCands_

bool pat::PATTauProducer::embedIsolationPFNeutralHadrCands_
private

Definition at line 85 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedIsolationTracks_

bool pat::PATTauProducer::embedIsolationTracks_
private

Definition at line 73 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFCand_

bool pat::PATTauProducer::embedLeadPFCand_
private

Definition at line 76 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFChargedHadrCand_

bool pat::PATTauProducer::embedLeadPFChargedHadrCand_
private

Definition at line 77 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedLeadPFNeutralCand_

bool pat::PATTauProducer::embedLeadPFNeutralCand_
private

Definition at line 78 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedLeadTrack_

bool pat::PATTauProducer::embedLeadTrack_
private

Definition at line 74 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFCands_

bool pat::PATTauProducer::embedSignalPFCands_
private

Definition at line 79 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFChargedHadrCands_

bool pat::PATTauProducer::embedSignalPFChargedHadrCands_
private

Definition at line 80 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFGammaCands_

bool pat::PATTauProducer::embedSignalPFGammaCands_
private

Definition at line 82 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedSignalPFNeutralHadrCands_

bool pat::PATTauProducer::embedSignalPFNeutralHadrCands_
private

Definition at line 81 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ embedSignalTracks_

bool pat::PATTauProducer::embedSignalTracks_
private

Definition at line 75 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ firstOccurence_

bool pat::PATTauProducer::firstOccurence_
private

Definition at line 66 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ genJetMatchToken_

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

Definition at line 94 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ genMatchTokens_

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

Definition at line 90 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ isoDepositLabels_

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

Definition at line 117 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ isoDepositTokens_

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

Definition at line 118 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ isolator_

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

Definition at line 115 of file PATTauProducer.cc.

Referenced by produce().

◆ isolatorTmpStorage_

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

Definition at line 116 of file PATTauProducer.cc.

Referenced by produce().

◆ pfTauIDContainerTokens_

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

Definition at line 109 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ pfTauIDTokens_

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

Definition at line 108 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ pfTauToken_

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

Definition at line 71 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ phID_

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

Definition at line 111 of file PATTauProducer.cc.

Referenced by produce().

◆ posAtECalEntranceComputer_

PositionAtECalEntranceComputer pat::PATTauProducer::posAtECalEntranceComputer_
private

Definition at line 136 of file PATTauProducer.cc.

Referenced by produce().

◆ pTTauComparator_

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

Definition at line 113 of file PATTauProducer.cc.

Referenced by produce().

◆ resolutionLoader_

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

Definition at line 124 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ skipMissingTauID_

bool pat::PATTauProducer::skipMissingTauID_
private

Definition at line 110 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ tauIDSrcContainers_

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

Definition at line 107 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ tauIDSrcs_

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

Definition at line 106 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ tauJetCorrFactorsTokens_

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

Definition at line 97 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ tauTransverseImpactParameterSrc_

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

Definition at line 72 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ tauTransverseImpactParameterToken_

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

Definition at line 70 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ userDataHelper_

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

Definition at line 127 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

◆ useUserData_

bool pat::PATTauProducer::useUserData_
private

Definition at line 126 of file PATTauProducer.cc.

Referenced by PATTauProducer(), and produce().

reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
pat::PATTauProducer::firstOccurence_
bool firstOccurence_
Definition: PATTauProducer.cc:66
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.cc:71
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:11724
pat::PATTauProducer::addGenJetMatch_
bool addGenJetMatch_
Definition: PATTauProducer.cc:92
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.cc:107
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.cc:102
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.cc:85
pat::PATTauProducer::embedSignalTracks_
bool embedSignalTracks_
Definition: PATTauProducer.cc:75
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.cc:73
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
pat::PATTauProducer::embedGenMatch_
bool embedGenMatch_
Definition: PATTauProducer.cc:89
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.cc:76
pat::PATTauProducer::embedIsolationPFGammaCands_
bool embedIsolationPFGammaCands_
Definition: PATTauProducer.cc:86
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
pat::PATTauProducer::embedLeadPFChargedHadrCand_
bool embedLeadPFChargedHadrCand_
Definition: PATTauProducer.cc:77
pat::PATTauProducer::isolator_
pat::helper::MultiIsolator isolator_
Definition: PATTauProducer.cc:115
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.cc:109
pat::PATTauProducer::addGenMatch_
bool addGenMatch_
Definition: PATTauProducer.cc:88
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.cc:111
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.cc:123
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.cc:82
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.cc:136
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.cc:90
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.cc:100
pat::PATTauProducer::embedLeadTrack_
bool embedLeadTrack_
Definition: PATTauProducer.cc:74
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.cc:117
reco::PFTauTransverseImpactParameter::flightLengthSig
double flightLengthSig() const
Definition: PFTauTransverseImpactParameter.cc:71
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
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.cc:116
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.cc:103
reco::Track
Definition: Track.h:27
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:114
TauSpinnerFilter_cfi.ntaus
ntaus
Definition: TauSpinnerFilter_cfi.py:5
pat::PATTauProducer::tauIDSrcs_
std::vector< NameTag > tauIDSrcs_
Definition: PATTauProducer.cc:106
pat::PATTauProducer::genJetMatchToken_
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
Definition: PATTauProducer.cc:94
pat::PATTauProducer::addTauJetCorrFactors_
bool addTauJetCorrFactors_
Definition: PATTauProducer.cc:96
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
pat::tau::TauPFEssential::hcalEnergy_
float hcalEnergy_
Definition: TauPFEssential.h:55
reco::PFTauTransverseImpactParameter
Definition: PFTauTransverseImpactParameter.h:24
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.cc:101
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.cc:80
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.cc:121
pat::PfGammaIso
Definition: Isolation.h:16
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
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.cc:108
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.cc:69
pat::PATTauProducer::skipMissingTauID_
bool skipMissingTauID_
Definition: PATTauProducer.cc:110
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.cc:118
pat::PATTauProducer::embedSignalPFNeutralHadrCands_
bool embedSignalPFNeutralHadrCands_
Definition: PATTauProducer.cc:81
pat::PATTauProducer::embedIsolationPFCands_
bool embedIsolationPFCands_
Definition: PATTauProducer.cc:83
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.cc:93
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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.cc:113
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.cc:127
pat::PATTauProducer::embedIsolationPFChargedHadrCands_
bool embedIsolationPFChargedHadrCands_
Definition: PATTauProducer.cc:84
edm::Provenance::stable
StableProvenance const & stable() const
Definition: Provenance.h:42
pat::PATTauProducer::addTauID_
bool addTauID_
Definition: PATTauProducer.cc:99
Exception
Definition: hltDiff.cc:245
pat::PATTauProducer::embedLeadPFNeutralCand_
bool embedLeadPFNeutralCand_
Definition: PATTauProducer.cc:78
pat::PATTauProducer::getTauIdDiscriminator
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
Definition: PATTauProducer.cc:818
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:824
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.cc:97
pat::PATTauProducer::resolutionLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
Definition: PATTauProducer.cc:124
pat::PATTauProducer::tauTransverseImpactParameterToken_
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
Definition: PATTauProducer.cc:70
pat::PATTauProducer::embedSignalPFCands_
bool embedSignalPFCands_
Definition: PATTauProducer.cc:79
cms::Exception
Definition: Exception.h:70
pat::PATTauProducer::tauTransverseImpactParameterSrc_
edm::InputTag tauTransverseImpactParameterSrc_
Definition: PATTauProducer.cc:72
pat::PATTauProducer::useUserData_
bool useUserData_
Definition: PATTauProducer.cc:126
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.cc:120
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