ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitEdm/Producers/interface/RefToBaseToPtr.h
Revision: 1.1
Committed: Tue Nov 4 19:25:55 2008 UTC (16 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2, Mit_008pre1, Mit_006b, Mit_006a, Mit_006
Log Message:
Added TrackToTrackAssociator tool

File Contents

# Content
1 // $Id: FillerElectrons.h,v 1.11 2008/11/03 18:11:09 bendavid Exp $
2
3 #ifndef DataFormats_Common_RefToBaseToPtr_h
4 #define DataFormats_Common_RefToBaseToPtr_h
5
6 /*----------------------------------------------------------------------
7
8 Ref: A function template for conversion from RefToBase to Ptr
9
10 ----------------------------------------------------------------------*/
11 /*
12 ----------------------------------------------------------------------*/
13
14 #include "DataFormats/Common/interface/RefToBase.h"
15 #include "DataFormats/Common/interface/Ptr.h"
16
17 namespace mitedm {
18 template <typename T>
19 edm::Ptr<T> refToBaseToPtr(
20 edm::RefToBase<T> const& ref) {
21 if (ref.get() == 0 && ref.productGetter() != 0) {
22 return edm::Ptr<T>(ref.id(), ref.key(), ref.productGetter());
23 }
24 else
25 return edm::Ptr<T>(ref.id(), ref.get(), ref.key());
26 }
27 }
28 #endif