CMS 3D CMS Logo

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

class definition More...

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

Inheritance diagram for pat::PATMuonProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATMuonProducer (const edm::ParameterSet &iConfig)
 default constructir More...
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 everything that needs to be done during the event loop More...
 
 ~PATMuonProducer ()
 default destructur More...
 
- 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)
 description of config file parameters More...
 
- 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::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
 
typedef std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
 
typedef std::pair< pat::IsolationKeys, edm::InputTagIsolationLabel
 
typedef std::vector< IsolationLabelIsolationLabels
 
typedef std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
 
typedef edm::RefToBase< reco::MuonMuonBaseRef
 typedefs for convenience More...
 

Private Member Functions

void embedHighLevel (pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
 
void fillMuon (Muon &aMuon, const MuonBaseRef &muonRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
 common muon filling, for both the standard and PF2PAT case More...
 
template<typename T >
void readIsolationLabels (const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T > > > &tokens)
 
void setMuonMiniIso (pat::Muon &aMuon, const pat::PackedCandidateCollection *pc)
 

Private Attributes

bool addEfficiencies_
 add efficiencies to the muon (this will be data members of th muon even w/o embedding) More...
 
bool addGenMatch_
 add generator match information More...
 
bool addPuppiIsolation_
 add puppi isolation More...
 
bool addResolutions_
 add resolutions to the muon (this will be data members of th muon even w/o embedding) More...
 
edm::EDGetTokenT< reco::BeamSpotbeamLineToken_
 input source of the primary vertex/beamspot More...
 
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
 source of caloMET muon corrections More...
 
bool computeMiniIso_
 
pat::helper::EfficiencyLoader efficiencyLoader_
 helper class to add efficiencies to the muon More...
 
bool embedBestTrack_
 embed the track from best muon measurement (global pflow) More...
 
bool embedCaloMETMuonCorrs_
 embed muon MET correction info for caloMET into the muon More...
 
bool embedCombinedMuon_
 embed track of the combined fit into the muon More...
 
bool embedDytMuon_
 embed track from DYT muon fit into the muon More...
 
bool embedGenMatch_
 embed the gen match information into the muon More...
 
bool embedHighLevelSelection_
 embed high level selection variables More...
 
bool embedPFCandidate_
 embed pfCandidates into the muon More...
 
bool embedPfEcalEnergy_
 add ecal PF energy More...
 
bool embedPickyMuon_
 embed track from picky muon fit into the muon More...
 
bool embedStandAloneMuon_
 embed track from muon system into the muon More...
 
bool embedTcMETMuonCorrs_
 embed muon MET correction info for tcMET into the muon More...
 
bool embedTpfmsMuon_
 embed track from tpfms muon fit into the muon More...
 
bool embedTrack_
 embed the track from inner tracker into the muon More...
 
bool embedTunePBestTrack_
 embed the track from best muon measurement (muon only) More...
 
bool forceEmbedBestTrack_
 force separate embed of the best track even if already embedded More...
 
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
 input tags for generator match information More...
 
IsolationLabels isoDepositLabels_
 input source for isoDeposits More...
 
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
 
IsolationLabels isolationValueLabels_
 input source isolation value maps More...
 
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
 
pat::helper::MultiIsolator isolator_
 helper class to add userdefined isolation values to the muon More...
 
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
 isolation value pair for temporary storage before being folded into the muon More...
 
std::vector< double > miniIsoParams_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 input source More...
 
edm::EDGetTokenT< pat::PackedCandidateCollectionpcToken_
 
edm::EDGetTokenT< reco::PFCandidateCollectionpfMuonToken_
 input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT More...
 
GreaterByPt< MuonpTComparator_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
 input source of the primary vertex More...
 
pat::helper::KinResolutionsLoader resolutionLoader_
 helper class to add resolutions to the muon More...
 
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
 source of tcMET muon corrections More...
 
bool useParticleFlow_
 switch to use particle flow (PF2PAT) or not More...
 
pat::PATUserDataHelper< pat::MuonuserDataHelper_
 helper class to add userData to the muon More...
 
bool useUserData_
 add user data to the muon (this will be data members of th muon even w/o embedding) More...
 

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

class definition

Produces pat::Muon's.

The PATMuonProducer produces analysis-level pat::Muon's starting from a collection of objects of reco::Muon.

Author
Steven Lowette, Roger Wolf
Version
Id
PATMuonProducer.h,v 1.29 2012/08/22 15:02:52 bellan Exp

Definition at line 43 of file PATMuonProducer.h.

Member Typedef Documentation

Definition at line 58 of file PATMuonProducer.h.

Definition at line 59 of file PATMuonProducer.h.

Definition at line 61 of file PATMuonProducer.h.

Definition at line 62 of file PATMuonProducer.h.

typedef std::vector< edm::Handle< edm::ValueMap<double> > > pat::PATMuonProducer::IsolationValueMaps
private

Definition at line 60 of file PATMuonProducer.h.

typedefs for convenience

Definition at line 57 of file PATMuonProducer.h.

Constructor & Destructor Documentation

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

default constructir

Definition at line 50 of file PATMuonProducer.cc.

References addEfficiencies_, addGenMatch_, addPuppiIsolation_, addResolutions_, beamLineToken_, caloMETMuonCorrsToken_, computeMiniIso_, edm::EDConsumerBase::consumes(), edm::EDConsumerBase::consumesCollector(), efficiencyLoader_, embedBestTrack_, embedCaloMETMuonCorrs_, embedCombinedMuon_, embedDytMuon_, embedGenMatch_, embedHighLevelSelection_, embedPFCandidate_, embedPfEcalEnergy_, embedPickyMuon_, embedStandAloneMuon_, embedTcMETMuonCorrs_, embedTpfmsMuon_, embedTrack_, embedTunePBestTrack_, Exception, edm::ParameterSet::existsAs(), forceEmbedBestTrack_, genMatchTokens_, edm::ParameterSet::getParameter(), isoDepositLabels_, isoDepositTokens_, isolationValueLabels_, isolationValueTokens_, miniIsoParams_, muonToken_, pcToken_, pfMuonToken_, PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_photons_, pvToken_, readIsolationLabels(), resolutionLoader_, GlobalPosition_Frontier_DevDB_cff::tag, tcMETMuonCorrsToken_, useParticleFlow_, userDataHelper_, useUserData_, and edm::vector_transform().

50  : useUserData_(iConfig.exists("userData")),
51  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false)
52 {
53  // input source
54  muonToken_ = consumes<edm::View<reco::Muon> >(iConfig.getParameter<edm::InputTag>( "muonSource" ));
55  // embedding of tracks
56  embedBestTrack_ = iConfig.getParameter<bool>( "embedMuonBestTrack" );
57  embedTunePBestTrack_ = iConfig.getParameter<bool>( "embedTunePMuonBestTrack" );
58  forceEmbedBestTrack_ = iConfig.getParameter<bool>( "forceBestTrackEmbedding" );
59  embedTrack_ = iConfig.getParameter<bool>( "embedTrack" );
60  embedCombinedMuon_ = iConfig.getParameter<bool>( "embedCombinedMuon" );
61  embedStandAloneMuon_ = iConfig.getParameter<bool>( "embedStandAloneMuon" );
62  // embedding of muon MET correction information
63  embedCaloMETMuonCorrs_ = iConfig.getParameter<bool>("embedCaloMETMuonCorrs" );
64  embedTcMETMuonCorrs_ = iConfig.getParameter<bool>("embedTcMETMuonCorrs" );
65  caloMETMuonCorrsToken_ = mayConsume<edm::ValueMap<reco::MuonMETCorrectionData> >(iConfig.getParameter<edm::InputTag>("caloMETMuonCorrs" ));
66  tcMETMuonCorrsToken_ = mayConsume<edm::ValueMap<reco::MuonMETCorrectionData> >(iConfig.getParameter<edm::InputTag>("tcMETMuonCorrs" ));
67  // pflow specific configurables
68  useParticleFlow_ = iConfig.getParameter<bool>( "useParticleFlow" );
69  embedPFCandidate_ = iConfig.getParameter<bool>( "embedPFCandidate" );
70  pfMuonToken_ = mayConsume<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>( "pfMuonSource" ));
71  embedPfEcalEnergy_ = iConfig.getParameter<bool>( "embedPfEcalEnergy" );
72  // embedding of tracks from TeV refit
73  embedPickyMuon_ = iConfig.getParameter<bool>( "embedPickyMuon" );
74  embedTpfmsMuon_ = iConfig.getParameter<bool>( "embedTpfmsMuon" );
75  embedDytMuon_ = iConfig.getParameter<bool>( "embedDytMuon" );
76  // Monte Carlo matching
77  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
78  if (addGenMatch_) {
79  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
80  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
82  }
83  else {
84  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
85  }
86  }
87  // efficiencies
88  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
89  if(addEfficiencies_){
91  }
92  // resolutions
93  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
94  if (addResolutions_) {
96  }
97  // puppi
98  addPuppiIsolation_ = iConfig.getParameter<bool>("addPuppiIsolation");
100  PUPPIIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationChargedHadrons"));
101  PUPPIIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationNeutralHadrons"));
102  PUPPIIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationPhotons"));
103  //puppiNoLeptons
104  PUPPINoLeptonsIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons"));
105  PUPPINoLeptonsIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons"));
106  PUPPINoLeptonsIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationPhotons"));
107  }
108  // read isoDeposit labels, for direct embedding
109  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
110  // read isolation value labels, for direct embedding
112  // check to see if the user wants to add user data
113  if( useUserData_ ){
115  }
116  // embed high level selection variables
117  embedHighLevelSelection_ = iConfig.getParameter<bool>("embedHighLevelSelection");
118  if ( embedHighLevelSelection_ ) {
119  beamLineToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"));
120  pvToken_ = consumes<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("pvSrc"));
121  }
122 
123  //for mini-isolation calculation
124  computeMiniIso_ = iConfig.getParameter<bool>("computeMiniIso");
125  miniIsoParams_ = iConfig.getParameter<std::vector<double> >("miniIsoParams");
126  if(computeMiniIso_ && miniIsoParams_.size() != 9){
127  throw cms::Exception("ParameterError") << "miniIsoParams must have exactly 9 elements.\n";
128  }
129  if(computeMiniIso_)
130  pcToken_ = consumes<pat::PackedCandidateCollection >(iConfig.getParameter<edm::InputTag>("pfCandsForMiniIso"));
131 
132  // produces vector of muons
133  produces<std::vector<Muon> >();
134 }
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding) ...
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
bool addPuppiIsolation_
add puppi isolation
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
source of tcMET muon corrections
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
input source of the primary vertex
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
input source
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding) ...
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
source of caloMET muon corrections
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
bool exists(std::string const &parameterName) const
checks if a parameter exists
bool embedBestTrack_
embed the track from best muon measurement (global pflow)
bool addResolutions_
add resolutions to the muon (this will be data members of th muon even w/o embedding) ...
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
std::vector< double > miniIsoParams_
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
edm::EDGetTokenT< reco::PFCandidateCollection > pfMuonToken_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT ...
pat::helper::MultiIsolator isolator_
helper class to add userdefined isolation values to the muon
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
input source of the primary vertex/beamspot
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
pat::PATUserDataHelper< pat::Muon > userDataHelper_
helper class to add userData to the muon
bool embedStandAloneMuon_
embed track from muon system into the muon
bool embedTrack_
embed the track from inner tracker into the muon
bool addGenMatch_
add generator match information
bool embedPfEcalEnergy_
add ecal PF energy
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
bool embedTunePBestTrack_
embed the track from best muon measurement (muon only)
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
bool embedPickyMuon_
embed track from picky muon fit into the muon
bool embedDytMuon_
embed track from DYT muon fit into the muon
bool embedGenMatch_
embed the gen match information into the muon
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T > > > &tokens)
IsolationLabels isoDepositLabels_
input source for isoDeposits
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
input tags for generator match information
IsolationLabels isolationValueLabels_
input source isolation value maps
bool forceEmbedBestTrack_
force separate embed of the best track even if already embedded
bool embedPFCandidate_
embed pfCandidates into the muon
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
bool embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
bool embedHighLevelSelection_
embed high level selection variables
PATMuonProducer::~PATMuonProducer ( )

