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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::pair< std::string, edm::InputTagNameTag
 

Private Member Functions

template<typename TauCollectionType , typename TauDiscrType >
float getTauIdDiscriminator (const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
 

Private Attributes

bool addEfficiencies_
 
bool addGenJetMatch_
 
bool addGenMatch_
 
bool addResolutions_
 
bool addTauID_
 
bool addTauJetCorrFactors_
 
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
 
std::vector< edm::EDGetTokenT< reco::CaloTauDiscriminator > > caloTauIDTokens_
 
edm::EDGetTokenT< reco::CaloTauCollectioncaloTauToken_
 
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::PFTauDiscriminator > > pfTauIDTokens_
 
edm::EDGetTokenT< reco::PFTauCollectionpfTauToken_
 
GreaterByPt< TaupTTauComparator_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
bool skipMissingTauID_
 
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 46 of file PATTauProducer.h.

Member Typedef Documentation

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

Definition at line 93 of file PATTauProducer.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file PATTauProducer.cc.

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

32  :
33  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false) ,
34  useUserData_(iConfig.exists("userData"))
35 {
36  firstOccurence_=true;
37  // initialize the configurables
38  baseTauToken_ = consumes<edm::View<reco::BaseTau> >(iConfig.getParameter<edm::InputTag>( "tauSource" ));
39  tauTransverseImpactParameterSrc_ = iConfig.getParameter<edm::InputTag>( "tauTransverseImpactParameterSource" );
40  tauTransverseImpactParameterToken_ = consumes<PFTauTIPAssociationByRef>( tauTransverseImpactParameterSrc_);
41  pfTauToken_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>( "tauSource" ));
42  caloTauToken_ = mayConsume<reco::CaloTauCollection>(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")) {
61  genMatchTokens_.push_back(consumes<edm::Association<reco::GenParticleCollection> >(iConfig.getParameter<edm::InputTag>( "genParticleMatch" )));
62  }
63  else {
64  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
65  }
66  }
67  addGenJetMatch_ = iConfig.getParameter<bool>( "addGenJetMatch" );
68  if(addGenJetMatch_) {
69  embedGenJetMatch_ = iConfig.getParameter<bool>( "embedGenJetMatch" );
70  genJetMatchToken_ = consumes<edm::Association<reco::GenJetCollection> >(iConfig.getParameter<edm::InputTag>( "genJetMatch" ));
71  }
72  addTauJetCorrFactors_ = iConfig.getParameter<bool>( "addTauJetCorrFactors" );
73  tauJetCorrFactorsTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "tauJetCorrFactorsSource" ), [this](edm::InputTag const & tag){return mayConsume<edm::ValueMap<TauJetCorrFactors> >(tag);});
74  // tau ID configurables
75  addTauID_ = iConfig.getParameter<bool>( "addTauID" );
76  if ( addTauID_ ) {
77  // read the different tau ID names
78  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
79  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
80  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
81  tauIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
82  }
83  // but in any case at least once
84  if (tauIDSrcs_.empty()) throw cms::Exception("Configuration") <<
85  "PATTauProducer: id addTauID is true, you must specify either:\n" <<
86  "\tPSet tauIDSources = { \n" <<
87  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
88  "\t}\n";
89  }
90  caloTauIDTokens_ = edm::vector_transform(tauIDSrcs_, [this](NameTag const & tag){return mayConsume<reco::CaloTauDiscriminator>(tag.second);});
91  pfTauIDTokens_ = edm::vector_transform(tauIDSrcs_, [this](NameTag const & tag){return mayConsume<reco::PFTauDiscriminator>(tag.second);});
92  skipMissingTauID_ = iConfig.getParameter<bool>( "skipMissingTauID" );
93  // IsoDeposit configurables
94  if (iConfig.exists("isoDeposits")) {
95  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
96  if ( depconf.exists("tracker") ) isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
97  if ( depconf.exists("ecal") ) isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
98  if ( depconf.exists("hcal") ) isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
99  if ( depconf.exists("pfAllParticles") ) isoDepositLabels_.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
100  if ( depconf.exists("pfChargedHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
101  if ( depconf.exists("pfNeutralHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfNeutralHadronIso,depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
102  if ( depconf.exists("pfGamma") ) isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
103 
104  if ( depconf.exists("user") ) {
105  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
106  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
107  int key = UserBaseIso;
108  for ( ; it != ed; ++it, ++key) {
109  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
110  }
111  }
112  }
113  isoDepositTokens_ = edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys,edm::InputTag> const & label){return consumes<edm::ValueMap<IsoDeposit> >(label.second);});
114  // Efficiency configurables
115  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
116  if (addEfficiencies_) {
117  efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
118  }
119  // Resolution configurables
120  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
121  if (addResolutions_) {
123  }
124  // Check to see if the user wants to add user data
125  if ( useUserData_ ) {
126  userDataHelper_ = PATUserDataHelper<Tau>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
127  }
128  // produces vector of taus
129  produces<std::vector<Tau> >();
130 }
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
std::pair< std::string, edm::InputTag > NameTag
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::helper::EfficiencyLoader efficiencyLoader_
bool exists(std::string const &parameterName) const
checks if a parameter exists
pat::helper::KinResolutionsLoader resolutionLoader_
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
const std::string names[nVars_]
bool embedIsolationPFChargedHadrCands_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:169
char const * label
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
pat::helper::MultiIsolator isolator_
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
bool embedIsolationPFNeutralHadrCands_
edm::EDGetTokenT< reco::CaloTauCollection > caloTauToken_
pat::PATUserDataHelper< pat::Tau > userDataHelper_
bool embedSignalPFNeutralHadrCands_
std::vector< edm::EDGetTokenT< reco::CaloTauDiscriminator > > caloTauIDTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
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
edm::InputTag tauTransverseImpactParameterSrc_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
bool embedSignalPFChargedHadrCands_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
std::vector< NameTag > tauIDSrcs_
edm::EDGetTokenT< reco::PFTauCollection > pfTauToken_
PATTauProducer::~PATTauProducer ( )
override

Definition at line 132 of file PATTauProducer.cc.

133 {
134 }

Member Function Documentation

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

Definition at line 543 of file PATTauProducer.cc.

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

544 {
546  iDesc.setComment("PAT tau producer module");
547 
548  // input source
549  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
550 
551  // embedding
552  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
553  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
554  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
555 
556  // MC matching configurables
557  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
558  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
559  std::vector<edm::InputTag> emptySourceVector;
560  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
561  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
562  )->setComment("input with MC match information");
563 
564  // MC jet matching variables
565  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
566  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
567  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
568 
569 
571 
572  // tau ID configurables
573  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
574  edm::ParameterSetDescription tauIDSourcesPSet;
575  tauIDSourcesPSet.setAllowAnything();
576  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("tauIDSource", edm::InputTag(), true) xor
577  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true)
578  )->setComment("input with tau ID variables");
579  // (Dis)allow to skip missing tauId sources
580  iDesc.add<bool>("skipMissingTauID", false)->setComment("allow to skip a tau ID variable when not present in the event");
581 
582  // IsoDeposit configurables
583  edm::ParameterSetDescription isoDepositsPSet;
584  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
585  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
586  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
587  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
588  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
589  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
590  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
591  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
592  iDesc.addOptional("isoDeposits", isoDepositsPSet);
593 
594  // Efficiency configurables
595  edm::ParameterSetDescription efficienciesPSet;
596  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
597  iDesc.add("efficiencies", efficienciesPSet);
598  iDesc.add<bool>("addEfficiencies", false);
599 
600  // Check to see if the user wants to add user data
601  edm::ParameterSetDescription userDataPSet;
603  iDesc.addOptional("userData", userDataPSet);
604 
605  edm::ParameterSetDescription isolationPSet;
606  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
607  iDesc.add("userIsolation", isolationPSet);
608 
609 }
void setComment(std::string const &value)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescription(edm::ParameterSetDescription &iDesc)
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
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 536 of file PATTauProducer.cc.

