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
 
 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 & itemsToGetFromEvent () 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)
 

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...
 
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...
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 input source More...
 
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 42 of file PATMuonProducer.h.

Member Typedef Documentation

Definition at line 57 of file PATMuonProducer.h.

Definition at line 58 of file PATMuonProducer.h.

Definition at line 60 of file PATMuonProducer.h.

Definition at line 61 of file PATMuonProducer.h.

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

Definition at line 59 of file PATMuonProducer.h.

typedefs for convenience

Definition at line 56 of file PATMuonProducer.h.

Constructor & Destructor Documentation

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

default constructir

Definition at line 47 of file PATMuonProducer.cc.

References addEfficiencies_, addGenMatch_, addPuppiIsolation_, addResolutions_, beamLineToken_, caloMETMuonCorrsToken_, edm::EDConsumerBase::consumes(), edm::EDConsumerBase::consumesCollector(), efficiencyLoader_, embedBestTrack_, embedCaloMETMuonCorrs_, embedCombinedMuon_, embedDytMuon_, embedGenMatch_, embedHighLevelSelection_, embedPFCandidate_, embedPfEcalEnergy_, embedPickyMuon_, embedStandAloneMuon_, embedTcMETMuonCorrs_, embedTpfmsMuon_, embedTrack_, embedTunePBestTrack_, edm::ParameterSet::existsAs(), forceEmbedBestTrack_, genMatchTokens_, edm::ParameterSet::getParameter(), isoDepositLabels_, isoDepositTokens_, isolationValueLabels_, isolationValueTokens_, muonToken_, 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().

47  : useUserData_(iConfig.exists("userData")),
48  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false)
49 {
50  // input source
51  muonToken_ = consumes<edm::View<reco::Muon> >(iConfig.getParameter<edm::InputTag>( "muonSource" ));
52  // embedding of tracks
53  embedBestTrack_ = iConfig.getParameter<bool>( "embedMuonBestTrack" );
54  embedTunePBestTrack_ = iConfig.getParameter<bool>( "embedTunePMuonBestTrack" );
55  forceEmbedBestTrack_ = iConfig.getParameter<bool>( "forceBestTrackEmbedding" );
56  embedTrack_ = iConfig.getParameter<bool>( "embedTrack" );
57  embedCombinedMuon_ = iConfig.getParameter<bool>( "embedCombinedMuon" );
58  embedStandAloneMuon_ = iConfig.getParameter<bool>( "embedStandAloneMuon" );
59  // embedding of muon MET correction information
60  embedCaloMETMuonCorrs_ = iConfig.getParameter<bool>("embedCaloMETMuonCorrs" );
61  embedTcMETMuonCorrs_ = iConfig.getParameter<bool>("embedTcMETMuonCorrs" );
62  caloMETMuonCorrsToken_ = mayConsume<edm::ValueMap<reco::MuonMETCorrectionData> >(iConfig.getParameter<edm::InputTag>("caloMETMuonCorrs" ));
63  tcMETMuonCorrsToken_ = mayConsume<edm::ValueMap<reco::MuonMETCorrectionData> >(iConfig.getParameter<edm::InputTag>("tcMETMuonCorrs" ));
64  // pflow specific configurables
65  useParticleFlow_ = iConfig.getParameter<bool>( "useParticleFlow" );
66  embedPFCandidate_ = iConfig.getParameter<bool>( "embedPFCandidate" );
67  pfMuonToken_ = mayConsume<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>( "pfMuonSource" ));
68  embedPfEcalEnergy_ = iConfig.getParameter<bool>( "embedPfEcalEnergy" );
69  // embedding of tracks from TeV refit
70  embedPickyMuon_ = iConfig.getParameter<bool>( "embedPickyMuon" );
71  embedTpfmsMuon_ = iConfig.getParameter<bool>( "embedTpfmsMuon" );
72  embedDytMuon_ = iConfig.getParameter<bool>( "embedDytMuon" );
73  // Monte Carlo matching
74  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
75  if (addGenMatch_) {
76  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
77  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
79  }
80  else {
81  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
82  }
83  }
84  // efficiencies
85  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
86  if(addEfficiencies_){
88  }
89  // resolutions
90  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
91  if (addResolutions_) {
93  }
94  // puppi
95  addPuppiIsolation_ = iConfig.getParameter<bool>("addPuppiIsolation");
97  PUPPIIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationChargedHadrons"));
98  PUPPIIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationNeutralHadrons"));
99  PUPPIIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationPhotons"));
100  //puppiNoLeptons
101  PUPPINoLeptonsIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons"));
102  PUPPINoLeptonsIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons"));
103  PUPPINoLeptonsIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationPhotons"));
104  }
105  // read isoDeposit labels, for direct embedding
106  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
107  // read isolation value labels, for direct embedding
109  // check to see if the user wants to add user data
110  if( useUserData_ ){
112  }
113  // embed high level selection variables
114  embedHighLevelSelection_ = iConfig.getParameter<bool>("embedHighLevelSelection");
115  if ( embedHighLevelSelection_ ) {
116  beamLineToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"));
117  pvToken_ = consumes<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("pvSrc"));
118  }
119  // produces vector of muons
120  produces<std::vector<Muon> >();
121 }
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_
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.
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 124 of file PATMuonProducer.cc.

