1 |
//
|
2 |
// $Id: PATMuonProducer.h,v 1.26 2010/05/12 12:34:43 rwolf Exp $
|
3 |
//
|
4 |
|
5 |
#ifndef PhysicsTools_PatAlgos_PATMuonProducer_h
|
6 |
#define PhysicsTools_PatAlgos_PATMuonProducer_h
|
7 |
|
8 |
/**
|
9 |
\class pat::PATMuonProducer PATMuonProducer.h "PhysicsTools/PatAlgos/interface/PATMuonProducer.h"
|
10 |
\brief Produces pat::Muon's
|
11 |
|
12 |
The PATMuonProducer produces analysis-level pat::Muon's starting from
|
13 |
a collection of objects of reco::Muon.
|
14 |
|
15 |
\author Steven Lowette, Roger Wolf
|
16 |
\version $Id: PATMuonProducer.h,v 1.26 2010/05/12 12:34:43 rwolf Exp $
|
17 |
*/
|
18 |
|
19 |
#include <string>
|
20 |
|
21 |
#include "FWCore/Framework/interface/Event.h"
|
22 |
#include "FWCore/Framework/interface/EDProducer.h"
|
23 |
#include "DataFormats/PatCandidates/interface/Muon.h"
|
24 |
#include "CommonTools/Utils/interface/PtComparator.h"
|
25 |
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
26 |
|
27 |
#include "TrackingTools/IPTools/interface/IPTools.h"
|
28 |
#include "PhysicsTools/PatAlgos/interface/MultiIsolator.h"
|
29 |
#include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
|
30 |
#include "PhysicsTools/PatAlgos/interface/KinResolutionsLoader.h"
|
31 |
|
32 |
#include "DataFormats/PatCandidates/interface/UserData.h"
|
33 |
#include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h"
|
34 |
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
|
35 |
|
36 |
|
37 |
namespace pat {
|
38 |
/// foward declarations
|
39 |
class TrackerIsolationPt;
|
40 |
class CaloIsolationEnergy;
|
41 |
|
42 |
/// class definition
|
43 |
class PATMuonProducer : public edm::EDProducer {
|
44 |
|
45 |
public:
|
46 |
/// default constructir
|
47 |
explicit PATMuonProducer(const edm::ParameterSet & iConfig);
|
48 |
/// default destructur
|
49 |
~PATMuonProducer();
|
50 |
/// everything that needs to be done during the event loop
|
51 |
virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup);
|
52 |
/// description of config file parameters
|
53 |
static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
|
54 |
|
55 |
private:
|
56 |
/// typedefs for convenience
|
57 |
typedef edm::RefToBase<reco::Muon> MuonBaseRef;
|
58 |
typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > GenAssociations;
|
59 |
typedef std::vector< edm::Handle< edm::ValueMap<IsoDeposit> > > IsoDepositMaps;
|
60 |
typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
|
61 |
typedef std::pair<pat::IsolationKeys,edm::InputTag> IsolationLabel;
|
62 |
typedef std::vector<IsolationLabel> IsolationLabels;
|
63 |
|
64 |
|
65 |
/// common muon filling, for both the standard and PF2PAT case
|
66 |
void fillMuon( Muon& aMuon, const MuonBaseRef& muonRef, const reco::CandidateBaseRef& baseRef, const GenAssociations& genMatches, const IsoDepositMaps& deposits, const IsolationValueMaps& isolationValues) const;
|
67 |
/// fill label vector from the contents of the parameter set,
|
68 |
/// for the embedding of isoDeposits or userIsolation values
|
69 |
void readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels);
|
70 |
|
71 |
|
72 |
// embed various impact parameters with errors
|
73 |
// embed high level selection
|
74 |
void embedHighLevel( pat::Muon & aMuon,
|
75 |
reco::TrackRef innerTrack,
|
76 |
reco::TransientTrack & tt,
|
77 |
reco::Vertex & primaryVertex,
|
78 |
bool primaryVertexIsValid,
|
79 |
reco::BeamSpot & beamspot,
|
80 |
bool beamspotIsValid );
|
81 |
|
82 |
|
83 |
private:
|
84 |
/// input source
|
85 |
edm::InputTag muonSrc_;
|
86 |
/// embed the track from inner tracker into the muon
|
87 |
bool embedTrack_;
|
88 |
/// embed track from muon system into the muon
|
89 |
bool embedStandAloneMuon_;
|
90 |
/// embed track of the combined fit into the muon
|
91 |
bool embedCombinedMuon_;
|
92 |
/// embed muon MET correction info for caloMET into the muon
|
93 |
bool embedCaloMETMuonCorrs_;
|
94 |
/// source of caloMET muon corrections
|
95 |
edm::InputTag caloMETMuonCorrs_;
|
96 |
/// embed muon MET correction info for tcMET into the muon
|
97 |
bool embedTcMETMuonCorrs_;
|
98 |
/// source of tcMET muon corrections
|
99 |
edm::InputTag tcMETMuonCorrs_;
|
100 |
/// add TeV track refits for the muon
|
101 |
bool addTeVRefits_;
|
102 |
/// input tag for picky muon refit
|
103 |
edm::InputTag pickySrc_;
|
104 |
/// input tag for tpfms muon refit
|
105 |
edm::InputTag tpfmsSrc_;
|
106 |
/// embed track from picky muon fit into the muon
|
107 |
bool embedPickyMuon_;
|
108 |
/// embed track from tpfms muon fit into the muon
|
109 |
bool embedTpfmsMuon_;
|
110 |
/// add generator match information
|
111 |
bool addGenMatch_;
|
112 |
/// input tags for generator match information
|
113 |
std::vector<edm::InputTag> genMatchSrc_;
|
114 |
/// embed the gen match information into the muon
|
115 |
bool embedGenMatch_;
|
116 |
/// add resolutions to the muon (this will be data members of th muon even w/o embedding)
|
117 |
bool addResolutions_;
|
118 |
/// helper class to add resolutions to the muon
|
119 |
pat::helper::KinResolutionsLoader resolutionLoader_;
|
120 |
/// switch to use particle flow (PF2PAT) or not
|
121 |
bool useParticleFlow_;
|
122 |
/// input source pfCandidates that will be to be transformed into pat::Muons, when using PF2PAT
|
123 |
edm::InputTag pfMuonSrc_;
|
124 |
/// embed pfCandidates into the muon
|
125 |
bool embedPFCandidate_;
|
126 |
/// embed high level selection variables
|
127 |
bool embedHighLevelSelection_;
|
128 |
/// input source of the primary vertex/beamspot
|
129 |
edm::InputTag beamLineSrc_;
|
130 |
/// use the primary vertex or the beamspot
|
131 |
bool usePV_;
|
132 |
/// input source of the primary vertex
|
133 |
edm::InputTag pvSrc_;
|
134 |
/// input source for isoDeposits
|
135 |
IsolationLabels isoDepositLabels_;
|
136 |
/// input source isolation value maps
|
137 |
IsolationLabels isolationValueLabels_;
|
138 |
/// add efficiencies to the muon (this will be data members of th muon even w/o embedding)
|
139 |
bool addEfficiencies_;
|
140 |
/// add user data to the muon (this will be data members of th muon even w/o embedding)
|
141 |
bool useUserData_;
|
142 |
|
143 |
/// --- tools ---
|
144 |
/// comparator for pt ordering
|
145 |
GreaterByPt<Muon> pTComparator_;
|
146 |
/// helper class to add userdefined isolation values to the muon
|
147 |
pat::helper::MultiIsolator isolator_;
|
148 |
/// isolation value pair for temporary storage before being folded into the muon
|
149 |
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_;
|
150 |
/// helper class to add efficiencies to the muon
|
151 |
pat::helper::EfficiencyLoader efficiencyLoader_;
|
152 |
/// helper class to add userData to the muon
|
153 |
pat::PATUserDataHelper<pat::Muon> userDataHelper_;
|
154 |
};
|
155 |
|
156 |
}
|
157 |
|
158 |
#endif
|