CMS 3D CMS Logo

NativeArrayTableProducer.cc
Go to the documentation of this file.
4 
5 #include <vector>
6 
7 template <typename TIn, typename TCol>
9 public:
11  : name_(params.getParameter<std::string>("name")),
12  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
13  src_(consumes<TIn>(params.getParameter<edm::InputTag>("src"))) {
14  produces<nanoaod::FlatTable>();
15  }
16 
18 
19  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override {
21  iEvent.getByToken(src_, src);
22 
23  const auto& in = *src;
24  auto out = std::make_unique<nanoaod::FlatTable>(in.size(), name_, false, false);
25  out->setDoc(doc_);
26  (*out).template addColumn<TCol>(this->name_, in, this->doc_);
27  iEvent.put(std::move(out));
28  }
29 
30 protected:
34 };
35 
40 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
NativeArrayTableProducer(edm::ParameterSet const &params)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
NativeArrayTableProducer< std::vector< double >, float > DoubleArrayTableProducer
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
int iEvent
Definition: GenABIO.cc:224
NativeArrayTableProducer< std::vector< bool >, bool > BoolArrayTableProducer
NativeArrayTableProducer< std::vector< float >, float > FloatArrayTableProducer
NativeArrayTableProducer< std::vector< int >, int > IntArrayTableProducer
HLT enums.
const edm::EDGetTokenT< TIn > src_
def move(src, dest)
Definition: eostools.py:511