Skip to content

Commit fdfb5e0

Browse files
committed
[GENERATORS] Apply code-checks-all with misc-definitions-in-headers additional check
1 parent 2203a47 commit fdfb5e0

File tree

8 files changed

+63
-58
lines changed

8 files changed

+63
-58
lines changed

GeneratorInterface/Core/interface/ConcurrentHadronizerFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ namespace edm {
266266
std::unique_ptr<GenEventInfoProduct> genEventInfo(cache->hadronizer_.getGenEventInfo());
267267
if (!genEventInfo.get()) {
268268
// create GenEventInfoProduct from HepMC event in case hadronizer didn't provide one
269-
genEventInfo.reset(new GenEventInfoProduct(event.get()));
269+
genEventInfo = std::make_unique<GenEventInfoProduct>(event.get());
270270
}
271271

272272
//if HepMCFilter was specified, test event

GeneratorInterface/Core/interface/HadronizerFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ namespace edm {
245245
std::unique_ptr<GenEventInfoProduct> genEventInfo(hadronizer_.getGenEventInfo());
246246
if (!genEventInfo.get()) {
247247
// create GenEventInfoProduct from HepMC event in case hadronizer didn't provide one
248-
genEventInfo.reset(new GenEventInfoProduct(event.get()));
248+
genEventInfo = std::make_unique<GenEventInfoProduct>(event.get());
249249
}
250250

251251
//if HepMCFilter was specified, test event

GeneratorInterface/GenFilters/plugins/PythiaFilterIsolatedTrack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PythiaFilterIsolatedTrack : public edm::stream::EDFilter<edm::GlobalCache<
4646
~PythiaFilterIsolatedTrack() override;
4747

4848
static std::unique_ptr<PythiaFilterIsoTracks::Counters> initializeGlobalCache(edm::ParameterSet const&) {
49-
return std::unique_ptr<PythiaFilterIsoTracks::Counters>(new PythiaFilterIsoTracks::Counters());
49+
return std::make_unique<PythiaFilterIsoTracks::Counters>();
5050
}
5151

5252
bool filter(edm::Event&, edm::EventSetup const&) override;

GeneratorInterface/LHEInterface/src/LH5Reader.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#include <algorithm>
22
#include <iomanip>
33
#include <iostream>
4-
#include <sstream>
5-
#include <fstream>
4+
#include <memory>
5+
6+
#include <cstdio>
67
#include <cstring>
8+
#include <fstream>
9+
#include <sstream>
710
#include <string>
811
#include <vector>
9-
#include <cstdio>
1012

1113
#include "FWCore/MessageLogger/interface/MessageLogger.h"
1214
#include "FWCore/ParameterSet/interface/ParameterSet.h"
@@ -179,13 +181,13 @@ namespace lhef {
179181
if (!curDoc) {
180182
if (!fileURLs.empty()) {
181183
logFileAction(" Initiating request to open LHE file ", fileURLs[curIndex]);
182-
curSource.reset(new FileSource(fileURLs[curIndex]));
184+
curSource = std::make_unique<FileSource>(fileURLs[curIndex]);
183185
logFileAction(" Successfully opened LHE file ", fileURLs[curIndex]);
184186
if (newFileOpened != nullptr)
185187
*newFileOpened = true;
186188
++curIndex;
187189
} else if (!strName.empty()) {
188-
curSource.reset(new StringSource(strName));
190+
curSource = std::make_unique<StringSource>(strName);
189191
}
190192
// New "doc" has been opened. This is the same as a new source.
191193
curDoc = true;

GeneratorInterface/LHEInterface/src/lheh5.cc

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ namespace lheh5 {
1717
}
1818

1919
Particle Events::mkParticle(size_t idx) const {
20-
return {std::move(_vid[idx]),
21-
std::move(_vstatus[idx]),
22-
std::move(_vmother1[idx]),
23-
std::move(_vmother2[idx]),
24-
std::move(_vcolor1[idx]),
25-
std::move(_vcolor2[idx]),
26-
std::move(_vpx[idx]),
27-
std::move(_vpy[idx]),
28-
std::move(_vpz[idx]),
29-
std::move(_ve[idx]),
30-
std::move(_vm[idx]),
31-
std::move(_vlifetime[idx]),
32-
std::move(_vspin[idx])};
20+
return {_vid[idx],
21+
_vstatus[idx],
22+
_vmother1[idx],
23+
_vmother2[idx],
24+
_vcolor1[idx],
25+
_vcolor2[idx],
26+
_vpx[idx],
27+
_vpy[idx],
28+
_vpz[idx],
29+
_ve[idx],
30+
_vm[idx],
31+
_vlifetime[idx],
32+
_vspin[idx]};
3333
}
3434

3535
std::vector<Particle> Events::mkEvent(size_t ievent) const {
@@ -50,17 +50,17 @@ namespace lheh5 {
5050

5151
EventHeader Events::mkEventHeader(int iev) const {
5252
return {
53-
std::move(_vnparticles[iev]),
54-
std::move(_vpid[iev]),
55-
std::move(_vweight[iev]),
56-
std::move(_vtrials[iev]),
57-
std::move(_vscale[iev]),
58-
std::move(_vrscale[iev]),
59-
std::move(_vfscale[iev]),
60-
std::move(_vaqed[iev]),
61-
std::move(_vaqcd[iev]),
62-
std::move(_vnpLO[iev]),
63-
std::move(_vnpNLO[iev]),
53+
_vnparticles[iev],
54+
_vpid[iev],
55+
_vweight[iev],
56+
_vtrials[iev],
57+
_vscale[iev],
58+
_vrscale[iev],
59+
_vfscale[iev],
60+
_vaqed[iev],
61+
_vaqcd[iev],
62+
_vnpLO[iev],
63+
_vnpNLO[iev],
6464
};
6565
}
6666

@@ -195,19 +195,19 @@ namespace lheh5 {
195195
}
196196

197197
Particle Events2::mkParticle(size_t idx) const {
198-
return {std::move(_vid[idx]),
199-
std::move(_vstatus[idx]),
200-
std::move(_vmother1[idx]),
201-
std::move(_vmother2[idx]),
202-
std::move(_vcolor1[idx]),
203-
std::move(_vcolor2[idx]),
204-
std::move(_vpx[idx]),
205-
std::move(_vpy[idx]),
206-
std::move(_vpz[idx]),
207-
std::move(_ve[idx]),
208-
std::move(_vm[idx]),
209-
std::move(_vlifetime[idx]),
210-
std::move(_vspin[idx])};
198+
return {_vid[idx],
199+
_vstatus[idx],
200+
_vmother1[idx],
201+
_vmother2[idx],
202+
_vcolor1[idx],
203+
_vcolor2[idx],
204+
_vpx[idx],
205+
_vpy[idx],
206+
_vpz[idx],
207+
_ve[idx],
208+
_vm[idx],
209+
_vlifetime[idx],
210+
_vspin[idx]};
211211
}
212212

213213
std::vector<Particle> Events2::mkEvent(size_t ievent) const {
@@ -230,15 +230,15 @@ namespace lheh5 {
230230

231231
EventHeader Events2::mkEventHeader(int iev) const {
232232
return {
233-
std::move(_vnparticles[iev]),
234-
std::move(_vpid[iev]),
235-
std::move(_vweight[iev]),
236-
std::move(_vtrials[iev]),
237-
std::move(_vscale[iev]),
238-
std::move(_vrscale[iev]),
239-
std::move(_vfscale[iev]),
240-
std::move(_vaqed[iev]),
241-
std::move(_vaqcd[iev]),
233+
_vnparticles[iev],
234+
_vpid[iev],
235+
_vweight[iev],
236+
_vtrials[iev],
237+
_vscale[iev],
238+
_vrscale[iev],
239+
_vfscale[iev],
240+
_vaqed[iev],
241+
_vaqcd[iev],
242242
npLO,
243243
npNLO,
244244
};

GeneratorInterface/Pythia8Interface/plugins/Py8MassGun.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
#include "GeneratorInterface/Core/interface/GeneratorFilter.h"
2+
#include <memory>
3+
4+
5+
#include "GeneratorInterface/Core/interface/GeneratorFilter.h"
36
#include "GeneratorInterface/ExternalDecays/interface/ExternalDecayDriver.h"
47

58
#include "GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h"
@@ -106,7 +109,7 @@ namespace gen {
106109
if (!fMasterGen->next())
107110
return false;
108111

109-
event().reset(new HepMC::GenEvent);
112+
event() = std::make_unique<HepMC::GenEvent>();
110113
return toHepMC.fill_next_event(fMasterGen->event, event().get());
111114
}
112115

SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LHEEventProduct {
2727

2828
~LHEEventProduct() = default;
2929

30-
void setPDF(const PDF &pdf) { pdf_.reset(new PDF(pdf)); }
30+
void setPDF(const PDF &pdf) { pdf_ = std::make_unique<PDF>(pdf); }
3131
void addWeight(const WGT &wgt) { weights_.push_back(wgt); }
3232
void addComment(const std::string &line) { comments_.push_back(line); }
3333

SimDataFormats/HTXS/interface/HiggsTemplateCrossSections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ namespace HTXS {
503503
template <class Vvec4>
504504
inline TLVs MakeTLVs(Vvec4 const &rivet_jets) {
505505
TLVs jets;
506-
for (auto jet : rivet_jets)
506+
for (const auto& jet : rivet_jets)
507507
jets.push_back(MakeTLV(jet));
508508
return jets;
509509
}

0 commit comments

Comments
 (0)