125 {
126 }

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

615 {
616  // Correct to PV
617 
618  // PV2D
619  std::pair<bool,Measurement1D> result =
621  GlobalVector(track->px(),
622  track->py(),
623  track->pz()),
624  primaryVertex);
625  double d0_corr = result.second.value();
626  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
627  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV2D);
628 
629 
630  // PV3D
631  result =
633  GlobalVector(track->px(),
634  track->py(),
635  track->pz()),
636  primaryVertex);
637  d0_corr = result.second.value();
638  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
639  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV3D);
640 
641 
642  // Correct to beam spot
643  // make a fake vertex out of beam spot
644  reco::Vertex vBeamspot(beamspot.position(), beamspot.rotatedCovariance3D());
645 
646  // BS2D
647  result =
649  GlobalVector(track->px(),
650  track->py(),
651  track->pz()),
652  vBeamspot);
653  d0_corr = result.second.value();
654  d0_err = beamspotIsValid ? result.second.error() : -1.0;
655  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS2D);
656 
657  // BS3D
658  result =
660  GlobalVector(track->px(),
661  track->py(),
662  track->pz()),
663  vBeamspot);
664  d0_corr = result.second.value();
665  d0_err = beamspotIsValid ? result.second.error() : -1.0;
666  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS3D);
667 }
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 500 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().

