Skip to content

Commit 2da2efd

Browse files
committed
Fix conflicts.
2 parents 0d00deb + b810b66 commit 2da2efd

36 files changed

+1255
-1347
lines changed

DQM/Physics/src/QcdPhotonsDQM.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
315315
iEvent.getByToken(theBarrelRecHitToken_, EBReducedRecHits);
316316
Handle<EcalRecHitCollection> EEReducedRecHits;
317317
iEvent.getByToken(theEndcapRecHitToken_, EEReducedRecHits);
318-
EcalClusterLazyTools lazyTool(iEvent, iSetup, theBarrelRecHitTag_, theEndcapRecHitTag_);
318+
EcalClusterLazyTools lazyTool(iEvent, iSetup, theBarrelRecHitToken_, theEndcapRecHitToken_);
319319

320320

321321
// Find the highest et "decent" photon

DQMOffline/Trigger/src/FourVectorHLTOffline.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2352,7 +2352,7 @@ void FourVectorHLTOffline::selectElectrons(const edm::Event& iEvent, const edm::
23522352

23532353
if(pEBRecHits.isValid() && pEERecHits.isValid()) {
23542354

2355-
EcalClusterLazyTools lazyTool(iEvent, iSetup, recHitsEBTag_, recHitsEETag_);
2355+
EcalClusterLazyTools lazyTool(iEvent, iSetup, recHitsEBToken, recHitsEEToken);
23562356
const reco::CaloCluster* bc = iter->superCluster()->seed().get(); // get the basic cluster
23572357

23582358
float eleMaxOver3x3 = ( lazyTool.eMax(*bc) / lazyTool.e3x3(*bc) );

EgammaAnalysis/ElectronTools/plugins/ElectronIdMVAProducer.cc

+116-117
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,28 @@
2424
using namespace std;
2525
using namespace reco;
2626
class ElectronIdMVAProducer : public edm::EDFilter {
27-
public:
28-
explicit ElectronIdMVAProducer(const edm::ParameterSet&);
29-
~ElectronIdMVAProducer();
30-
31-
private:
32-
virtual bool filter(edm::Event&, const edm::EventSetup&);
33-
34-
// ----------member data ---------------------------
35-
bool verbose_;
36-
edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
37-
edm::EDGetTokenT<reco::GsfElectronCollection> electronToken_;
38-
edm::EDGetTokenT<double> eventrhoToken_;
39-
edm::InputTag reducedEBRecHitCollection_;
40-
edm::InputTag reducedEERecHitCollection_;
41-
42-
double _Rho;
43-
string method_;
44-
vector<string> mvaWeightFiles_;
45-
bool Trig_;
46-
bool NoIP_;
47-
48-
EGammaMvaEleEstimator* mvaID_;
49-
27+
public:
28+
explicit ElectronIdMVAProducer(const edm::ParameterSet&);
29+
~ElectronIdMVAProducer();
30+
31+
private:
32+
virtual bool filter(edm::Event&, const edm::EventSetup&);
33+
34+
// ----------member data ---------------------------
35+
bool verbose_;
36+
edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
37+
edm::EDGetTokenT<reco::GsfElectronCollection> electronToken_;
38+
edm::EDGetTokenT<double> eventrhoToken_;
39+
edm::EDGetTokenT<EcalRecHitCollection> reducedEBRecHitCollectionToken_;
40+
edm::EDGetTokenT<EcalRecHitCollection> reducedEERecHitCollectionToken_;
41+
42+
double _Rho;
43+
string method_;
44+
vector<string> mvaWeightFiles_;
45+
bool Trig_;
46+
bool NoIP_;
47+
48+
EGammaMvaEleEstimator* mvaID_;
5049
};
5150

5251
//
@@ -61,47 +60,47 @@ class ElectronIdMVAProducer : public edm::EDFilter {
6160
// constructors and destructor
6261
//
6362
ElectronIdMVAProducer::ElectronIdMVAProducer(const edm::ParameterSet& iConfig) {
64-
verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
65-
vertexToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexTag"));
66-
electronToken_ = consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electronTag"));
67-
eventrhoToken_ = consumes<double>(edm::InputTag("kt6PFJets", "rho"));
68-
reducedEBRecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedEBRecHitCollection");
69-
reducedEERecHitCollection_ = iConfig.getParameter<edm::InputTag>("reducedEERecHitCollection");
70-
method_ = iConfig.getParameter<string>("method");
71-
std::vector<string> fpMvaWeightFiles = iConfig.getParameter<std::vector<std::string> >("mvaWeightFile");
72-
Trig_ = iConfig.getParameter<bool>("Trig");
73-
NoIP_ = iConfig.getParameter<bool>("NoIP");
74-
75-
produces<edm::ValueMap<float> >("");
76-
77-
mvaID_ = new EGammaMvaEleEstimator();
78-
79-
EGammaMvaEleEstimator::MVAType type_;
80-
if(Trig_ && !NoIP_){type_ = EGammaMvaEleEstimator::kTrig;}
81-
82-
if(Trig_ && NoIP_){type_ = EGammaMvaEleEstimator::kTrigNoIP;}
83-
84-
if(!Trig_){type_ = EGammaMvaEleEstimator::kNonTrig;}
85-
86-
bool manualCat_ = true;
87-
88-
string path_mvaWeightFileEleID;
89-
for(unsigned ifile=0 ; ifile < fpMvaWeightFiles.size() ; ++ifile) {
90-
path_mvaWeightFileEleID = edm::FileInPath ( fpMvaWeightFiles[ifile].c_str() ).fullPath();
91-
mvaWeightFiles_.push_back(path_mvaWeightFileEleID);
92-
}
93-
94-
mvaID_->initialize(method_, type_, manualCat_, mvaWeightFiles_);
95-
63+
verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
64+
vertexToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexTag"));
65+
electronToken_ = consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electronTag"));
66+
eventrhoToken_ = consumes<double>(edm::InputTag("kt6PFJets", "rho"));
67+
reducedEBRecHitCollectionToken_ = consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("reducedEBRecHitCollection"));
68+
reducedEERecHitCollectionToken_ = consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("reducedEERecHitCollection"));
69+
method_ = iConfig.getParameter<string>("method");
70+
std::vector<string> fpMvaWeightFiles = iConfig.getParameter<std::vector<std::string> >("mvaWeightFile");
71+
Trig_ = iConfig.getParameter<bool>("Trig");
72+
NoIP_ = iConfig.getParameter<bool>("NoIP");
73+
74+
produces<edm::ValueMap<float> >("");
75+
76+
mvaID_ = new EGammaMvaEleEstimator();
77+
78+
EGammaMvaEleEstimator::MVAType type_;
79+
if(Trig_ && !NoIP_){type_ = EGammaMvaEleEstimator::kTrig;}
80+
81+
if(Trig_ && NoIP_){type_ = EGammaMvaEleEstimator::kTrigNoIP;}
82+
83+
if(!Trig_){type_ = EGammaMvaEleEstimator::kNonTrig;}
84+
85+
bool manualCat_ = true;
86+
87+
string path_mvaWeightFileEleID;
88+
for(unsigned ifile=0 ; ifile < fpMvaWeightFiles.size() ; ++ifile) {
89+
path_mvaWeightFileEleID = edm::FileInPath ( fpMvaWeightFiles[ifile].c_str() ).fullPath();
90+
mvaWeightFiles_.push_back(path_mvaWeightFileEleID);
91+
}
92+
93+
mvaID_->initialize(method_, type_, manualCat_, mvaWeightFiles_);
94+
9695
}
9796

9897

9998
ElectronIdMVAProducer::~ElectronIdMVAProducer()
10099
{
101-
102-
// do anything here that needs to be done at desctruction time
103-
// (e.g. close files, deallocate resources etc.)
104-
100+
101+
// do anything here that needs to be done at desctruction time
102+
// (e.g. close files, deallocate resources etc.)
103+
105104
}
106105

107106

@@ -111,64 +110,64 @@ ElectronIdMVAProducer::~ElectronIdMVAProducer()
111110

112111
// ------------ method called on each new Event ------------
113112
bool ElectronIdMVAProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {
114-
using namespace edm;
115-
116-
std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>() );
117-
118-
Handle<reco::VertexCollection> vertexCollection;
119-
iEvent.getByToken(vertexToken_, vertexCollection);
120-
121-
Vertex dummy;
122-
const Vertex *pv = &dummy;
123-
if ( vertexCollection->size() != 0) {
124-
pv = &*vertexCollection->begin();
125-
} else { // create a dummy PV
126-
Vertex::Error e;
127-
e(0, 0) = 0.0015 * 0.0015;
128-
e(1, 1) = 0.0015 * 0.0015;
129-
e(2, 2) = 15. * 15.;
130-
Vertex::Point p(0, 0, 0);
131-
dummy = Vertex(p, e, 0, 0, 0);
132-
}
133-
134-
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection_, reducedEERecHitCollection_);
135-
136-
edm::ESHandle<TransientTrackBuilder> builder;
137-
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
138-
TransientTrackBuilder thebuilder = *(builder.product());
139-
140-
Handle<reco::GsfElectronCollection> egCollection;
141-
iEvent.getByToken(electronToken_,egCollection);
142-
const reco::GsfElectronCollection egCandidates = (*egCollection.product());
143-
144-
_Rho=0;
145-
edm::Handle<double> rhoPtr;
146-
iEvent.getByToken(eventrhoToken_,rhoPtr);
147-
_Rho=*rhoPtr;
148-
149-
std::vector<float> values;
150-
values.reserve(egCollection->size());
151-
152-
for ( reco::GsfElectronCollection::const_iterator egIter = egCandidates.begin(); egIter != egCandidates.end(); ++egIter) {
153-
154-
double mvaVal = -999999;
155-
if(!NoIP_){
156-
mvaVal = mvaID_->mvaValue( *egIter, *pv,thebuilder,lazyTools, verbose_);
157-
}
158-
if(NoIP_){
159-
mvaVal = mvaID_->mvaValue( *egIter, *pv, _Rho,/*thebuilder,*/lazyTools, verbose_);
160-
}
161-
162-
values.push_back( mvaVal );
163-
}
164-
165-
edm::ValueMap<float>::Filler filler(*out);
166-
filler.insert(egCollection, values.begin(), values.end() );
167-
filler.fill();
168-
169-
iEvent.put(out);
170-
171-
return true;
113+
using namespace edm;
114+
115+
std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>() );
116+
117+
Handle<reco::VertexCollection> vertexCollection;
118+
iEvent.getByToken(vertexToken_, vertexCollection);
119+
120+
Vertex dummy;
121+
const Vertex *pv = &dummy;
122+
if ( vertexCollection->size() != 0) {
123+
pv = &*vertexCollection->begin();
124+
} else { // create a dummy PV
125+
Vertex::Error e;
126+
e(0, 0) = 0.0015 * 0.0015;
127+
e(1, 1) = 0.0015 * 0.0015;
128+
e(2, 2) = 15. * 15.;
129+
Vertex::Point p(0, 0, 0);
130+
dummy = Vertex(p, e, 0, 0, 0);
131+
}
132+
133+
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollectionToken_, reducedEERecHitCollectionToken_);
134+
135+
edm::ESHandle<TransientTrackBuilder> builder;
136+
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
137+
TransientTrackBuilder thebuilder = *(builder.product());
138+
139+
Handle<reco::GsfElectronCollection> egCollection;
140+
iEvent.getByToken(electronToken_,egCollection);
141+
const reco::GsfElectronCollection egCandidates = (*egCollection.product());
142+
143+
_Rho=0;
144+
edm::Handle<double> rhoPtr;
145+
iEvent.getByToken(eventrhoToken_,rhoPtr);
146+
_Rho=*rhoPtr;
147+
148+
std::vector<float> values;
149+
values.reserve(egCollection->size());
150+
151+
for ( reco::GsfElectronCollection::const_iterator egIter = egCandidates.begin(); egIter != egCandidates.end(); ++egIter) {
152+
153+
double mvaVal = -999999;
154+
if(!NoIP_){
155+
mvaVal = mvaID_->mvaValue( *egIter, *pv,thebuilder,lazyTools, verbose_);
156+
}
157+
if(NoIP_){
158+
mvaVal = mvaID_->mvaValue( *egIter, *pv, _Rho,/*thebuilder,*/lazyTools, verbose_);
159+
}
160+
161+
values.push_back( mvaVal );
162+
}
163+
164+
edm::ValueMap<float>::Filler filler(*out);
165+
filler.insert(egCollection, values.begin(), values.end() );
166+
filler.fill();
167+
168+
iEvent.put(out);
169+
170+
return true;
172171
}
173172

