Skip to content

Commit 3ef1d8b

Browse files
committed
Clean up unused variables
1 parent e3658fe commit 3ef1d8b

File tree

13 files changed

+195
-241
lines changed

13 files changed

+195
-241
lines changed

CommonTools/RecoUtils/plugins/LeptonFSRProducer.cc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,21 @@
1010
*/
1111

1212
#include <memory>
13-
#include "FWCore/Framework/interface/Frameworkfwd.h"
14-
#include "FWCore/Framework/interface/global/EDProducer.h"
1513

14+
#include "DataFormats/Candidate/interface/Candidate.h"
15+
#include "DataFormats/Common/interface/ValueMap.h"
16+
#include "DataFormats/Math/interface/LorentzVector.h"
17+
#include "DataFormats/PatCandidates/interface/Electron.h"
18+
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
19+
#include "DataFormats/PatCandidates/interface/Muon.h"
20+
#include "DataFormats/PatCandidates/interface/PackedCandidate.h"
1621
#include "FWCore/Framework/interface/Event.h"
22+
#include "FWCore/Framework/interface/Frameworkfwd.h"
1723
#include "FWCore/Framework/interface/MakerMacros.h"
18-
24+
#include "FWCore/Framework/interface/global/EDProducer.h"
1925
#include "FWCore/ParameterSet/interface/ParameterSet.h"
2026
#include "FWCore/Utilities/interface/StreamID.h"
2127

22-
#include "DataFormats/Candidate/interface/Candidate.h"
23-
#include "DataFormats/PatCandidates/interface/PackedCandidate.h"
24-
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
25-
#include "DataFormats/Math/interface/LorentzVector.h"
26-
27-
#include "DataFormats/PatCandidates/interface/Muon.h"
28-
#include "DataFormats/PatCandidates/interface/Electron.h"
29-
#include "DataFormats/Common/interface/ValueMap.h"
30-
3128
class LeptonFSRProducer : public edm::global::EDProducer<> {
3229
public:
3330
explicit LeptonFSRProducer(const edm::ParameterSet& iConfig)
@@ -217,7 +214,7 @@ void LeptonFSRProducer::produce(edm::StreamID streamID, edm::Event& iEvent, cons
217214
}
218215
} // end of loop over pfCands
219216

220-
edm::OrphanHandle<std::vector<pat::GenericParticle>> oh = iEvent.put(std::move(fsrPhotons));
217+
iEvent.put(std::move(fsrPhotons));
221218

222219
{
223220
std::unique_ptr<edm::ValueMap<int>> bareIdx(new edm::ValueMap<int>());

CommonTools/UtilAlgos/interface/AssociationVectorSelector.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ void AssociationVectorSelector<KeyRefProd, CVal, KeySelector, ValSelector>::prod
6868
KeyRefProd ref = evt.getRefBeforePut<collection_t>();
6969
unique_ptr<association_t> selectedAssociation(new association_t(ref, selected.get()));
7070
size = selected->size();
71-
OrphanHandle<collection_t> oh = evt.put(std::move(selected));
72-
for (size_t i = 0; i != size; ++i)
71+
evt.put(std::move(selected));
72+
for (size_t i = 0; i != size; ++i) {
7373
selectedAssociation->setValue(i, selectedValues[i]);
74+
}
7475
evt.put(std::move(selectedAssociation));
7576
}
7677

