CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 PATMuonProducer (const edm::ParameterSet &iConfig)
 default constructir More...
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 everything that needs to be done during the event loop More...
 
 ~PATMuonProducer ()
 default destructur More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 description of config file parameters More...
 
- Static Public Member Functions inherited from edm::EDProducer
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::InputTag
IsolationLabel
 
typedef std::vector
< IsolationLabel
IsolationLabels
 
typedef std::vector
< edm::Handle< edm::ValueMap
< double > > > 
IsolationValueMaps
 
typedef edm::RefToBase
< reco::Muon
MuonBaseRef
 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...
 
void readIsolationLabels (const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels)
 

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 addResolutions_
 add resolutions to the muon (this will be data members of th muon even w/o embedding) More...
 
edm::InputTag beamLineSrc_
 input source of the primary vertex/beamspot More...
 
edm::InputTag caloMETMuonCorrs_
 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 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 embedImprovedBestTrack_
 embed the track from best muon measurement, new tuneP, 53X option only More...
 
bool embedPFCandidate_
 embed pfCandidates into the muon 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...
 
std::vector< edm::InputTaggenMatchSrc_
 input tags for generator match information More...
 
IsolationLabels isoDepositLabels_
 input source for isoDeposits More...
 
IsolationLabels isolationValueLabels_
 input source isolation value maps More...
 
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::InputTag muonSrc_
 input source More...
 
edm::InputTag pfMuonSrc_
 input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT More...
 
GreaterByPt< MuonpTComparator_
 
edm::InputTag pvSrc_
 input source of the primary vertex More...
 
pat::helper::KinResolutionsLoader resolutionLoader_
 helper class to add resolutions to the muon More...
 
edm::InputTag tcMETMuonCorrs_
 source of tcMET muon corrections More...
 
bool useParticleFlow_
 switch to use particle flow (PF2PAT) or not More...
 
bool usePV_
 use the primary vertex or the beamspot 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::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.28.6.1 2012/09/04 17:31:56 vadler 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 48 of file PATMuonProducer.cc.

References addEfficiencies_, addGenMatch_, addResolutions_, beamLineSrc_, caloMETMuonCorrs_, efficiencyLoader_, embedBestTrack_, embedCaloMETMuonCorrs_, embedCombinedMuon_, embedDytMuon_, embedGenMatch_, embedHighLevelSelection_, embedImprovedBestTrack_, embedPFCandidate_, embedPickyMuon_, embedStandAloneMuon_, embedTcMETMuonCorrs_, embedTpfmsMuon_, embedTrack_, edm::ParameterSet::existsAs(), genMatchSrc_, edm::ParameterSet::getParameter(), isoDepositLabels_, isolationValueLabels_, muonSrc_, pfMuonSrc_, pvSrc_, readIsolationLabels(), resolutionLoader_, tcMETMuonCorrs_, useParticleFlow_, usePV_, userDataHelper_, and useUserData_.

