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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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, const CTPPSPixelGainCalibrations &gainCalibration)
 

Private Attributes

RPixDetClusterizer clusterizer_
 
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcdtokenCTPPSPixelAnalysisMask_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
 
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcdtokenGainCalib_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 41 of file CTPPSPixelClusterProducer.h.

Constructor & Destructor Documentation

◆ CTPPSPixelClusterProducer()

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

Definition at line 5 of file CTPPSPixelClusterProducer.cc.

6  : tokenCTPPSPixelDigi_(consumes<edm::DetSetVector<CTPPSPixelDigi> >(conf.getParameter<edm::InputTag>("tag"))),
9  verbosity_(conf.getUntrackedParameter<int>("RPixVerbosity")),
10  clusterizer_(conf) {
11  produces<edm::DetSetVector<CTPPSPixelCluster> >();
12 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd > tokenGainCalib_

◆ ~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.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_2022v11_cff::InputTag.

16  {
18  desc.addUntracked<int>("RPixVerbosity", 0);
19  desc.add<edm::InputTag>("tag", edm::InputTag("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 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

get inputs

Definition at line 29 of file CTPPSPixelClusterProducer.cc.

References edm::EventSetup::getData(), iEvent, convertSQLitetoXML_cfg::output, run(), tokenCTPPSPixelAnalysisMask_, tokenCTPPSPixelDigi_, and tokenGainCalib_.

29  {
32  iEvent.getByToken(tokenCTPPSPixelDigi_, rpd);
33 
35 
36  if (!rpd->empty()) {
37  // get analysis mask to mask channels
38  const auto &mask = iSetup.getData(tokenCTPPSPixelAnalysisMask_);
39  // get calibration DB
40  const auto &gainCalibrations = iSetup.getData(tokenGainCalib_);
41  // run clusterisation
42  run(*rpd, output, mask, gainCalibrations);
43  }
44  // write output
45  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelCluster> >(output));
46 }
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
void run(const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask &mask, const CTPPSPixelGainCalibrations &gainCalibration)
int iEvent
Definition: GenABIO.cc:224
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd > tokenGainCalib_

◆ run()

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

Definition at line 48 of file CTPPSPixelClusterProducer.cc.

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

Referenced by produce().

51  {
52  for (const auto &ds_digi : input) {
53  edm::DetSet<CTPPSPixelCluster> &ds_cluster = output.find_or_insert(ds_digi.id);
54  clusterizer_.buildClusters(ds_digi.id, ds_digi.data, ds_cluster.data, &gainCalibration, &mask);
55 
56  if (verbosity_) {
57  unsigned int cluN = 0;
58  for (std::vector<CTPPSPixelCluster>::iterator iit = ds_cluster.data.begin(); iit != ds_cluster.data.end();
59  iit++) {
60  edm::LogInfo("CTPPSPixelClusterProducer") << "Cluster " << ++cluN << " avg row " << (*iit).avg_row()
61  << " avg col " << (*iit).avg_col() << " ADC.size " << (*iit).size();
62  }
63  }
64  }
65 }
static std::string const input
Definition: EdmProvDump.cc:47
Log< level::Info, false > LogInfo
collection_type data
Definition: DetSet.h:80
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)

Member Data Documentation

◆ clusterizer_

RPixDetClusterizer CTPPSPixelClusterProducer::clusterizer_
private

Definition at line 56 of file CTPPSPixelClusterProducer.h.

Referenced by run().

◆ tokenCTPPSPixelAnalysisMask_

edm::ESGetToken<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd> CTPPSPixelClusterProducer::tokenCTPPSPixelAnalysisMask_
private

Definition at line 52 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

◆ tokenCTPPSPixelDigi_

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

Definition at line 51 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

◆ tokenGainCalib_

edm::ESGetToken<CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd> CTPPSPixelClusterProducer::tokenGainCalib_
private

Definition at line 53 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

◆ verbosity_

int CTPPSPixelClusterProducer::verbosity_
private

Definition at line 54 of file CTPPSPixelClusterProducer.h.

Referenced by run().