Lines changed: 85 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,85 @@
1-
// -*- C++ -*-
2-
//
3-
// Package: L1GctInternJetProducer
4-
// Class: L1GctInternJetProducer
5-
//
6-
/**\class L1GctInternJetProducer \file L1GctInternJetProducer.cc EventFilter/GctRawToDigi/plugins/L1GctInternJetProducer.cc
7-
*/
8-
//
9-
// Original Author: Alex Tapper
10-
//
11-
//
12-
13-
// system include files
14-
#include <memory>
15-
16-
// user include files
17-
#include "EventFilter/GctRawToDigi/plugins/L1GctInternJetProducer.h"
18-
19-
#include "FWCore/Framework/interface/Frameworkfwd.h"
20-
#include "FWCore/Framework/interface/MakerMacros.h"
21-
22-
#include "DataFormats/Common/interface/Handle.h"
23-
#include "FWCore/Framework/interface/ESHandle.h"
24-
#include "DataFormats/Common/interface/OrphanHandle.h"
25-
26-
L1GctInternJetProducer::L1GctInternJetProducer(const edm::ParameterSet& iConfig)
27-
: internalJetSource_(iConfig.getParameter<edm::InputTag>("internalJetSource")),
28-
caloGeomToken_(esConsumes<L1CaloGeometry, L1CaloGeometryRecord>()),
29-
jetScaleToken_(esConsumes<L1CaloEtScale, L1JetEtScaleRcd>()),
30-
centralBxOnly_(iConfig.getParameter<bool>("centralBxOnly")) {
31-
using namespace l1extra;
32-
33-
produces<L1JetParticleCollection>("Internal");
34-
}
35-
36-
void L1GctInternJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
37-
//std::cout << "ARGGHHH!" << std::endl;
38-
using namespace edm;
39-
using namespace l1extra;
40-
using namespace std;
41-
42-
unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
43-
44-
ESHandle<L1CaloGeometry> caloGeomESH = iSetup.getHandle(caloGeomToken_);
45-
const L1CaloGeometry* caloGeom = &(*caloGeomESH);
46-
47-
ESHandle<L1CaloEtScale> jetScale = iSetup.getHandle(jetScaleToken_);
48-
49-
double etSumLSB = jetScale->linearLsb();
50-
//std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
51-
52-
Handle<L1GctInternJetDataCollection> hwIntJetCands;
53-
iEvent.getByLabel(internalJetSource_, hwIntJetCands);
54-
//std::cout << "At leas Something is happening" <<std::endl;
55-
if (!hwIntJetCands.isValid()) {
56-
std::cout << "These aren't the Jets you're looking for" << std::endl;
57-
58-
LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
59-
<< "\nrequested in configuration, but not found in the event." << std::endl;
60-
61-
} else {
62-
//std::cout << "apparently the collection was found" <<std::endl;
63-
L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
64-
L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
65-
int i;
66-
for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
67-
//std::cout << " JetS a plenty" <<std::endl;
68-
if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
69-
double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
70-
71-
//double et = 10.;
72-
//std::cout << "jetET: " << jetItr->et() <<std::endl;
73-
//std::cout << "ET was: " << et << std::endl;
74-
double eta = caloGeom->etaBinCenter(jetItr->regionId());
75-
double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
76-
77-
internJetColl->push_back(
78-
L1JetParticle(math::PtEtaPhiMLorentzVector(et, eta, phi, 0.), Ref<L1GctJetCandCollection>(), jetItr->bx()));
79-
}
80-
}
81-
}
82-
83-
OrphanHandle<L1JetParticleCollection> internalJetHandle = iEvent.put(std::move(internJetColl), "Internal");
84-
}
85-
86-
//define this as a plug-in
87-
DEFINE_FWK_MODULE(L1GctInternJetProducer);
1+
// -*- C++ -*-
2+
//
3+
// Package: L1GctInternJetProducer
4+
// Class: L1GctInternJetProducer
5+
//
6+
/**\class L1GctInternJetProducer \file L1GctInternJetProducer.cc EventFilter/GctRawToDigi/plugins/L1GctInternJetProducer.cc
7+
*/
8+
//
9+
// Original Author: Alex Tapper
10+
//
11+
//
12+
13+
// system include files
14+
#include <memory>
15+
16+
// user include files
17+
#include "DataFormats/Common/interface/Handle.h"
18+
#include "FWCore/Framework/interface/ESHandle.h"
19+
#include "FWCore/Framework/interface/Frameworkfwd.h"
20+
#include "FWCore/Framework/interface/MakerMacros.h"
21+
22+
#include "L1GctInternJetProducer.h"
23+
24+
L1GctInternJetProducer::L1GctInternJetProducer(const edm::ParameterSet& iConfig)
25+
: internalJetSource_(iConfig.getParameter<edm::InputTag>("internalJetSource")),
26+
caloGeomToken_(esConsumes<L1CaloGeometry, L1CaloGeometryRecord>()),
27+
jetScaleToken_(esConsumes<L1CaloEtScale, L1JetEtScaleRcd>()),
28+
centralBxOnly_(iConfig.getParameter<bool>("centralBxOnly")) {
29+
using namespace l1extra;
30+
31+
produces<L1JetParticleCollection>("Internal");
32+
}
33+
34+
void L1GctInternJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
35+
//std::cout << "ARGGHHH!" << std::endl;
36+
using namespace edm;
37+
using namespace l1extra;
38+
using namespace std;
39+
40+
unique_ptr<L1JetParticleCollection> internJetColl(new L1JetParticleCollection);
41+
42+
ESHandle<L1CaloGeometry> caloGeomESH = iSetup.getHandle(caloGeomToken_);
43+
const L1CaloGeometry* caloGeom = &(*caloGeomESH);
44+
45+
ESHandle<L1CaloEtScale> jetScale = iSetup.getHandle(jetScaleToken_);
46+
47+
double etSumLSB = jetScale->linearLsb();
48+
//std::cout << "Inside the Jet producer " << etSumLSB << std::endl;
49+
50+
Handle<L1GctInternJetDataCollection> hwIntJetCands;
51+
iEvent.getByLabel(internalJetSource_, hwIntJetCands);
52+
//std::cout << "At leas Something is happening" <<std::endl;
53+
if (!hwIntJetCands.isValid()) {
54+
std::cout << "These aren't the Jets you're looking for" << std::endl;
55+
56+
LogDebug("L1GctInternJetProducer") << "\nWarning: L1GctJetCandCollection with " << internalJetSource_
57+
<< "\nrequested in configuration, but not found in the event." << std::endl;
58+
59+
} else {
60+
//std::cout << "apparently the collection was found" <<std::endl;
61+
L1GctInternJetDataCollection::const_iterator jetItr = hwIntJetCands->begin();
62+
L1GctInternJetDataCollection::const_iterator jetEnd = hwIntJetCands->end();
63+
int i;
64+
for (i = 0; jetItr != jetEnd; ++jetItr, ++i) {
65+
//std::cout << " JetS a plenty" <<std::endl;
66+
if (!jetItr->empty() && (!centralBxOnly_ || jetItr->bx() == 0)) {
67+
double et = (jetItr->oflow() ? (double)0xfff : (double)jetItr->et()) * etSumLSB + 1.e-6;
68+
69+
//double et = 10.;
70+
//std::cout << "jetET: " << jetItr->et() <<std::endl;
71+
//std::cout << "ET was: " << et << std::endl;
72+
double eta = caloGeom->etaBinCenter(jetItr->regionId());
73+
double phi = caloGeom->emJetPhiBinCenter(jetItr->regionId());
74+
75+
internJetColl->push_back(
76+
L1JetParticle(math::PtEtaPhiMLorentzVector(et, eta, phi, 0.), Ref<L1GctJetCandCollection>(), jetItr->bx()));
77+
}
78+
}
79+
}
80+
81+
iEvent.put(std::move(internJetColl), "Internal");
82+
}
83+
84+
//define this as a plug-in
85+
DEFINE_FWK_MODULE(L1GctInternJetProducer);

