CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CTPPSPixelRecHitProducer.cc
Go to the documentation of this file.
2 
4  src_ = conf.getParameter<edm::InputTag>("RPixClusterTag");
5  verbosity_ = conf.getUntrackedParameter<int>("RPixVerbosity");
6  tokenCTPPSPixelCluster_ = consumes<edm::DetSetVector<CTPPSPixelCluster> >(src_);
7  produces<edm::DetSetVector<CTPPSPixelRecHit> >();
8  pixelTopologyToken_ = esConsumes<PPSPixelTopology, PPSPixelTopologyRcd>();
9 }
10 
12 
15  desc.addUntracked<int>("RPixVerbosity", 0);
16  desc.add<edm::InputTag>("RPixClusterTag", edm::InputTag("ctppsPixelClusters"));
17  descriptions.add("ctppsPixelRecHits", desc);
18 }
19 
22  iEvent.getByToken(tokenCTPPSPixelCluster_, rpCl);
23 
25 
27 
28  // run reconstruction
29  if (!rpCl->empty())
30  run(*rpCl, output, *thePixelTopology);
31 
32  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelRecHit> >(output));
33 }
34 
37  const PPSPixelTopology &ppt) {
38  for (const auto &ds_cluster : input) {
39  edm::DetSet<CTPPSPixelRecHit> &ds_rechit = output.find_or_insert(ds_cluster.id);
40 
41  //calculate the cluster parameters and convert it into a rechit
42  cluster2hit_.buildHits(ds_cluster.id, ds_cluster.data, ds_rechit.data, ppt);
43  }
44 }
45 
struct @719 param_
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static std::string const input
Definition: EdmProvDump.cc:47
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCTPPSPixelCluster_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void run(const edm::DetSetVector< CTPPSPixelCluster > &input, edm::DetSetVector< CTPPSPixelRecHit > &output, const PPSPixelTopology &ppt)
void buildHits(unsigned int detId, const std::vector< CTPPSPixelCluster > &clusters, std::vector< CTPPSPixelRecHit > &hits, const PPSPixelTopology &ppt)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void add(std::string const &label, ParameterSetDescription const &psetDescription)
CTPPSPixelRecHitProducer(const edm::ParameterSet &param)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
collection_type data
Definition: DetSet.h:80
void produce(edm::Event &, const edm::EventSetup &) override
edm::ESGetToken< PPSPixelTopology, PPSPixelTopologyRcd > pixelTopologyToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151