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 
11  produces<edm::DetSetVector<CTPPSPixelCluster> >();
12 }
13 
15 
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 }
28 
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 }
51 
54  const CTPPSPixelAnalysisMask *mask) {
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 }
69 
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
MessageLogger.h
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
CTPPSPixelClusterProducer::theGainCalibrationDB
CTPPSPixelGainCalibrationDBService theGainCalibrationDB
Definition: CTPPSPixelClusterProducer.h:64
CTPPSPixelClusterProducer::CTPPSPixelClusterProducer
CTPPSPixelClusterProducer(const edm::ParameterSet &param)
Definition: CTPPSPixelClusterProducer.cc:5
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::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
param_
struct @684 param_
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSPixelClusterProducer::~CTPPSPixelClusterProducer
~CTPPSPixelClusterProducer() override
Definition: CTPPSPixelClusterProducer.cc:14
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
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition: CTPPSPixelAnalysisMask.h:34
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
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
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
CTPPSPixelClusterProducer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelAnalysisMaskRcd
Definition: CTPPSPixelAnalysisMaskRcd.h:23
CTPPSPixelClusterProducer
Definition: CTPPSPixelClusterProducer.h:39
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
edm::ParameterSet
Definition: ParameterSet.h:36
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CTPPSPixelClusterProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CTPPSPixelClusterProducer.cc:29
CTPPSPixelClusterProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CTPPSPixelClusterProducer.cc:16
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
edm::Event
Definition: Event.h:73