L1Trigger/L1ExtraFromDigis/src/L1ExtraParticlesProd.cc

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -195,28 +195,20 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
195195
}
196196
}
197197

198-
OrphanHandle<L1MuonParticleCollection> muHandle = iEvent.put(std::move(muColl));
198+
iEvent.put(std::move(muColl));
199199

200200
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201201
// ~~~~~~~~~~~~~~~~~~~~ Calorimeter ~~~~~~~~~~~~~~~~~~~~
202202
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203203

204204
unique_ptr<L1EmParticleCollection> isoEmColl(new L1EmParticleCollection);
205-
206205
unique_ptr<L1EmParticleCollection> nonIsoEmColl(new L1EmParticleCollection);
207-
208206
unique_ptr<L1JetParticleCollection> cenJetColl(new L1JetParticleCollection);
209-
210207
unique_ptr<L1JetParticleCollection> forJetColl(new L1JetParticleCollection);
211-
212208
unique_ptr<L1JetParticleCollection> tauJetColl(new L1JetParticleCollection);
213-
214209
unique_ptr<L1JetParticleCollection> isoTauJetColl(new L1JetParticleCollection);
215-
216210
unique_ptr<L1EtMissParticleCollection> etMissColl(new L1EtMissParticleCollection);
217-
218211
unique_ptr<L1EtMissParticleCollection> htMissColl(new L1EtMissParticleCollection);
219-
220212
unique_ptr<L1HFRingsCollection> hfRingsColl(new L1HFRingsCollection);
221213

