CMS 3D CMS Logo

HiSignalParticleProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <vector>
3 
6 
9 
12 
17 
19 public:
21  ~HiSignalParticleProducer() override = default;
22 
24 
25 private:
26  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
27 
29 };
30 
32  : genParticleSrc_(consumes<edm::View<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("src"))) {
33  std::string alias = (iConfig.getParameter<edm::InputTag>("src")).label();
34  produces<reco::GenParticleCollection>().setBranchAlias(alias);
35 }
36 
38  auto signalGenParticles = std::make_unique<reco::GenParticleCollection>();
39 
41  iEvent.getByToken(genParticleSrc_, genParticles);
42 
43  for (const reco::GenParticle& genParticle : *genParticles) {
44  if (genParticle.collisionId() == 0) {
45  signalGenParticles->push_back(genParticle);
46  }
47  }
48 
49  iEvent.put(std::move(signalGenParticles));
50 }
51 
54  desc.setComment("Selects genParticles from collision id = 0");
55  desc.add<edm::InputTag>("src", edm::InputTag("genParticles"));
56  descriptions.addWithDefaultLabel(desc);
57 }
58 
edm::StreamID
Definition: StreamID.h:30
GenJetCollection.h
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
sistrip::View
View
Definition: ConstantsForView.h:26
reco::GenParticle
Definition: GenParticle.h:21
HiSignalParticleProducer
Definition: HiSignalParticleProducer.cc:18
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HiSignalParticleProducer::~HiSignalParticleProducer
~HiSignalParticleProducer() override=default
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
GenParticle
Definition: GenParticle.py:1
GenParticle.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GenParticleFwd.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HiSignalParticleProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: HiSignalParticleProducer.cc:37
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
HiSignalParticleProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: HiSignalParticleProducer.cc:52
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
HiSignalParticleProducer::genParticleSrc_
edm::EDGetTokenT< edm::View< reco::GenParticle > > genParticleSrc_
Definition: HiSignalParticleProducer.cc:28
Frameworkfwd.h
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
View.h
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
HiSignalParticleProducer::HiSignalParticleProducer
HiSignalParticleProducer(const edm::ParameterSet &)
Definition: HiSignalParticleProducer.cc:31