default destructur

Definition at line 137 of file PATMuonProducer.cc.

138 {
139 }

Member Function Documentation

void PATMuonProducer::embedHighLevel ( pat::Muon aMuon,
reco::TrackRef  track,
reco::TransientTrack tt,
reco::Vertex primaryVertex,
bool  primaryVertexIsValid,
reco::BeamSpot beamspot,
bool  beamspotIsValid 
)
private

Definition at line 644 of file PATMuonProducer.cc.

References pat::Muon::BS2D, pat::Muon::BS3D, DEFINE_FWK_MODULE, reco::BeamSpot::position(), pat::Muon::PV2D, pat::Muon::PV3D, mps_fire::result, reco::BeamSpot::rotatedCovariance3D(), pat::Muon::setDB(), IPTools::signedImpactParameter3D(), and IPTools::signedTransverseImpactParameter().

Referenced by produce().

652 {
653  // Correct to PV
654 
655  // PV2D
656  std::pair<bool,Measurement1D> result =
658  GlobalVector(track->px(),
659  track->py(),
660  track->pz()),
661  primaryVertex);
662  double d0_corr = result.second.value();
663  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
664  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV2D);
665 
666 
667  // PV3D
668  result =
670  GlobalVector(track->px(),
671  track->py(),
672  track->pz()),
673  primaryVertex);
674  d0_corr = result.second.value();
675  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
676  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV3D);
677 
678 
679  // Correct to beam spot
680  // make a fake vertex out of beam spot
681  reco::Vertex vBeamspot(beamspot.position(), beamspot.rotatedCovariance3D());
682 
683  // BS2D
684  result =
686  GlobalVector(track->px(),
687  track->py(),
688  track->pz()),
689  vBeamspot);
690  d0_corr = result.second.value();
691  d0_err = beamspotIsValid ? result.second.error() : -1.0;
692  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS2D);
693 
694  // BS3D
695  result =
697  GlobalVector(track->px(),
698  track->py(),
699  track->pz()),
700  vBeamspot);
701  d0_corr = result.second.value();
702  d0_err = beamspotIsValid ? result.second.error() : -1.0;
703  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS3D);
704 }
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
void setDB(double dB, double edB, IPTYPE type=PV2D)
Definition: Muon.h:243
const Point & position() const
position
Definition: BeamSpot.h:62
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:78
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void PATMuonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

