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