CMS 3D CMS Logo

NativeArrayTableProducer.cc
Go to the documentation of this file.
4 
5 #include <vector>
6 
7 template<typename TIn, typename TCol, nanoaod::FlatTable::ColumnType CT>
9  public:
10 
12  name_( params.getParameter<std::string>("name") ),
13  doc_(params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""),
14  src_(consumes<TIn>( params.getParameter<edm::InputTag>("src") ))
15  {
16  produces<nanoaod::FlatTable>();
17  }
18 
20 
21  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override {
23  iEvent.getByToken(src_, src);
24 
25  const auto & in = *src;
26  auto out = std::make_unique<nanoaod::FlatTable>(in.size(), name_, false, false);
27  out->setDoc(doc_);
28  (*out).template addColumn<TCol>(this->name_, in, this->doc_, CT);
29  iEvent.put(std::move(out));
30  }
31 
32  protected:
36 };
37 
42 
48 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
NativeArrayTableProducer< std::vector< float >, float, nanoaod::FlatTable::FloatColumn > FloatArrayTableProducer
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
NativeArrayTableProducer(edm::ParameterSet const &params)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const edm::EDGetTokenT< TIn > src_
NativeArrayTableProducer< std::vector< bool >, uint8_t, nanoaod::FlatTable::UInt8Column > BoolArrayTableProducer
NativeArrayTableProducer< std::vector< double >, float, nanoaod::FlatTable::FloatColumn > DoubleArrayTableProducer
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:230
HLT enums.
NativeArrayTableProducer< std::vector< int >, int, nanoaod::FlatTable::IntColumn > IntArrayTableProducer
def move(src, dest)
Definition: eostools.py:510