description of config file parameters

Definition at line 532 of file PATMuonProducer.cc.

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

533 {
535  iDesc.setComment("PAT muon producer module");
536 
537  // input source
538  iDesc.add<edm::InputTag>("muonSource", edm::InputTag("no default"))->setComment("input collection");
539 
540  // embedding
541  iDesc.add<bool>("embedMuonBestTrack", true)->setComment("embed muon best track (global pflow)");
542  iDesc.add<bool>("embedTunePMuonBestTrack", true)->setComment("embed muon best track (muon only)");
543  iDesc.add<bool>("forceBestTrackEmbedding", true)->setComment("force embedding separately the best tracks even if they're already embedded e.g. as tracker or global tracks");
544  iDesc.add<bool>("embedTrack", true)->setComment("embed external track");
545  iDesc.add<bool>("embedStandAloneMuon", true)->setComment("embed external stand-alone muon");
546  iDesc.add<bool>("embedCombinedMuon", false)->setComment("embed external combined muon");
547  iDesc.add<bool>("embedPickyMuon", false)->setComment("embed external picky track");
548  iDesc.add<bool>("embedTpfmsMuon", false)->setComment("embed external tpfms track");
549  iDesc.add<bool>("embedDytMuon", false)->setComment("embed external dyt track ");
550 
551  // embedding of MET muon corrections
552  iDesc.add<bool>("embedCaloMETMuonCorrs", true)->setComment("whether to add MET muon correction for caloMET or not");
553  iDesc.add<edm::InputTag>("caloMETMuonCorrs", edm::InputTag("muonMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for caloMET");
554  iDesc.add<bool>("embedTcMETMuonCorrs", true)->setComment("whether to add MET muon correction for tcMET or not");
555  iDesc.add<edm::InputTag>("tcMETMuonCorrs", edm::InputTag("muonTCMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for tcMET");
556 
557  // pf specific parameters
558  iDesc.add<edm::InputTag>("pfMuonSource", edm::InputTag("pfMuons"))->setComment("particle flow input collection");
559  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
560  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
561  iDesc.add<bool>("embedPfEcalEnergy", true)->setComment("add ecal energy as reconstructed by PF");
562 
563  // MC matching configurables
564  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
565  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
566  std::vector<edm::InputTag> emptySourceVector;
567  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
568  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
569  )->setComment("input with MC match information");
570 
571  // mini-iso
572  iDesc.add<bool>("computeMiniIso", false)->setComment("whether or not to compute and store electron mini-isolation");
573  iDesc.add<edm::InputTag>("pfCandsForMiniIso", edm::InputTag("packedPFCandidates"))->setComment("collection to use to compute mini-iso");
574  iDesc.add<std::vector<double> >("miniIsoParams", std::vector<double>())->setComment("mini-iso parameters to use for muons");
575 
577 
578  // IsoDeposit configurables
579  edm::ParameterSetDescription isoDepositsPSet;
580  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
581  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
582  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
583  isoDepositsPSet.addOptional<edm::InputTag>("particle");
584  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
585  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
586  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
587  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
588  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
589  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
590  iDesc.addOptional("isoDeposits", isoDepositsPSet);
591 
592  // isolation values configurables
593  edm::ParameterSetDescription isolationValuesPSet;
594  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
595  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
596  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
597  isolationValuesPSet.addOptional<edm::InputTag>("particle");
598  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
599  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
600  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
601  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
602  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
603  iDesc.addOptional("isolationValues", isolationValuesPSet);
604 
605  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
606  true >> (edm::ParameterDescription<edm::InputTag>("puppiIsolationChargedHadrons", edm::InputTag("muonPUPPIIsolation","h+-DR030-ThresholdVeto000-ConeVeto000"), true) and
607  edm::ParameterDescription<edm::InputTag>("puppiIsolationNeutralHadrons", edm::InputTag("muonPUPPIIsolation","h0-DR030-ThresholdVeto000-ConeVeto001"), true) and
608  edm::ParameterDescription<edm::InputTag>("puppiIsolationPhotons", edm::InputTag("muonPUPPIIsolation","gamma-DR030-ThresholdVeto000-ConeVeto001"), true) and
609  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons", edm::InputTag("muonPUPPINoLeptonsIsolation","h+-DR030-ThresholdVeto000-ConeVeto000"), true) and
610  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons", edm::InputTag("muonPUPPINoLeptonsIsolation","h0-DR030-ThresholdVeto000-ConeVeto001"), true) and
611  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationPhotons", edm::InputTag("muonPUPPINoLeptonsIsolation","gamma-DR030-ThresholdVeto000-ConeVeto001"), true)) or
612  false >> edm::EmptyGroupDescription());
613 
614  // Efficiency configurables
615  edm::ParameterSetDescription efficienciesPSet;
616  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
617  iDesc.add("efficiencies", efficienciesPSet);
618  iDesc.add<bool>("addEfficiencies", false);
619 
620  // Check to see if the user wants to add user data
621  edm::ParameterSetDescription userDataPSet;
623  iDesc.addOptional("userData", userDataPSet);
624 
625  edm::ParameterSetDescription isolationPSet;
626  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
627  iDesc.add("userIsolation", isolationPSet);
628 
629  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
630  edm::ParameterSetDescription highLevelPSet;
631  highLevelPSet.setAllowAnything();
632  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
633  )->setComment("input with high level selection");
635  )->setComment("input with high level selection");
636 
637  //descriptions.add("PATMuonProducer", iDesc);
638 }
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T > > cases)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void PATMuonProducer::fillMuon ( Muon aMuon,
const MuonBaseRef muonRef,
const reco::CandidateBaseRef baseRef,
const GenAssociations genMatches,
const IsoDepositMaps deposits,
const IsolationValueMaps isolationValues 
) const
private

