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)
 

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 innerTrack, 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...
 
bool addTeVRefits_
 add TeV track refits for the muon 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 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 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 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 linkToPFSource_
 
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...
 
edm::InputTag pickySrc_
 input tag for picky muon refit 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...
 
edm::InputTag tpfmsSrc_
 input tag for tpfms muon refit 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.27 2010/09/14 15:20:20 kukartse 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 47 of file PATMuonProducer.cc.

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

47  : useUserData_(iConfig.exists("userData")),
48  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), false)
49 {
50  // input source
51  muonSrc_ = iConfig.getParameter<edm::InputTag>( "muonSource" );
52  // embedding of tracks
53  embedTrack_ = iConfig.getParameter<bool>( "embedTrack" );
54  embedCombinedMuon_ = iConfig.getParameter<bool>( "embedCombinedMuon" );
55  embedStandAloneMuon_ = iConfig.getParameter<bool>( "embedStandAloneMuon" );
56 
57  // embedding of muon MET correction information
58  embedCaloMETMuonCorrs_ = iConfig.getParameter<bool>("embedCaloMETMuonCorrs" );
59  embedTcMETMuonCorrs_ = iConfig.getParameter<bool>("embedTcMETMuonCorrs" );
60  caloMETMuonCorrs_ = iConfig.getParameter<edm::InputTag>("caloMETMuonCorrs" );
61  tcMETMuonCorrs_ = iConfig.getParameter<edm::InputTag>("tcMETMuonCorrs" );
62 
63  // pflow specific configurables
64  useParticleFlow_ = iConfig.getParameter<bool>( "useParticleFlow" );
65  linkToPFSource_ = iConfig.getParameter<edm::InputTag>( "linkToPFSource" ); //SAK
66  embedPFCandidate_ = iConfig.getParameter<bool>( "embedPFCandidate" );
67  pfMuonSrc_ = iConfig.getParameter<edm::InputTag>( "pfMuonSource" );
68 
69  // TeV track refits
70  addTeVRefits_ = iConfig.getParameter<bool>("addTeVRefits");
71  if(addTeVRefits_){
72  pickySrc_ = iConfig.getParameter<edm::InputTag>("pickySrc");
73  tpfmsSrc_ = iConfig.getParameter<edm::InputTag>("tpfmsSrc");
74  }
75  // embedding of tracks from TeV refit
76  embedPickyMuon_ = iConfig.getParameter<bool>( "embedPickyMuon" );
77  embedTpfmsMuon_ = iConfig.getParameter<bool>( "embedTpfmsMuon" );
78 
79  // Monte Carlo matching
80  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
81  if(addGenMatch_){
82  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
83  if(iConfig.existsAs<edm::InputTag>("genParticleMatch")){
84  genMatchSrc_.push_back(iConfig.getParameter<edm::InputTag>( "genParticleMatch" ));
85  } else {
86  genMatchSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" );
87  }
88  }
89 
90  // efficiencies
91  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
92  if(addEfficiencies_){
94  }
95 
96  // resolutions
97  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
98  if (addResolutions_) {
100  }
101 
102  // read isoDeposit labels, for direct embedding
103  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_);
104  // read isolation value labels, for direct embedding
105  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_);
106 
107  // check to see if the user wants to add user data
108  if( useUserData_ ){
110  }
111 
112  // embed high level selection variables
113  usePV_ = true;
114  embedHighLevelSelection_ = iConfig.getParameter<bool>("embedHighLevelSelection");
115  if ( embedHighLevelSelection_ ) {
116  beamLineSrc_ = iConfig.getParameter<edm::InputTag>("beamLineSrc");
117  usePV_ = iConfig.getParameter<bool>("usePV");
118  pvSrc_ = iConfig.getParameter<edm::InputTag>("pvSrc");
119  }
120 
121  // produces vector of muons
122  produces<std::vector<Muon> >();
123 }
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
edm::InputTag pickySrc_
input tag for picky muon refit
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:181
bool addEfficiencies_
add efficiencies to the muon (this will be data members of th muon even w/o embedding) ...
edm::InputTag tpfmsSrc_
input tag for tpfms muon refit
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
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)
bool addTeVRefits_
add TeV track refits for the muon
edm::InputTag caloMETMuonCorrs_
source of caloMET muon corrections
edm::InputTag linkToPFSource_
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
bool embedPickyMuon_
embed track from picky 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 126 of file PATMuonProducer.cc.

