CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
CTPPSPixelAnalysisMaskRcd
tokenCTPPSPixelAnalysisMask_
 
edm::EDGetTokenT
< edm::DetSetVector
< CTPPSPixelDigi > > 
tokenCTPPSPixelDigi_
 
edm::ESGetToken
< CTPPSPixelGainCalibrations,
CTPPSPixelGainCalibrationsRcd
tokenGainCalib_
 
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 ( 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 }
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd > tokenGainCalib_
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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(), submitPVResolutionJobs::desc, and HLT_FULL_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 }
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::Event::getByToken(), edm::EventSetup::getData(), convertSQLitetoXML_cfg::output, edm::Event::put(), 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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
void run(const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask &mask, const CTPPSPixelGainCalibrations &gainCalibration)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd > tokenGainCalib_
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, edm::DetSetVector< T >::find_or_insert(), 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 }
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
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

RPixDetClusterizer CTPPSPixelClusterProducer::clusterizer_
private

Definition at line 56 of file CTPPSPixelClusterProducer.h.

Referenced by run().

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

Definition at line 52 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

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

Definition at line 51 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

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

Definition at line 53 of file CTPPSPixelClusterProducer.h.

Referenced by produce().

int CTPPSPixelClusterProducer::verbosity_
private

Definition at line 54 of file CTPPSPixelClusterProducer.h.

Referenced by run().