1 #ifndef SimPPS_PPSPixelDigiProducer_PPSPixelDigiProducer_h
2 #define SimPPS_PPSPixelDigiProducer_PPSPixelDigiProducer_h
73 #include "CLHEP/Random/RandomEngine.h"
76 class HepRandomEngine;
90 typedef std::map<unsigned int, std::vector<PSimHit>>
simhit_map;
95 std::map<uint32_t, std::unique_ptr<RPixDetDigitizer>>
theAlgoMap;
107 produces<edm::DetSetVector<CTPPSPixelDigi>>();
123 desc.add<std::vector<std::string>>(
"ROUList", {
"CTPPSPixelHits"});
124 desc.add<
int>(
"RPixVerbosity", 0);
125 desc.add<
bool>(
"CTPPSPixelDigiSimHitRelationsPersistence",
129 desc.add<
double>(
"RPixEquivalentNoiseCharge", 1000.0);
130 desc.add<
bool>(
"RPixNoNoise",
false);
133 desc.add<
double>(
"RPixGeVPerElectron", 3.61e-09);
134 desc.add<std::vector<double>>(
"RPixInterSmearing", {0.011});
135 desc.add<
bool>(
"RPixLandauFluctuations",
true);
136 desc.add<
int>(
"RPixChargeDivisions", 20);
137 desc.add<
double>(
"RPixDeltaProductionCut", 0.120425);
140 desc.add<
std::string>(
"ChargeMapFile2E",
"SimPPS/PPSPixelDigiProducer/data/PixelChargeMap.txt");
141 desc.add<
std::string>(
"ChargeMapFile2E_2X",
"SimPPS/PPSPixelDigiProducer/data/PixelChargeMap_2X.txt");
142 desc.add<
std::string>(
"ChargeMapFile2E_2Y",
"SimPPS/PPSPixelDigiProducer/data/PixelChargeMap_2Y.txt");
143 desc.add<
std::string>(
"ChargeMapFile2E_2X2Y",
"SimPPS/PPSPixelDigiProducer/data/PixelChargeMap_2X2Y.txt");
149 desc.add<
double>(
"RPixDummyROCThreshold", 1900.0);
150 desc.add<
double>(
"RPixDummyROCElectronPerADC", 135.0);
151 desc.add<
int>(
"VCaltoElectronGain", 50);
152 desc.add<
int>(
"VCaltoElectronOffset", -411);
153 desc.add<
bool>(
"doSingleCalibration",
false);
154 desc.add<
double>(
"RPixDeadPixelProbability", 0.001);
155 desc.add<
bool>(
"RPixDeadPixelSimulationOn",
true);
159 descriptions.
add(
"RPixDetDigitizer",
desc);
171 <<
"This class requires the RandomNumberGeneratorService\n"
172 "which is not present in the configuration file. You must add the service\n"
173 "in the configuration file or remove the modules that require it.";
188 edm::LogInfo(
"PPS") <<
"PixelDigiProducer \n\n=================== Starting SimHit access"
189 <<
" ===================";
194 for (cfi =
col.begin(); cfi !=
col.end(); cfi++) {
196 <<
" Hit " <<
count <<
" has tof " << cfi->timeOfFlight() <<
" trackid " << cfi->trackId()
198 <<
", from EncodedEventId: " << cfi->eventId().bunchCrossing() <<
" "
199 << cfi->eventId().event() <<
" bcr from MixCol " << cfi.
bunch();
200 edm::LogInfo(
"PPS") <<
" PixelDigiProducer Hit: " << (*cfi) <<
" " << cfi->exitPoint();
208 edm::LogInfo(
"PPS") <<
"PixelDigiProducer Input MixCollection size = " << allRPixHits.size();
215 for (isim = allRPixHits.begin(); isim != allRPixHits.end(); ++isim) {
216 SimHitMap[(*isim).detUnitId()].push_back((*isim));
220 std::vector<edm::DetSet<CTPPSPixelDigi>> theDigiVector;
221 theDigiVector.reserve(400);
222 theDigiVector.clear();
228 theAlgoMap[it->first] = std::make_unique<RPixDetDigitizer>(
232 std::vector<int> input_links;
233 std::vector<std::vector<std::pair<int, double>>> output_digi_links;
236 SimHitMap[it->first], input_links, digi_collector.
data, output_digi_links, &gainCalibration, &thePixelTopology);
238 if (!digi_collector.
data.empty()) {
239 theDigiVector.push_back(digi_collector);
246 edm::LogInfo(
"PPS") <<
"PixelDigiProducer digi_output->size()=" << digi_output->size();