CMS 3D CMS Logo

InputDataProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1Trigger/VertexFinder
4 // Class: InputDataProducer
5 //
13 //
14 // Original Author: Alexx Perloff
15 // Created: Fri, 05 Feb 2021 23:42:17 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 #include <vector>
22 
23 // user include files
40 
41 //
42 // class declaration
43 //
44 
46 public:
47  explicit InputDataProducer(const edm::ParameterSet&);
48  ~InputDataProducer() override;
49 
50  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
51 
52 private:
53  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
54 
55  // ----------constants, enums and typedefs ---------
57 
58  // ----------member data ---------------------------
69 };
70 
71 //
72 // constructors and destructor
73 //
75  : outputCollectionName_(iConfig.getParameter<std::string>("outputCollectionName")),
76  settings_(iConfig),
77  hepMCToken_(consumes<edm::HepMCProduct>(iConfig.getParameter<edm::InputTag>("hepMCInputTag"))),
78  genParticlesToken_(
79  consumes<edm::View<reco::GenParticle>>(iConfig.getParameter<edm::InputTag>("genParticleInputTag"))),
80  tpToken_(consumes<edm::View<TrackingParticle>>(iConfig.getParameter<edm::InputTag>("tpInputTag"))),
81  tpValueMapToken_(
82  consumes<edm::ValueMap<l1tVertexFinder::TP>>(iConfig.getParameter<edm::InputTag>("tpValueMapInputTag"))),
83  stubToken_(consumes<DetSetVec>(iConfig.getParameter<edm::InputTag>("stubInputTag"))),
86  // Define EDM output to be written to file (if required)
87  produces<l1tVertexFinder::InputData>(outputCollectionName_);
88 
89  //now do what ever other initialization is needed
90 }
91 
93 
94 //
95 // member functions
96 //
97 
98 // ------------ method called to produce the data ------------
100  std::unique_ptr<l1tVertexFinder::InputData> product = std::make_unique<l1tVertexFinder::InputData>(iEvent,
101  iSetup,
102  settings_,
103  hepMCToken_,
105  tpToken_,
107  stubToken_,
108  tTopoToken_,
109  tGeomToken_);
110 
111  iEvent.put(std::move(product), outputCollectionName_);
112 }
113 
114 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
116  //The following says we do not know what parameters are allowed so do no validation
117  // Please change this to state exactly what you do use, even if it is no parameters
119  desc.setUnknown();
120  descriptions.addDefault(desc);
121 }
122 
123 //define this as a plug-in
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::EDGetTokenT< edm::View< reco::GenParticle > > genParticlesToken_
~InputDataProducer() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
InputDataProducer(const edm::ParameterSet &)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
l1tVertexFinder::AnalysisSettings settings_
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< edm::HepMCProduct > hepMCToken_
const edm::EDGetTokenT< edm::ValueMap< l1tVertexFinder::TP > > tpValueMapToken_
const edm::EDGetTokenT< edm::ValueMap< l1tVertexFinder::Stub > > stubValueMapToken_
const edm::EDGetTokenT< DetSetVec > stubToken_
fixed size matrix
HLT enums.
Monte Carlo truth information used for tracking validation.
const edm::EDGetTokenT< edm::View< TrackingParticle > > tpToken_
edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > > DetSetVec
const std::string outputCollectionName_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move(src, dest)
Definition: eostools.py:511