127 {
128 }

Member Function Documentation

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

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

617 {
618  // Correct to PV
619 
620  // PV2D
621  std::pair<bool,Measurement1D> result =
623  GlobalVector(innerTrack->px(),
624  innerTrack->py(),
625  innerTrack->pz()),
626  primaryVertex);
627  double d0_corr = result.second.value();
628  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
629  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV2D);
630 
631 
632  // PV3D
633  result =
635  GlobalVector(innerTrack->px(),
636  innerTrack->py(),
637  innerTrack->pz()),
638  primaryVertex);
639  d0_corr = result.second.value();
640  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
641  aMuon.setDB( d0_corr, d0_err, pat::Muon::PV3D);
642 
643 
644  // Correct to beam spot
645  // make a fake vertex out of beam spot
646  reco::Vertex vBeamspot(beamspot.position(), beamspot.rotatedCovariance3D());
647 
648  // BS2D
649  result =
651  GlobalVector(innerTrack->px(),
652  innerTrack->py(),
653  innerTrack->pz()),
654  vBeamspot);
655  d0_corr = result.second.value();
656  d0_err = beamspotIsValid ? result.second.error() : -1.0;
657  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS2D);
658 
659  // BS3D
660  result =
662  GlobalVector(innerTrack->px(),
663  innerTrack->py(),
664  innerTrack->pz()),
665  vBeamspot);
666  d0_corr = result.second.value();
667  d0_err = beamspotIsValid ? result.second.error() : -1.0;
668  aMuon.setDB( d0_corr, d0_err, pat::Muon::BS3D);
669 }
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:188
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void PATMuonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

description of config file parameters

Definition at line 477 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(), edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

478 {
480  iDesc.setComment("PAT muon producer module");
481 
482  // input source
483  iDesc.add<edm::InputTag>("muonSource", edm::InputTag("no default"))->setComment("input collection");
484 
485  // embedding
486  iDesc.add<bool>("embedTrack", true)->setComment("embed external track");
487  iDesc.add<bool>("embedStandAloneMuon", true)->setComment("embed external stand-alone muon");
488  iDesc.add<bool>("embedCombinedMuon", false)->setComment("embed external combined muon");
489  iDesc.add<bool>("embedPickyMuon", false)->setComment("embed external picky muon");
490  iDesc.add<bool>("embedTpfmsMuon", false)->setComment("embed external tpfms muon");
491 
492  // embedding of MET muon corrections
493  iDesc.add<bool>("embedCaloMETMuonCorrs", true)->setComment("whether to add MET muon correction for caloMET or not");
494  iDesc.add<edm::InputTag>("caloMETMuonCorrs", edm::InputTag("muonMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for caloMET");
495  iDesc.add<bool>("embedTcMETMuonCorrs", true)->setComment("whether to add MET muon correction for tcMET or not");
496  iDesc.add<edm::InputTag>("tcMETMuonCorrs", edm::InputTag("muonTCMETValueMapProducer" , "muCorrData"))->setComment("source of MET muon corrections for tcMET");
497 
498  // pf specific parameters
499  iDesc.add<edm::InputTag>("pfMuonSource", edm::InputTag("pfMuons"))->setComment("particle flow input collection");
500  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
501  iDesc.add<edm::InputTag>("linkToPFSource", edm::InputTag())->setComment("alternative PF collection to link to (pfCandidateRef) -- traverses inheritance chain up to this");
502  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
503 
504  // TeV refit
505  iDesc.ifValue( edm::ParameterDescription<bool>("addTeVRefits", true, true),
506  true >> (edm::ParameterDescription<edm::InputTag>("pickySrc", edm::InputTag(), true) and
508  )->setComment("If TeV refits are added, their sources need to be specified");
509 
510  // MC matching configurables
511  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
512  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
513  std::vector<edm::InputTag> emptySourceVector;
514  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
515  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
516  )->setComment("input with MC match information");
517 
519 
520  // IsoDeposit configurables
521  edm::ParameterSetDescription isoDepositsPSet;
522  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
523  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
524  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
525  isoDepositsPSet.addOptional<edm::InputTag>("particle");
526  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
527  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
528  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
529  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
530  iDesc.addOptional("isoDeposits", isoDepositsPSet);
531 
532  // isolation values configurables
533  edm::ParameterSetDescription isolationValuesPSet;
534  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
535  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
536  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
537  isolationValuesPSet.addOptional<edm::InputTag>("particle");
538  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
539  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
540  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
541  iDesc.addOptional("isolationValues", isolationValuesPSet);
542 
543  // Efficiency configurables
544  edm::ParameterSetDescription efficienciesPSet;
545  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
546  iDesc.add("efficiencies", efficienciesPSet);
547  iDesc.add<bool>("addEfficiencies", false);
548 
549  // Check to see if the user wants to add user data
550  edm::ParameterSetDescription userDataPSet;
552  iDesc.addOptional("userData", userDataPSet);
553 
554  edm::ParameterSetDescription isolationPSet;
555  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
556  iDesc.add("userIsolation", isolationPSet);
557 
558  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
559  edm::ParameterSetDescription highLevelPSet;
560  highLevelPSet.setAllowAnything();
561  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
562  )->setComment("input with high level selection");
564  )->setComment("input with high level selection");
565  iDesc.addNode( edm::ParameterDescription<bool>("usePV", bool(), true)
566  )->setComment("input with high level selection, use primary vertex (true) or beam line (false)");
567 
568  //descriptions.add("PATMuonProducer", iDesc);
569 }
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)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
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 418 of file PATMuonProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), edm::contains(), efficiencyLoader_, pat::Muon::embedCombinedMuon(), embedCombinedMuon_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Muon::embedStandAloneMuon(), embedStandAloneMuon_, pat::Muon::embedTrack(), embedTrack_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), first, i, edm::RefToBase< T >::id(), isoDepositLabels_, isolationValueLabels_, j, n, pat::Muon::pfCandidateRef(), resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), reco::LeafCandidate::setP4(), pat::helper::KinResolutionsLoader::setResolutions(), LaserTracksInput_cfi::source, and useParticleFlow_.

