CMS 3D CMS Logo

Functions
Utils.h File Reference
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/ValueMap.h"
#include "FWCore/Framework/interface/Event.h"
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

template<typename ValueType , class HandleType >
void writeValueMap (edm::Event &iEvent, const edm::Handle< HandleType > &handle, const std::vector< ValueType > &values, const std::string &label)
 

Function Documentation

template<typename ValueType , class HandleType >
void writeValueMap ( edm::Event iEvent,
const edm::Handle< HandleType > &  handle,
const std::vector< ValueType > &  values,
const std::string &  label 
)

Definition at line 13 of file Utils.h.

References objects.autophobj::filler, eostools::move(), and edm::Event::put().

Referenced by EcalBarrelClusterFastTimer::produce(), TrackTimeValueMapProducer::produce(), and PhotonIDValueMapProducer::produce().

17 {
18  auto valMap = std::make_unique<edm::ValueMap<ValueType>>();
19  typename edm::ValueMap<ValueType>::Filler filler(*valMap);
20  filler.insert(handle, values.begin(), values.end());
21  filler.fill();
22  iEvent.put(std::move(valMap),label);
23 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
def move(src, dest)
Definition: eostools.py:510