Skip to content

Commit

Permalink
Merge pull request #22174 from gartung/L1Trigger-TrackTrigger-ESProdu…
Browse files Browse the repository at this point in the history
…cer-returntype

L1Trigger/TrackTrigger: Update return type of produce to unique_ptr.
  • Loading branch information
cmsbuild committed Feb 20, 2018
2 parents b240677 + 4f2a5b0 commit f3e363a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
Expand Up @@ -98,7 +98,6 @@ class ES_TTClusterAlgorithm_neighbor : public edm::ESProducer
{
private:
/// Data members
std::shared_ptr< TTClusterAlgorithm< T > > _theAlgo;

public:
/// Constructor
Expand All @@ -111,13 +110,12 @@ class ES_TTClusterAlgorithm_neighbor : public edm::ESProducer
~ES_TTClusterAlgorithm_neighbor() override{}

/// Implement the producer
std::shared_ptr< TTClusterAlgorithm< T > > produce( const TTClusterAlgorithmRecord & record )
std::unique_ptr< TTClusterAlgorithm< T > > produce( const TTClusterAlgorithmRecord & record )
{
TTClusterAlgorithm< T >* TTClusterAlgo =
new TTClusterAlgorithm_neighbor< T >( );

_theAlgo = std::shared_ptr< TTClusterAlgorithm< T > >( TTClusterAlgo );
return _theAlgo;
return std::unique_ptr< TTClusterAlgorithm< T > >( TTClusterAlgo );
}

}; /// Close class
Expand Down
Expand Up @@ -91,7 +91,6 @@ class ES_TTClusterAlgorithm_official: public edm::ESProducer
{
private:
/// Data members
std::shared_ptr< TTClusterAlgorithm< T > > _theAlgo;
int mWidthCut;

public:
Expand All @@ -106,13 +105,12 @@ class ES_TTClusterAlgorithm_official: public edm::ESProducer
~ES_TTClusterAlgorithm_official() override{}

/// Implement the producer
std::shared_ptr< TTClusterAlgorithm< T > > produce( const TTClusterAlgorithmRecord & record )
std::unique_ptr< TTClusterAlgorithm< T > > produce( const TTClusterAlgorithmRecord & record )
{
TTClusterAlgorithm< T >* TTClusterAlgo =
new TTClusterAlgorithm_official< T >( mWidthCut );

_theAlgo = std::shared_ptr< TTClusterAlgorithm< T > >( TTClusterAlgo );
return _theAlgo;
return std::unique_ptr< TTClusterAlgorithm< T > >( TTClusterAlgo );
}

}; /// Close class
Expand Down
6 changes: 2 additions & 4 deletions L1Trigger/TrackTrigger/interface/TTStubAlgorithm_cbc3.h
Expand Up @@ -85,7 +85,6 @@ class ES_TTStubAlgorithm_cbc3 : public edm::ESProducer
{
private:
/// Data members
std::shared_ptr< TTStubAlgorithm< T > > _theAlgo;

/// Z-matching
bool mPerformZMatching2S;
Expand All @@ -102,7 +101,7 @@ class ES_TTStubAlgorithm_cbc3 : public edm::ESProducer
~ES_TTStubAlgorithm_cbc3() override{}

/// Implement the producer
std::shared_ptr< TTStubAlgorithm< T > > produce( const TTStubAlgorithmRecord & record )
std::unique_ptr< TTStubAlgorithm< T > > produce( const TTStubAlgorithmRecord & record )
{
edm::ESHandle< TrackerGeometry > tGeomHandle;
record.getRecord< TrackerDigiGeometryRecord >().get( tGeomHandle );
Expand All @@ -112,8 +111,7 @@ class ES_TTStubAlgorithm_cbc3 : public edm::ESProducer
const TrackerTopology* const theTrackerTopo = tTopoHandle.product();

TTStubAlgorithm< T >* TTStubAlgo = new TTStubAlgorithm_cbc3< T >( theTrackerGeom, theTrackerTopo, mPerformZMatching2S );
_theAlgo = std::shared_ptr< TTStubAlgorithm< T > >( TTStubAlgo );
return _theAlgo;
return std::unique_ptr< TTStubAlgorithm< T > >( TTStubAlgo );
}

};
Expand Down
6 changes: 2 additions & 4 deletions L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h
Expand Up @@ -115,7 +115,6 @@ class ES_TTStubAlgorithm_official : public edm::ESProducer
{
private:
/// Data members
std::shared_ptr< TTStubAlgorithm< T > > _theAlgo;

/// Windows
std::vector< double > setBarrelCut;
Expand Down Expand Up @@ -159,7 +158,7 @@ class ES_TTStubAlgorithm_official : public edm::ESProducer
~ES_TTStubAlgorithm_official() override{}

/// Implement the producer
std::shared_ptr< TTStubAlgorithm< T > > produce( const TTStubAlgorithmRecord & record )
std::unique_ptr< TTStubAlgorithm< T > > produce( const TTStubAlgorithmRecord & record )
{
edm::ESHandle< TrackerGeometry > tGeomHandle;
record.getRecord< TrackerDigiGeometryRecord >().get( tGeomHandle );
Expand All @@ -172,8 +171,7 @@ class ES_TTStubAlgorithm_official : public edm::ESProducer
setBarrelCut, setRingCut, setTiltedCut, setBarrelNTilt,
mPerformZMatchingPS, mPerformZMatching2S);

_theAlgo = std::shared_ptr< TTStubAlgorithm< T > >( TTStubAlgo );
return _theAlgo;
return std::unique_ptr< TTStubAlgorithm< T > >( TTStubAlgo );
}

};
Expand Down

0 comments on commit f3e363a

Please sign in to comment.