Referenced by produce().

419 {
420  // in the particle flow algorithm,
421  // the muon momentum is recomputed.
422  // the new value is stored as the momentum of the
423  // resulting PFCandidate of type Muon, and choosen
424  // as the pat::Muon momentum
425  if (useParticleFlow_)
426  aMuon.setP4( aMuon.pfCandidateRef()->p4() );
427  if (embedTrack_) aMuon.embedTrack();
430 
431  // store the match to the generated final state muons
432  if (addGenMatch_) {
433  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
434  reco::GenParticleRef genMuon = (*genMatches[i])[baseRef];
435  aMuon.addGenParticleRef(genMuon);
436  }
437  if (embedGenMatch_) aMuon.embedGenParticle();
438  }
439  if (efficiencyLoader_.enabled()) {
440  efficiencyLoader_.setEfficiencies( aMuon, muonRef );
441  }
442 
443  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
444  if(useParticleFlow_) {
445  if (deposits[j]->contains(baseRef.id()))
446  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[baseRef]);
447  else {
448  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
449  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[source]);
450  }
451  }
452  else{
453  aMuon.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[muonRef]);
454  }
455  }
456 
457  for (size_t j = 0; j<isolationValues.size(); ++j) {
458  if(useParticleFlow_) {
459  if (isolationValues[j]->contains(baseRef.id()))
460  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[baseRef]);
461  else {
462  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
463  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[source]);
464  }
465  }
466  else{
467  aMuon.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[muonRef]);
468  }
469  }
470 
471  if (resolutionLoader_.enabled()) {
473  }
474 }
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:221
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
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.
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:173
void embedCombinedMuon()
set reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon...
Definition: Muon.cc:231
bool useParticleFlow_
switch to use particle flow (PF2PAT) or not
bool embedStandAloneMuon_
embed track from muon system into the muon
reco::PFCandidateRef pfCandidateRef() const
reference to the source IsolatedPFCandidates
Definition: Muon.cc:193
bool embedTrack_
embed the track from inner tracker into the muon
bool addGenMatch_
add generator match information
void embedGenParticle()
Definition: PATObject.h:669
void embedTrack()
set reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.cc:211
int j
Definition: DBlmapReader.cc:9
bool first
Definition: L1TdeRCT.cc:79
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:653
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to 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 embedCombinedMuon_
embed track of the combined fit into the muon
pat::helper::KinResolutionsLoader resolutionLoader_
helper class to add resolutions to the muon
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 130 of file PATMuonProducer.cc.

