Skip to content

Commit

Permalink
Merge pull request #15404 from wmtan/UseUniquePtrInL1
Browse files Browse the repository at this point in the history
Use unique_ptr, not auto_ptr, in 2 L1 packages
  • Loading branch information
davidlange6 committed Aug 11, 2016
2 parents cf3cb8d + c63ee30 commit d1095a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions L1Trigger/L1TCommon/plugins/L1TMuonLegacyConverter.cc
Expand Up @@ -104,7 +104,7 @@ L1TMuonLegacyConverter::produce( edm::Event& iEvent,
// ~~~~~~~~~~~~~~~~~~~~ Muons ~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

auto_ptr< MuonBxCollection > imdMuonsLegacy( new MuonBxCollection() );
std::unique_ptr< MuonBxCollection > imdMuonsLegacy( new MuonBxCollection() );

if( produceMuonParticles_ )
{
Expand Down Expand Up @@ -187,7 +187,7 @@ L1TMuonLegacyConverter::produce( edm::Event& iEvent,
}
}

iEvent.put( imdMuonsLegacy, "imdMuonsLegacy" );
iEvent.put( std::move(imdMuonsLegacy), "imdMuonsLegacy" );

} // closing produce

Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackTrigger/plugins/TTClusterBuilder.cc
Expand Up @@ -14,7 +14,7 @@ template< >
void TTClusterBuilder< Ref_Phase2TrackerDigi_ >::produce( edm::Event& iEvent, const edm::EventSetup& iSetup )
{
/// Prepare output
std::auto_ptr< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > > > TTClusterDSVForOutput( new edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > > );
std::unique_ptr< edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > > > TTClusterDSVForOutput( new edmNew::DetSetVector< TTCluster< Ref_Phase2TrackerDigi_ > > );
std::map< DetId, std::vector< Ref_Phase2TrackerDigi_ > > rawHits;
this->RetrieveRawHits( rawHits, iEvent );

Expand Down Expand Up @@ -76,7 +76,7 @@ void TTClusterBuilder< Ref_Phase2TrackerDigi_ >::produce( edm::Event& iEvent, co
} /// End of loop over detector elements

/// Put output in the event
iEvent.put( TTClusterDSVForOutput, "ClusterInclusive" );
iEvent.put( std::move(TTClusterDSVForOutput), "ClusterInclusive" );
}

/// Retrieve hits from the event
Expand Down
14 changes: 7 additions & 7 deletions L1Trigger/TrackTrigger/plugins/TTStubBuilder.h
Expand Up @@ -116,10 +116,10 @@ void TTStubBuilder< T >::produce( edm::Event& iEvent, const edm::EventSetup& iSe
const TrackerGeometry* const theTrackerGeom = tGeomHandle.product();

/// Prepare output
std::auto_ptr< edmNew::DetSetVector< TTCluster< T > > > TTClusterDSVForOutput( new edmNew::DetSetVector< TTCluster< T > > );
std::auto_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputTemp( new edmNew::DetSetVector< TTStub< T > > );
std::auto_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputAccepted( new edmNew::DetSetVector< TTStub< T > > );
std::auto_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputRejected( new edmNew::DetSetVector< TTStub< T > > );
std::unique_ptr< edmNew::DetSetVector< TTCluster< T > > > TTClusterDSVForOutput( new edmNew::DetSetVector< TTCluster< T > > );
std::unique_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputTemp( new edmNew::DetSetVector< TTStub< T > > );
std::unique_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputAccepted( new edmNew::DetSetVector< TTStub< T > > );
std::unique_ptr< edmNew::DetSetVector< TTStub< T > > > TTStubDSVForOutputRejected( new edmNew::DetSetVector< TTStub< T > > );

/// Get the Clusters already stored away
edm::Handle< edmNew::DetSetVector< TTCluster< T > > > clusterHandle;
Expand Down Expand Up @@ -302,7 +302,7 @@ void TTStubBuilder< T >::produce( edm::Event& iEvent, const edm::EventSetup& iSe

/// Put output in the event (1)
/// Get also the OrphanHandle of the accepted clusters
edm::OrphanHandle< edmNew::DetSetVector< TTCluster< T > > > TTClusterAcceptedHandle = iEvent.put( TTClusterDSVForOutput, "ClusterAccepted" );
edm::OrphanHandle< edmNew::DetSetVector< TTCluster< T > > > TTClusterAcceptedHandle = iEvent.put( std::move(TTClusterDSVForOutput), "ClusterAccepted" );

/// Now, correctly reset the output
typename edmNew::DetSetVector< TTStub< T > >::const_iterator stubDetIter;
Expand Down Expand Up @@ -377,8 +377,8 @@ void TTStubBuilder< T >::produce( edm::Event& iEvent, const edm::EventSetup& iSe
} /// End of loop over stub DetSetVector

/// Put output in the event (2)
iEvent.put( TTStubDSVForOutputAccepted, "StubAccepted" );
iEvent.put( TTStubDSVForOutputRejected, "StubRejected" );
iEvent.put( std::move(TTStubDSVForOutputAccepted), "StubAccepted" );
iEvent.put( std::move(TTStubDSVForOutputRejected), "StubRejected" );
}

/// Sort routine for stub ordering
Expand Down

0 comments on commit d1095a7

Please sign in to comment.