CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CTPPSPixelRecHitProducer Class Reference

#include <CTPPSPixelRecHitProducer.h>

Inheritance diagram for CTPPSPixelRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 CTPPSPixelRecHitProducer (const edm::ParameterSet &param)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~CTPPSPixelRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void run (const edm::DetSetVector< CTPPSPixelCluster > &input, edm::DetSetVector< CTPPSPixelRecHit > &output)
 

Private Attributes

RPixClusterToHit cluster2hit_
 
edm::ParameterSet param_
 
edm::InputTag src_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCTPPSPixelCluster_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 30 of file CTPPSPixelRecHitProducer.h.

Constructor & Destructor Documentation

CTPPSPixelRecHitProducer::CTPPSPixelRecHitProducer ( const edm::ParameterSet param)
explicit

Definition at line 4 of file CTPPSPixelRecHitProducer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), src_, tokenCTPPSPixelCluster_, and verbosity_.

4  :
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 }
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCTPPSPixelCluster_
CTPPSPixelRecHitProducer::~CTPPSPixelRecHitProducer ( )
override

Definition at line 13 of file CTPPSPixelRecHitProducer.cc.

13 {}

Member Function Documentation

void CTPPSPixelRecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 15 of file CTPPSPixelRecHitProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and edm::ParameterSetDescription::addUntracked().

15  {
17  desc.addUntracked<int>("RPixVerbosity",0);
18  desc.add<edm::InputTag>("RPixClusterTag",edm::InputTag("ctppsPixelClusters"));
19  descriptions.add("ctppsPixelRecHits", desc);
20 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CTPPSPixelRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 22 of file CTPPSPixelRecHitProducer.cc.

References edm::Event::getByToken(), convertSQLitetoXML_cfg::output, edm::Event::put(), run(), and tokenCTPPSPixelCluster_.

22  {
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void run(const edm::DetSetVector< CTPPSPixelCluster > &input, edm::DetSetVector< CTPPSPixelRecHit > &output)
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCTPPSPixelCluster_
void CTPPSPixelRecHitProducer::run ( const edm::DetSetVector< CTPPSPixelCluster > &  input,
edm::DetSetVector< CTPPSPixelRecHit > &  output 
)
private

Definition at line 37 of file CTPPSPixelRecHitProducer.cc.

References RPixClusterToHit::buildHits(), cluster2hit_, edm::DetSet< T >::data, DEFINE_FWK_MODULE, and edm::DetSetVector< T >::find_or_insert().

Referenced by produce().

37  {
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 }
void buildHits(unsigned int detId, const std::vector< CTPPSPixelCluster > &clusters, std::vector< CTPPSPixelRecHit > &hits)
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:254
collection_type data
Definition: DetSet.h:78

Member Data Documentation

RPixClusterToHit CTPPSPixelRecHitProducer::cluster2hit_
private

Definition at line 48 of file CTPPSPixelRecHitProducer.h.

Referenced by run().

edm::ParameterSet CTPPSPixelRecHitProducer::param_
private

Definition at line 42 of file CTPPSPixelRecHitProducer.h.

edm::InputTag CTPPSPixelRecHitProducer::src_
private

Definition at line 45 of file CTPPSPixelRecHitProducer.h.

Referenced by CTPPSPixelRecHitProducer().

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelCluster> > CTPPSPixelRecHitProducer::tokenCTPPSPixelCluster_
private

Definition at line 46 of file CTPPSPixelRecHitProducer.h.

Referenced by CTPPSPixelRecHitProducer(), and produce().

int CTPPSPixelRecHitProducer::verbosity_
private

Definition at line 43 of file CTPPSPixelRecHitProducer.h.

Referenced by CTPPSPixelRecHitProducer().