Referenced by produce().

537 {
538  edm::Ref<TauCollectionType> tauRef(tauCollection, tauIdx);
539  return (*tauIdDiscr)[tauRef];
540 }
void PATTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 136 of file PATTauProducer.cc.

References addGenJetMatch_, addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), pat::Tau::addJECFactors(), addTauID_, addTauJetCorrFactors_, baseTauToken_, pat::helper::MultiIsolator::beginEvent(), caloTauIDTokens_, caloTauToken_, 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::tau::TauPFEssential::etaAtEcalEntrance_, pat::tau::TauPFEssential::etaAtEcalEntranceLeadChargedCand_, Exception, pat::helper::MultiIsolator::fill(), spr::find(), plotBeamSpotDB::first, firstOccurence_, reco::PFTauTransverseImpactParameter::flightLength(), pat::tau::TauPFEssential::flightLength_, reco::PFTauTransverseImpactParameter::flightLengthSig(), pat::tau::TauPFEssential::flightLengthSig_, jetProducer_cfi::genJetMatch, genJetMatchToken_, genMatchTokens_, edm::Ptr< T >::get(), edm::Ref< C, T, F >::get(), edm::Event::getByToken(), getTauIdDiscriminator(), reco::PFCandidate::gsfTrackRef(), reco::PFTauTransverseImpactParameter::hasSecondaryVertex(), pat::tau::TauPFEssential::hasSV_, pat::PackedCandidate::hasTrackDetails(), reco::PFCandidate::hcalEnergy(), pat::tau::TauPFEssential::hcalEnergy_, pat::tau::TauPFEssential::hcalEnergyLeadChargedHadrCand_, mps_fire::i, photons_cff::ids, training_settings::idx, 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(), edm::EventBase::isRealData(), edm::HandleBase::isValid(), edm::InputTag::label(), pat::tau::TauPFEssential::leadingTrackNormChi2_, jets_cff::levels, eostools::move(), reco::PFCandidate::muonRef(), gen::n, dataset::name, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), reco::TrackBase::normalizedChi2(), hemisphereProducer_cfi::patTaus, pat::Tau::pfEssential_, RecoPFTauTag_cff::PFTau, pfTauIDTokens_, pfTauToken_, pat::tau::TauPFEssential::phiAtEcalEntrance_, reco::PFCandidate::positionAtECALEntrance(), pat::PackedCandidate::pseudoTrack(), reco::TrackBase::pt(), pat::tau::TauPFEssential::ptLeadChargedCand_, pTTauComparator_, edm::Event::put(), resolutionLoader_, 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_, AlCaHLTBitMon_QueryRunRegistry::string, tauIDSrcs_, tauJetCorrFactorsTokens_, tauTransverseImpactParameterSrc_, tauTransverseImpactParameterToken_, HiIsolationCommonParameters_cff::track, reco::PFCandidate::trackRef(), userDataHelper_, and useUserData_.

