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 31 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().

31  :
32  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false) ,
33  useUserData_(iConfig.exists("userData"))
34 {
35  firstOccurence_=true;
36  // initialize the configurables
37  baseTauToken_ = consumes<edm::View<reco::BaseTau> >(iConfig.getParameter<edm::InputTag>( "tauSource" ));
38  tauTransverseImpactParameterSrc_ = iConfig.getParameter<edm::InputTag>( "tauTransverseImpactParameterSource" );
39  tauTransverseImpactParameterToken_ = consumes<PFTauTIPAssociationByRef>( tauTransverseImpactParameterSrc_);
40  pfTauToken_ = consumes<reco::PFTauCollection>(iConfig.getParameter<edm::InputTag>( "tauSource" ));
41  caloTauToken_ = mayConsume<reco::CaloTauCollection>(iConfig.getParameter<edm::InputTag>( "tauSource" ));
42  embedIsolationTracks_ = iConfig.getParameter<bool>( "embedIsolationTracks" );
43  embedLeadTrack_ = iConfig.getParameter<bool>( "embedLeadTrack" );
44  embedSignalTracks_ = iConfig.getParameter<bool>( "embedSignalTracks" );
45  embedLeadPFCand_ = iConfig.getParameter<bool>( "embedLeadPFCand" );
46  embedLeadPFChargedHadrCand_ = iConfig.getParameter<bool>( "embedLeadPFChargedHadrCand" );
47  embedLeadPFNeutralCand_ = iConfig.getParameter<bool>( "embedLeadPFNeutralCand" );
48  embedSignalPFCands_ = iConfig.getParameter<bool>( "embedSignalPFCands" );
49  embedSignalPFChargedHadrCands_ = iConfig.getParameter<bool>( "embedSignalPFChargedHadrCands" );
50  embedSignalPFNeutralHadrCands_ = iConfig.getParameter<bool>( "embedSignalPFNeutralHadrCands" );
51  embedSignalPFGammaCands_ = iConfig.getParameter<bool>( "embedSignalPFGammaCands" );
52  embedIsolationPFCands_ = iConfig.getParameter<bool>( "embedIsolationPFCands" );
53  embedIsolationPFChargedHadrCands_ = iConfig.getParameter<bool>( "embedIsolationPFChargedHadrCands" );
54  embedIsolationPFNeutralHadrCands_ = iConfig.getParameter<bool>( "embedIsolationPFNeutralHadrCands" );
55  embedIsolationPFGammaCands_ = iConfig.getParameter<bool>( "embedIsolationPFGammaCands" );
56  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
57  if (addGenMatch_) {
58  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
59  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
60  genMatchTokens_.push_back(consumes<edm::Association<reco::GenParticleCollection> >(iConfig.getParameter<edm::InputTag>( "genParticleMatch" )));
61  }
62  else {
63  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
64  }
65  }
66  addGenJetMatch_ = iConfig.getParameter<bool>( "addGenJetMatch" );
67  if(addGenJetMatch_) {
68  embedGenJetMatch_ = iConfig.getParameter<bool>( "embedGenJetMatch" );
69  genJetMatchToken_ = consumes<edm::Association<reco::GenJetCollection> >(iConfig.getParameter<edm::InputTag>( "genJetMatch" ));
70  }
71  addTauJetCorrFactors_ = iConfig.getParameter<bool>( "addTauJetCorrFactors" );
72  tauJetCorrFactorsTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "tauJetCorrFactorsSource" ), [this](edm::InputTag const & tag){return mayConsume<edm::ValueMap<TauJetCorrFactors> >(tag);});
73  // tau ID configurables
74  addTauID_ = iConfig.getParameter<bool>( "addTauID" );
75  if ( addTauID_ ) {
76  // read the different tau ID names
77  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
78  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
79  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
80  tauIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
81  }
82  // but in any case at least once
83  if (tauIDSrcs_.empty()) throw cms::Exception("Configuration") <<
84  "PATTauProducer: id addTauID is true, you must specify either:\n" <<
85  "\tPSet tauIDSources = { \n" <<
86  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
87  "\t}\n";
88  }
89  caloTauIDTokens_ = edm::vector_transform(tauIDSrcs_, [this](NameTag const & tag){return mayConsume<reco::CaloTauDiscriminator>(tag.second);});
90  pfTauIDTokens_ = edm::vector_transform(tauIDSrcs_, [this](NameTag const & tag){return mayConsume<reco::PFTauDiscriminator>(tag.second);});
91  skipMissingTauID_ = iConfig.getParameter<bool>( "skipMissingTauID" );
92  // IsoDeposit configurables
93  if (iConfig.exists("isoDeposits")) {
94  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
95  if ( depconf.exists("tracker") ) isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
96  if ( depconf.exists("ecal") ) isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
97  if ( depconf.exists("hcal") ) isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
98  if ( depconf.exists("pfAllParticles") ) isoDepositLabels_.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
99  if ( depconf.exists("pfChargedHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
100  if ( depconf.exists("pfNeutralHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfNeutralHadronIso,depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
101  if ( depconf.exists("pfGamma") ) isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
102 
103  if ( depconf.exists("user") ) {
104  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
105  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
106  int key = UserBaseIso;
107  for ( ; it != ed; ++it, ++key) {
108  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
109  }
110  }
111  }
112  isoDepositTokens_ = edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys,edm::InputTag> const & label){return consumes<edm::ValueMap<IsoDeposit> >(label.second);});
113  // Efficiency configurables
114  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
115  if (addEfficiencies_) {
116  efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
117  }
118  // Resolution configurables
119  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
120  if (addResolutions_) {
122  }
123  // Check to see if the user wants to add user data
124  if ( useUserData_ ) {
125  userDataHelper_ = PATUserDataHelper<Tau>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
126  }
127  // produces vector of taus
128  produces<std::vector<Tau> >();
129 }
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:185
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
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
const std::string names[nVars_]
bool embedIsolationPFChargedHadrCands_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:193
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_
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 131 of file PATTauProducer.cc.

132 {
133 }

Member Function Documentation

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

Definition at line 514 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().

515 {
517  iDesc.setComment("PAT tau producer module");
518 
519  // input source
520  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
521 
522  // embedding
523  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
524  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
525  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
526 
527  // MC matching configurables
528  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
529  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
530  std::vector<edm::InputTag> emptySourceVector;
531  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
532  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
533  )->setComment("input with MC match information");
534 
535  // MC jet matching variables
536  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
537  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
538  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
539 
540 
542 
543  // tau ID configurables
544  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
545  edm::ParameterSetDescription tauIDSourcesPSet;
546  tauIDSourcesPSet.setAllowAnything();
547  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("tauIDSource", edm::InputTag(), true) xor
548  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true)
549  )->setComment("input with tau ID variables");
550  // (Dis)allow to skip missing tauId sources
551  iDesc.add<bool>("skipMissingTauID", false)->setComment("allow to skip a tau ID variable when not present in the event");
552 
553  // IsoDeposit configurables
554  edm::ParameterSetDescription isoDepositsPSet;
555  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
556  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
557  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
558  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
559  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
560  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
561  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
562  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
563  iDesc.addOptional("isoDeposits", isoDepositsPSet);
564 
565  // Efficiency configurables
566  edm::ParameterSetDescription efficienciesPSet;
567  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
568  iDesc.add("efficiencies", efficienciesPSet);
569  iDesc.add<bool>("addEfficiencies", false);
570 
571  // Check to see if the user wants to add user data
572  edm::ParameterSetDescription userDataPSet;
574  iDesc.addOptional("userData", userDataPSet);
575 
576  edm::ParameterSetDescription isolationPSet;
577  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
578  iDesc.add("userIsolation", isolationPSet);
579 
580 }
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 507 of file PATTauProducer.cc.