174173
//define this as a plug-in

EgammaAnalysis/ElectronTools/test/ElectronTestAnalyzer.cc

+26-31
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,36 @@ using namespace edm;
6767
using namespace reco;
6868
using namespace std;
6969
class ElectronTestAnalyzer : public edm::EDAnalyzer {
70-
public:
71-
explicit ElectronTestAnalyzer(const edm::ParameterSet&);
72-
~ElectronTestAnalyzer();
73-
74-
75-
private:
76-
virtual void beginJob(const edm::EventSetup&) ;
77-
virtual void analyze(const edm::Event&, const edm::EventSetup&);
78-
virtual void endJob() ;
79-
virtual void myBindVariables();
80-
virtual void myVar(const reco::GsfElectron& ele,
81-
const reco::Vertex& vertex,
82-
const TransientTrackBuilder& transientTrackBuilder,
83-
EcalClusterLazyTools myEcalCluster,
84-
bool printDebug = kFALSE);
85-
virtual void evaluate_mvas(const edm::Event& iEvent, const edm::EventSetup& iSetup);
86-
70+
public:
71+
explicit ElectronTestAnalyzer(const edm::ParameterSet&);
72+
~ElectronTestAnalyzer();
73+
74+
75+
private:
76+
virtual void beginJob(const edm::EventSetup&) ;
77+
virtual void analyze(const edm::Event&, const edm::EventSetup&);
78+
virtual void endJob() ;
79+
virtual void myBindVariables();
80+
virtual void myVar(const reco::GsfElectron& ele,
81+
const reco::Vertex& vertex,
82+
const TransientTrackBuilder& transientTrackBuilder,
83+
EcalClusterLazyTools myEcalCluster,
84+
bool printDebug = kFALSE);
85+
virtual void evaluate_mvas(const edm::Event& iEvent, const edm::EventSetup& iSetup);
86+
8787
bool trainTrigPresel(const reco::GsfElectron& ele);
88-
88+
8989
ParameterSet conf_;
90-
90+
9191
edm::EDGetTokenT<GsfElectronCollection> gsfEleToken_;
9292
edm::EDGetTokenT<GenParticleCollection> genToken_;
9393
//edm::EDGetTokenT<edm::HepMCProduct> mcTruthToken_;
9494
edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
9595
//edm::EDGetTokenT<reco::PFCandidateCollection> pfCandToken_;
9696
edm::EDGetTokenT<double> eventrhoToken_;
9797
edm::EDGetTokenT<reco::MuonCollection> muonToken_;
98+
edm::EDGetTokenT<EcalRecHitCollection> reducedEBRecHitCollectionToken_;
99+
edm::EDGetTokenT<EcalRecHitCollection> reducedEERecHitCollectionToken_;
98100

99101
EGammaMvaEleEstimator* myMVATrigV0;
100102
EGammaMvaEleEstimator* myMVATrigNoIPV0;
@@ -181,8 +183,9 @@ ElectronTestAnalyzer::ElectronTestAnalyzer(const edm::ParameterSet& iConfig):
181183
vertexToken_(consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"))),
182184
//pfCandToken_(consumes<reco::PFCandidateCollection>(edm::InputTag("particleFlow"))),
183185
eventrhoToken_(consumes<double>(edm::InputTag("kt6PFJets", "rho"))),
184-
muonToken_(consumes<reco::MuonCollection>(edm::InputTag("muons")))
185-
186+
muonToken_(consumes<reco::MuonCollection>(edm::InputTag("muons"))),
187+
reducedEBRecHitCollectionToken_(consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"))),
188+
reducedEERecHitCollectionToken_(consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE")))
186189
{
187190
Bool_t manualCat = true;
188191

@@ -320,12 +323,7 @@ ElectronTestAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& i
320323
Vertex::Point p(0, 0, 0);
321324
dummy = Vertex(p, e, 0, 0, 0);
322325
}
323-
324-
325-
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB"));
326-
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE"));
327-
328-
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection);
326+
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollectionToken_, reducedEERecHitCollectionToken_);
329327

330328
edm::ESHandle<TransientTrackBuilder> builder;
331329
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
@@ -777,10 +775,7 @@ ElectronTestAnalyzer::evaluate_mvas(const edm::Event& iEvent, const edm::EventSe
777775
IdentifiedMuons.push_back(*iM);
778776
}
779777

780-
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB"));
781-
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE"));
782-
783-
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection);
778+
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollectionToken_, reducedEERecHitCollectionToken_);
784779

