CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 alignCSCRings::e, edm::HandleBase::isValid(), eostools::move(), and edm::Handle< T >::product().

Referenced by HcalRawToDigiFake::produce().

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