501 {
503  iDesc.setComment("PAT muon producer module");
504 
505  // input source
506  iDesc.add<edm::InputTag>("muonSource", edm::InputTag("no default"))->setComment("input collection");
507 
508  // embedding
509  iDesc.add<bool>("embedMuonBestTrack", true)->setComment("embed muon best track (global pflow)");
510  iDesc.add<bool>("embedTunePMuonBestTrack", true)->setComment("embed muon best track (muon only)");
511  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");
512  iDesc.add<bool>("embedTrack", true)->setComment("embed external track");
513  iDesc.add<bool>("embedStandAloneMuon", true)->setComment("embed external stand-alone muon");
514  iDesc.add<bool>("embedCombinedMuon", false)->setComment("embed external combined muon");
515  iDesc.add<bool>("embedPickyMuon", false)->setComment("embed external picky track");
516  iDesc.add<bool>("embedTpfmsMuon", false)->setComment("embed external tpfms track");
517  iDesc.add<bool>("embedDytMuon", false)->setComment("embed external dyt track ");
518 
519  // embedding of MET muon corrections
520  iDesc.add<bool>("embedCaloMETMuonCorrs", true)->setComment("whether to add MET muon correction for caloMET or not");
521  iDesc.add<edm::InputTag>("caloMETMuonCorrs", edm::InputTag("muonMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for caloMET");
522  iDesc.add<bool>("embedTcMETMuonCorrs", true)->setComment("whether to add MET muon correction for tcMET or not");
523  iDesc.add<edm::InputTag>("tcMETMuonCorrs", edm::InputTag("muonTCMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for tcMET");
524 
525  // pf specific parameters
526  iDesc.add<edm::InputTag>("pfMuonSource", edm::InputTag("pfMuons"))->setComment("particle flow input collection");
527  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
528  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
529  iDesc.add<bool>("embedPfEcalEnergy", true)->setComment("add ecal energy as reconstructed by PF");
530 
531  // MC matching configurables
532  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
533  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
534  std::vector<edm::InputTag> emptySourceVector;
535  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
536  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
537  )->setComment("input with MC match information");
538 
540 
541  // IsoDeposit configurables
542  edm::ParameterSetDescription isoDepositsPSet;
543  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
544  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
545  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
546  isoDepositsPSet.addOptional<edm::InputTag>("particle");
547  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
548  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
549  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
550  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
551  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
552  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
553  iDesc.addOptional("isoDeposits", isoDepositsPSet);
554 
555  // isolation values configurables
556  edm::ParameterSetDescription isolationValuesPSet;
557  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
558  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
559  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
560  isolationValuesPSet.addOptional<edm::InputTag>("particle");
561  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
562  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
563  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
564  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
565  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
566  iDesc.addOptional("isolationValues", isolationValuesPSet);
567 
568  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
569  true >> (edm::ParameterDescription<edm::InputTag>("puppiIsolationChargedHadrons", edm::InputTag("muonPUPPIIsolation","h+-DR030-ThresholdVeto000-ConeVeto000"), true) and
570  edm::ParameterDescription<edm::InputTag>("puppiIsolationNeutralHadrons", edm::InputTag("muonPUPPIIsolation","h0-DR030-ThresholdVeto000-ConeVeto001"), true) and
571  edm::ParameterDescription<edm::InputTag>("puppiIsolationPhotons", edm::InputTag("muonPUPPIIsolation","gamma-DR030-ThresholdVeto000-ConeVeto001"), true) and
572  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons", edm::InputTag("muonPUPPINoLeptonsIsolation","h+-DR030-ThresholdVeto000-ConeVeto000"), true) and
573  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons", edm::InputTag("muonPUPPINoLeptonsIsolation","h0-DR030-ThresholdVeto000-ConeVeto001"), true) and
574  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationPhotons", edm::InputTag("muonPUPPINoLeptonsIsolation","gamma-DR030-ThresholdVeto000-ConeVeto001"), true)) or
575  false >> edm::EmptyGroupDescription());
576 
577  // Efficiency configurables
578  edm::ParameterSetDescription efficienciesPSet;
579  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
580  iDesc.add("efficiencies", efficienciesPSet);
581  iDesc.add<bool>("addEfficiencies", false);
582 
583  // Check to see if the user wants to add user data
584  edm::ParameterSetDescription userDataPSet;
586  iDesc.addOptional("userData", userDataPSet);
587 
588  edm::ParameterSetDescription isolationPSet;
589  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
590  iDesc.add("userIsolation", isolationPSet);
591 
592  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
593  edm::ParameterSetDescription highLevelPSet;
594  highLevelPSet.setAllowAnything();
595  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
596  )->setComment("input with high level selection");
598  )->setComment("input with high level selection");
599 
600  //descriptions.add("PATMuonProducer", iDesc);
601 }
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 423 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().