common muon filling, for both the standard and PF2PAT case

Definition at line 446 of file PATMuonProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), edm::contains(), reco::Muon::DYT, efficiencyLoader_, embedBestTrack_, pat::Muon::embedCombinedMuon(), embedCombinedMuon_, pat::Muon::embedDytMuon(), embedDytMuon_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Muon::embedMuonBestTrack(), pat::Muon::embedPickyMuon(), embedPickyMuon_, pat::Muon::embedStandAloneMuon(), embedStandAloneMuon_, pat::Muon::embedTpfmsMuon(), embedTpfmsMuon_, pat::Muon::embedTrack(), embedTrack_, embedTunePBestTrack_, pat::Muon::embedTunePMuonBestTrack(), pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), plotBeamSpotDB::first, forceEmbedBestTrack_, mps_fire::i, edm::RefToBase< T >::id(), reco::Muon::isAValidMuonTrack(), reco::Muon::isGlobalMuon(), isoDepositLabels_, isolationValueLabels_, gen::n, pat::Muon::pfCandidateRef(), reco::Muon::Picky, resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), reco::LeafCandidate::setP4(), pat::helper::KinResolutionsLoader::setResolutions(), source, reco::Muon::TPFMS, and useParticleFlow_.

Referenced by produce().

447 {
448  // in the particle flow algorithm,
449  // the muon momentum is recomputed.
450  // the new value is stored as the momentum of the
451  // resulting PFCandidate of type Muon, and choosen
452  // as the pat::Muon momentum
453  if (useParticleFlow_)
454  aMuon.setP4( aMuon.pfCandidateRef()->p4() );
455  if (embedTrack_) aMuon.embedTrack();
458 
459  // embed the TeV refit track refs (only available for globalMuons)
460  if (aMuon.isGlobalMuon()) {
462  aMuon.embedPickyMuon();
464  aMuon.embedTpfmsMuon();
466  aMuon.embedDytMuon();
467  }
468 
469  // embed best tracks (at the end, so unless forceEmbedBestTrack_ is true we can save some space not embedding them twice)
472 
473  // store the match to the generated final state muons
474  if (addGenMatch_) {
475  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
476  reco::GenParticleRef genMuon = (*genMatches[i])[baseRef];
477  aMuon.addGenParticleRef(genMuon);
478  }
479  if (embedGenMatch_) aMuon.embedGenParticle();
480  }
481  if (efficiencyLoader_.enabled()) {
482  efficiencyLoader_.setEfficiencies( aMuon, muonRef );
483  }
484 
485  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
486  if(useParticleFlow_) {
487  if (deposits[j]->contains(baseRef.id())) {
488  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[baseRef]);
489  } else if (deposits[j]->contains(muonRef.id())){
490  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
491  } else {
492  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
493  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[source]);
494  }
495  }
496  else{
497  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
498  }
499  }
500 
501  for (size_t j = 0; j<isolationValues.size(); ++j) {
502  if(useParticleFlow_) {
503  if (isolationValues[j]->contains(baseRef.id())) {
504  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[baseRef]);
505  } else if (isolationValues[j]->contains(muonRef.id())) {
506  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
507  } else {
508  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
509  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[source]);
510  }
511  }
512  else{
513  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
514  }
515  }
516 
517  if (resolutionLoader_.enabled()) {
519  }
520 }
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void embedDytMuon()
embed reference to the above dyt Track
void embedTpfmsMuon()
embed reference to the above tpfms Track
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
void embedTunePMuonBestTrack(bool force=false)
void embedMuonBestTrack(bool force=false)
bool isGlobalMuon() const
Definition: Muon.h:225
bool embedBestTrack_
embed the track from best muon measurement (global pflow)
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
ProductID id() const
Definition: RefToBase.h:242
void embedStandAloneMuon()
set reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:176
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
bool embedStandAloneMuon_
embed track from muon system into the muon
bool embedTrack_
embed the track from inner tracker into the muon
bool addGenMatch_
add generator match information
void embedGenParticle()
Definition: PATObject.h:694
reco::PFCandidateRef pfCandidateRef() const
bool isAValidMuonTrack(const MuonTrackType &type) const
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:678
bool embedTunePBestTrack_
embed the track from best muon measurement (muon only)
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
bool embedPickyMuon_
embed track from picky muon fit into the muon
bool embedDytMuon_
embed track from DYT muon fit into the muon
bool embedGenMatch_
embed the gen match information into the muon
IsolationLabels isoDepositLabels_
input source for isoDeposits
IsolationLabels isolationValueLabels_
input source isolation value maps
void embedPickyMuon()
embed reference to the above picky Track
bool forceEmbedBestTrack_
force separate embed of the best track even if already embedded
bool embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
static std::string const source
Definition: EdmProvDump.cc:43
void PATMuonProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

