CMS 3D CMS Logo

CTPPSPixelClusterProducer.cc
Go to the documentation of this file.
1 
4 
6  src_ = conf.getParameter<std::string>("label");
7  verbosity_ = conf.getUntrackedParameter<int>("RPixVerbosity");
8 
9  tokenCTPPSPixelDigi_ = consumes<edm::DetSetVector<CTPPSPixelDigi> >(edm::InputTag(src_));
10  tokenCTPPSPixelAnalysisMask_ = esConsumes<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>();
11 
12  produces<edm::DetSetVector<CTPPSPixelCluster> >();
13 }
14 
16 
19  desc.addUntracked<int>("RPixVerbosity", 0);
20  desc.add<std::string>("label", "ctppsPixelDigis");
21  desc.add<int>("SeedADCThreshold", 2);
22  desc.add<int>("ADCThreshold", 2);
23  desc.add<double>("ElectronADCGain", 135.0);
24  desc.add<int>("VCaltoElectronGain", 50);
25  desc.add<int>("VCaltoElectronOffset", -411);
26  desc.add<bool>("doSingleCalibration", false);
27  descriptions.add("ctppsPixelClusters", desc);
28 }
29 
33  iEvent.getByToken(tokenCTPPSPixelDigi_, rpd);
34 
35  // get analysis mask to mask channels
37 
38  if (!rpd->empty())
40 
42 
43  // run clusterisation
44  if (!rpd->empty()) {
45  // get calibration DB
47  run(*rpd, output, aMask.product());
48  }
49  // write output
50  iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelCluster> >(output));
51 }
52 
55  const CTPPSPixelAnalysisMask *mask) {
56  for (const auto &ds_digi : input) {
57  edm::DetSet<CTPPSPixelCluster> &ds_cluster = output.find_or_insert(ds_digi.id);
58  clusterizer_.buildClusters(ds_digi.id, ds_digi.data, ds_cluster.data, theGainCalibrationDB.getCalibs(), mask);
59 
60  if (verbosity_) {
61  unsigned int cluN = 0;
62  for (std::vector<CTPPSPixelCluster>::iterator iit = ds_cluster.data.begin(); iit != ds_cluster.data.end();
63  iit++) {
64  edm::LogInfo("CTPPSPixelClusterProducer") << "Cluster " << ++cluN << " avg row " << (*iit).avg_row()
65  << " avg col " << (*iit).avg_col() << " ADC.size " << (*iit).size();
66  }
67  }
68  }
69 }
70 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector
Definition: DetSetVector.h:61
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
CTPPSPixelClusterProducer::theGainCalibrationDB
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
Definition: CTPPSPixelClusterProducer.h:66
CTPPSPixelClusterProducer::CTPPSPixelClusterProducer
CTPPSPixelClusterProducer(const edm::ParameterSet &param)
Definition: CTPPSPixelClusterProducer.cc:5
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
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::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSPixelClusterProducer::~CTPPSPixelClusterProducer
~CTPPSPixelClusterProducer() override
Definition: CTPPSPixelClusterProducer.cc:15
CTPPSPixelClusterProducer::tokenCTPPSPixelDigi_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenCTPPSPixelDigi_
Definition: CTPPSPixelClusterProducer.h:57
CTPPSPixelGainCalibrationDBService::getCalibs
const CTPPSPixelGainCalibrations * getCalibs() const
Definition: CTPPSPixelGainCalibrationDBService.h:28
CTPPSPixelClusterProducer::src_
edm::InputTag src_
Definition: CTPPSPixelClusterProducer.h:56
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition: CTPPSPixelAnalysisMask.h:34
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSPixelClusterProducer::tokenCTPPSPixelAnalysisMask_
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenCTPPSPixelAnalysisMask_
Definition: CTPPSPixelClusterProducer.h:58
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:53
CTPPSPixelClusterProducer::verbosity_
int verbosity_
Definition: CTPPSPixelClusterProducer.h:54
CTPPSPixelClusterProducer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelClusterProducer
Definition: CTPPSPixelClusterProducer.h:40
edm::ParameterSet
Definition: ParameterSet.h:47
param_
struct @685 param_
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
edm::EventSetup
Definition: EventSetup.h:57
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CTPPSPixelClusterProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CTPPSPixelClusterProducer.cc:30
CTPPSPixelClusterProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CTPPSPixelClusterProducer.cc:17
CTPPSPixelClusterProducer::clusterizer_
RPixDetClusterizer clusterizer_
Definition: CTPPSPixelClusterProducer.h:60
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Event
Definition: Event.h:73