CMS 3D CMS Logo

CTPPSPixelRecHitProducer.cc
Go to the documentation of this file.
2 
3 
5  param_(conf), cluster2hit_(conf)
6 {
7  src_ = conf.getParameter<edm::InputTag>("RPixClusterTag");
8  verbosity_ = conf.getUntrackedParameter<int> ("RPixVerbosity");
9  tokenCTPPSPixelCluster_ = consumes<edm::DetSetVector<CTPPSPixelCluster> >(src_);
10  produces<edm::DetSetVector<CTPPSPixelRecHit> > ();
11 }
12 
14 
17  desc.addUntracked<int>("RPixVerbosity",0);
18  desc.add<edm::InputTag>("RPixClusterTag",edm::InputTag("ctppsPixelClusters"));
19  descriptions.add("ctppsPixelRecHits", desc);
20 }
21 
23 
25  iEvent.getByToken(tokenCTPPSPixelCluster_, rpCl);
26 
28 
29 // run reconstruction
30  if (!rpCl->empty())
31  run(*rpCl, output);
32 
33  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelRecHit> >(output));
34 
35 }
36 
38 
39  for (const auto &ds_cluster : input)
40  {
41  edm::DetSet<CTPPSPixelRecHit> &ds_rechit = output.find_or_insert(ds_cluster.id);
42 
43 //calculate the cluster parameters and convert it into a rechit
44  cluster2hit_.buildHits(ds_cluster.id, ds_cluster.data, ds_rechit.data);
45 
46  }
47 }
48 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void buildHits(unsigned int detId, const std::vector< CTPPSPixelCluster > &clusters, std::vector< CTPPSPixelRecHit > &hits)
void run(const edm::DetSetVector< CTPPSPixelCluster > &input, edm::DetSetVector< CTPPSPixelRecHit > &output)
static std::string const input
Definition: EdmProvDump.cc:44
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:254
struct @603 param_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCTPPSPixelCluster_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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:78
void produce(edm::Event &, const edm::EventSetup &) override