everything that needs to be done during the event loop

Definition at line 141 of file PATMuonProducer.cc.

References addGenMatch_, addPuppiIsolation_, beamLineToken_, ecalDrivenElectronSeedsParameters_cff::beamSpot, pat::helper::MultiIsolator::beginEvent(), TransientTrackBuilder::build(), muonProducer_cfi::caloMETMuonCorrs, caloMETMuonCorrsToken_, computeMiniIso_, CandIsolatorFromDeposits_cfi::deposits, reco::PFCandidate::ecalEnergy(), efficiencyLoader_, pat::Muon::embedCaloMETMuonCorrs(), embedCaloMETMuonCorrs_, embedCombinedMuon_, embedGenMatch_, embedHighLevel(), embedHighLevelSelection_, pat::Muon::embedPFCandidate(), embedPFCandidate_, embedPfEcalEnergy_, pat::Muon::embedTcMETMuonCorrs(), embedTcMETMuonCorrs_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), pat::helper::MultiIsolator::fill(), fillMuon(), genMatchTokens_, edm::EventSetup::get(), edm::Event::getByToken(), cutBasedMuonId_MuonPOG_V0_cff::globalTrack, mps_fire::i, training_settings::idx, diffTreeTool::index, susybsm::HSCParticleType::innerTrack, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), isoDepositTokens_, electronProducer_cff::isolationValues, isolationValueTokens_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), eostools::move(), reco::PFCandidate::muonRef(), electronCleaner_cfi::muons, muonToken_, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), nhits, hemisphereProducer_cfi::patMuons, pcToken_, pfMuonToken_, impactParameterTagInfos_cfi::primaryVertex, edm::Handle< T >::product(), pTComparator_, PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_photons_, edm::Event::put(), pvToken_, resolutionLoader_, pat::Lepton< LeptonType >::setIsolation(), pat::Muon::setIsolationPUPPI(), pat::Muon::setIsolationPUPPINoLeptons(), setMuonMiniIso(), pat::Muon::setNormChi2(), pat::Muon::setNumberOfValidHits(), pat::Muon::setPFCandidateRef(), pat::Muon::setPfEcalEnergy(), muonProducer_cfi::tcMETMuonCorrs, tcMETMuonCorrsToken_, groupFilesInBlocks::tt, useParticleFlow_, userDataHelper_, and useUserData_.