48  : useUserData_(iConfig.exists("userData")),
49  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), false)
50 {
51  // input source
52  muonSrc_ = iConfig.getParameter<edm::InputTag>( "muonSource" );
53  // embedding of tracks
54  embedBestTrack_ = iConfig.getParameter<bool>( "embedMuonBestTrack" );
55  embedImprovedBestTrack_ = iConfig.getParameter<bool>( "embedImprovedMuonBestTrack" );
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  caloMETMuonCorrs_ = iConfig.getParameter<edm::InputTag>("caloMETMuonCorrs" );
63  tcMETMuonCorrs_ = iConfig.getParameter<edm::InputTag>("tcMETMuonCorrs" );
64  // pflow specific configurables
65  useParticleFlow_ = iConfig.getParameter<bool>( "useParticleFlow" );
66  embedPFCandidate_ = iConfig.getParameter<bool>( "embedPFCandidate" );
67  pfMuonSrc_ = iConfig.getParameter<edm::InputTag>( "pfMuonSource" );
68  // embedding of tracks from TeV refit
69  embedPickyMuon_ = iConfig.getParameter<bool>( "embedPickyMuon" );
70  embedTpfmsMuon_ = iConfig.getParameter<bool>( "embedTpfmsMuon" );
71  embedDytMuon_ = iConfig.getParameter<bool>( "embedDytMuon" );
72  // Monte Carlo matching
73  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
74  if(addGenMatch_){
75  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
76  if(iConfig.existsAs<edm::InputTag>("genParticleMatch")){
77  genMatchSrc_.push_back(iConfig.getParameter<edm::InputTag>( "genParticleMatch" ));
78  } else {
79  genMatchSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" );
80  }
81  }
82  // efficiencies
83  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
84  if(addEfficiencies_){
86  }
87  // resolutions
88  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
89  if (addResolutions_) {
91  }
92  // read isoDeposit labels, for direct embedding
93  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_);
94  // read isolation value labels, for direct embedding
95  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_);
96  // check to see if the user wants to add user data
97  if( useUserData_ ){
99  }
100  // embed high level selection variables
101  usePV_ = true;
102  embedHighLevelSelection_ = iConfig.getParameter<bool>("embedHighLevelSelection");
103  if ( embedHighLevelSelection_ ) {
104  beamLineSrc_ = iConfig.getParameter<edm::InputTag>("beamLineSrc");
105  usePV_ = iConfig.getParameter<bool>("usePV");
106  pvSrc_ = iConfig.getParameter<edm::InputTag>("pvSrc");
107  }
108  // produces vector of muons
109  produces<std::vector<Muon> >();
110 }
bool embedTpfmsMuon_
embed track from tpfms muon fit into the muon
bool useUserData_
add user data to the muon (this will be data members of th muon even w/o embedding) ...
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
bool usePV_
use the primary vertex or the beamspot
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:187
bool embedImprovedBestTrack_
embed the track from best muon measurement, new tuneP, 53X option only
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding) ...
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
edm::InputTag pvSrc_
input source of the primary vertex
bool exists(std::string const &parameterName) const
checks if a parameter exists
bool embedBestTrack_
embed the track from best muon measurement
edm::InputTag tcMETMuonCorrs_
source of tcMET muon corrections
edm::InputTag pfMuonSrc_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT ...
bool addResolutions_
add resolutions to the muon (this will be data members of th muon even w/o embedding) ...
pat::helper::MultiIsolator isolator_
helper class to add userdefined isolation values to the muon
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
edm::InputTag beamLineSrc_
input source of the primary vertex/beamspot
std::vector< edm::InputTag > genMatchSrc_
input tags for generator match information
edm::InputTag muonSrc_
input source
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels)
edm::InputTag caloMETMuonCorrs_
source of caloMET muon corrections
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
bool embedPFCandidate_
embed pfCandidates into the muon
bool embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
bool embedHighLevelSelection_
embed high level selection variables
PATMuonProducer::~PATMuonProducer ( )

default destructur

Definition at line 113 of file PATMuonProducer.cc.

114 {
115 }

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 582 of file PATMuonProducer.cc.

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

Referenced by produce().

590 {
591  // Correct to PV
592 
593  // PV2D
594  std::pair<bool,Measurement1D> result =
596  GlobalVector(track->px(),
597  track->py(),
598  track->pz()),
599  primaryVertex);
600  double d0_corr = result.second.value();
601  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
602  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV2D);
603 
604 
605  // PV3D
606  result =
608  GlobalVector(track->px(),
609  track->py(),
610  track->pz()),
611  primaryVertex);
612  d0_corr = result.second.value();
613  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
614  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV3D);
615 
616 
617  // Correct to beam spot
618  // make a fake vertex out of beam spot
619  reco::Vertex vBeamspot(beamspot.position(), beamspot.rotatedCovariance3D());
620 
621  // BS2D
622  result =
624  GlobalVector(track->px(),
625  track->py(),
626  track->pz()),
627  vBeamspot);
628  d0_corr = result.second.value();
629  d0_err = beamspotIsValid ? result.second.error() : -1.0;
630  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS2D);
631 
632  // BS3D
633  result =
635  GlobalVector(track->px(),
636  track->py(),
637  track->pz()),
638  vBeamspot);
639  d0_corr = result.second.value();
640  d0_err = beamspotIsValid ? result.second.error() : -1.0;
641  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS3D);
642 }
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
tuple result
Definition: query.py:137
const Point & position() const
position
Definition: BeamSpot.h:63
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:79
void setDB(double dB, double edB, IpType type=None)
Definition: Muon.h:220
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void PATMuonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