424 {
425  // in the particle flow algorithm,
426  // the muon momentum is recomputed.
427  // the new value is stored as the momentum of the
428  // resulting PFCandidate of type Muon, and choosen
429  // as the pat::Muon momentum
430  if (useParticleFlow_)
431  aMuon.setP4( aMuon.pfCandidateRef()->p4() );
432  if (embedTrack_) aMuon.embedTrack();
435 
436  // embed the TeV refit track refs (only available for globalMuons)
437  if (aMuon.isGlobalMuon()) {
439  aMuon.embedPickyMuon();
441  aMuon.embedTpfmsMuon();
443  aMuon.embedDytMuon();
444  }
445 
446  // embed best tracks (at the end, so unless forceEmbedBestTrack_ is true we can save some space not embedding them twice)
449 
450  // store the match to the generated final state muons
451  if (addGenMatch_) {
452  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
453  reco::GenParticleRef genMuon = (*genMatches[i])[baseRef];
454  aMuon.addGenParticleRef(genMuon);
455  }
456  if (embedGenMatch_) aMuon.embedGenParticle();
457  }
458  if (efficiencyLoader_.enabled()) {
459  efficiencyLoader_.setEfficiencies( aMuon, muonRef );
460  }
461 
462  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
463  if(useParticleFlow_) {
464  if (deposits[j]->contains(baseRef.id())) {
465  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[baseRef]);
466  } else if (deposits[j]->contains(muonRef.id())){
467  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
468  } else {
469  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
470  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[source]);
471  }
472  }
473  else{
474  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
475  }
476  }
477 
478  for (size_t j = 0; j<isolationValues.size(); ++j) {
479  if(useParticleFlow_) {
480  if (isolationValues[j]->contains(baseRef.id())) {
481  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[baseRef]);
482  } else if (isolationValues[j]->contains(muonRef.id())) {
483  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
484  } else {
485  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
486  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[source]);
487  }
488  }
489  else{
490  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
491  }
492  }
493 
494  if (resolutionLoader_.enabled()) {
496  }
497 }
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:98
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:175
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 128 of file PATMuonProducer.cc.

References addGenMatch_, addPuppiIsolation_, beamLineToken_, ecalDrivenElectronSeedsParameters_cff::beamSpot, pat::helper::MultiIsolator::beginEvent(), TransientTrackBuilder::build(), muonProducer_cfi::caloMETMuonCorrs, caloMETMuonCorrsToken_, 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, pfMuonToken_, impactParameterTagInfos_cfi::primaryVertex, 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(), pat::Muon::setNormChi2(), pat::Muon::setNumberOfValidHits(), pat::Muon::setPFCandidateRef(), pat::Muon::setPfEcalEnergy(), muonProducer_cfi::tcMETMuonCorrs, tcMETMuonCorrsToken_, groupFilesInBlocks::tt, useParticleFlow_, userDataHelper_, and useUserData_.