Referenced by produce().

508 {
509  edm::Ref<TauCollectionType> tauRef(tauCollection, tauIdx);
510  return (*tauIdDiscr)[tauRef];
511 }
void PATTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 135 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, 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(), 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::Event::getByToken(), getTauIdDiscriminator(), reco::PFTauTransverseImpactParameter::hasSecondaryVertex(), pat::tau::TauPFEssential::hasSV_, pat::tau::TauPFEssential::hcalEnergy_, pat::tau::TauPFEssential::hcalEnergyLeadChargedHadrCand_, mps_fire::i, electrons_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(), gen::n, dataset::name, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), hemisphereProducer_cfi::patTaus, pat::Tau::pfEssential_, RecoPFTauTag_cff::PFTau, pfTauIDTokens_, pfTauToken_, pat::tau::TauPFEssential::phiAtEcalEntrance_, 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, userDataHelper_, and useUserData_.

136 {
137  // switch off embedding (in unschedules mode)
138  if (iEvent.isRealData()){
139  addGenMatch_ = false;
140  embedGenMatch_ = false;
141  addGenJetMatch_ = false;
142  }
143 
144  // Get the collection of taus from the event
146  try {
147  iEvent.getByToken(baseTauToken_, anyTaus);
148  } catch (const edm::Exception &e) {
149  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.";
150  auto patTaus = std::make_unique<std::vector<Tau>>();
151  iEvent.put(std::move(patTaus));
152  return;
153  }
154 
155  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
156 
158  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
159 
160  std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(isoDepositTokens_.size());
161  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
162  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
163  }
164 
165  // prepare the MC matching
166  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(genMatchTokens_.size());
167  if (addGenMatch_) {
168  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
169  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
170  }
171  }
172 
174  if (addGenJetMatch_) iEvent.getByToken(genJetMatchToken_, genJetMatch);
175 
176  // read in the jet correction factors ValueMap
177  std::vector<edm::ValueMap<TauJetCorrFactors> > tauJetCorrs;
178  if (addTauJetCorrFactors_) {
179  for ( size_t i = 0; i < tauJetCorrFactorsTokens_.size(); ++i ) {
181  iEvent.getByToken(tauJetCorrFactorsTokens_[i], tauJetCorr);
182  tauJetCorrs.push_back( *tauJetCorr );
183  }
184  }
185 
186  auto patTaus = std::make_unique<std::vector<Tau>>();
187 
188  bool first=true; // this is introduced to issue warnings only for the first tau-jet
189  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
190  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
191  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
192 
193  Tau aTau(tausRef);
194  if (embedLeadTrack_) aTau.embedLeadTrack();
195  if (embedSignalTracks_) aTau.embedSignalTracks();
196  if (embedIsolationTracks_) aTau.embedIsolationTracks();
197  if (embedLeadPFCand_) {
198  if (aTau.isPFTau() )
199  aTau.embedLeadPFCand();
200  else
201  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
202  }
204  if (aTau.isPFTau() )
205  aTau.embedLeadPFChargedHadrCand();
206  else
207  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
208  }
210  if (aTau.isPFTau() )
211  aTau.embedLeadPFNeutralCand();
212  else
213  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
214  }
215  if (embedSignalPFCands_) {
216  if (aTau.isPFTau() )
217  aTau.embedSignalPFCands();
218  else
219  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
220  }
222  if (aTau.isPFTau() )
223  aTau.embedSignalPFChargedHadrCands();
224  else
225  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
226  }
228  if (aTau.isPFTau() )
229  aTau.embedSignalPFNeutralHadrCands();
230  else
231  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
232  }
234  if (aTau.isPFTau() )
235  aTau.embedSignalPFGammaCands();
236  else
237  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
238  }
240  if (aTau.isPFTau() )
241  aTau.embedIsolationPFCands();
242  else
243  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
244  }
246  if (aTau.isPFTau() )
247  aTau.embedIsolationPFChargedHadrCands();
248  else
249  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
250  }
252  if (aTau.isPFTau() )
253  aTau.embedIsolationPFNeutralHadrCands();
254  else
255  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
256  }
258  if (aTau.isPFTau() )
259  aTau.embedIsolationPFGammaCands();
260  else
261  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
262  }
263 
264  if (addTauJetCorrFactors_) {
265  // add additional JetCorrs to the jet
266  for ( unsigned int i=0; i<tauJetCorrs.size(); ++i ) {
267  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
268  // uncomment for debugging
269  // tauJetCorr.print();
270  aTau.addJECFactors(tauJetCorr);
271  }
272  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
273  if(std::find(levels.begin(), levels.end(), "L2L3Residual")!=levels.end()){
274  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
275  }
276  else if(std::find(levels.begin(), levels.end(), "L3Absolute")!=levels.end()){
277  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
278  }
279  else{
280  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
281  if(first){
282  edm::LogWarning("L3Absolute not found")
283  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
284  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
285  << " uncorrected.";
286  first=false;
287  }
288  }
289  }
290 
291  // store the match to the generated final state muons
292  if (addGenMatch_) {
293  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
294  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
295  aTau.addGenParticleRef(genTau);
296  }
297  if (embedGenMatch_) aTau.embedGenParticle();
298  }
299 
300  // store the match to the visible part of the generated tau
301  if (addGenJetMatch_) {
302  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
303  if (genJetTau.isNonnull() && genJetTau.isAvailable() ) {
304  aTau.setGenJet( genJetTau );
305  } // leave empty if no match found
306  }
307 
308  // prepare ID extraction
309  if ( addTauID_ ) {
310  std::string missingDiscriminators;
311  std::vector<pat::Tau::IdPair> ids(tauIDSrcs_.size());
312  auto const& tausDeref = *tausRef;
313  for ( size_t i = 0; i < tauIDSrcs_.size(); ++i ) {
314  if ( typeid(tausDeref) == typeid(reco::PFTau) ) {
315  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
316  edm::Handle<reco::PFTauCollection> pfTauCollection;
317  iEvent.getByToken(pfTauToken_, pfTauCollection);
318 
320  iEvent.getByToken(pfTauIDTokens_[i], pfTauIdDiscr);
321 
322  if(skipMissingTauID_ && !pfTauIdDiscr.isValid()){
323  if(!missingDiscriminators.empty()){
324  missingDiscriminators+=", ";
325  }
326  missingDiscriminators+=tauIDSrcs_[i].first;
327  continue;
328  }
329  ids[i].first = tauIDSrcs_[i].first;
330  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
331  } else if ( typeid(tausDeref) == typeid(reco::CaloTau) ) {
332  //std::cout << "filling CaloTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
333  edm::Handle<reco::CaloTauCollection> caloTauCollection;
334  iEvent.getByToken(caloTauToken_, caloTauCollection);
335 
337  iEvent.getByToken(caloTauIDTokens_[i], caloTauIdDiscr);
338 
339  if(skipMissingTauID_ && !caloTauIdDiscr.isValid()){
340  if(!missingDiscriminators.empty()){
341  missingDiscriminators+=", ";
342  }
343  missingDiscriminators+=tauIDSrcs_[i].first;
344  continue;
345  }
346  ids[i].first = tauIDSrcs_[i].first;
347  ids[i].second = getTauIdDiscriminator(caloTauCollection, idx, caloTauIdDiscr);
348  } else {
349  throw cms::Exception("Type Mismatch") <<
350  "PATTauProducer: unsupported datatype '" << typeid(tausDeref).name() << "' for tauSource\n";
351  }
352  }
353  if(!missingDiscriminators.empty() && firstOccurence_){
354  edm::LogWarning("DataSource") << "The following tau discriminators have not been found in the event:\n"
355  << missingDiscriminators <<"\n"
356  << "They will not be embedded into the pat::Tau object.\n"
357  << "Note: this message will be printed only at first occurence.";
358  firstOccurence_=false;
359  }
360  aTau.setTauIDs(ids);
361  }
362 
363  // extraction of reconstructed tau decay mode
364  // (only available for PFTaus)
365  if ( aTau.isPFTau() ) {
367  iEvent.getByToken(pfTauToken_, pfTaus);
368  reco::PFTauRef pfTauRef(pfTaus, idx);
369 
370  aTau.setDecayMode(pfTauRef->decayMode());
371  }
372 
373  // extraction of variables needed to rerun MVA isolation and anti-electron discriminator on MiniAOD
374  if( aTau.isPFTau() ) {
376  iEvent.getByToken(pfTauToken_, pfTaus);
377  reco::PFTauRef pfTauRef(pfTaus, idx);
378  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
379  float ecalEnergy = 0;
380  float hcalEnergy = 0;
381  float sumPhiTimesEnergy = 0.;
382  float sumEtaTimesEnergy = 0.;
383  float sumEnergy = 0.;
384  float leadChargedCandPt = -99;
385  float leadChargedCandEtaAtEcalEntrance = -99;
386  const std::vector<reco::PFCandidatePtr>& signalCands = pfTauRef->signalPFCands();
387  for(std::vector<reco::PFCandidatePtr>::const_iterator it = signalCands.begin(); it != signalCands.end(); ++it) {
388  const reco::PFCandidatePtr& icand = *it;
389  ecalEnergy += icand->ecalEnergy();
390  hcalEnergy += icand->hcalEnergy();
391  sumPhiTimesEnergy += icand->positionAtECALEntrance().phi()*icand->energy();
392  sumEtaTimesEnergy += icand->positionAtECALEntrance().eta()*icand->energy();
393  sumEnergy += icand->energy();
394  const reco::Track* track = nullptr;
395  if ( icand->trackRef().isNonnull() ) track = icand->trackRef().get();
396  else if ( icand->muonRef().isNonnull() && icand->muonRef()->innerTrack().isNonnull() ) track = icand->muonRef()->innerTrack().get();
397  else if ( icand->muonRef().isNonnull() && icand->muonRef()->globalTrack().isNonnull() ) track = icand->muonRef()->globalTrack().get();
398  else if ( icand->muonRef().isNonnull() && icand->muonRef()->outerTrack().isNonnull() ) track = icand->muonRef()->outerTrack().get();
399  else if ( icand->gsfTrackRef().isNonnull() ) track = icand->gsfTrackRef().get();
400  if( track ) {
401  if( track->pt() > leadChargedCandPt ) {
402  leadChargedCandEtaAtEcalEntrance = icand->positionAtECALEntrance().eta();
403  leadChargedCandPt = track->pt();
404  }
405  }
406  }
407  aTauPFEssential.ecalEnergy_ = ecalEnergy;
408  aTauPFEssential.hcalEnergy_ = hcalEnergy;
409  aTauPFEssential.ptLeadChargedCand_ = leadChargedCandPt;
410  aTauPFEssential.etaAtEcalEntranceLeadChargedCand_ = leadChargedCandEtaAtEcalEntrance;
411  if (sumEnergy != 0.) {
412  aTauPFEssential.phiAtEcalEntrance_ = sumPhiTimesEnergy/sumEnergy;
413  aTauPFEssential.etaAtEcalEntrance_ = sumEtaTimesEnergy/sumEnergy;
414  }
415  else {
416  aTauPFEssential.phiAtEcalEntrance_ = -99.;
417  aTauPFEssential.etaAtEcalEntrance_ = -99.;
418  }
419  float leadingTrackNormChi2 = 0;
420  float ecalEnergyLeadChargedHadrCand = -99.;
421  float hcalEnergyLeadChargedHadrCand = -99.;
422  float emFraction = -1.;
423  float myHCALenergy = 0.;
424  float myECALenergy = 0.;
425  const reco::PFCandidatePtr& leadingPFCharged = pfTauRef->leadPFChargedHadrCand();
426  if(leadingPFCharged.isNonnull()) {
427  ecalEnergyLeadChargedHadrCand = leadingPFCharged->ecalEnergy();
428  hcalEnergyLeadChargedHadrCand = leadingPFCharged->hcalEnergy();
429  reco::TrackRef trackRef = leadingPFCharged->trackRef();
430  if( trackRef.isNonnull() ) {
431  leadingTrackNormChi2 = trackRef->normalizedChi2();
432  for( std::vector<reco::PFCandidatePtr>::const_iterator tauIt = pfTauRef->isolationPFCands().begin(); tauIt!=pfTauRef->isolationPFCands().end(); ++tauIt ){
433  myHCALenergy += (*tauIt)->hcalEnergy();
434  myECALenergy += (*tauIt)->ecalEnergy();
435  }
436  for( std::vector<reco::PFCandidatePtr>::const_iterator tauIt = pfTauRef->signalPFCands().begin(); tauIt!=pfTauRef->signalPFCands().end(); ++tauIt ){
437  myHCALenergy += (*tauIt)->hcalEnergy();
438  myECALenergy += (*tauIt)->ecalEnergy();
439  }
440  if( myHCALenergy + myECALenergy != 0. ) {
441  emFraction = myECALenergy/( myHCALenergy + myECALenergy);
442  }
443  }
444  }
445  aTauPFEssential.emFraction_ = emFraction;
446  aTauPFEssential.leadingTrackNormChi2_ = leadingTrackNormChi2;
447  aTauPFEssential.ecalEnergyLeadChargedHadrCand_ = ecalEnergyLeadChargedHadrCand;
448  aTauPFEssential.hcalEnergyLeadChargedHadrCand_ = hcalEnergyLeadChargedHadrCand;
449  // extraction of tau lifetime information
450  if( !tauTransverseImpactParameterSrc_.label().empty() ) {
451  edm::Handle<PFTauTIPAssociationByRef> tauLifetimeInfos;
452  iEvent.getByToken(tauTransverseImpactParameterToken_, tauLifetimeInfos);
453  const reco::PFTauTransverseImpactParameter& tauLifetimeInfo = *(*tauLifetimeInfos)[pfTauRef];
454  pat::tau::TauPFEssential& aTauPFEssential = aTau.pfEssential_[0];
455  aTauPFEssential.dxy_PCA_ = tauLifetimeInfo.dxy_PCA();
456  aTauPFEssential.dxy_ = tauLifetimeInfo.dxy();
457  aTauPFEssential.dxy_error_ = tauLifetimeInfo.dxy_error();
458  aTauPFEssential.hasSV_ = tauLifetimeInfo.hasSecondaryVertex();
459  aTauPFEssential.flightLength_ = tauLifetimeInfo.flightLength();
460  aTauPFEssential.flightLengthSig_ = tauLifetimeInfo.flightLengthSig();
461  aTauPFEssential.ip3d_ = tauLifetimeInfo.ip3d();
462  aTauPFEssential.ip3d_error_ = tauLifetimeInfo.ip3d_error();
463  }
464  }
465 
466  // Isolation
467  if (isolator_.enabled()) {
469  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
470  // better to loop backwards, so the vector is resized less times
471  for ( IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
472  ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
473  aTau.setIsolation(it->first, it->second);
474  }
475  }
476 
477  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
478  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
479  }
480 
481  if (efficiencyLoader_.enabled()) {
482  efficiencyLoader_.setEfficiencies( aTau, tausRef );
483  }
484 
485  if (resolutionLoader_.enabled()) {
487  }
488 
489  if ( useUserData_ ) {
490  userDataHelper_.add( aTau, iEvent, iSetup );
491  }
492 
493  patTaus->push_back(aTau);
494  }
495 
496  // sort taus in pT
497  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
498 
499  // put genEvt object in Event
500  iEvent.put(std::move(patTaus));
501 
502  // clean up
504 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool isAvailable() const
Definition: Ref.h:577
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:137
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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:64
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool embedIsolationPFChargedHadrCands_
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_
pat::PATUserDataHelper< pat::Tau > userDataHelper_
genJetMatch
switch on/off embedding of matched genJet&#39;s
bool embedSignalPFNeutralHadrCands_
bool isValid() const
Definition: HandleBase.h:74
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
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
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().