description of config file parameters

Definition at line 444 of file PATMuonProducer.cc.

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

445 {
447  iDesc.setComment("PAT muon producer module");
448 
449  // input source
450  iDesc.add<edm::InputTag>("muonSource", edm::InputTag("no default"))->setComment("input collection");
451 
452  // embedding
453  iDesc.add<bool>("embedMuonBestTrack", true)->setComment("embed muon best track");
454  iDesc.add<bool>("embedImprovedMuonBestTrack", true)->setComment("embed muon best track, new tuneP (only 53X)");
455  iDesc.add<bool>("embedTrack", true)->setComment("embed external track");
456  iDesc.add<bool>("embedStandAloneMuon", true)->setComment("embed external stand-alone muon");
457  iDesc.add<bool>("embedCombinedMuon", false)->setComment("embed external combined muon");
458  iDesc.add<bool>("embedPickyMuon", false)->setComment("embed external picky track");
459  iDesc.add<bool>("embedTpfmsMuon", false)->setComment("embed external tpfms track");
460  iDesc.add<bool>("embedDytMuon", false)->setComment("embed external dyt track ");
461 
462  // embedding of MET muon corrections
463  iDesc.add<bool>("embedCaloMETMuonCorrs", true)->setComment("whether to add MET muon correction for caloMET or not");
464  iDesc.add<edm::InputTag>("caloMETMuonCorrs", edm::InputTag("muonMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for caloMET");
465  iDesc.add<bool>("embedTcMETMuonCorrs", true)->setComment("whether to add MET muon correction for tcMET or not");
466  iDesc.add<edm::InputTag>("tcMETMuonCorrs", edm::InputTag("muonTCMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for tcMET");
467 
468  // pf specific parameters
469  iDesc.add<edm::InputTag>("pfMuonSource", edm::InputTag("pfMuons"))->setComment("particle flow input collection");
470  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
471  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
472 
473  // MC matching configurables
474  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
475  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
476  std::vector<edm::InputTag> emptySourceVector;
477  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
478  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
479  )->setComment("input with MC match information");
480 
482 
483  // IsoDeposit configurables
484  edm::ParameterSetDescription isoDepositsPSet;
485  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
486  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
487  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
488  isoDepositsPSet.addOptional<edm::InputTag>("particle");
489  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
490  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
491  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
492  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
493  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
494  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
495  iDesc.addOptional("isoDeposits", isoDepositsPSet);
496 
497  // isolation values configurables
498  edm::ParameterSetDescription isolationValuesPSet;
499  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
500  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
501  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
502  isolationValuesPSet.addOptional<edm::InputTag>("particle");
503  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
504  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
505  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
506  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
507  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
508  iDesc.addOptional("isolationValues", isolationValuesPSet);
509 
510  // Efficiency configurables
511  edm::ParameterSetDescription efficienciesPSet;
512  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
513  iDesc.add("efficiencies", efficienciesPSet);
514  iDesc.add<bool>("addEfficiencies", false);
515 
516  // Check to see if the user wants to add user data
517  edm::ParameterSetDescription userDataPSet;
519  iDesc.addOptional("userData", userDataPSet);
520 
521  edm::ParameterSetDescription isolationPSet;
522  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
523  iDesc.add("userIsolation", isolationPSet);
524 
525  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
526  edm::ParameterSetDescription highLevelPSet;
527  highLevelPSet.setAllowAnything();
528  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
529  )->setComment("input with high level selection");
531  )->setComment("input with high level selection");
532  iDesc.addNode( edm::ParameterDescription<bool>("usePV", bool(), true)
533  )->setComment("input with high level selection, use primary vertex (true) or beam line (false)");
534 
535  //descriptions.add("PATMuonProducer", iDesc);
536 }
void setComment(std::string const &value)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescription(edm::ParameterSetDescription &iDesc)
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
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 365 of file PATMuonProducer.cc.

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

Referenced by produce().

