CMS 3D CMS Logo

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 }
9 
11 
14  desc.addUntracked<int>("RPixVerbosity", 0);
15  desc.add<edm::InputTag>("RPixClusterTag", edm::InputTag("ctppsPixelClusters"));
16  descriptions.add("ctppsPixelRecHits", desc);
17 }
18 
21  iEvent.getByToken(tokenCTPPSPixelCluster_, rpCl);
22 
24 
25  // run reconstruction
26  if (!rpCl->empty())
27  run(*rpCl, output);
28 
29  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelRecHit> >(output));
30 }
31 
34  for (const auto &ds_cluster : input) {
35  edm::DetSet<CTPPSPixelRecHit> &ds_rechit = output.find_or_insert(ds_cluster.id);
36 
37  //calculate the cluster parameters and convert it into a rechit
38  cluster2hit_.buildHits(ds_cluster.id, ds_cluster.data, ds_rechit.data);
39  }
40 }
41 
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:131
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
struct @680 param_
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:48
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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:81
void produce(edm::Event &, const edm::EventSetup &) override