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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATTauProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~PATTauProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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_
 
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_
 
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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

Definition at line 129 of file PATTauProducer.cc.

130 {
131 }

Member Function Documentation

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

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

491 {
493  iDesc.setComment("PAT tau producer module");
494 
495  // input source
496  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
497 
498  // embedding
499  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
500  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
501  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
502 
503  // MC matching configurables
504  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
505  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
506  std::vector<edm::InputTag> emptySourceVector;
507  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
508  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
509  )->setComment("input with MC match information");
510 
511  // MC jet matching variables
512  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
513  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
514  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
515 
516 
518 
519  // tau ID configurables
520  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
521  edm::ParameterSetDescription tauIDSourcesPSet;
522  tauIDSourcesPSet.setAllowAnything();
523  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("tauIDSource", edm::InputTag(), true) xor
524  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true)
525  )->setComment("input with electron ID variables");
526 
527  // IsoDeposit configurables
528  edm::ParameterSetDescription isoDepositsPSet;
529  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
530  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
531  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
532  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
533  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
534  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
535  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
536  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
537  iDesc.addOptional("isoDeposits", isoDepositsPSet);
538 
539  // Efficiency configurables
540  edm::ParameterSetDescription efficienciesPSet;
541  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
542  iDesc.add("efficiencies", efficienciesPSet);
543  iDesc.add<bool>("addEfficiencies", false);
544 
545  // Check to see if the user wants to add user data
546  edm::ParameterSetDescription userDataPSet;
548  iDesc.addOptional("userData", userDataPSet);
549 
550  edm::ParameterSetDescription isolationPSet;
551  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
552  iDesc.add("userIsolation", isolationPSet);
553 
554 }
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 483 of file PATTauProducer.cc.

Referenced by produce().

484 {
485  edm::Ref<TauCollectionType> tauRef(tauCollection, tauIdx);
486  return (*tauIdDiscr)[tauRef];
487 }
void PATTauProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 133 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, 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, 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::InputTag::label(), pat::tau::TauPFEssential::leadingTrackNormChi2_, jetCorrFactors_cfi::levels, eostools::move(), gen::n, 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(), tauIDSrcs_, tauJetCorrFactorsTokens_, tauTransverseImpactParameterSrc_, tauTransverseImpactParameterToken_, HiIsolationCommonParameters_cff::track, userDataHelper_, and useUserData_.

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

Referenced by PATTauProducer().

bool pat::PATTauProducer::addGenJetMatch_
private

Definition at line 84 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addGenMatch_
private

Definition at line 80 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addResolutions_
private

Definition at line 108 of file PATTauProducer.h.

Referenced by PATTauProducer().

bool pat::PATTauProducer::addTauID_
private

Definition at line 91 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::addTauJetCorrFactors_
private

Definition at line 88 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 60 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 94 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 63 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 106 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedGenJetMatch_
private

Definition at line 85 of file PATTauProducer.h.

Referenced by PATTauProducer().

bool pat::PATTauProducer::embedGenMatch_
private

Definition at line 81 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFCands_
private

Definition at line 75 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFChargedHadrCands_
private

Definition at line 76 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFGammaCands_
private

Definition at line 78 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationPFNeutralHadrCands_
private

Definition at line 77 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedIsolationTracks_
private

Definition at line 65 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFCand_
private

Definition at line 68 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFChargedHadrCand_
private

Definition at line 69 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadPFNeutralCand_
private

Definition at line 70 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedLeadTrack_
private

Definition at line 66 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFCands_
private

Definition at line 71 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFChargedHadrCands_
private

Definition at line 72 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFGammaCands_
private

Definition at line 74 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalPFNeutralHadrCands_
private

Definition at line 73 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::embedSignalTracks_
private

Definition at line 67 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 86 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 82 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 102 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 103 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 100 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 101 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 95 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 62 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 98 of file PATTauProducer.h.

Referenced by produce().

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

Definition at line 109 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 93 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 89 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 64 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 61 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

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

Definition at line 112 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().

bool pat::PATTauProducer::useUserData_
private

Definition at line 111 of file PATTauProducer.h.

Referenced by PATTauProducer(), and produce().