Skip to content

Commit

Permalink
Migrate to new AssociationMap interface
Browse files Browse the repository at this point in the history
  • Loading branch information
wddgit committed Mar 11, 2015
1 parent f07c246 commit 204c906
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion RecoEcal/EgammaClusterProducers/src/CosmicClusterProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ void CosmicClusterProducer::clusterizeECALPart(edm::Event &evt, const edm::Event


// BasicClusterShapeAssociationMap
std::auto_ptr<reco::BasicClusterShapeAssociationCollection> shapeAssocs_p(new reco::BasicClusterShapeAssociationCollection);
std::auto_ptr<reco::BasicClusterShapeAssociationCollection> shapeAssocs_p(
new reco::BasicClusterShapeAssociationCollection(bccHandle, clusHandle));

for (unsigned int i = 0; i < clusHandle->size(); i++){
shapeAssocs_p->insert(edm::Ref<reco::BasicClusterCollection>(bccHandle,i),edm::Ref<reco::ClusterShapeCollection>(clusHandle,i));
}
Expand Down
5 changes: 4 additions & 1 deletion RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void HFEMClusterProducer::produce(edm::Event & e, edm::EventSetup const& iSetup)
// create return data
std::auto_ptr<reco::HFEMClusterShapeCollection> retdata1(new HFEMClusterShapeCollection());
std::auto_ptr<reco::SuperClusterCollection> retdata2(new SuperClusterCollection());
std::auto_ptr<reco::HFEMClusterShapeAssociationCollection> retdata3(new HFEMClusterShapeAssociationCollection());

algo_.isMC(!e.isRealData());

Expand All @@ -50,6 +49,10 @@ void HFEMClusterProducer::produce(edm::Event & e, edm::EventSetup const& iSetup)
// put the results
ShapeHandle=e.put(retdata1);
SupHandle=e.put(retdata2);

std::auto_ptr<reco::HFEMClusterShapeAssociationCollection> retdata3(
new HFEMClusterShapeAssociationCollection(SupHandle, ShapeHandle));

for (unsigned int i=0; i < ShapeHandle->size();i++){
retdata3->insert(edm::Ref<reco::SuperClusterCollection>(SupHandle,i),edm::Ref<reco::HFEMClusterShapeCollection>(ShapeHandle,i));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void CosmicTrackSelector::produce( edm::Event& evt, const edm::EventSetup& es )
evt.getByToken(srcTraj_, hTraj);
selTrajs_ = auto_ptr< vector<Trajectory> >(new vector<Trajectory>());
rTrajectories_ = evt.getRefBeforePut< vector<Trajectory> >();
selTTAss_ = auto_ptr< TrajTrackAssociationCollection >(new TrajTrackAssociationCollection());
selTTAss_ = auto_ptr< TrajTrackAssociationCollection >(new TrajTrackAssociationCollection(&evt.productGetter()));
for (size_t i = 0, n = hTraj->size(); i < n; ++i) {
Ref< vector<Trajectory> > trajRef(hTraj, i);
TrajTrackAssociationCollection::const_iterator match = hTTAss->find(trajRef);
Expand Down

0 comments on commit 204c906

Please sign in to comment.