137 {
138  // switch off embedding (in unschedules mode)
139  if (iEvent.isRealData()){
140  addGenMatch_ = false;
141  embedGenMatch_ = false;
142  addGenJetMatch_ = false;
143  }
144 
145  // Get the collection of taus from the event
147  try {
148  iEvent.getByToken(baseTauToken_, anyTaus);
149  } catch (const edm::Exception &e) {
150  edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. Instead, an empty tau collection is being be produced.";
151  auto patTaus = std::make_unique<std::vector<Tau>>();
152  iEvent.put(std::move(patTaus));
153  return;
154  }
155 
156  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
157 
159  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
160 
161  std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(isoDepositTokens_.size());
162  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
163  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
164  }
165 
166  // prepare the MC matching
167  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(genMatchTokens_.size());
168  if (addGenMatch_) {
169  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
170  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
171  }
172  }
173 
175  if (addGenJetMatch_) iEvent.getByToken(genJetMatchToken_, genJetMatch);
176 
177  // read in the jet correction factors ValueMap
178  std::vector<edm::ValueMap<TauJetCorrFactors> > tauJetCorrs;
179  if (addTauJetCorrFactors_) {
180  for ( size_t i = 0; i < tauJetCorrFactorsTokens_.size(); ++i ) {
182  iEvent.getByToken(tauJetCorrFactorsTokens_[i], tauJetCorr);
183  tauJetCorrs.push_back( *tauJetCorr );
184  }
185  }
186 
187  auto patTaus = std::make_unique<std::vector<Tau>>();
188 
189  bool first=true; // this is introduced to issue warnings only for the first tau-jet
190  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
191  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
192  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
193 
194  Tau aTau(tausRef);
195  if (embedLeadTrack_) aTau.embedLeadTrack();
196  if (embedSignalTracks_) aTau.embedSignalTracks();
197  if (embedIsolationTracks_) aTau.embedIsolationTracks();
198  if (embedLeadPFCand_) {
199  if (aTau.isPFTau() )
200  aTau.embedLeadPFCand();
201  else
202  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
203  }
205  if (aTau.isPFTau() )
206  aTau.embedLeadPFChargedHadrCand();
207  else
208  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
209  }
211  if (aTau.isPFTau() )
212  aTau.embedLeadPFNeutralCand();
213  else
214  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
215  }
216  if (embedSignalPFCands_) {
217  if (aTau.isPFTau() )
218  aTau.embedSignalPFCands();
219  else
220  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
221  }
223  if (aTau.isPFTau() )
224  aTau.embedSignalPFChargedHadrCands();
225  else
226  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
227  }
229  if (aTau.isPFTau() )
230  aTau.embedSignalPFNeutralHadrCands();
231  else
232  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
233  }
235  if (aTau.isPFTau() )
236  aTau.embedSignalPFGammaCands();
237  else
238  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
239  }
241  if (aTau.isPFTau() )
242  aTau.embedIsolationPFCands();
243  else
244  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
245  }
247  if (aTau.isPFTau() )
248  aTau.embedIsolationPFChargedHadrCands();
249  else
250  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
251  }
253  if (aTau.isPFTau() )
254  aTau.embedIsolationPFNeutralHadrCands();
255  else
256  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
257  }
259  if (aTau.isPFTau() )
260  aTau.embedIsolationPFGammaCands();
261  else
262  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
263  }
264 
265  if (addTauJetCorrFactors_) {
266  // add additional JetCorrs to the jet
267  for ( unsigned int i=0; i<tauJetCorrs.size(); ++i ) {
268  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
269  // uncomment for debugging
270  // tauJetCorr.print();
271  aTau.addJECFactors(tauJetCorr);
272  }
273  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
274  if(std::find(levels.begin(), levels.end(), "L2L3Residual")!=levels.end()){
275  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
276  }
277  else if(std::find(levels.begin(), levels.end(), "L3Absolute")!=levels.end()){
278  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
279  }
280  else{
281  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
282  if(first){
283  edm::LogWarning("L3Absolute not found")
284  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
285  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
286  << " uncorrected.";
287  first=false;
288  }
289  }
290  }
291 
292  // store the match to the generated final state muons
293  if (addGenMatch_) {
294  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
295  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
296  aTau.addGenParticleRef(genTau);
297  }
298  if (embedGenMatch_) aTau.embedGenParticle();
299  }
300 
301  // store the match to the visible part of the generated tau
302  if (addGenJetMatch_) {
303  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
304  if (genJetTau.isNonnull() && genJetTau.isAvailable() ) {
305  aTau.setGenJet( genJetTau );
306  } // leave empty if no match found
307  }
308 
309  // prepare ID extraction
310  if ( addTauID_ ) {
311  std::string missingDiscriminators;
312  std::vector<pat::Tau::IdPair> ids(tauIDSrcs_.size());
313  auto const& tausDeref = *tausRef;
314  for ( size_t i = 0; i < tauIDSrcs_.size(); ++i ) {
315  if ( typeid(tausDeref) == typeid(reco::PFTau) ) {
316  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
317  edm::Handle<reco::PFTauCollection> pfTauCollection;
318  iEvent.getByToken(pfTauToken_, pfTauCollection);
319 
321  iEvent.getByToken(pfTauIDTokens_[i], pfTauIdDiscr);
322 
323  if(skipMissingTauID_ && !pfTauIdDiscr.isValid()){
324  if(!missingDiscriminators.empty()){
325  missingDiscriminators+=", ";
326  }
327  missingDiscriminators+=tauIDSrcs_[i].first;
328  continue;
329  }
330  ids[i].first = tauIDSrcs_[i].first;
331  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
332  } else if ( typeid(tausDeref) == typeid(reco::CaloTau) ) {
333  //std::cout << "filling CaloTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
334  edm::Handle<reco::CaloTauCollection> caloTauCollection;
335  iEvent.getByToken(caloTauToken_, caloTauCollection);
336 
338  iEvent.getByToken(caloTauIDTokens_[i], caloTauIdDiscr);
339 
340  if(skipMissingTauID_ && !caloTauIdDiscr.isValid()){
341  if(!missingDiscriminators.empty()){
342  missingDiscriminators+=", ";
343  }
344  missingDiscriminators+=tauIDSrcs_[i].first;
345  continue;
346  }
347  ids[i].first = tauIDSrcs_[i].first;
348  ids[i].second = getTauIdDiscriminator(caloTauCollection, idx, caloTauIdDiscr);
349  } else {
350  throw cms::Exception("Type Mismatch") <<
351  "PATTauProducer: unsupported datatype '" << typeid(tausDeref).name() << "' for tauSource\n";
352  }
353  }
354  if(!missingDiscriminators.empty() && firstOccurence_){
355  edm::LogWarning("DataSource") << "The following tau discriminators have not been found in the event:\n"
356  << missingDiscriminators <<"\n"
357  << "They will not be embedded into the pat::Tau object.\n"
358  << "Note: this message will be printed only at first occurence.";
359  firstOccurence_=false;
360  }
361  aTau.setTauIDs(ids);
362  }
363 
364  // extraction of reconstructed tau decay mode
365  // (only available for PFTaus)
366  if ( aTau.isPFTau() ) {
368  iEvent.getByToken(pfTauToken_, pfTaus);
369  reco::PFTauRef pfTauRef(pfTaus, idx);
370 
371  aTau.setDecayMode(pfTauRef->decayMode());
372  }
373 
374  // extraction of variables needed to rerun MVA isolation and anti-electron discriminator on MiniAOD
375  if( !aTau.pfEssential_.empty() ) {
377  iEvent.getByToken(pfTauToken_, pfTaus);
378  reco::PFTauRef pfTauRef(pfTaus, idx);
379  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
380  float ecalEnergy = 0;
381  float hcalEnergy = 0;
382  float sumPhiTimesEnergy = 0.;
383  float sumEtaTimesEnergy = 0.;
384  float sumEnergy = 0.;
385  float leadChargedCandPt = -99;
386  float leadChargedCandEtaAtEcalEntrance = -99;
387  const std::vector<reco::CandidatePtr>& signalCands = pfTauRef->signalCands();
388  for(const auto& it : signalCands) {
389  const reco::PFCandidate* icand = dynamic_cast<const reco::PFCandidate*>(it.get());
390  if (icand != nullptr) {
391  ecalEnergy += icand->ecalEnergy();
392  hcalEnergy += icand->hcalEnergy();
393  sumPhiTimesEnergy += icand->positionAtECALEntrance().phi()*icand->energy();
394  sumEtaTimesEnergy += icand->positionAtECALEntrance().eta()*icand->energy();
395  sumEnergy += icand->energy();
396  const reco::Track* track = nullptr;
397  if ( icand->trackRef().isNonnull() ) track = icand->trackRef().get();
398  else if ( icand->muonRef().isNonnull() && icand->muonRef()->innerTrack().isNonnull() ) track = icand->muonRef ()->innerTrack().get();
399  else if ( icand->muonRef().isNonnull() && icand->muonRef()->globalTrack().isNonnull() ) track = icand->muonRef ()->globalTrack().get();
400  else if ( icand->muonRef().isNonnull() && icand->muonRef()->outerTrack().isNonnull() ) track = icand->muonRef ()->outerTrack().get();
401  else if ( icand->gsfTrackRef().isNonnull() ) track = icand->gsfTrackRef().get();
402  if( track ) {
403  if( track->pt() > leadChargedCandPt ) {
404  leadChargedCandEtaAtEcalEntrance = icand->positionAtECALEntrance().eta();
405  leadChargedCandPt = track->pt();
406  }
407  }
408  }
409  else {
410  // TauReco@MiniAOD: individual ECAL and HCAL energies currently not available for PackedCandidates
411  // (see above implementation for PFCandidates).
412  // Should be added if available, as well as on-the-fly computation of position at ECAL entrance
413  sumEnergy += it->energy();
414  const reco::Track* track = it->bestTrack();
415  if( track != nullptr ) {
416  if( track->pt() > leadChargedCandPt ) {
417  leadChargedCandPt = track->pt();
418  }
419  }
420  }
421  }
422  aTauPFEssential.ecalEnergy_ = ecalEnergy;
423  aTauPFEssential.hcalEnergy_ = hcalEnergy;
424  aTauPFEssential.ptLeadChargedCand_ = leadChargedCandPt;
425  aTauPFEssential.etaAtEcalEntranceLeadChargedCand_ = leadChargedCandEtaAtEcalEntrance;
426  if (sumEnergy != 0.) {
427  aTauPFEssential.phiAtEcalEntrance_ = sumPhiTimesEnergy/sumEnergy;
428  aTauPFEssential.etaAtEcalEntrance_ = sumEtaTimesEnergy/sumEnergy;
429  }
430  else {
431  aTauPFEssential.phiAtEcalEntrance_ = -99.;
432  aTauPFEssential.etaAtEcalEntrance_ = -99.;
433  }
434  float leadingTrackNormChi2 = 0;
435  float ecalEnergyLeadChargedHadrCand = -99.;
436  float hcalEnergyLeadChargedHadrCand = -99.;
437  float emFraction = -1.;
438  float myHCALenergy = 0.;
439  float myECALenergy = 0.;
440  const reco::CandidatePtr& leadingPFCharged = pfTauRef->leadChargedHadrCand();
441  if(leadingPFCharged.isNonnull()) {
442  const reco::PFCandidate* pfCandPtr = dynamic_cast<const reco::PFCandidate*>(leadingPFCharged.get());
443  if(pfCandPtr != nullptr) { // PFTau made from PFCandidates
444  ecalEnergyLeadChargedHadrCand = pfCandPtr->ecalEnergy();
445  hcalEnergyLeadChargedHadrCand = pfCandPtr->hcalEnergy();
446  reco::TrackRef trackRef = pfCandPtr->trackRef();
447  if( trackRef.isNonnull() ) {
448  leadingTrackNormChi2 = trackRef->normalizedChi2();
449  for(const auto& isoPFCand : pfTauRef->isolationPFCands()){
450  myHCALenergy += isoPFCand->hcalEnergy();
451  myECALenergy += isoPFCand->ecalEnergy();
452  }
453  for(const auto& signalPFCand : pfTauRef->signalPFCands()){
454  myHCALenergy += signalPFCand->hcalEnergy();
455  myECALenergy += signalPFCand->ecalEnergy();
456  }
457  if( myHCALenergy + myECALenergy != 0. ) {
458  emFraction = myECALenergy/( myHCALenergy + myECALenergy);
459  }
460  }
461  }
462  else {
463  const pat::PackedCandidate* packedCandPtr = dynamic_cast<const pat::PackedCandidate*>(leadingPFCharged.get());
464  if (packedCandPtr != nullptr) {
465  // TauReco@MiniAOD: Update code below if ecal/hcal energies are available.
466  const reco::Track* track = packedCandPtr->hasTrackDetails() ? &packedCandPtr->pseudoTrack() : nullptr;
467  if (track != nullptr) {
468  leadingTrackNormChi2 = track->normalizedChi2();
469  }
470  }
471  }
472  }
473 
474  aTauPFEssential.emFraction_ = emFraction;
475  aTauPFEssential.leadingTrackNormChi2_ = leadingTrackNormChi2;
476  aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand;
477  aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand;
478  // extraction of tau lifetime information
479  if( !tauTransverseImpactParameterSrc_.label().empty() ) {
480  edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
481  iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
482  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
483  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
484  aTauPFEssential.dxy_PCA_ = tauLifetimeInfo.dxy_PCA();
485  aTauPFEssential.dxy_ = tauLifetimeInfo.dxy();
486  aTauPFEssential.dxy_error_ = tauLifetimeInfo.dxy_error();
487  aTauPFEssential.hasSV_ = tauLifetimeInfo.hasSecondaryVertex();
488  aTauPFEssential.flightLength_ = tauLifetimeInfo.flightLength();
489  aTauPFEssential.flightLengthSig_ = tauLifetimeInfo.flightLengthSig();
490  aTauPFEssential.ip3d_ = tauLifetimeInfo.ip3d();
491  aTauPFEssential.ip3d_error_ = tauLifetimeInfo.ip3d_error();
492  }
493  }
494 
495  // Isolation
496  if (isolator_.enabled()) {
498  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
499  // better to loop backwards, so the vector is resized less times
500  for ( IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
501  ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
502  aTau.setIsolation(it->first, it->second);
503  }
504  }
505 
506  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
507  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
508  }
509 
510  if (efficiencyLoader_.enabled()) {
511  efficiencyLoader_.setEfficiencies( aTau, tausRef );
512  }
513 
514  if (resolutionLoader_.enabled()) {
516  }
517 
518  if ( useUserData_ ) {
519  userDataHelper_.add( aTau, iEvent, iSetup );
520  }
521 
522  patTaus->push_back(aTau);
523  }
524 
525  // sort taus in pT
526  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
527 
528  // put genEvt object in Event
529  iEvent.put(std::move(patTaus));
530 
531  // clean up
533 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool isAvailable() const
Definition: Ref.h:575
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:222
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:594
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:159
pat::helper::EfficiencyLoader efficiencyLoader_
pat::helper::KinResolutionsLoader resolutionLoader_
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool isRealData() const
Definition: EventBase.h:62
const math::XYZPointF & positionAtECALEntrance() const
Definition: PFCandidate.h:368
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool embedIsolationPFChargedHadrCands_
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:442
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
edm::EDGetTokenT< PFTauTIPAssociationByRef > tauTransverseImpactParameterToken_
pat::helper::MultiIsolator isolator_
edm::EDGetTokenT< edm::View< reco::BaseTau > > baseTauToken_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
bool embedIsolationPFNeutralHadrCands_
double pt() const
track transverse momentum
Definition: TrackBase.h:654
edm::EDGetTokenT< reco::CaloTauCollection > caloTauToken_
double energy() const final
energy
pat::PATUserDataHelper< pat::Tau > userDataHelper_
virtual const reco::Track & pseudoTrack() const
genJetMatch
switch on/off embedding of matched genJet&#39;s
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
bool embedSignalPFNeutralHadrCands_
bool isValid() const
Definition: HandleBase.h:74
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:459
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
Definition: Tau.py:1
std::vector< edm::EDGetTokenT< reco::CaloTauDiscriminator > > caloTauIDTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< TauJetCorrFactors > > > tauJetCorrFactorsTokens_
edm::InputTag tauTransverseImpactParameterSrc_
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetMatchToken_
std::string const & label() const
Definition: InputTag.h:36
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:480
double hcalEnergy() const
return corrected Hcal energy
Definition: PFCandidate.h:232
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
bool embedSignalPFChargedHadrCands_
std::vector< edm::EDGetTokenT< reco::PFTauDiscriminator > > pfTauIDTokens_
std::vector< NameTag > tauIDSrcs_
edm::EDGetTokenT< reco::PFTauCollection > pfTauToken_
def move(src, dest)
Definition: eostools.py:511
GreaterByPt< Tau > pTTauComparator_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82