222214
if (produceCaloParticles_) {
@@ -847,23 +839,15 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
847839
}
848840
}
849841

850-
OrphanHandle<L1EmParticleCollection> isoEmHandle = iEvent.put(std::move(isoEmColl), "Isolated");
851-
852-
OrphanHandle<L1EmParticleCollection> nonIsoEmHandle = iEvent.put(std::move(nonIsoEmColl), "NonIsolated");
853-
854-
OrphanHandle<L1JetParticleCollection> cenJetHandle = iEvent.put(std::move(cenJetColl), "Central");
855-
856-
OrphanHandle<L1JetParticleCollection> forJetHandle = iEvent.put(std::move(forJetColl), "Forward");
857-
858-
OrphanHandle<L1JetParticleCollection> tauJetHandle = iEvent.put(std::move(tauJetColl), "Tau");
859-
860-
OrphanHandle<L1JetParticleCollection> IsoTauJetHandle = iEvent.put(std::move(isoTauJetColl), "IsoTau");
861-
862-
OrphanHandle<L1EtMissParticleCollection> etMissCollHandle = iEvent.put(std::move(etMissColl), "MET");
863-
864-
OrphanHandle<L1EtMissParticleCollection> htMissCollHandle = iEvent.put(std::move(htMissColl), "MHT");
865-
866-
OrphanHandle<L1HFRingsCollection> hfRingsCollHandle = iEvent.put(std::move(hfRingsColl));
842+
iEvent.put(std::move(isoEmColl), "Isolated");
843+
iEvent.put(std::move(nonIsoEmColl), "NonIsolated");
844+
iEvent.put(std::move(cenJetColl), "Central");
845+
iEvent.put(std::move(forJetColl), "Forward");
846+
iEvent.put(std::move(tauJetColl), "Tau");
847+
iEvent.put(std::move(isoTauJetColl), "IsoTau");
848+
iEvent.put(std::move(etMissColl), "MET");
849+
iEvent.put(std::move(htMissColl), "MHT");
850+
iEvent.put(std::move(hfRingsColl));
867851
}
868852

869853
// math::XYZTLorentzVector

L1Trigger/VertexFinder/plugins/TPStubValueMapProducer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void TPStubValueMapProducer::produce(edm::StreamID, edm::Event& iEvent, const ed
191191

192192
// Collections of products
193193
auto vTrackingParticlesHandle = iEvent.put(std::move(vTrackingParticles));
194-
auto vAllMatchedTPsHandle = iEvent.put(std::move(vAllMatchedTPs), outputCollectionNames_[2]);
194+
iEvent.put(std::move(vAllMatchedTPs), outputCollectionNames_[2]);
195195

196196
// Value maps to TP/Stub
197197
auto TPV = std::make_unique<edm::ValueMap<l1tVertexFinder::TP>>();

MuonAnalysis/MuonAssociators/plugins/MuonFSRProducer.cc

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
// system include files
22
#include <memory>
33

4-
// user include files
5-
#include "FWCore/Framework/interface/Frameworkfwd.h"
6-
#include "FWCore/Framework/interface/global/EDProducer.h"
7-
4+
// CMSSW include files
5+
#include "DataFormats/Candidate/interface/Candidate.h"
6+
#include "DataFormats/Math/interface/LorentzVector.h"
7+
#include "DataFormats/PatCandidates/interface/Electron.h"
8+
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
9+
#include "DataFormats/PatCandidates/interface/Muon.h"
10+
#include "DataFormats/PatCandidates/interface/PackedCandidate.h"
811
#include "FWCore/Framework/interface/Event.h"
12+
#include "FWCore/Framework/interface/Frameworkfwd.h"
913
#include "FWCore/Framework/interface/MakerMacros.h"
10-
14+
#include "FWCore/Framework/interface/global/EDProducer.h"
1115
#include "FWCore/ParameterSet/interface/ParameterSet.h"
1216
#include "FWCore/Utilities/interface/StreamID.h"
1317

14-
#include "DataFormats/Candidate/interface/Candidate.h"
15-
#include "DataFormats/PatCandidates/interface/PackedCandidate.h"
16-
#include "DataFormats/PatCandidates/interface/GenericParticle.h"
17-
#include "DataFormats/Math/interface/LorentzVector.h"
18-
19-
#include "DataFormats/PatCandidates/interface/Muon.h"
20-
#include "DataFormats/PatCandidates/interface/Electron.h"
21-
2218
//
2319
// class declaration
2420
//
@@ -182,7 +178,7 @@ void MuonFSRProducer::produce(edm::StreamID streamID, edm::Event& iEvent, const
182178
}
183179
}
184180

