Skip to content

Commit

Permalink
Even better - use smart ptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
rekovic committed Dec 16, 2016
1 parent d4dcae5 commit 4521903
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions L1Trigger/L1TNtuples/plugins/L1GenTreeProducer.cc
Expand Up @@ -74,7 +74,7 @@ class L1GenTreeProducer : public edm::EDAnalyzer {
TTree * tree_;

// data format
L1Analysis::L1AnalysisGeneratorDataFormat * l1GenData_;
std::unique_ptr<L1Analysis::L1AnalysisGeneratorDataFormat> l1GenData_;

// EDM input tags
edm::EDGetTokenT<reco::GenJetCollection> genJetToken_;
Expand All @@ -92,7 +92,7 @@ L1GenTreeProducer::L1GenTreeProducer(const edm::ParameterSet& iConfig)
genParticleToken_ = consumes<reco::GenParticleCollection>(iConfig.getUntrackedParameter<edm::InputTag>("genParticleToken"));
pileupInfoToken_ = consumes<std::vector<PileupSummaryInfo> >(iConfig.getUntrackedParameter<edm::InputTag>("pileupInfoToken"));

l1GenData_ = new L1Analysis::L1AnalysisGeneratorDataFormat();
l1GenData_ = std::make_unique<L1Analysis::L1AnalysisGeneratorDataFormat>();

// set up output
tree_=fs_->make<TTree>("L1GenTree", "L1GenTree");
Expand All @@ -105,8 +105,6 @@ L1GenTreeProducer::~L1GenTreeProducer()

// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)

delete l1GenData_;

}

Expand Down

0 comments on commit 4521903

Please sign in to comment.