129 {
130  // switch off embedding (in unschedules mode)
131  if (iEvent.isRealData()){
132  addGenMatch_ = false;
133  embedGenMatch_ = false;
134  }
135 
137  iEvent.getByToken(muonToken_, muons);
138 
139  // get the ESHandle for the transient track builder,
140  // if needed for high level selection embedding
142 
143  if(isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
145  if(resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
146 
148  for (size_t j = 0; j<isoDepositTokens_.size(); ++j) {
149  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
150  }
151 
153  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
155  }
156 
157  //value maps for puppi isolation
158  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_charged_hadrons;
159  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_neutral_hadrons;
160  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_photons;
161  //value maps for puppiNoLeptons isolation
162  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_charged_hadrons;
163  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_neutral_hadrons;
164  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_photons;
165  if(addPuppiIsolation_){
166  //puppi
167  iEvent.getByToken(PUPPIIsolation_charged_hadrons_, PUPPIIsolation_charged_hadrons);
168  iEvent.getByToken(PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_neutral_hadrons);
169  iEvent.getByToken(PUPPIIsolation_photons_, PUPPIIsolation_photons);
170  //puppiNoLeptons
171  iEvent.getByToken(PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_charged_hadrons);
172  iEvent.getByToken(PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons);
173  iEvent.getByToken(PUPPINoLeptonsIsolation_photons_, PUPPINoLeptonsIsolation_photons);
174  }
175 
176  // prepare the MC genMatchTokens_
177  GenAssociations genMatches(genMatchTokens_.size());
178  if (addGenMatch_) {
179  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
180  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
181  }
182  }
183 
184  // prepare the high level selection: needs beamline
185  // OR primary vertex, depending on user selection
188  bool beamSpotIsValid = false;
189  bool primaryVertexIsValid = false;
190  if ( embedHighLevelSelection_ ) {
191  // get the beamspot
192  edm::Handle<reco::BeamSpot> beamSpotHandle;
193  iEvent.getByToken(beamLineToken_, beamSpotHandle);
194 
195  // get the primary vertex
197  iEvent.getByToken( pvToken_, pvHandle );
198 
199  if( beamSpotHandle.isValid() ){
200  beamSpot = *beamSpotHandle;
201  beamSpotIsValid = true;
202  } else{
203  edm::LogError("DataNotAvailable")
204  << "No beam spot available from EventSetup, not adding high level selection \n";
205  }
206  if( pvHandle.isValid() && !pvHandle->empty() ) {
207  primaryVertex = pvHandle->at(0);
208  primaryVertexIsValid = true;
209  } else {
210  edm::LogError("DataNotAvailable")
211  << "No primary vertex available from EventSetup, not adding high level selection \n";
212  }
213  // this is needed by the IPTools methods from the tracking group
214  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
215  }
216 
217  // this will be the new object collection
218  std::vector<Muon> * patMuons = new std::vector<Muon>();
219 
221  if( useParticleFlow_ ){
222  // get the PFCandidates of type muons
223  iEvent.getByToken(pfMuonToken_, pfMuons);
224 
225  unsigned index=0;
226  for( reco::PFCandidateConstIterator i = pfMuons->begin(); i != pfMuons->end(); ++i, ++index) {
227  const reco::PFCandidate& pfmu = *i;
228  //const reco::IsolaPFCandidate& pfmu = *i;
229  const reco::MuonRef& muonRef = pfmu.muonRef();
230  assert( muonRef.isNonnull() );
231 
232  MuonBaseRef muonBaseRef(muonRef);
233  Muon aMuon(muonBaseRef);
234 
235  if ( useUserData_ ) {
236  userDataHelper_.add( aMuon, iEvent, iSetup );
237  }
238 
239  // embed high level selection
240  if ( embedHighLevelSelection_ ) {
241  // get the tracks
242  reco::TrackRef innerTrack = muonBaseRef->innerTrack();
243  reco::TrackRef globalTrack= muonBaseRef->globalTrack();
244  reco::TrackRef bestTrack = muonBaseRef->muonBestTrack();
245  reco::TrackRef chosenTrack = innerTrack;
246  // Make sure the collection it points to is there
247  if ( bestTrack.isNonnull() && bestTrack.isAvailable() )
248  chosenTrack = bestTrack;
249 
250  if ( chosenTrack.isNonnull() && chosenTrack.isAvailable() ) {
251  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
252  aMuon.setNumberOfValidHits( nhits );
253 
254  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
255  embedHighLevel( aMuon,
256  chosenTrack,
257  tt,
258  primaryVertex,
259  primaryVertexIsValid,
260  beamSpot,
261  beamSpotIsValid );
262 
263  }
264 
265  if ( globalTrack.isNonnull() && globalTrack.isAvailable() && !embedCombinedMuon_) {
266  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
267  aMuon.setNormChi2( norm_chi2 );
268  }
269  }
270  reco::PFCandidateRef pfRef(pfMuons,index);
271  //reco::PFCandidatePtr ptrToMother(pfMuons,index);
272  reco::CandidateBaseRef pfBaseRef( pfRef );
273 
274  aMuon.setPFCandidateRef( pfRef );
275  if( embedPFCandidate_ ) aMuon.embedPFCandidate();
276  fillMuon( aMuon, muonBaseRef, pfBaseRef, genMatches, deposits, isolationValues );
277 
278  if (addPuppiIsolation_) {
279  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonBaseRef],
280  (*PUPPIIsolation_neutral_hadrons)[muonBaseRef],
281  (*PUPPIIsolation_photons)[muonBaseRef]);
282 
283  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonBaseRef],
284  (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonBaseRef],
285  (*PUPPINoLeptonsIsolation_photons)[muonBaseRef]);
286  }
287  else {
288  aMuon.setIsolationPUPPI(-999., -999.,-999.);
289  aMuon.setIsolationPUPPINoLeptons(-999., -999.,-999.);
290  }
291 
292  if (embedPfEcalEnergy_) {
293  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
294  }
295 
296  patMuons->push_back(aMuon);
297  }
298  }
299  else {
301  iEvent.getByToken(muonToken_, muons);
302 
303  // embedding of muon MET corrections
305  //edm::ValueMap<reco::MuonMETCorrectionData> caloMETmuCorValueMap;
307  iEvent.getByToken(caloMETMuonCorrsToken_, caloMETMuonCorrs);
308  //caloMETmuCorValueMap = *caloMETmuCorValueMap_h;
309  }
311  //edm::ValueMap<reco::MuonMETCorrectionData> tcMETmuCorValueMap;
313  iEvent.getByToken(tcMETMuonCorrsToken_, tcMETMuonCorrs);
314  //tcMETmuCorValueMap = *tcMETmuCorValueMap_h;
315  }
316 
317  if (embedPfEcalEnergy_) {
318  // get the PFCandidates of type muons
319  iEvent.getByToken(pfMuonToken_, pfMuons);
320  }
321 
322  for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
323  // construct the Muon from the ref -> save ref to original object
324  unsigned int idx = itMuon - muons->begin();
325  MuonBaseRef muonRef = muons->refAt(idx);
326  reco::CandidateBaseRef muonBaseRef( muonRef );
327 
328  Muon aMuon(muonRef);
329  fillMuon( aMuon, muonRef, muonBaseRef, genMatches, deposits, isolationValues);
330  if (addPuppiIsolation_) {
331  aMuon.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[muonRef], (*PUPPIIsolation_neutral_hadrons)[muonRef], (*PUPPIIsolation_photons)[muonRef]);
332  aMuon.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[muonRef], (*PUPPINoLeptonsIsolation_neutral_hadrons)[muonRef], (*PUPPINoLeptonsIsolation_photons)[muonRef]);
333  }
334  else {
335  aMuon.setIsolationPUPPI(-999., -999.,-999.);
336  aMuon.setIsolationPUPPINoLeptons(-999., -999.,-999.);
337  }
338 
339  // Isolation
340  if (isolator_.enabled()) {
341  //reco::CandidatePtr mother = ptrToMother->sourceCandidatePtr(0);
342  isolator_.fill(*muons, idx, isolatorTmpStorage_);
343  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
344  // better to loop backwards, so the vector is resized less times
345  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
346  aMuon.setIsolation(it->first, it->second);
347  }
348  }
349 
350  // for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
351  // aMuon.setIsoDeposit(isoDepositLabels_[j].first,
352  // (*deposits[j])[muonRef]);
353  // }
354 
355  // add sel to selected
356  edm::Ptr<reco::Muon> muonsPtr = muons->ptrAt(idx);
357  if ( useUserData_ ) {
358  userDataHelper_.add( aMuon, iEvent, iSetup );
359  }
360 
361  // embed high level selection
362  if ( embedHighLevelSelection_ ) {
363  // get the tracks
364  reco::TrackRef innerTrack = itMuon->innerTrack();
365  reco::TrackRef globalTrack= itMuon->globalTrack();
366  reco::TrackRef bestTrack = itMuon->muonBestTrack();
367  reco::TrackRef chosenTrack = innerTrack;
368  // Make sure the collection it points to is there
369  if ( bestTrack.isNonnull() && bestTrack.isAvailable() )
370  chosenTrack = bestTrack;
371  if ( chosenTrack.isNonnull() && chosenTrack.isAvailable() ) {
372  unsigned int nhits = chosenTrack->numberOfValidHits(); // ????
373  aMuon.setNumberOfValidHits( nhits );
374 
375  reco::TransientTrack tt = trackBuilder->build(chosenTrack);
376  embedHighLevel( aMuon,
377  chosenTrack,
378  tt,
379  primaryVertex,
380  primaryVertexIsValid,
381  beamSpot,
382  beamSpotIsValid );
383 
384  }
385 
386  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
387  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
388  aMuon.setNormChi2( norm_chi2 );
389  }
390  }
391 
392  // embed MET muon corrections
393  if( embedCaloMETMuonCorrs_ ) aMuon.embedCaloMETMuonCorrs((*caloMETMuonCorrs)[muonRef]);
394  if( embedTcMETMuonCorrs_ ) aMuon.embedTcMETMuonCorrs((*tcMETMuonCorrs )[muonRef]);
395 
396  if (embedPfEcalEnergy_) {
397  aMuon.setPfEcalEnergy(-99.0);
398  for (const reco::PFCandidate &pfmu : *pfMuons) {
399  if (pfmu.muonRef().isNonnull()) {
400  if (pfmu.muonRef().id() != muonRef.id()) throw cms::Exception("Configuration") << "Muon reference within PF candidates does not point to the muon collection." << std::endl;
401  if (pfmu.muonRef().key() == muonRef.key()) {
402  aMuon.setPfEcalEnergy(pfmu.ecalEnergy());
403  }
404  }
405  }
406  }
407 
408  patMuons->push_back(aMuon);
409  }
410  }
411 
412  // sort muons in pt
413  std::sort(patMuons->begin(), patMuons->end(), pTComparator_);
414 
415  // put genEvt object in Event
416  std::unique_ptr<std::vector<Muon> > ptr(patMuons);
417  iEvent.put(std::move(ptr));
418 
420 }
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:576
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:252
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:457
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
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:264
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool isRealData() const
Definition: EventBase.h:62
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:258
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
const T & get() const
Definition: EventSetup.h:56
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 176 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().

