CMS 3D CMS Logo

TrackingParticleNumberOfLayersProducer.cc
Go to the documentation of this file.
7 
9 
16 public:
18 
19  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
20 
21  void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override;
22 
23 private:
25  std::vector<edm::EDGetTokenT<std::vector<PSimHit>>> simHitTokens_;
26 };
27 
29  : tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("trackingParticles"))) {
30  for (const auto &tag : iConfig.getParameter<std::vector<edm::InputTag>>("simHits")) {
31  simHitTokens_.push_back(consumes<std::vector<PSimHit>>(tag));
32  }
33 
34  produces<edm::ValueMap<unsigned int>>("trackerLayers");
35  produces<edm::ValueMap<unsigned int>>("pixelLayers");
36  produces<edm::ValueMap<unsigned int>>("stripStereoLayers");
37 }
38 
41  desc.add<edm::InputTag>("trackingParticles", edm::InputTag("mix", "MergedTrackTruth"));
42 
43  desc.add<std::vector<edm::InputTag>>("simHits",
44  {edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof"),
45  edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelHighTof"),
46  edm::InputTag("g4SimHits", "TrackerHitsPixelEndcapLowTof"),
47  edm::InputTag("g4SimHits", "TrackerHitsPixelEndcapHighTof"),
48  edm::InputTag("g4SimHits", "TrackerHitsTIBLowTof"),
49  edm::InputTag("g4SimHits", "TrackerHitsTIBHighTof"),
50  edm::InputTag("g4SimHits", "TrackerHitsTIDLowTof"),
51  edm::InputTag("g4SimHits", "TrackerHitsTIDHighTof"),
52  edm::InputTag("g4SimHits", "TrackerHitsTOBLowTof"),
53  edm::InputTag("g4SimHits", "TrackerHitsTOBHighTof"),
54  edm::InputTag("g4SimHits", "TrackerHitsTECLowTof"),
55  edm::InputTag("g4SimHits", "TrackerHitsTECHighTof")});
56 
57  descriptions.add("trackingParticleNumberOfLayersProducer", desc);
58 }
59 
62  const edm::EventSetup &iSetup) const {
64  iEvent.getByToken(tpToken_, htps);
65 
67  auto ret = algo.calculate(htps, iSetup);
68  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nTrackerLayers>(ret)), "trackerLayers");
69  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nPixelLayers>(ret)), "pixelLayers");
70  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nStripMonoAndStereoLayers>(ret)), "stripStereoLayers");
71 }
72 
ConfigurationDescriptions.h
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
edm::StreamID
Definition: StreamID.h:30
TrackingParticleNumberOfLayers
Definition: TrackingParticleNumberOfLayers.h:44
edm::EDGetTokenT< TrackingParticleCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackingParticleNumberOfLayersProducer::produce
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: TrackingParticleNumberOfLayersProducer.cc:60
TrackingParticleNumberOfLayers.h
edm::Handle< TrackingParticleCollection >
cmsdt::algo
algo
Definition: constants.h:171
MakerMacros.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
TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer
TrackingParticleNumberOfLayersProducer(const edm::ParameterSet &iConfig)
Definition: TrackingParticleNumberOfLayersProducer.cc:28
ParameterSetDescription.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
TrackingParticleNumberOfLayersProducer
Definition: TrackingParticleNumberOfLayersProducer.cc:15
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
TrackingParticleNumberOfLayersProducer::tpToken_
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
Definition: TrackingParticleNumberOfLayersProducer.cc:24
TrackingParticleNumberOfLayersProducer::simHitTokens_
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_
Definition: TrackingParticleNumberOfLayersProducer.cc:25
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:9
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet.h
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
TrackingParticleNumberOfLayersProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrackingParticleNumberOfLayersProducer.cc:39