142 {
143  // switch off embedding (in unschedules mode)
144  if (iEvent.isRealData()){
145  addGenMatch_ = false;
146  embedGenMatch_ = false;
147  }
148 
150  iEvent.getByToken(muonToken_, muons);
151 
152 
154  if(computeMiniIso_)
155  iEvent.getByToken(pcToken_, pc);
156 
157  // get the ESHandle for the transient track builder,
158  // if needed for high level selection embedding
160 
161  if(isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
163  if(resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
164 
166  for (size_t j = 0; j<isoDepositTokens_.size(); ++j) {
167  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
168  }
169 
171  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
173  }
174 
175  //value maps for puppi isolation
176  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_charged_hadrons;
177  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_neutral_hadrons;
178  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_photons;
179  //value maps for puppiNoLeptons isolation
180  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_charged_hadrons;
181  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_neutral_hadrons;
182  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_photons;
183  if(addPuppiIsolation_){
184  //puppi
185  iEvent.getByToken(PUPPIIsolation_charged_hadrons_, PUPPIIsolation_charged_hadrons);
186  iEvent.getByToken(PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_neutral_hadrons);
187  iEvent.getByToken(PUPPIIsolation_photons_, PUPPIIsolation_photons);
188  //puppiNoLeptons
189  iEvent.getByToken(PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_charged_hadrons);
190  iEvent.getByToken(PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons);
191  iEvent.getByToken(PUPPINoLeptonsIsolation_photons_, PUPPINoLeptonsIsolation_photons);
192  }
193 
194  // prepare the MC genMatchTokens_
195  GenAssociations genMatches(genMatchTokens_.size());
196  if (addGenMatch_) {
197  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
198  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
199  }
200  }
201 
202  // prepare the high level selection: needs beamline
203  // OR primary vertex, depending on user selection
206  bool beamSpotIsValid = false;
207  bool primaryVertexIsValid = false;
208  if ( embedHighLevelSelection_ ) {
209  // get the beamspot
210  edm::Handle<reco::BeamSpot> beamSpotHandle;
211  iEvent.getByToken(beamLineToken_, beamSpotHandle);
212 
213  // get the primary vertex
215  iEvent.getByToken( pvToken_, pvHandle );
216 
217  if( beamSpotHandle.isValid() ){
218  beamSpot = *beamSpotHandle;
219  beamSpotIsValid = true;
220  } else{
221  edm::LogError("DataNotAvailable")
222  << "No beam spot available from EventSetup, not adding high level selection \n";
223  }
224  if( pvHandle.isValid() && !pvHandle->empty() ) {
225  primaryVertex = pvHandle->at(0);
226  primaryVertexIsValid = true;
227  } else {
228  edm::LogError("DataNotAvailable")
229  << "No primary vertex available from EventSetup, not adding high level selection \n";
230  }
231  // this is needed by the IPTools methods from the tracking group
232  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
233  }
234 
235  // this will be the new object collection
236  std::vector<Muon> * patMuons = new std::vector<Muon>();
237 
239  if( useParticleFlow_ ){
240  // get the PFCandidates of type muons
241  iEvent.getByToken(pfMuonToken_, pfMuons);
242 
243  unsigned index=0;
244  for( reco::PFCandidateConstIterator i = pfMuons->begin(); i != pfMuons->end(); ++i, ++index) {
245  const reco::PFCandidate& pfmu = *i;
246  //const reco::IsolaPFCandidate& pfmu = *i;
247  const reco::MuonRef& muonRef = pfmu.muonRef();
248  assert( muonRef.isNonnull() );
249 
250  MuonBaseRef muonBaseRef(muonRef);
251  Muon aMuon(muonBaseRef);
252 
253  if ( useUserData_ ) {
254  userDataHelper_.add( aMuon, iEvent, iSetup );
255  }
256 
257  // embed high level selection
258  if ( embedHighLevelSelection_ ) {
259  // get the tracks
260  reco::TrackRef innerTrack = muonBaseRef->innerTrack();
261  reco::TrackRef globalTrack= muonBaseRef->globalTrack();
262  reco::TrackRef bestTrack = muonBaseRef->muonBestTrack();
263  reco::TrackRef chosenTrack = innerTrack;
264  // Make sure the collection it points to is there
265  if ( bestTrack.isNonnull() && bestTrack.isAvailable() )
266  chosenTrack = bestTrack;
267 
268  if ( chosenTrack.isNonnull() && chosenTrack.isAvailable() ) {
269  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
270  aMuon.setNumberOfValidHits( nhits );
271 
272  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
273  embedHighLevel( aMuon,
274  chosenTrack,
275  tt,
276  primaryVertex,
277  primaryVertexIsValid,
278  beamSpot,
279  beamSpotIsValid );
280 
281  }
282 
283  if ( globalTrack.isNonnull() && globalTrack.isAvailable() && !embedCombinedMuon_) {
284  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
285  aMuon.setNormChi2( norm_chi2 );
286  }
287  }
288  reco::PFCandidateRef pfRef(pfMuons,index);
289  //reco::PFCandidatePtr ptrToMother(pfMuons,index);
290  reco::CandidateBaseRef pfBaseRef( pfRef );
291 
292  aMuon.setPFCandidateRef( pfRef );
293  if( embedPFCandidate_ ) aMuon.embedPFCandidate();
294  fillMuon( aMuon, muonBaseRef, pfBaseRef, genMatches, deposits, isolationValues );
295 
296  if(computeMiniIso_)
297  setMuonMiniIso(aMuon, pc.product());
298 
299  if (addPuppiIsolation_) {
300  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonBaseRef],
301  (*PUPPIIsolation_neutral_hadrons)[muonBaseRef],
302  (*PUPPIIsolation_photons)[muonBaseRef]);
303 
304  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonBaseRef],
305  (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonBaseRef],
306  (*PUPPINoLeptonsIsolation_photons)[muonBaseRef]);
307  }
308  else {
309  aMuon.setIsolationPUPPI(-999., -999.,-999.);
310  aMuon.setIsolationPUPPINoLeptons(-999., -999.,-999.);
311  }
312 
313  if (embedPfEcalEnergy_) {
314  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
315  }
316 
317  patMuons->push_back(aMuon);
318  }
319  }
320  else {
322  iEvent.getByToken(muonToken_, muons);
323 
324  // embedding of muon MET corrections
326  //edm::ValueMap<reco::MuonMETCorrectionData> caloMETmuCorValueMap;
328  iEvent.getByToken(caloMETMuonCorrsToken_, caloMETMuonCorrs);
329  //caloMETmuCorValueMap = *caloMETmuCorValueMap_h;
330  }
332  //edm::ValueMap<reco::MuonMETCorrectionData> tcMETmuCorValueMap;
334  iEvent.getByToken(tcMETMuonCorrsToken_, tcMETMuonCorrs);
335  //tcMETmuCorValueMap = *tcMETmuCorValueMap_h;
336  }
337 
338  if (embedPfEcalEnergy_) {
339  // get the PFCandidates of type muons
340  iEvent.getByToken(pfMuonToken_, pfMuons);
341  }
342 
343  for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
344  // construct the Muon from the ref -> save ref to original object
345  unsigned int idx = itMuon - muons->begin();
346  MuonBaseRef muonRef = muons->refAt(idx);
347  reco::CandidateBaseRef muonBaseRef( muonRef );
348 
349  Muon aMuon(muonRef);
350  fillMuon( aMuon, muonRef, muonBaseRef, genMatches, deposits, isolationValues);
351  if(computeMiniIso_)
352  setMuonMiniIso(aMuon, pc.product());
353  if (addPuppiIsolation_) {
354  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonRef], (*PUPPIIsolation_neutral_hadrons)[muonRef], (*PUPPIIsolation_photons)[muonRef]);
355  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonRef], (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonRef], (*PUPPINoLeptonsIsolation_photons)[muonRef]);
356  }
357  else {
358  aMuon.setIsolationPUPPI(-999., -999.,-999.);
359  aMuon.setIsolationPUPPINoLeptons(-999., -999.,-999.);
360  }
361 
362  // Isolation
363  if (isolator_.enabled()) {
364  //reco::CandidatePtr mother = ptrToMother->sourceCandidatePtr(0);
365  isolator_.fill(*muons, idx, isolatorTmpStorage_);
366  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
367  // better to loop backwards, so the vector is resized less times
368  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
369  aMuon.setIsolation(it->first, it->second);
370  }
371  }
372 
373  // for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
374  // aMuon.setIsoDeposit(isoDepositLabels_[j].first,
375  // (*deposits[j])[muonRef]);
376  // }
377 
378  // add sel to selected
379  edm::Ptr<reco::Muon> muonsPtr = muons->ptrAt(idx);
380  if ( useUserData_ ) {
381  userDataHelper_.add( aMuon, iEvent, iSetup );
382  }
383 
384  // embed high level selection
385  if ( embedHighLevelSelection_ ) {
386  // get the tracks
387  reco::TrackRef innerTrack = itMuon->innerTrack();
388  reco::TrackRef globalTrack= itMuon->globalTrack();
389  reco::TrackRef bestTrack = itMuon->muonBestTrack();
390  reco::TrackRef chosenTrack = innerTrack;
391  // Make sure the collection it points to is there
392  if ( bestTrack.isNonnull() && bestTrack.isAvailable() )
393  chosenTrack = bestTrack;
394  if ( chosenTrack.isNonnull() && chosenTrack.isAvailable() ) {
395  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
396  aMuon.setNumberOfValidHits( nhits );
397 
398  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
399  embedHighLevel( aMuon,
400  chosenTrack,
401  tt,
402  primaryVertex,
403  primaryVertexIsValid,
404  beamSpot,
405  beamSpotIsValid );
406 
407  }
408 
409  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
410  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
411  aMuon.setNormChi2( norm_chi2 );
412  }
413  }
414 
415  // embed MET muon corrections
416  if( embedCaloMETMuonCorrs_ ) aMuon.embedCaloMETMuonCorrs((*caloMETMuonCorrs)[muonRef]);
417  if( embedTcMETMuonCorrs_ ) aMuon.embedTcMETMuonCorrs((*tcMETMuonCorrs )[muonRef]);
418 
419  if (embedPfEcalEnergy_) {
420  aMuon.setPfEcalEnergy(-99.0);
421  for (const reco::PFCandidate &pfmu : *pfMuons) {
422  if (pfmu.muonRef().isNonnull()) {
423  if (pfmu.muonRef().id() != muonRef.id()) throw cms::Exception("Configuration") << "Muon reference within PF candidates does not point to the muon collection." << std::endl;
424  if (pfmu.muonRef().key() == muonRef.key()) {
425  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
426  }
427  }
428  }
429  }
430 
431  patMuons->push_back(aMuon);
432  }
433  }
434 
435  // sort muons in pt
436  std::sort(patMuons->begin(), patMuons->end(), pTComparator_);
437 
438  // put genEvt object in Event
439  std::unique_ptr<std::vector<Muon> > ptr(patMuons);
440  iEvent.put(std::move(ptr));
441 
443 }
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding) ...
bool isAvailable() const
Definition: Ref.h:577
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
double ecalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:221
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
bool addPuppiIsolation_
add puppi isolation
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
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMETMuonCorrsToken_
source of tcMET muon corrections
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
input source of the primary vertex
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
input source
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > caloMETMuonCorrsToken_
source of caloMET muon corrections
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
void setMuonMiniIso(pat::Muon &aMuon, const pat::PackedCandidateCollection *pc)
reco::TransientTrack build(const reco::Track *p) const
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
key_type key() const
Accessor for product key.
Definition: Ref.h:265
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool isRealData() const
Definition: EventBase.h:64
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
edm::EDGetTokenT< reco::PFCandidateCollection > pfMuonToken_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT ...
pat::helper::MultiIsolator isolator_
helper class to add userdefined isolation values to the muon
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
input source of the primary vertex/beamspot
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
pat::PATUserDataHelper< pat::Muon > userDataHelper_
helper class to add userData to the muon
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)
GreaterByPt< Muon > pTComparator_
bool addGenMatch_
add generator match information
Definition: Muon.py:1
bool embedPfEcalEnergy_
add ecal PF energy
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
bool isValid() const
Definition: HandleBase.h:74
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:455
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
void fillMuon(Muon &aMuon, const MuonBaseRef &muonRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
common muon filling, for both the standard and PF2PAT case
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
isolation value pair for temporary storage before being folded into the muon
bool embedGenMatch_
embed the gen match information into the muon
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
input tags for generator match information
ProductIndex id() const
Definition: ProductID.h:38
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
edm::RefToBase< reco::Muon > MuonBaseRef
typedefs for convenience
bool embedPFCandidate_
embed pfCandidates into the muon
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
bool embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
def move(src, dest)
Definition: eostools.py:510
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82
bool embedHighLevelSelection_
embed high level selection variables
template<typename T >
void pat::PATMuonProducer::readIsolationLabels ( const edm::ParameterSet iConfig,
const char *  psetName,
IsolationLabels labels,
std::vector< edm::EDGetTokenT< edm::ValueMap< T > > > &  tokens 
)
private

fill label vector from the contents of the parameter set, for the embedding of isoDeposits or userIsolation values

Definition at line 183 of file PATMuonProducer.h.

References pat::EcalIso, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), pat::HcalIso, crabWrapper::key, diffTwoXMLs::label, pat::PfAllParticleIso, pat::PfChargedAllIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, pat::PfPUChargedHadronIso, pat::TrackIso, pat::UserBaseIso, and edm::vector_transform().

