CMS 3D CMS Logo

CrossingFramePSimHitToPSimHits.cc
Go to the documentation of this file.
7 
10 
12 public:
14 
15  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
16 
17  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
18 
19 private:
20  struct InputInfo {
25  };
26 
27  std::vector<InputInfo> input_;
28 };
29 
31  auto src = iConfig.getParameter<std::vector<edm::InputTag>>("src");
32  input_.reserve(src.size());
33  for (const auto& tag : src) {
34  input_.emplace_back(consumes<CrossingFrame<PSimHit>>(tag), tag.instance());
35  produces<std::vector<PSimHit>>(input_.back().instance);
36  }
37 }
38 
41  desc.add<std::vector<edm::InputTag>>("src", std::vector<edm::InputTag>());
42  descriptions.add("crossingFramePSimHitToPSimHits", desc);
43 }
44 
47  const edm::EventSetup& iSetup) const {
48  for (const auto& input : input_) {
50  iEvent.getByToken(input.token, hframe);
51  const auto& frame = *hframe;
52  const auto& signalHits = frame.getSignal();
53  const auto& pileupHits = frame.getPileups();
54 
55  auto output = std::make_unique<std::vector<PSimHit>>();
56  output->reserve(signalHits.size() + pileupHits.size());
57  for (const auto& ptr : signalHits)
58  output->emplace_back(*ptr);
59  for (const auto& ptr : pileupHits)
60  output->emplace_back(*ptr);
61  iEvent.put(std::move(output), input.instance);
62  }
63 }
64 
65 //define this as a plug-in
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
CrossingFramePSimHitToPSimHitsConverter::InputInfo::instance
std::string instance
Definition: CrossingFramePSimHitToPSimHits.cc:24
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::EDGetTokenT< CrossingFrame< PSimHit > >
CrossingFramePSimHitToPSimHitsConverter::InputInfo::token
Token token
Definition: CrossingFramePSimHitToPSimHits.cc:23
CrossingFrame.h
CrossingFramePSimHitToPSimHitsConverter
Definition: CrossingFramePSimHitToPSimHits.cc:11
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CrossingFramePSimHitToPSimHitsConverter::input_
std::vector< InputInfo > input_
Definition: CrossingFramePSimHitToPSimHits.cc:27
edm::Handle
Definition: AssociativeIterator.h:50
CrossingFrame
Definition: CrossingFrame.h:38
MakerMacros.h
PSimHit.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
CrossingFramePSimHitToPSimHitsConverter::produce
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: CrossingFramePSimHitToPSimHits.cc:45
CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter
CrossingFramePSimHitToPSimHitsConverter(const edm::ParameterSet &iConfig)
Definition: CrossingFramePSimHitToPSimHits.cc:30
ParameterSetDescription.h
OrderedSet.t
t
Definition: OrderedSet.py:90
CrossingFramePSimHitToPSimHitsConverter::InputInfo::InputInfo
InputInfo(Token t, const std::string &i)
Definition: CrossingFramePSimHitToPSimHits.cc:22
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
Event.h
CrossingFramePSimHitToPSimHitsConverter::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CrossingFramePSimHitToPSimHits.cc:39
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
ParameterSet.h
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
EDProducer.h
edm::Event
Definition: Event.h:73
CrossingFramePSimHitToPSimHitsConverter::InputInfo
Definition: CrossingFramePSimHitToPSimHits.cc:20