Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:47

0001 #ifndef FWCore_Framework_makeRefToBaseProdFrom_h
0002 #define FWCore_Framework_makeRefToBaseProdFrom_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     makeRefToBaseProdFrom
0007 //
0008 /**\class makeRefToBaseProdFrom makeRefToBaseProdFrom.h "FWCore/Framework/interface/makeRefToBaseProdFrom.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Tue, 02 Dec 2014 16:00:08 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "DataFormats/Common/interface/RefToBase.h"
0025 #include "DataFormats/Common/interface/RefToBaseProd.h"
0026 #include "DataFormats/Common/interface/View.h"
0027 #include "DataFormats/Common/interface/Handle.h"
0028 #include "FWCore/Framework/interface/Event.h"
0029 
0030 // forward declarations
0031 
0032 namespace edm {
0033   template <typename T>
0034   RefToBaseProd<T> makeRefToBaseProdFrom(RefToBase<T> const& iRef, Event const& iEvent) {
0035     Handle<View<T>> view;
0036     iEvent.get(iRef.id(), view);
0037 
0038     return RefToBaseProd<T>(view);
0039   }
0040 }  // namespace edm
0041 #endif