CMS 3D CMS Logo

PreMixingMtdTruthWorker.cc
Go to the documentation of this file.
7 
11 
14 
16 public:
18  ~PreMixingMtdTruthWorker() override = default;
19 
20  void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override;
21  void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override;
22  void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override;
23  void put(edm::Event &iEvent,
24  edm::EventSetup const &iSetup,
25  std::vector<PileupSummaryInfo> const &ps,
26  int bunchSpacing) override;
27 
28 private:
30 
32 
35 
36  std::unique_ptr<MtdSimLayerClusterCollection> newClusters_;
37 };
38 
40  edm::ProducesCollector producesCollector,
42  : sigClusterToken_(iC.consumes<MtdSimLayerClusterCollection>(ps.getParameter<edm::InputTag>("labelSig"))),
43  clusterPileInputTag_(ps.getParameter<edm::InputTag>("pileInputTag")),
44  mtdSimLCCollectionDM_(ps.getParameter<std::string>("collectionDM")) {
46 }
47 
49  newClusters_ = std::make_unique<MtdSimLayerClusterCollection>();
50 }
51 
54  iEvent.getByToken(sigClusterToken_, clusters);
55 
56  if (clusters.isValid()) {
57  add(*clusters);
58  }
59 }
60 
64 
65  if (clusters.isValid()) {
66  add(*clusters);
67  }
68 }
69 
71  // Copy MtdSimLayerClusters
72  newClusters_->reserve(newClusters_->size() + clusters.size());
73  std::copy(clusters.begin(), clusters.end(), std::back_inserter(*newClusters_));
74 }
75 
77  edm::EventSetup const &iSetup,
78  std::vector<PileupSummaryInfo> const &ps,
79  int bunchSpacing) {
81 }
82 
std::vector< MtdSimLayerCluster > MtdSimLayerClusterCollection
void add(const MtdSimLayerClusterCollection &clusters)
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
PreMixingMtdTruthWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
void put(edm::Event &iEvent, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bunchSpacing) override
int iEvent
Definition: GenABIO.cc:224
~PreMixingMtdTruthWorker() override=default
void addSignals(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
void addPileups(PileUpEventPrincipal const &pep, edm::EventSetup const &iSetup) override
HLT enums.
std::unique_ptr< MtdSimLayerClusterCollection > newClusters_
edm::EDGetTokenT< MtdSimLayerClusterCollection > sigClusterToken_
void initializeEvent(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
#define DEFINE_PREMIXING_WORKER(TYPE)
def move(src, dest)
Definition: eostools.py:511
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const