366 {
367  // in the particle flow algorithm,
368  // the muon momentum is recomputed.
369  // the new value is stored as the momentum of the
370  // resulting PFCandidate of type Muon, and choosen
371  // as the pat::Muon momentum
372  if (useParticleFlow_)
373  aMuon.setP4( aMuon.pfCandidateRef()->p4() );
374  if (embedBestTrack_) aMuon.embedMuonBestTrack();
376  aMuon.setBestTrack(newBestTrack.second);
379  aMuon.setImprovedBestTrack(newImprovedBestTrack.second);
380  if (embedTrack_) aMuon.embedTrack();
383 
384  // embed the TeV refit track refs (only available for globalMuons)
385  if (aMuon.isGlobalMuon()) {
387  aMuon.embedPickyMuon();
389  aMuon.embedTpfmsMuon();
391  aMuon.embedDytMuon();
392  }
393 
394  // store the match to the generated final state muons
395  if (addGenMatch_) {
396  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
397  reco::GenParticleRef genMuon = (*genMatches[i])[baseRef];
398  aMuon.addGenParticleRef(genMuon);
399  }
400  if (embedGenMatch_) aMuon.embedGenParticle();
401  }
402  if (efficiencyLoader_.enabled()) {
403  efficiencyLoader_.setEfficiencies( aMuon, muonRef );
404  }
405 
406  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
407  if(useParticleFlow_) {
408  if (deposits[j]->contains(baseRef.id())) {
409  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[baseRef]);
410  } else if (deposits[j]->contains(muonRef.id())){
411  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
412  } else {
413  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
414  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[source]);
415  }
416  }
417  else{
418  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
419  }
420  }
421 
422  for (size_t j = 0; j<isolationValues.size(); ++j) {
423  if(useParticleFlow_) {
424  if (isolationValues[j]->contains(baseRef.id())) {
425  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[baseRef]);
426  } else if (isolationValues[j]->contains(muonRef.id())) {
427  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
428  } else {
429  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
430  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[source]);
431  }
432  }
433  else{
434  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
435  }
436  }
437 
438  if (resolutionLoader_.enabled()) {
440  }
441 }
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
int i
Definition: DBlmapReader.cc:9
void embedStandAloneMuon()
set reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
Definition: Muon.cc:282
reco::Muon::MuonTrackTypePair muonBestTrack(const reco::Muon &muon, reco::TunePType tunePType)
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:100
bool embedImprovedBestTrack_
embed the track from best muon measurement, new tuneP, 53X option only
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
bool isGlobalMuon() const
Definition: Muon.h:211
bool embedBestTrack_
embed the track from best muon measurement
virtual void setP4(const LorentzVector &p4)
set 4-momentum
ProductID id() const
Definition: RefToBase.h:220
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedPickyMuon()
embed reference to the above picky Track
Definition: Muon.cc:315
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:177
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
Definition: Muon.cc:292
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
bool isAValidMuonTrack(const MuonTrackType &type) const
Definition: Muon.cc:760
bool embedStandAloneMuon_
embed track from muon system into the muon
reco::PFCandidateRef pfCandidateRef() const
reference to the source IsolatedPFCandidates
Definition: Muon.cc:232
bool embedTrack_
embed the track from inner tracker into the muon
bool addGenMatch_
add generator match information
void embedGenParticle()
Definition: PATObject.h:675
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.cc:272
int j
Definition: DBlmapReader.cc:9
bool first
Definition: L1TdeRCT.cc:94
void embedTpfmsMuon()
embed reference to the above tpfms Track
Definition: Muon.cc:325
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:659
void embedDytMuon()
embed reference to the above dyt Track
Definition: Muon.cc:335
void embedMuonBestTrack()
set reference to Track selected to be the best measurement of the muon parameters (reimplemented from...
Definition: Muon.cc:250
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedImprovedMuonBestTrack()
set reference to Track selected to be the best measurement of the muon parameters (reimplemented from...
Definition: Muon.cc:259
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:94
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
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:41
bool embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
virtual void setImprovedBestTrack(MuonTrackType muonType)
Definition: Muon.h:91
void PATMuonProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

everything that needs to be done during the event loop

Implements edm::EDProducer.

Definition at line 117 of file PATMuonProducer.cc.

References IPTools::absoluteTransverseImpactParameter(), addGenMatch_, beamLineSrc_, SiPixelRawToDigiRegional_cfi::beamSpot, pat::helper::MultiIsolator::beginEvent(), caloMETMuonCorrs_, reco::defaultTuneP, efficiencyLoader_, pat::Muon::embedCaloMETMuonCorrs(), embedCaloMETMuonCorrs_, embedGenMatch_, embedHighLevel(), embedHighLevelSelection_, pat::Muon::embedPFCandidate(), embedPFCandidate_, 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(), genMatchSrc_, edm::EventSetup::get(), edm::Event::getByLabel(), i, getHLTprescales::index, susybsm::HSCParticleType::innerTrack, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), isoDepositLabels_, isolationValueLabels_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), j, muon::muonBestTrack(), reco::PFCandidate::muonRef(), patZpeak::muons, muonSrc_, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), muonProducer_cfi::patMuons, pfMuons_cff::pfMuons, pfMuonSrc_, pTComparator_, edm::Event::put(), pvSrc_, resolutionLoader_, query::result, edm::second(), pat::Muon::setDB(), pat::Lepton< LeptonType >::setIsolation(), pat::Muon::setNormChi2(), pat::Muon::setNumberOfValidHits(), pat::Muon::setPFCandidateRef(), python.multivaluedict::sort(), tcMETMuonCorrs_, groupFilesInBlocks::tt, useParticleFlow_, usePV_, userDataHelper_, useUserData_, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

