CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackingParticleNumberOfLayersProducer.cc
Go to the documentation of this file.
9 
11 
18 public:
20 
21  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
22 
23  void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override;
24 
25 private:
27  std::vector<edm::EDGetTokenT<std::vector<PSimHit>>> simHitTokens_;
29 };
30 
32  : tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("trackingParticles"))),
34  for (const auto &tag : iConfig.getParameter<std::vector<edm::InputTag>>("simHits")) {
35  simHitTokens_.push_back(consumes<std::vector<PSimHit>>(tag));
36  }
37 
38  produces<edm::ValueMap<unsigned int>>("trackerLayers");
39  produces<edm::ValueMap<unsigned int>>("pixelLayers");
40  produces<edm::ValueMap<unsigned int>>("stripStereoLayers");
41 }
42 
45  desc.add<edm::InputTag>("trackingParticles", edm::InputTag("mix", "MergedTrackTruth"));
46 
47  desc.add<std::vector<edm::InputTag>>("simHits",
48  {edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof"),
49  edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelHighTof"),
50  edm::InputTag("g4SimHits", "TrackerHitsPixelEndcapLowTof"),
51  edm::InputTag("g4SimHits", "TrackerHitsPixelEndcapHighTof"),
52  edm::InputTag("g4SimHits", "TrackerHitsTIBLowTof"),
53  edm::InputTag("g4SimHits", "TrackerHitsTIBHighTof"),
54  edm::InputTag("g4SimHits", "TrackerHitsTIDLowTof"),
55  edm::InputTag("g4SimHits", "TrackerHitsTIDHighTof"),
56  edm::InputTag("g4SimHits", "TrackerHitsTOBLowTof"),
57  edm::InputTag("g4SimHits", "TrackerHitsTOBHighTof"),
58  edm::InputTag("g4SimHits", "TrackerHitsTECLowTof"),
59  edm::InputTag("g4SimHits", "TrackerHitsTECHighTof")});
60 
61  descriptions.add("trackingParticleNumberOfLayersProducer", desc);
62 }
63 
66  const edm::EventSetup &iSetup) const {
68  iEvent.getByToken(tpToken_, htps);
69 
71  auto ret = algo.calculate(htps, iSetup.getData(tTopoToken_));
72  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nTrackerLayers>(ret)), "trackerLayers");
73  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nPixelLayers>(ret)), "pixelLayers");
74  iEvent.put(std::move(std::get<TrackingParticleNumberOfLayers::nStripMonoAndStereoLayers>(ret)), "stripStereoLayers");
75 }
76 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
tuple ret
prodAgent to be discontinued
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::tuple< std::unique_ptr< edm::ValueMap< unsigned int > >, std::unique_ptr< edm::ValueMap< unsigned int > >, std::unique_ptr< edm::ValueMap< unsigned int > > > calculate(const edm::Handle< TrackingParticleCollection > &tps, const TrackerTopology &tTopo) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_
TrackingParticleNumberOfLayersProducer(const edm::ParameterSet &iConfig)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< TrackingParticle > TrackingParticleCollection
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
tTopoToken_