References IPTools::absoluteTransverseImpactParameter(), addGenMatch_, addTeVRefits_, beamLineSrc_, pat::helper::MultiIsolator::beginEvent(), caloMETMuonCorrs_, efficiencyLoader_, pat::Muon::embedCaloMETMuonCorrs(), embedCaloMETMuonCorrs_, embedGenMatch_, embedHighLevel(), embedHighLevelSelection_, pat::Muon::embedPFCandidate(), embedPFCandidate_, pat::Muon::embedPickyMuon(), embedPickyMuon_, pat::Muon::embedTcMETMuonCorrs(), embedTcMETMuonCorrs_, pat::Muon::embedTpfmsMuon(), embedTpfmsMuon_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), edm::InputTag::encode(), pat::helper::MultiIsolator::endEvent(), edm::HandleBase::failedToGet(), pat::helper::MultiIsolator::fill(), fillMuon(), genMatchSrc_, edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::HandleBase::id(), edm::Ptr< T >::id(), edm::Ref< C, T, F >::id(), getHLTprescales::index, susybsm::HSCParticleType::innerTrack, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), edm::Ptr< T >::isNull(), isoDepositLabels_, isolationValueLabels_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), j, edm::Ptr< T >::key(), edm::InputTag::label(), linkToPFSource_, reco::PFCandidate::muonRef(), patZpeak::muons, muonSrc_, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), muonProducer_cfi::patMuons, pat::Muon::pfCandidateRef(), pfMuonSrc_, pickySrc_, 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(), pat::Muon::setPickyMuon(), pat::Muon::setTpfmsMuon(), python.multivaluedict::sort(), LaserTracksInput_cfi::source, tcMETMuonCorrs_, tpfmsSrc_, useParticleFlow_, usePV_, userDataHelper_, useUserData_, edm::helpers::KeyVal< K, V >::val, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