Referenced by PATMuonProducer().

184 {
185  labels.clear();
186 
187  if (iConfig.exists( psetName )) {
188  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
189 
190  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
191  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
192  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
193  if (depconf.exists("pfAllParticles")) {
194  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
195  }
196  if (depconf.exists("pfChargedHadrons")) {
197  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
198  }
199  if (depconf.exists("pfChargedAll")) {
200  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
201  }
202  if (depconf.exists("pfPUChargedHadrons")) {
203  labels.push_back(std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
204  }
205  if (depconf.exists("pfNeutralHadrons")) {
206  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
207  }
208  if (depconf.exists("pfPhotons")) {
209  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
210  }
211  if (depconf.exists("user")) {
212  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
213  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
215  for ( ; it != ed; ++it, ++key) {
216  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
217  }
218  tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes<edm::ValueMap<T> >(label.second);});
219  }
220  }
221  tokens = edm::vector_transform(labels, [this](pat::PATMuonProducer::IsolationLabel const & label){return consumes<edm::ValueMap<T> >(label.second);});
222 }
T getParameter(std::string const &) const
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
bool exists(std::string const &parameterName) const
checks if a parameter exists
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
void PATMuonProducer::setMuonMiniIso ( pat::Muon aMuon,
const pat::PackedCandidateCollection pc 
)
private

Definition at line 522 of file PATMuonProducer.cc.

References pat::getMiniPFIsolation(), miniIsoParams_, reco::LeafCandidate::p4(), and pat::Lepton< LeptonType >::setMiniPFIsolation().

Referenced by produce().

