1 |
dgele |
1.1 |
//
|
2 |
|
|
// $Id: PATElectronProducer.h,v 1.12.2.5 2009/04/30 09:11:45 gpetrucc Exp $
|
3 |
|
|
//
|
4 |
|
|
|
5 |
|
|
#ifndef PhysicsTools_PatAlgos_PATElectronProducer_h
|
6 |
|
|
#define PhysicsTools_PatAlgos_PATElectronProducer_h
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
\class pat::PATElectronProducer PATElectronProducer.h "PhysicsTools/PatAlgos/interface/PATElectronProducer.h"
|
10 |
|
|
\brief Produces pat::Electron's
|
11 |
|
|
|
12 |
|
|
The PATElectronProducer produces analysis-level pat::Electron's starting from
|
13 |
|
|
a collection of objects of ElectronType.
|
14 |
|
|
|
15 |
|
|
\author Steven Lowette, James Lamb
|
16 |
|
|
\version $Id: PATElectronProducer.h,v 1.12.2.5 2009/04/30 09:11:45 gpetrucc Exp $
|
17 |
|
|
*/
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
#include "FWCore/Framework/interface/EDProducer.h"
|
21 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
22 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
23 |
|
|
#include "FWCore/ParameterSet/interface/InputTag.h"
|
24 |
|
|
#include "DataFormats/Common/interface/View.h"
|
25 |
|
|
#include "DataFormats/Common/interface/ValueMap.h"
|
26 |
|
|
#include "DataFormats/Candidate/interface/CandAssociation.h"
|
27 |
|
|
|
28 |
|
|
#include "PhysicsTools/Utilities/interface/PtComparator.h"
|
29 |
|
|
|
30 |
|
|
#include "PhysicsTools/PatAlgos/interface/MultiIsolator.h"
|
31 |
|
|
#include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
|
32 |
|
|
#include "PhysicsTools/PatAlgos/interface/KinResolutionsLoader.h"
|
33 |
|
|
|
34 |
|
|
#include "DataFormats/PatCandidates/interface/Electron.h"
|
35 |
|
|
|
36 |
|
|
#include "DataFormats/PatCandidates/interface/UserData.h"
|
37 |
|
|
#include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h"
|
38 |
|
|
|
39 |
|
|
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
|
40 |
|
|
|
41 |
|
|
#include <string>
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
namespace pat {
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
class TrackerIsolationPt;
|
48 |
|
|
class CaloIsolationEnergy;
|
49 |
|
|
class LeptonLRCalc;
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
class PATElectronProducer : public edm::EDProducer {
|
53 |
|
|
|
54 |
|
|
public:
|
55 |
|
|
|
56 |
|
|
explicit PATElectronProducer(const edm::ParameterSet & iConfig);
|
57 |
|
|
~PATElectronProducer();
|
58 |
|
|
|
59 |
|
|
virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup);
|
60 |
|
|
typedef edm::RefToBase<ElectronType> ElectronBaseRef;
|
61 |
|
|
|
62 |
|
|
private:
|
63 |
|
|
|
64 |
|
|
// configurables
|
65 |
|
|
edm::InputTag electronSrc_;
|
66 |
|
|
bool embedGsfTrack_;
|
67 |
|
|
bool embedSuperCluster_;
|
68 |
|
|
bool embedTrack_;
|
69 |
|
|
bool addGenMatch_;
|
70 |
|
|
bool embedGenMatch_;
|
71 |
|
|
std::vector<edm::InputTag> genMatchSrc_;
|
72 |
|
|
bool addTrigMatch_;
|
73 |
|
|
std::vector<edm::InputTag> trigMatchSrc_;
|
74 |
|
|
bool addElecID_;
|
75 |
|
|
|
76 |
|
|
/// pflow specific
|
77 |
|
|
bool useParticleFlow_;
|
78 |
|
|
edm::InputTag pfElecSrc_;
|
79 |
|
|
bool embedPFCandidate_;
|
80 |
|
|
|
81 |
|
|
typedef std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > GenAssociations;
|
82 |
|
|
|
83 |
|
|
typedef std::vector<edm::Handle<edm::Association<TriggerPrimitiveCollection> > > TrigAssociations;
|
84 |
|
|
|
85 |
|
|
void FillElectron(Electron& aEl,
|
86 |
|
|
const ElectronBaseRef& elecRef,
|
87 |
|
|
const reco::CandidateBaseRef& baseRef,
|
88 |
|
|
const GenAssociations& genMatches,
|
89 |
|
|
const TrigAssociations& trigMatches) const;
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
typedef std::pair<std::string, edm::InputTag> NameTag;
|
93 |
|
|
std::vector<NameTag> elecIDSrcs_;
|
94 |
|
|
|
95 |
|
|
// tools
|
96 |
|
|
GreaterByPt<Electron> pTComparator_;
|
97 |
|
|
|
98 |
|
|
pat::helper::MultiIsolator isolator_;
|
99 |
|
|
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event
|
100 |
|
|
std::vector<std::pair<pat::IsolationKeys,edm::InputTag> > isoDepositLabels_;
|
101 |
|
|
|
102 |
|
|
bool addEfficiencies_;
|
103 |
|
|
pat::helper::EfficiencyLoader efficiencyLoader_;
|
104 |
|
|
|
105 |
|
|
bool addResolutions_;
|
106 |
|
|
pat::helper::KinResolutionsLoader resolutionLoader_;
|
107 |
|
|
|
108 |
|
|
bool useUserData_;
|
109 |
|
|
pat::PATUserDataHelper<pat::Electron> userDataHelper_;
|
110 |
|
|
|
111 |
|
|
//Add electron Cluster Shapes */
|
112 |
|
|
bool addElecShapes_;
|
113 |
|
|
//Ecal Cluster Lazy Tools
|
114 |
|
|
std::auto_ptr<EcalClusterLazyTools> lazyTools_;
|
115 |
|
|
|
116 |
|
|
//For the Cluster Shape reading */
|
117 |
|
|
edm::InputTag reducedBarrelRecHitCollection_;
|
118 |
|
|
edm::InputTag reducedEndcapRecHitCollection_;
|
119 |
|
|
|
120 |
|
|
};
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
}
|
124 |
|
|
|
125 |
|
|
#endif
|