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 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< 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(), src_, AlCaHLTBitMon_QueryRunRegistry::string, tokenCTPPSPixelDigi_, and verbosity_.

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

Definition at line 17 of file CTPPSPixelClusterProducer.cc.

17  {
18 
19 }

Member Function Documentation

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

Definition at line 21 of file CTPPSPixelClusterProducer.cc.

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

21  {
23  desc.addUntracked<int>("RPixVerbosity",0);
24  desc.add<std::string>("label", "ctppsPixelDigis");
25  desc.add<int>("SeedADCThreshold",2);
26  desc.add<int>("ADCThreshold",2);
27  desc.add<double>("ElectronADCGain",135.0);
28  desc.add<int>("VCaltoElectronGain",50);
29  desc.add<int>("VCaltoElectronOffset",-411);
30  desc.add<bool>("doSingleCalibration",false);
31  descriptions.add("ctppsPixelClusters", desc);
32 }
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 34 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_.

34  {
35 
38  iEvent.getByToken(tokenCTPPSPixelDigi_, rpd);
39 
40 // get analysis mask to mask channels
42 
43  if(!rpd->empty())
44  iSetup.get<CTPPSPixelAnalysisMaskRcd>().get(aMask);
45 
47 
48 // run clusterisation
49  if (!rpd->empty()){
50 // get calibration DB
51  theGainCalibrationDB.getDB(iEvent,iSetup);
52  run(*rpd, output, aMask.product());
53  }
54 // write output
55  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelCluster> >(output));
56 
57 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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:71
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 59 of file CTPPSPixelClusterProducer.cc.

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

Referenced by produce().

60  {
61 
62  for (const auto &ds_digi : input)
63  {
64  edm::DetSet<CTPPSPixelCluster> &ds_cluster = output.find_or_insert(ds_digi.id);
65  clusterizer_.buildClusters(ds_digi.id, ds_digi.data, ds_cluster.data, theGainCalibrationDB.getCalibs(), mask);
66 
67  if(verbosity_){
68  unsigned int cluN=0;
69  for(std::vector<CTPPSPixelCluster>::iterator iit = ds_cluster.data.begin(); iit != ds_cluster.data.end(); iit++){
70  edm::LogInfo("CTPPSPixelClusterProducer") << "Cluster " << ++cluN <<" avg row "
71  << (*iit).avg_row()<< " avg col " << (*iit).avg_col()<<" ADC.size " << (*iit).size();
72  }
73  }
74  }
75 }
const CTPPSPixelGainCalibrations * getCalibs() const
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:254
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
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::ParameterSet CTPPSPixelClusterProducer::param_
private

Definition at line 50 of file CTPPSPixelClusterProducer.h.

edm::InputTag CTPPSPixelClusterProducer::src_
private

Definition at line 53 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer().

CTPPSPixelGainCalibrationDBService CTPPSPixelClusterProducer::theGainCalibrationDB
private

Definition at line 60 of file CTPPSPixelClusterProducer.h.

Referenced by produce(), and run().

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

Definition at line 54 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and produce().

int CTPPSPixelClusterProducer::verbosity_
private

Definition at line 51 of file CTPPSPixelClusterProducer.h.

Referenced by CTPPSPixelClusterProducer(), and run().