185-
edm::OrphanHandle<std::vector<pat::GenericParticle>> oh = iEvent.put(std::move(fsrPhotons));
181+
iEvent.put(std::move(fsrPhotons));
186182
}
187183

188184
double MuonFSRProducer::computeRelativeIsolation(const pat::PackedCandidate& photon,

PhysicsTools/PatAlgos/plugins/PATGenCandsFromSimTracksProducer.cc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
\version $Id: PATGenCandsFromSimTracksProducer.cc,v 1.8 2010/10/20 23:09:25 wmtan Exp $
1010
*/
1111

12-
#include "FWCore/Framework/interface/Frameworkfwd.h"
13-
#include "FWCore/Framework/interface/stream/EDProducer.h"
14-
#include "FWCore/Framework/interface/Event.h"
15-
#include "FWCore/Framework/interface/MakerMacros.h"
16-
#include "FWCore/ParameterSet/interface/ParameterSet.h"
12+
#include <ext/algorithm>
13+
#include <memory>
1714

15+
#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
1816
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
1917
#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
18+
#include "FWCore/Framework/interface/Event.h"
19+
#include "FWCore/Framework/interface/Frameworkfwd.h"
20+
#include "FWCore/Framework/interface/MakerMacros.h"
21+
#include "FWCore/Framework/interface/stream/EDProducer.h"
22+
#include "FWCore/ParameterSet/interface/ParameterSet.h"
2023
#include "SimDataFormats/Track/interface/SimTrackContainer.h"
2124
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
22-
23-
#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
24-
#include "SimGeneral/HepPDTRecord/interface/PdtEntry.h"
2525
#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
26-
27-
#include <ext/algorithm>
28-
#include <memory>
26+
#include "SimGeneral/HepPDTRecord/interface/PdtEntry.h"
2927

3028
namespace pat {
3129
class PATGenCandsFromSimTracksProducer : public edm::stream::EDProducer<> {
@@ -326,7 +324,10 @@ void PATGenCandsFromSimTracksProducer::produce(Event &event, const EventSetup &i
326324
}
327325

328326
// Write to the Event, and get back a handle (which can be useful for debugging)
329-
edm::OrphanHandle<reco::GenParticleCollection> orphans = event.put(std::move(cands));
327+
#ifdef DEBUG_PATGenCandsFromSimTracksProducer
328+
edm::OrphanHandle<reco::GenParticleCollection> orphans =
329+
#endif
330+
event.put(std::move(cands));
330331

331332
#ifdef DEBUG_PATGenCandsFromSimTracksProducer
332333
std::cout << "Produced a list of " << orphans->size() << " genParticles." << std::endl;

RecoEcal/EgammaClusterProducers/src/SCEnergyCorrectorDRNProducer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void SCEnergyCorrectorDRNProducer::produce(edm::Event& iEvent, const edm::EventS
9999
++i;
100100
}
101101

102-
auto scHandle = iEvent.put(std::move(corrSCs));
102+
iEvent.put(std::move(corrSCs));
103103
}
104104

105105
void SCEnergyCorrectorDRNProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {

0 commit comments

Comments
 (0)