CMS 3D CMS Logo

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

#include <CTPPSPixelClusterProducer.h>

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

Public Member Functions

 CTPPSPixelClusterProducer (const edm::ParameterSet &param)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~CTPPSPixelClusterProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void run (const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask *mask)
 

Private Attributes

RPixDetClusterizer clusterizer_
 
edm::ParameterSet param_
 
edm::InputTag src_
 
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
 
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 39 of file CTPPSPixelClusterProducer.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file CTPPSPixelClusterProducer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_2018_cff::InputTag, src_, AlCaHLTBitMon_QueryRunRegistry::string, tokenCTPPSPixelDigi_, and verbosity_.

5  : param_(conf), clusterizer_(conf) {
6  src_ = conf.getParameter<std::string>("label");
7  verbosity_ = conf.getUntrackedParameter<int>("RPixVerbosity");
8 
9  tokenCTPPSPixelDigi_ = consumes<edm::DetSetVector<CTPPSPixelDigi> >(edm::InputTag(src_));
10 
11  produces<edm::DetSetVector<CTPPSPixelCluster> >();
12 }
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
CTPPSPixelClusterProducer::~CTPPSPixelClusterProducer ( )
override

Definition at line 14 of file CTPPSPixelClusterProducer.cc.

14 {}

Member Function Documentation

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

Definition at line 16 of file CTPPSPixelClusterProducer.cc.

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

16  {
18  desc.addUntracked<int>("RPixVerbosity", 0);
19  desc.add<std::string>("label", "ctppsPixelDigis");
20  desc.add<int>("SeedADCThreshold", 2);
21  desc.add<int>("ADCThreshold", 2);
22  desc.add<double>("ElectronADCGain", 135.0);
23  desc.add<int>("VCaltoElectronGain", 50);
24  desc.add<int>("VCaltoElectronOffset", -411);
25  desc.add<bool>("doSingleCalibration", false);
26  descriptions.add("ctppsPixelClusters", desc);
27 }
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 CTPPSPixelClusterProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

get inputs

Definition at line 29 of file CTPPSPixelClusterProducer.cc.

References edm::EventSetup::get(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::Event::getByToken(), CTPPSPixelGainCalibrationDBService::getDB(), convertSQLitetoXML_cfg::output, edm::ESHandle< T >::product(), edm::Event::put(), run(), theGainCalibrationDB, and tokenCTPPSPixelDigi_.

29  {
32  iEvent.getByToken(tokenCTPPSPixelDigi_, rpd);
33 
34  // get analysis mask to mask channels
36 
37  if (!rpd->empty())
38  iSetup.get<CTPPSPixelAnalysisMaskRcd>().get(aMask);
39 
41 
42  // run clusterisation
43  if (!rpd->empty()) {
44  // get calibration DB
45  theGainCalibrationDB.getDB(iEvent, iSetup);
46  run(*rpd, output, aMask.product());
47  }
48  // write output
49  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelCluster> >(output));
50 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void run(const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask *mask)
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
virtual void getDB(const edm::Event &e, const edm::EventSetup &c)
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
void CTPPSPixelClusterProducer::run ( const edm::DetSetVector< CTPPSPixelDigi > &  input,
edm::DetSetVector< CTPPSPixelCluster > &  output,
const CTPPSPixelAnalysisMask mask 
)
private

Definition at line 52 of file CTPPSPixelClusterProducer.cc.

References RPixDetClusterizer::buildClusters(), clusterizer_, edm::DetSet< T >::data, DEFINE_FWK_MODULE, edm::DetSetVector< T >::find_or_insert(), CTPPSPixelGainCalibrationDBService::getCalibs(), theGainCalibrationDB, and verbosity_.

Referenced by produce().

54  {
55  for (const auto &ds_digi : input) {
56  edm::DetSet<CTPPSPixelCluster> &ds_cluster = output.find_or_insert(ds_digi.id);
57  clusterizer_.buildClusters(ds_digi.id, ds_digi.data, ds_cluster.data, theGainCalibrationDB.getCalibs(), mask);
58 
59  if (verbosity_) {
60  unsigned int cluN = 0;
61  for (std::vector<CTPPSPixelCluster>::iterator iit = ds_cluster.data.begin(); iit != ds_cluster.data.end();
62  iit++) {
63  edm::LogInfo("CTPPSPixelClusterProducer") << "Cluster " << ++cluN << " avg row " << (*iit).avg_row()
64  << " avg col " << (*iit).avg_col() << " ADC.size " << (*iit).size();
65  }
66  }
67  }
68 }
const CTPPSPixelGainCalibrations * getCalibs() const
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
collection_type data
Definition: DetSet.h:81
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)

Member Data Documentation

RPixDetClusterizer CTPPSPixelClusterProducer::clusterizer_
private

Definition at line 55 of file CTPPSPixelClusterProducer.h.

Referenced by run().

edm::ParameterSet CTPPSPixelClusterProducer::param_
private

Definition at line 49 of file CTPPSPixelClusterProducer.h.

edm::InputTag CTPPSPixelClusterProducer::src_
private

Definition at line 52 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer().

CTPPSPixelGainCalibrationDBService CTPPSPixelClusterProducer::theGainCalibrationDB
private

Definition at line 61 of file CTPPSPixelClusterProducer.h.

Referenced by produce(), and run().

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelDigi> > CTPPSPixelClusterProducer::tokenCTPPSPixelDigi_
private

Definition at line 53 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and produce().

int CTPPSPixelClusterProducer::verbosity_
private

Definition at line 50 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and run().