CMS 3D CMS Logo

CTPPSPixelClusterProducer.cc
Go to the documentation of this file.
1 
4 
6  : tokenCTPPSPixelDigi_(consumes<edm::DetSetVector<CTPPSPixelDigi> >(conf.getParameter<edm::InputTag>("tag"))),
7  tokenCTPPSPixelAnalysisMask_(esConsumes()),
8  tokenGainCalib_(esConsumes()),
9  verbosity_(conf.getUntrackedParameter<int>("RPixVerbosity")),
10  clusterizer_(conf) {
11  produces<edm::DetSetVector<CTPPSPixelCluster> >();
12 }
13 
15 
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 }
28 
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 }
47 
50  const CTPPSPixelAnalysisMask &mask,
51  const CTPPSPixelGainCalibrations &gainCalibration) {
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 }
66 
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
edm
HLT enums.
Definition: AlignableModifier.h:19
CTPPSPixelClusterProducer::CTPPSPixelClusterProducer
CTPPSPixelClusterProducer(const edm::ParameterSet &param)
Definition: CTPPSPixelClusterProducer.cc:5
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
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::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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:54
CTPPSPixelClusterProducer::tokenGainCalib_
edm::ESGetToken< CTPPSPixelGainCalibrations, CTPPSPixelGainCalibrationsRcd > tokenGainCalib_
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:55
CTPPSPixelClusterProducer::verbosity_
int verbosity_
Definition: CTPPSPixelClusterProducer.h:57
CTPPSPixelClusterProducer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CTPPSPixelClusterProducer
Definition: CTPPSPixelClusterProducer.h:41
CTPPSPixelDigi
Definition: CTPPSPixelDigi.h:10
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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:59
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
CTPPSPixelClusterProducer::run
void run(const edm::DetSetVector< CTPPSPixelDigi > &input, edm::DetSetVector< CTPPSPixelCluster > &output, const CTPPSPixelAnalysisMask &mask, const CTPPSPixelGainCalibrations &gainCalibration)
Definition: CTPPSPixelClusterProducer.cc:48
edm::InputTag
Definition: InputTag.h:15