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::CTPPSPixelClusterProducer ( const edm::ParameterSet param)
explicit

Definition at line 5 of file CTPPSPixelClusterProducer.cc.

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 }

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

◆ ~CTPPSPixelClusterProducer()

CTPPSPixelClusterProducer::~CTPPSPixelClusterProducer ( )
override

Definition at line 14 of file CTPPSPixelClusterProducer.cc.

14 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 16 of file CTPPSPixelClusterProducer.cc.

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 }

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

◆ produce()

void CTPPSPixelClusterProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

get inputs

Definition at line 29 of file CTPPSPixelClusterProducer.cc.

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
46  run(*rpd, output, aMask.product());
47  }
48  // write output
49  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelCluster> >(output));
50 }

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

◆ run()

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

Definition at line 52 of file CTPPSPixelClusterProducer.cc.

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 }

References RPixDetClusterizer::buildClusters(), clusterizer_, edm::DetSet< T >::data, CTPPSPixelGainCalibrationDBService::getCalibs(), input, convertSQLitetoXML_cfg::output, theGainCalibrationDB, and verbosity_.

Referenced by produce().

Member Data Documentation

◆ clusterizer_

RPixDetClusterizer CTPPSPixelClusterProducer::clusterizer_
private

Definition at line 58 of file CTPPSPixelClusterProducer.h.

Referenced by run().

◆ param_

edm::ParameterSet CTPPSPixelClusterProducer::param_
private

Definition at line 52 of file CTPPSPixelClusterProducer.h.

◆ src_

edm::InputTag CTPPSPixelClusterProducer::src_
private

Definition at line 55 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer().

◆ theGainCalibrationDB

CTPPSPixelGainCalibrationDBService CTPPSPixelClusterProducer::theGainCalibrationDB
private

Definition at line 64 of file CTPPSPixelClusterProducer.h.

Referenced by produce(), and run().

◆ tokenCTPPSPixelDigi_

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

Definition at line 56 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and produce().

◆ verbosity_

int CTPPSPixelClusterProducer::verbosity_
private

Definition at line 53 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and run().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector
Definition: DetSetVector.h:61
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
CTPPSPixelClusterProducer::theGainCalibrationDB
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
Definition: CTPPSPixelClusterProducer.h:64
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RPixDetClusterizer::buildClusters
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)
Definition: RPixDetClusterizer.cc:25
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSPixelClusterProducer::tokenCTPPSPixelDigi_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
Definition: CTPPSPixelClusterProducer.h:56
CTPPSPixelGainCalibrationDBService::getCalibs
const CTPPSPixelGainCalibrations * getCalibs() const
Definition: CTPPSPixelGainCalibrationDBService.h:28
CTPPSPixelClusterProducer::src_
edm::InputTag src_
Definition: CTPPSPixelClusterProducer.h:55
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSPixelGainCalibrationDBService::getDB
virtual void getDB(const edm::Event &e, const edm::EventSetup &c)
Definition: CTPPSPixelGainCalibrationDBService.cc:25
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSPixelClusterProducer::run
void run(const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask *mask)
Definition: CTPPSPixelClusterProducer.cc:52
CTPPSPixelClusterProducer::verbosity_
int verbosity_
Definition: CTPPSPixelClusterProducer.h:53
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelAnalysisMaskRcd
Definition: CTPPSPixelAnalysisMaskRcd.h:23
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
iEvent
int iEvent
Definition: GenABIO.cc:224
CTPPSPixelClusterProducer::clusterizer_
RPixDetClusterizer clusterizer_
Definition: CTPPSPixelClusterProducer.h:58
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
CTPPSPixelClusterProducer::param_
edm::ParameterSet param_
Definition: CTPPSPixelClusterProducer.h:52