CMS 3D CMS Logo

Functions
raw_impl Namespace Reference

Functions

template<class T >
void get (edm::EDGetTokenT< T > tok, edm::Event &e, const std::string &productName="")
 

Function Documentation

template<class T >
void raw_impl::get ( edm::EDGetTokenT< T tok,
edm::Event e,
const std::string &  productName = "" 
)

Definition at line 19 of file HcalRawToDigiFake.cc.

References edm::HandleBase::isValid(), eostools::move(), and edm::Handle< T >::product().

Referenced by HcalRawToDigiFake::produce().

20  {
21  edm::Handle<T> h_coll;
22  e.getByToken(tok, h_coll);
23  auto o_coll = std::make_unique<T>();
24  if(h_coll.isValid()){
25  //copy constructor
26  o_coll = std::make_unique<T>(*(h_coll.product()));
27  }
28  if(!productName.empty()) e.put(std::move(o_coll),productName);
29  else e.put(std::move(o_coll));
30  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool isValid() const
Definition: HandleBase.h:74
T const * product() const
Definition: Handle.h:74
def move(src, dest)
Definition: eostools.py:511