Member Data Documentation

bool pat::PATTauProducer::addEfficiencies_
private

Definition at line 106 of file PATTauProducer.h.

Referenced by PATTauProducer().

bool pat::PATTauProducer::addGenJetMatch_
private

Definition at line 85 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addGenMatch_
private

Definition at line 81 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addResolutions_
private

Definition at line 109 of file PATTauProducer.h.

Referenced by PATTauProducer().

bool pat::PATTauProducer::addTauID_
private

Definition at line 92 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addTauJetCorrFactors_
private

Definition at line 89 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 61 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

std::vector<edm::EDGetTokenT<reco::CaloTauDiscriminator> > pat::PATTauProducer::caloTauIDTokens_
private

Definition at line 95 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

edm::EDGetTokenT<reco::CaloTauCollection> pat::PATTauProducer::caloTauToken_
private

Definition at line 64 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 107 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedGenJetMatch_
private

Definition at line 86 of file PATTauProducer.h.

Referenced by PATTauProducer().

bool pat::PATTauProducer::embedGenMatch_
private

Definition at line 82 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFCands_
private

Definition at line 76 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFChargedHadrCands_
private

Definition at line 77 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFGammaCands_
private

Definition at line 79 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFNeutralHadrCands_
private

Definition at line 78 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationTracks_
private

Definition at line 66 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFCand_
private

Definition at line 69 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFChargedHadrCand_
private

Definition at line 70 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFNeutralCand_
private

Definition at line 71 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadTrack_
private

Definition at line 67 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFCands_
private

Definition at line 72 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFChargedHadrCands_
private

Definition at line 73 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFGammaCands_
private

Definition at line 75 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFNeutralHadrCands_
private

Definition at line 74 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalTracks_
private

Definition at line 68 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::firstOccurence_
private

Definition at line 58 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 87 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 83 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 103 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 104 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 101 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 102 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 96 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 63 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 99 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 110 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::skipMissingTauID_
private

Definition at line 97 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 94 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 90 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 65 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 62 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 113 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::useUserData_
private

Definition at line 112 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().