177 {
178  labels.clear();
179 
180  if (iConfig.exists( psetName )) {
181  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
182 
183  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
184  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
185  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
186  if (depconf.exists("pfAllParticles")) {
187  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
188  }
189  if (depconf.exists("pfChargedHadrons")) {
190  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
191  }
192  if (depconf.exists("pfChargedAll")) {
193  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
194  }
195  if (depconf.exists("pfPUChargedHadrons")) {
196  labels.push_back(std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
197  }
198  if (depconf.exists("pfNeutralHadrons")) {
199  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
200  }
201  if (depconf.exists("pfPhotons")) {
202  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
203  }
204  if (depconf.exists("user")) {
205  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
206  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
208  for ( ; it != ed; ++it, ++key) {
209  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
210  }
211  tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes<edm::ValueMap<T> >(label.second);});
212  }
213  }
214  tokens = edm::vector_transform(labels, [this](pat::PATMuonProducer::IsolationLabel const & label){return consumes<edm::ValueMap<T> >(label.second);});
215 }
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

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 141 of file PATMuonProducer.h.

Referenced by PATMuonProducer().

bool pat::PATMuonProducer::addGenMatch_
private

add generator match information

Definition at line 113 of file PATMuonProducer.h.

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

bool pat::PATMuonProducer::addPuppiIsolation_
private