131 {
133  iEvent.getByLabel(muonSrc_, muons);
134 
135  if (iEvent.isRealData()){
136  addGenMatch_ = false;
137  embedGenMatch_ = false;
138  }
139 
140  // get the ESHandle for the transient track builder,
141  // if needed for high level selection embedding
143 
144  if(isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
146  if(resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
147 
148  IsoDepositMaps deposits(isoDepositLabels_.size());
149  for (size_t j = 0; j<isoDepositLabels_.size(); ++j) {
150  iEvent.getByLabel(isoDepositLabels_[j].second, deposits[j]);
151  }
152 
153  IsolationValueMaps isolationValues(isolationValueLabels_.size());
154  for (size_t j = 0; j<isolationValueLabels_.size(); ++j) {
155  iEvent.getByLabel(isolationValueLabels_[j].second, isolationValues[j]);
156  }
157 
158  // prepare the MC matching
159  GenAssociations genMatches(genMatchSrc_.size());
160  if (addGenMatch_) {
161  for (size_t j = 0, nd = genMatchSrc_.size(); j < nd; ++j) {
162  iEvent.getByLabel(genMatchSrc_[j], genMatches[j]);
163  }
164  }
165 
166  // prepare the high level selection: needs beamline
167  // OR primary vertex, depending on user selection
168  reco::TrackBase::Point beamPoint(0,0,0);
169  reco::Vertex primaryVertex;
170  reco::BeamSpot beamSpot;
171  bool beamSpotIsValid = false;
172  bool primaryVertexIsValid = false;
173  if ( embedHighLevelSelection_ ) {
174  // get the beamspot
175  edm::Handle<reco::BeamSpot> beamSpotHandle;
176  iEvent.getByLabel(beamLineSrc_, beamSpotHandle);
177 
178  // get the primary vertex
180  iEvent.getByLabel( pvSrc_, pvHandle );
181 
182  if( beamSpotHandle.isValid() ){
183  beamSpot = *beamSpotHandle;
184  beamSpotIsValid = true;
185  } else{
186  edm::LogError("DataNotAvailable")
187  << "No beam spot available from EventSetup, not adding high level selection \n";
188  }
189  beamPoint = reco::TrackBase::Point ( beamSpot.x0(), beamSpot.y0(), beamSpot.z0() );
190  if( pvHandle.isValid() && !pvHandle->empty() ) {
191  primaryVertex = pvHandle->at(0);
192  primaryVertexIsValid = true;
193  } else {
194  edm::LogError("DataNotAvailable")
195  << "No primary vertex available from EventSetup, not adding high level selection \n";
196  }
197  // this is needed by the IPTools methods from the tracking group
198  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
199  }
200 
201  // this will be the new object collection
202  std::vector<Muon> * patMuons = new std::vector<Muon>();
203 
204  if( useParticleFlow_ ){
205  // get the PFCandidates of type muons
207  iEvent.getByLabel(pfMuonSrc_, pfMuons);
208  //-- SAK ------------------------------------------------------------------
210  if (linkToPFSource_.label().length())
211  iEvent.getByLabel(linkToPFSource_, pfForLinking);
212  //-- SAK ------------------------------------------------------------------
213 
214  unsigned index=0;
215  for( reco::PFCandidateConstIterator i = pfMuons->begin(); i != pfMuons->end(); ++i, ++index) {
216  const reco::PFCandidate& pfmu = *i;
217  //const reco::IsolaPFCandidate& pfmu = *i;
218  const reco::MuonRef& muonRef = pfmu.muonRef();
219  assert( muonRef.isNonnull() );
220 
221  MuonBaseRef muonBaseRef(muonRef);
222  Muon aMuon(muonBaseRef);
223 
224  if ( useUserData_ ) {
225  userDataHelper_.add( aMuon, iEvent, iSetup );
226  }
227 
228  // embed high level selection
229  if ( embedHighLevelSelection_ ) {
230  // get the tracks
231  reco::TrackRef innerTrack = muonBaseRef->innerTrack();
232  reco::TrackRef globalTrack= muonBaseRef->globalTrack();
233  // Make sure the collection it points to is there
234  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
235  unsigned int nhits = innerTrack->numberOfValidHits();
236  aMuon.setNumberOfValidHits( nhits );
237 
238  reco::TransientTrack tt = trackBuilder->build(innerTrack);
239  embedHighLevel( aMuon,
240  innerTrack,
241  tt,
242  primaryVertex,
243  primaryVertexIsValid,
244  beamSpot,
245  beamSpotIsValid );
246 
247  // Correct to PV, or beam spot
248  if ( !usePV_ ) {
249  double corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
250  aMuon.setDB( corr_d0, -1.0 );
251  } else {
252  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
253  double d0_corr = result.second.value();
254  double d0_err = result.second.error();
255  aMuon.setDB( d0_corr, d0_err );
256  }
257  }
258 
259  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
260  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
261  aMuon.setNormChi2( norm_chi2 );
262  }
263  }
264  reco::PFCandidateRef pfRef(pfMuons,index);
265  //reco::PFCandidatePtr ptrToMother(pfMuons,index);
266  reco::CandidateBaseRef pfBaseRef( pfRef );
267 
268  aMuon.setPFCandidateRef( pfRef );
269  if( embedPFCandidate_ ) aMuon.embedPFCandidate();
270  fillMuon( aMuon, muonBaseRef, pfBaseRef, genMatches, deposits, isolationValues );
271 
272  //-- SAK ----------------------------------------------------------------
273  if (linkToPFSource_.label().length() && aMuon.pfCandidateRef().id() != pfForLinking.id()) {
274  reco::CandidatePtr source = aMuon.pfCandidateRef()->sourceCandidatePtr(0);
275  while (source.id() != pfForLinking.id()) {
276  source = source->sourceCandidatePtr(0);
277  if (source.isNull())
278  throw cms::Exception("InputSource", "Object in "+pfMuonSrc_.encode()+" does not link back to "+linkToPFSource_.encode());
279  } // end loop over inheritance chain
280  aMuon.setPFCandidateRef(reco::PFCandidateRef(pfForLinking, source.key()));
281  }
282  //-- SAK ----------------------------------------------------------------
283  patMuons->push_back(aMuon);
284  }
285  }
286  else {
288  iEvent.getByLabel(muonSrc_, muons);
289 
290  // prepare the TeV refit track retrieval
291  edm::Handle<reco::TrackToTrackMap> pickyMap, tpfmsMap;
292  if (addTeVRefits_) {
293  iEvent.getByLabel(pickySrc_, pickyMap);
294  iEvent.getByLabel(tpfmsSrc_, tpfmsMap);
295  }
296 
297  // embedding of muon MET corrections
299  //edm::ValueMap<reco::MuonMETCorrectionData> caloMETmuCorValueMap;
301  iEvent.getByLabel(caloMETMuonCorrs_, caloMETMuonCorrs);
302  //caloMETmuCorValueMap = *caloMETmuCorValueMap_h;
303  }
305  //edm::ValueMap<reco::MuonMETCorrectionData> tcMETmuCorValueMap;
307  iEvent.getByLabel(tcMETMuonCorrs_, tcMETMuonCorrs);
308  //tcMETmuCorValueMap = *tcMETmuCorValueMap_h;
309  }
310  for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
311  // construct the Muon from the ref -> save ref to original object
312  unsigned int idx = itMuon - muons->begin();
313  MuonBaseRef muonRef = muons->refAt(idx);
314  reco::CandidateBaseRef muonBaseRef( muonRef );
315 
316  Muon aMuon(muonRef);
317  fillMuon( aMuon, muonRef, muonBaseRef, genMatches, deposits, isolationValues);
318 
319  // store the TeV refit track refs (only available for globalMuons)
320  if (addTeVRefits_ && itMuon->isGlobalMuon()) {
322  const reco::TrackRef& globalTrack = itMuon->globalTrack();
323 
324  // If the getByLabel calls failed above (i.e. if the TeV refit
325  // maps/collections were not in the event), then the TrackRefs
326  // in the Muon object will remain null.
327  if (!pickyMap.failedToGet()) {
328  it = pickyMap->find(globalTrack);
329  if (it != pickyMap->end()) aMuon.setPickyMuon(it->val);
330  if (embedPickyMuon_) aMuon.embedPickyMuon();
331  }
332 
333  if (!tpfmsMap.failedToGet()) {
334  it = tpfmsMap->find(globalTrack);
335  if (it != tpfmsMap->end()) aMuon.setTpfmsMuon(it->val);
336  if (embedTpfmsMuon_) aMuon.embedTpfmsMuon();
337  }
338  }
339 
340  // Isolation
341  if (isolator_.enabled()) {
342  //reco::CandidatePtr mother = ptrToMother->sourceCandidatePtr(0);
343  isolator_.fill(*muons, idx, isolatorTmpStorage_);
344  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
345  // better to loop backwards, so the vector is resized less times
346  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
347  aMuon.setIsolation(it->first, it->second);
348  }
349  }
350 
351  // for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
352  // aMuon.setIsoDeposit(isoDepositLabels_[j].first,
353  // (*deposits[j])[muonRef]);
354  // }
355 
356  // add sel to selected
357  edm::Ptr<reco::Muon> muonsPtr = muons->ptrAt(idx);
358  if ( useUserData_ ) {
359  userDataHelper_.add( aMuon, iEvent, iSetup );
360  }
361 
362  // embed high level selection
363  if ( embedHighLevelSelection_ ) {
364  // get the tracks
365  reco::TrackRef innerTrack = itMuon->innerTrack();
366  reco::TrackRef globalTrack= itMuon->globalTrack();
367  // Make sure the collection it points to is there
368  if ( innerTrack.isNonnull() && innerTrack.isAvailable() ) {
369  unsigned int nhits = innerTrack->numberOfValidHits();
370  aMuon.setNumberOfValidHits( nhits );
371 
372  reco::TransientTrack tt = trackBuilder->build(innerTrack);
373  embedHighLevel( aMuon,
374  innerTrack,
375  tt,
376  primaryVertex,
377  primaryVertexIsValid,
378  beamSpot,
379  beamSpotIsValid );
380 
381  // Correct to PV, or beam spot
382  if ( !usePV_ ) {
383  double corr_d0 = -1.0 * innerTrack->dxy( beamPoint );
384  aMuon.setDB( corr_d0, -1.0 );
385  } else {
386  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
387  double d0_corr = result.second.value();
388  double d0_err = result.second.error();
389  aMuon.setDB( d0_corr, d0_err );
390  }
391  }
392 
393  if ( globalTrack.isNonnull() && globalTrack.isAvailable() ) {
394  double norm_chi2 = globalTrack->chi2() / globalTrack->ndof();
395  aMuon.setNormChi2( norm_chi2 );
396  }
397  }
398 
399  // embed MET muon corrections
400  if( embedCaloMETMuonCorrs_ ) aMuon.embedCaloMETMuonCorrs((*caloMETMuonCorrs)[muonRef]);
401  if( embedTcMETMuonCorrs_ ) aMuon.embedTcMETMuonCorrs((*tcMETMuonCorrs )[muonRef]);
402 
403  patMuons->push_back(aMuon);
404  }
405  }
406 
407  // sort muons in pt
408  std::sort(patMuons->begin(), patMuons->end(), pTComparator_);
409 
410  // put genEvt object in Event
411  std::auto_ptr<std::vector<Muon> > ptr(patMuons);
412  iEvent.put(ptr);
413 
415 }
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
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:86
edm::InputTag pickySrc_
input tag for picky muon refit
bool embedTcMETMuonCorrs_
embed muon MET correction info for tcMET into the muon
ProductID id() const
Definition: HandleBase.cc:15
edm::InputTag tpfmsSrc_
input tag for tpfms muon refit
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:275
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool isRealData() const
Definition: EventBase.h:60
std::string encode() const
Definition: InputTag.cc:72
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:249
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:84
void embedHighLevel(pat::Muon &aMuon, reco::TrackRef innerTrack, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:169
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:355
reco::MuonRef muonRef() const
Definition: PFCandidate.cc:347
bool failedToGet() const
Definition: HandleBase.h:80
key_type key() const
Definition: Ptr.h:174
edm::InputTag muonSrc_
input source
const T & get() const
Definition: EventSetup.h:55
bool addTeVRefits_
add TeV track refits for the muon
edm::InputTag caloMETMuonCorrs_
source of caloMET muon corrections
edm::InputTag linkToPFSource_
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
std::string const & label() const
Definition: InputTag.h:25
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
bool isNull() const
Checks for null.
Definition: Ptr.h:153
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
pat::helper::EfficiencyLoader efficiencyLoader_
helper class to add efficiencies to the muon
bool embedPickyMuon_
embed track from picky muon fit into the muon
tuple muons
Definition: patZpeak.py:38
double y0() const
y coordinate
Definition: BeamSpot.h:67
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
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
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 572 of file PATMuonProducer.cc.

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

Referenced by PATMuonProducer().

573 {
574  labels.clear();
575 
576  if (iConfig.exists( psetName )) {
577  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>(psetName);
578 
579  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
580  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
581  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
582  if (depconf.exists("pfAllParticles")) {
583  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
584  }
585  if (depconf.exists("pfChargedHadrons")) {
586  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
587  }
588  if (depconf.exists("pfNeutralHadrons")) {
589  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
590  }
591  if (depconf.exists("pfPhotons")) {
592  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
593  }
594  if (depconf.exists("user")) {
595  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
596  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
597  int key = UserBaseIso;
598  for ( ; it != ed; ++it, ++key) {
599  labels.push_back(std::make_pair(IsolationKeys(key), *it));
600  }
601  }
602  }
603 }
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
tuple labels
Definition: L1TDQM_cfg.py:62
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 111 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 117 of file PATMuonProducer.h.

Referenced by PATMuonProducer().

bool pat::PATMuonProducer::addTeVRefits_
private

add TeV track refits for the muon

Definition at line 101 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

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 95 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::embedCaloMETMuonCorrs_
private

embed muon MET correction info for caloMET into the muon

Definition at line 93 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 91 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 115 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::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 107 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedStandAloneMuon_
private

embed track from muon system into the muon

Definition at line 89 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 97 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 PATMuonProducer(), and produce().

bool pat::PATMuonProducer::embedTrack_
private

embed the track from inner tracker into the muon

Definition at line 87 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 113 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::linkToPFSource_
private

Definition at line 122 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and 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().

edm::InputTag pat::PATMuonProducer::pickySrc_
private

input tag for picky muon refit

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

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

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

source of tcMET muon corrections

Definition at line 99 of file PATMuonProducer.h.

Referenced by PATMuonProducer(), and produce().

edm::InputTag pat::PATMuonProducer::tpfmsSrc_
private

input tag for tpfms muon refit

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