785780
edm::ESHandle<TransientTrackBuilder> builder;
786781
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);

HLTrigger/HLTanalyzers/interface/HLTAnalyzer.h

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ class HLTAnalyzer : public edm::EDAnalyzer {
185185
edm::EDGetTokenT<reco::RecoEcalCandidateIsolationMap> IsoPhoTrackIsolToken_;
186186
edm::EDGetTokenT<reco::SuperClusterCollection> HFECALClustersToken_;
187187
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> HFElectronsToken_;
188+
edm::EDGetTokenT<EcalRecHitCollection> EcalRecHitEBToken_;
189+
edm::EDGetTokenT<EcalRecHitCollection> EcalRecHitEEToken_;
188190

189191
// ECAL Activity
190192
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> ECALActivityToken_;

HLTrigger/HLTanalyzers/src/HLTAnalyzer.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ HLTAnalyzer::HLTAnalyzer(edm::ParameterSet const& conf) {
300300
ActivityR9Token_ = consumes<reco::RecoEcalCandidateIsolationMap>(ActivityR9_);
301301
ActivityR9IDToken_ = consumes<reco::RecoEcalCandidateIsolationMap>(ActivityR9ID_);
302302
ActivityHoverEHToken_ = consumes<reco::RecoEcalCandidateIsolationMap>(ActivityHoverEH_);
303+
EcalRecHitEBToken_ = consumes<EcalRecHitCollection>(edm::InputTag("hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
304+
EcalRecHitEEToken_ = consumes<EcalRecHitCollection>(edm::InputTag("hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
303305

304306
CandIsoToken_ = consumes<reco::RecoEcalCandidateCollection>(CandIso_);
305307
CandNonIsoToken_ = consumes<reco::RecoEcalCandidateCollection>(CandNonIso_);
@@ -533,9 +535,7 @@ void HLTAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetu
533535
edm::Handle<reco::VertexCollection> recoVertexsOffline0;
534536

535537
// new stuff for the egamma EleId
536-
edm::InputTag ecalRechitEBTag (std::string("hltEcalRegionalEgammaRecHit:EcalRecHitsEB"));
537-
edm::InputTag ecalRechitEETag (std::string("hltEcalRegionalEgammaRecHit:EcalRecHitsEE"));
538-
EcalClusterLazyTools lazyTools( iEvent, iSetup, ecalRechitEBTag, ecalRechitEETag);
538+
EcalClusterLazyTools lazyTools( iEvent, iSetup, EcalRecHitEBToken_, EcalRecHitEEToken_ );
539539

540540
edm::Handle<reco::HFEMClusterShapeAssociationCollection> electronHFClusterAssociation;
541541
iEvent.getByToken(HFEMClusterShapeAssociationToken_,electronHFClusterAssociation);

0 commit comments

Comments
 (0)