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

◆ get()

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.

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  }

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

Referenced by HcalRawToDigiFake::produce().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::Handle
Definition: AssociativeIterator.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37