523 {
524  pat::PFIsolation miniiso = pat::getMiniPFIsolation(pc, aMuon.p4(),
525  miniIsoParams_[0], miniIsoParams_[1], miniIsoParams_[2],
526  miniIsoParams_[3], miniIsoParams_[4], miniIsoParams_[5],
527  miniIsoParams_[6], miniIsoParams_[7], miniIsoParams_[8]);
528  aMuon.setMiniPFIsolation(miniiso);
529 }
std::vector< double > miniIsoParams_
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const math::XYZTLorentzVector &p4, float mindr=0.05, float maxdr=0.2, float kt_scale=10.0, float ptthresh=0.5, float deadcone_ch=0.0001, float deadcone_pu=0.01, float deadcone_ph=0.01, float deadcone_nh=0.01, float dZ_cut=0.0)
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99

Member Data Documentation

bool pat::PATMuonProducer::addEfficiencies_
private

add efficiencies to the muon (this will be data members of th muon even w/o embedding)

Definition at line 148 of file PATMuonProducer.h.

Referenced by PATMuonProducer().

bool pat::PATMuonProducer::addGenMatch_
private

add generator match information

Definition at line 120 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

bool pat::PATMuonProducer::addPuppiIsolation_
private

add puppi isolation

Definition at line 154 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::addResolutions_
private

add resolutions to the muon (this will be data members of th muon even w/o embedding)

Definition at line 126 of file PATMuonProducer.h.

Referenced by PATMuonProducer().

edm::EDGetTokenT<reco::BeamSpot> pat::PATMuonProducer::beamLineToken_
private

input source of the primary vertex/beamspot

Definition at line 138 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<reco::MuonMETCorrectionData> > pat::PATMuonProducer::caloMETMuonCorrsToken_
private

source of caloMET muon corrections

Definition at line 108 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::computeMiniIso_
private

Definition at line 90 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

pat::helper::EfficiencyLoader pat::PATMuonProducer::efficiencyLoader_
private

helper class to add efficiencies to the muon

Definition at line 172 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedBestTrack_
private

embed the track from best muon measurement (global pflow)

Definition at line 94 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedCaloMETMuonCorrs_
private

embed muon MET correction info for caloMET into the muon

Definition at line 106 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedCombinedMuon_
private

embed track of the combined fit into the muon

Definition at line 104 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedDytMuon_
private

embed track from DYT muon fit into the muon

Definition at line 118 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedGenMatch_
private

embed the gen match information into the muon

Definition at line 124 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedHighLevelSelection_
private

embed high level selection variables

Definition at line 136 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedPFCandidate_
private

embed pfCandidates into the muon

Definition at line 134 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedPfEcalEnergy_
private

add ecal PF energy

Definition at line 152 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedPickyMuon_
private

embed track from picky muon fit into the muon

Definition at line 114 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedStandAloneMuon_
private

embed track from muon system into the muon

Definition at line 102 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedTcMETMuonCorrs_
private

embed muon MET correction info for tcMET into the muon

Definition at line 110 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedTpfmsMuon_
private

embed track from tpfms muon fit into the muon

Definition at line 116 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedTrack_
private

embed the track from inner tracker into the muon

Definition at line 100 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedTunePBestTrack_
private

embed the track from best muon measurement (muon only)

Definition at line 96 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::forceEmbedBestTrack_
private

force separate embed of the best track even if already embedded

Definition at line 98 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

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

input tags for generator match information

Definition at line 122 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

IsolationLabels pat::PATMuonProducer::isoDepositLabels_
private

input source for isoDeposits

Definition at line 142 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

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

Definition at line 143 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

IsolationLabels pat::PATMuonProducer::isolationValueLabels_
private

input source isolation value maps

Definition at line 145 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > pat::PATMuonProducer::isolationValueTokens_
private

Definition at line 146 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

pat::helper::MultiIsolator pat::PATMuonProducer::isolator_
private

helper class to add userdefined isolation values to the muon

Definition at line 168 of file PATMuonProducer.h.

Referenced by produce().

pat::helper::MultiIsolator::IsolationValuePairs pat::PATMuonProducer::isolatorTmpStorage_
private

isolation value pair for temporary storage before being folded into the muon

Definition at line 170 of file PATMuonProducer.h.

Referenced by produce().

std::vector<double> pat::PATMuonProducer::miniIsoParams_
private

Definition at line 91 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and setMuonMiniIso().

edm::EDGetTokenT<edm::View<reco::Muon> > pat::PATMuonProducer::muonToken_
private

input source

Definition at line 86 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<pat::PackedCandidateCollection > pat::PATMuonProducer::pcToken_
private

Definition at line 89 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<reco::PFCandidateCollection> pat::PATMuonProducer::pfMuonToken_
private

input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT

Definition at line 132 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

GreaterByPt<Muon> pat::PATMuonProducer::pTComparator_
private

— tools — comparator for pt ordering

Definition at line 166 of file PATMuonProducer.h.

Referenced by produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPIIsolation_charged_hadrons_
private

Definition at line 156 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPIIsolation_neutral_hadrons_
private

Definition at line 157 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPIIsolation_photons_
private

Definition at line 158 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPINoLeptonsIsolation_charged_hadrons_
private

Definition at line 160 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPINoLeptonsIsolation_neutral_hadrons_
private

Definition at line 161 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATMuonProducer::PUPPINoLeptonsIsolation_photons_
private

Definition at line 162 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::EDGetTokenT<std::vector<reco::Vertex> > pat::PATMuonProducer::pvToken_
private

input source of the primary vertex

Definition at line 140 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

pat::helper::KinResolutionsLoader pat::PATMuonProducer::resolutionLoader_
private

helper class to add resolutions to the muon

Definition at line 128 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

edm::EDGetTokenT<edm::ValueMap<reco::MuonMETCorrectionData> > pat::PATMuonProducer::tcMETMuonCorrsToken_
private

source of tcMET muon corrections

Definition at line 112 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::useParticleFlow_
private

switch to use particle flow (PF2PAT) or not

Definition at line 130 of file PATMuonProducer.h.

Referenced by fillMuon(), PATMuonProducer(), and produce().

pat::PATUserDataHelper<pat::Muon> pat::PATMuonProducer::userDataHelper_
private

helper class to add userData to the muon

Definition at line 174 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::useUserData_
private

add user data to the muon (this will be data members of th muon even w/o embedding)

Definition at line 150 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().