118 {
119  // switch off embedding (in unschedules mode)
120  if (iEvent.isRealData()){
121  addGenMatch_ = false;
122  embedGenMatch_ = false;
123  }
124 
126  iEvent.getByLabel(muonSrc_, muons);
127 
128  // get the ESHandle for the transient track builder,
129  // if needed for high level selection embedding
131 
132  if(isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
134  if(resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
135 
136  IsoDepositMaps deposits(isoDepositLabels_.size());
137  for (size_t j = 0; j<isoDepositLabels_.size(); ++j) {
138  iEvent.getByLabel(isoDepositLabels_[j].second, deposits[j]);
139  }
140 
141  IsolationValueMaps isolationValues(isolationValueLabels_.size());
142  for (size_t j = 0; j<isolationValueLabels_.size(); ++j) {
143  iEvent.getByLabel(isolationValueLabels_[j].second, isolationValues[j]);
144  }
145 
146  // prepare the MC matching
147  GenAssociations genMatches(genMatchSrc_.size());
148  if (addGenMatch_) {
149  for (size_t j = 0, nd = genMatchSrc_.size(); j < nd; ++j) {
150  iEvent.getByLabel(genMatchSrc_[j], genMatches[j]);
151  }
152  }
153 
154  // prepare the high level selection: needs beamline
155  // OR primary vertex, depending on user selection
156  reco::TrackBase::Point beamPoint(0,0,0);
157  reco::Vertex primaryVertex;
159  bool beamSpotIsValid = false;
160  bool primaryVertexIsValid = false;
161  if ( embedHighLevelSelection_ ) {
162  // get the beamspot
163  edm::Handle<reco::BeamSpot> beamSpotHandle;
164  iEvent.getByLabel(beamLineSrc_, beamSpotHandle);
165 
166  // get the primary vertex
168  iEvent.getByLabel( pvSrc_, pvHandle );
169 
170  if( beamSpotHandle.isValid() ){
171  beamSpot = *beamSpotHandle;
172  beamSpotIsValid = true;
173  } else{
174  edm::LogError("DataNotAvailable")
175  << "No beam spot available from EventSetup, not adding high level selection \n";
176  }
177  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
178  if( pvHandle.isValid() && !pvHandle->empty() ) {
179  primaryVertex = pvHandle->at(0);
180  primaryVertexIsValid = true;
181  } else {
182  edm::LogError("DataNotAvailable")
183  << "No primary vertex available from EventSetup, not adding high level selection \n";
184  }
185  // this is needed by the IPTools methods from the tracking group
186  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
187  }
188 
189  // this will be the new object collection
190  std::vector<Muon> * patMuons = new std::vector<Muon>();
191 
192  if( useParticleFlow_ ){
193  // get the PFCandidates of type muons
195  iEvent.getByLabel(pfMuonSrc_, pfMuons);
196 
197  unsigned index=0;
198  for( reco::PFCandidateConstIterator i = pfMuons->begin(); i != pfMuons->end(); ++i, ++index) {
199  const reco::PFCandidate& pfmu = *i;
200  //const reco::IsolaPFCandidate& pfmu = *i;
201  const reco::MuonRef& muonRef = pfmu.muonRef();
202  assert( muonRef.isNonnull() );
203 
204  MuonBaseRef muonBaseRef(muonRef);
205  Muon aMuon(muonBaseRef);
206 
207  if ( useUserData_ ) {
208  userDataHelper_.add( aMuon, iEvent, iSetup );
209  }
210 
211  // embed high level selection
212  if ( embedHighLevelSelection_ ) {
213  // get the tracks
214  reco::TrackRef innerTrack = muonBaseRef->innerTrack();
215  reco::TrackRef globalTrack= muonBaseRef->globalTrack();
216  reco::TrackRef bestTrack = muon::muonBestTrack(*muonBaseRef, reco::defaultTuneP).first;
217 
218  // Make sure the collection it points to is there
219  if ( bestTrack.isNonnull() && bestTrack.isAvailable() ) {
220  unsigned int nhits = bestTrack->numberOfValidHits(); // ????
221  aMuon.setNumberOfValidHits( nhits );
222 
223  reco::TransientTrack tt = trackBuilder->build(bestTrack);
224  embedHighLevel( aMuon,
225  bestTrack,
226  tt,
227  primaryVertex,
228  primaryVertexIsValid,
229  beamSpot,
230  beamSpotIsValid );
231 
232  // Correct to PV, or beam spot
233  if ( !usePV_ ) {
234  double corr_d0 = -1.0 * bestTrack->dxy( beamPoint );
235  aMuon.setDB( corr_d0, -1.0 );
236  } else {
237  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
238  double d0_corr = result.second.value();
239  double d0_err = result.second.error();
240  aMuon.setDB( d0_corr, d0_err );
241  }
242  }
243 
244  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
245  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
246  aMuon.setNormChi2( norm_chi2 );
247  }
248  }
249  reco::PFCandidateRef pfRef(pfMuons,index);
250  //reco::PFCandidatePtr ptrToMother(pfMuons,index);
251  reco::CandidateBaseRef pfBaseRef( pfRef );
252 
253  aMuon.setPFCandidateRef( pfRef );
254  if( embedPFCandidate_ ) aMuon.embedPFCandidate();
255  fillMuon( aMuon, muonBaseRef, pfBaseRef, genMatches, deposits, isolationValues );
256  patMuons->push_back(aMuon);
257  }
258  }
259  else {
261  iEvent.getByLabel(muonSrc_, muons);
262 
263  // embedding of muon MET corrections
265  //edm::ValueMap<reco::MuonMETCorrectionData> caloMETmuCorValueMap;
267  iEvent.getByLabel(caloMETMuonCorrs_, caloMETMuonCorrs);
268  //caloMETmuCorValueMap = *caloMETmuCorValueMap_h;
269  }
271  //edm::ValueMap<reco::MuonMETCorrectionData> tcMETmuCorValueMap;
273  iEvent.getByLabel(tcMETMuonCorrs_, tcMETMuonCorrs);
274  //tcMETmuCorValueMap = *tcMETmuCorValueMap_h;
275  }
276  for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
277  // construct the Muon from the ref -> save ref to original object
278  unsigned int idx = itMuon - muons->begin();
279  MuonBaseRef muonRef = muons->refAt(idx);
280  reco::CandidateBaseRef muonBaseRef( muonRef );
281 
282  Muon aMuon(muonRef);
283  fillMuon( aMuon, muonRef, muonBaseRef, genMatches, deposits, isolationValues);
284 
285  // Isolation
286  if (isolator_.enabled()) {
287  //reco::CandidatePtr mother = ptrToMother->sourceCandidatePtr(0);
288  isolator_.fill(*muons, idx, isolatorTmpStorage_);
289  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
290  // better to loop backwards, so the vector is resized less times
291  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
292  aMuon.setIsolation(it->first, it->second);
293  }
294  }
295 
296  // for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
297  // aMuon.setIsoDeposit(isoDepositLabels_[j].first,
298  // (*deposits[j])[muonRef]);
299  // }
300 
301  // add sel to selected
302  edm::Ptr<reco::Muon> muonsPtr = muons->ptrAt(idx);
303  if ( useUserData_ ) {
304  userDataHelper_.add( aMuon, iEvent, iSetup );
305  }
306 
307  // embed high level selection
308  if ( embedHighLevelSelection_ ) {
309  // get the tracks
310  reco::TrackRef innerTrack = itMuon->innerTrack();
311  reco::TrackRef globalTrack= itMuon->globalTrack();
312  reco::TrackRef bestTrack = muon::muonBestTrack(*itMuon, reco::defaultTuneP).first;
313 
314  // Make sure the collection it points to is there
315  if ( bestTrack.isNonnull() && bestTrack.isAvailable() ) {
316  unsigned int nhits = bestTrack->numberOfValidHits(); // ????
317  aMuon.setNumberOfValidHits( nhits );
318 
319  reco::TransientTrack tt = trackBuilder->build(bestTrack);
320  embedHighLevel( aMuon,
321  bestTrack,
322  tt,
323  primaryVertex,
324  primaryVertexIsValid,
325  beamSpot,
326  beamSpotIsValid );
327 
328  // Correct to PV, or beam spot
329  if ( !usePV_ ) {
330  double corr_d0 = -1.0 * bestTrack->dxy( beamPoint );
331  aMuon.setDB( corr_d0, -1.0 );
332  } else {
333  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
334  double d0_corr = result.second.value();
335  double d0_err = result.second.error();
336  aMuon.setDB( d0_corr, d0_err );
337  }
338  }
339 
340  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
341  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
342  aMuon.setNormChi2( norm_chi2 );
343  }
344  }
345 
346  // embed MET muon corrections
347  if( embedCaloMETMuonCorrs_ ) aMuon.embedCaloMETMuonCorrs((*caloMETMuonCorrs)[muonRef]);
348  if( embedTcMETMuonCorrs_ ) aMuon.embedTcMETMuonCorrs((*tcMETMuonCorrs )[muonRef]);
349 
350  patMuons->push_back(aMuon);
351  }
352  }
353 
354  // sort muons in pt
355  std::sort(patMuons->begin(), patMuons->end(), pTComparator_);
356 
357  // put genEvt object in Event
358  std::auto_ptr<std::vector<Muon> > ptr(patMuons);
359  iEvent.put(ptr);
360 
362 }
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) ...
double z0() const
z coordinate
Definition: BeamSpot.h:69
bool usePV_
use the primary vertex or the beamspot
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
reco::Muon::MuonTrackTypePair muonBestTrack(const reco::Muon &muon, reco::TunePType tunePType)
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
std::vector< edm::Handle< edm::ValueMap< reco::IsoDeposit > > > IsoDepositMaps
bool embedCaloMETMuonCorrs_
embed muon MET correction info for caloMET into the muon
edm::InputTag pvSrc_
input source of the primary vertex
edm::InputTag tcMETMuonCorrs_
source of tcMET muon corrections
edm::InputTag pfMuonSrc_
input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT ...
bool isAvailable() const
Definition: Ref.h:276
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool isRealData() const
Definition: EventBase.h:60
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
pat::helper::MultiIsolator isolator_
helper class to add userdefined isolation values to the muon
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
U second(std::pair< T, U > const &p)
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
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
GreaterByPt< Muon > pTComparator_
bool addGenMatch_
add generator match information
edm::InputTag beamLineSrc_
input source of the primary vertex/beamspot
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: TrackBase.h:76
bool isValid() const
Definition: HandleBase.h:76
std::vector< edm::InputTag > genMatchSrc_
input tags for generator match information
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:355
edm::InputTag muonSrc_
input source
const T & get() const
Definition: EventSetup.h:55
edm::InputTag caloMETMuonCorrs_
source of caloMET muon corrections
std::pair< bool, Measurement1D > absoluteTransverseImpactParameter(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:43
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:33
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
tuple muons
Definition: patZpeak.py:38
double y0() const
y coordinate
Definition: BeamSpot.h:67
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
IsolationLabels isoDepositLabels_
input source for isoDeposits
IsolationLabels isolationValueLabels_
input source isolation value maps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
edm::RefToBase< reco::Muon > MuonBaseRef
typedefs for convenience
bool embedPFCandidate_
embed pfCandidates into the muon
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
Analysis-level muon class.
Definition: Muon.h:51
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82
tuple pfMuons
Definition: pfMuons_cff.py:10
double x0() const
x coordinate
Definition: BeamSpot.h:65
bool embedHighLevelSelection_
embed high level selection variables
void PATMuonProducer::readIsolationLabels ( const edm::ParameterSet iConfig,
const char *  psetName,
IsolationLabels labels 
)
private

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

Definition at line 539 of file PATMuonProducer.cc.

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

Referenced by PATMuonProducer().

540 {
541  labels.clear();
542 
543  if (iConfig.exists( psetName )) {
544  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
545 
546  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
547  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
548  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
549  if (depconf.exists("pfAllParticles")) {
550  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
551  }
552  if (depconf.exists("pfChargedHadrons")) {
553  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
554  }
555  if (depconf.exists("pfChargedAll")) {
556  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
557  }
558  if (depconf.exists("pfPUChargedHadrons")) {
559  labels.push_back(std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
560  }
561  if (depconf.exists("pfNeutralHadrons")) {
562  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
563  }
564  if (depconf.exists("pfPhotons")) {
565  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
566  }
567  if (depconf.exists("user")) {
568  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
569  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
570  int key = UserBaseIso;
571  for ( ; it != ed; ++it, ++key) {
572  labels.push_back(std::make_pair(IsolationKeys(key), *it));
573  }
574  }
575  }
576 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
list key
Definition: combine.py:13

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

Referenced by PATMuonProducer().

bool pat::PATMuonProducer::addGenMatch_
private

add generator match information

Definition at line 112 of file PATMuonProducer.h.

Referenced by fillMuon(), 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 118 of file PATMuonProducer.h.

Referenced by PATMuonProducer().

edm::InputTag pat::PATMuonProducer::beamLineSrc_
private

input source of the primary vertex/beamspot

Definition at line 130 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::InputTag pat::PATMuonProducer::caloMETMuonCorrs_
private

source of caloMET muon corrections

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

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

bool pat::PATMuonProducer::embedBestTrack_
private

embed the track from best muon measurement

Definition at line 88 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 98 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 96 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedDytMuon_
private

embed track from DYT muon fit into the muon

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

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

bool pat::PATMuonProducer::embedHighLevelSelection_
private

embed high level selection variables

Definition at line 128 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedImprovedBestTrack_
private

embed the track from best muon measurement, new tuneP, 53X option only

Definition at line 90 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

bool pat::PATMuonProducer::embedPFCandidate_
private

embed pfCandidates into the muon

Definition at line 126 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 106 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 94 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 102 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 108 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 92 of file PATMuonProducer.h.

Referenced by fillMuon(), and PATMuonProducer().

std::vector<edm::InputTag> pat::PATMuonProducer::genMatchSrc_
private

input tags for generator match information

Definition at line 114 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

IsolationLabels pat::PATMuonProducer::isoDepositLabels_
private

input source for isoDeposits

Definition at line 136 of file PATMuonProducer.h.

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

IsolationLabels pat::PATMuonProducer::isolationValueLabels_
private

input source isolation value maps

Definition at line 138 of file PATMuonProducer.h.

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

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

helper class to add userdefined isolation values to the muon

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

Referenced by produce().

edm::InputTag pat::PATMuonProducer::muonSrc_
private

input source

Definition at line 85 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::InputTag pat::PATMuonProducer::pfMuonSrc_
private

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

Definition at line 124 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

— tools — comparator for pt ordering

Definition at line 146 of file PATMuonProducer.h.

Referenced by produce().

edm::InputTag pat::PATMuonProducer::pvSrc_
private

input source of the primary vertex

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

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

edm::InputTag pat::PATMuonProducer::tcMETMuonCorrs_
private

source of tcMET muon corrections

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

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

bool pat::PATMuonProducer::usePV_
private

use the primary vertex or the beamspot

Definition at line 132 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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

helper class to add userData to the muon

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

Referenced by PATMuonProducer(), and produce().