add puppi isolation

Definition at line 147 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 119 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 131 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 101 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 165 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 87 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 99 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 97 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 111 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 117 of file PATMuonProducer.h.

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

bool pat::PATMuonProducer::embedHighLevelSelection_
private

embed high level selection variables

Definition at line 129 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedPFCandidate_
private

embed pfCandidates into the muon

Definition at line 127 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedPfEcalEnergy_
private

add ecal PF energy

Definition at line 145 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 107 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 95 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 103 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 109 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 93 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 89 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 91 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 115 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

IsolationLabels pat::PATMuonProducer::isoDepositLabels_
private

input source for isoDeposits

Definition at line 135 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

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

Definition at line 136 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

IsolationLabels pat::PATMuonProducer::isolationValueLabels_
private

input source isolation value maps

Definition at line 138 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

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

Definition at line 139 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 161 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 163 of file PATMuonProducer.h.

Referenced by produce().

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

input source

Definition at line 84 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 125 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

— tools — comparator for pt ordering

Definition at line 159 of file PATMuonProducer.h.

Referenced by produce().

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

Definition at line 149 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

Definition at line 150 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

Definition at line 151 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

Definition at line 153 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

Definition at line 154 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

Definition at line 155 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 133 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 121 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 105 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 123 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 167 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 143 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().