68 hitsProducer_(iConfig.getParameter<
std::
string>(
"hitsProducer")),
69 trackerContainers_(iConfig.getParameter<
std::vector<
std::
string> >(
"ROUList")),
70 geometryType_(iConfig.getParameter<
std::
string>(
"GeometryType")),
71 isOuterTrackerReadoutAnalog_(iConfig.getParameter<
bool>(
"isOTreadoutAnalog")),
72 premixStage1_(iConfig.getParameter<
bool>(
"premixStage1")),
74 iConfig.getParameter<
edm::
ParameterSet>(
"AlgorithmCommon").getUntrackedParameter<
bool>(
"makeDigiSimLinks")) {
111 uint32_t rawId = det_u->geographicalId().rawId();
123 size_t globalSimHitIndex,
124 const uint32_t tofBin) {
125 if (hSimHits.isValid()) {
126 std::set<uint32_t> detIds;
127 auto const&
simHits = *(hSimHits.product());
129 uint32_t detId_raw = (*it).detUnitId();
134 if (detIds.insert(detId_raw).second) {
145 kiter->second->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, phase2det, bfield);
147 edm::LogInfo(
"Phase2TrackerDigitizer") <<
"Unsupported algorithm: ";
157 <<
"Phase2TrackerDigitizer requires the RandomNumberGeneratorService\n"
158 "which is not present in the configuration file. You must add the service\n"
159 "in the configuration file or remove the modules that require it.";
165 el.second->init(iSetup);
167 el.second->initializeEvent(rng->
getEngine(
e.streamID()));
177 accumulate_local<edm::Event>(
iEvent, iSetup);
183 accumulate_local<PileUpEventPrincipal>(
iEvent, iSetup);
197 if (
v.find(
std::string(
"HighTof")) != std::string::npos)
214 algo.loadAccumulator(detMap.first, detMap.second);
223 addOuterTrackerCollection<PixelDigi>(
iEvent, iSetup);
225 addOuterTrackerCollection<Phase2TrackerDigi>(
iEvent, iSetup);
269 edm::LogError(
"Phase2TrackerDigitizer") <<
"ERROR - Wrong Detector Type, No Algorithm available ";
276 const bool ot_analog) {
279 std::vector<edm::DetSet<PixelDigi> > digiVector;
280 std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
282 uint32_t rawId = det_u->geographicalId().rawId();
284 auto fiter =
algomap_.find(algotype);
292 std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
293 fiter->second->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo);
297 for (
auto const& digi_p : digi_map) {
300 collector.
data.emplace_back(ip.first, ip.second,
info.sig_tot);
301 for (
auto const& sim_p :
info.simInfoList) {
302 linkcollector.
data.emplace_back(digi_p.first,
303 sim_p.second->trackId(),
304 sim_p.second->hitIndex(),
305 sim_p.second->tofBin(),
306 sim_p.second->eventId(),
310 if (!collector.
data.empty())
311 digiVector.push_back(
std::move(collector));
312 if (!linkcollector.
data.empty())
313 digiLinkVector.push_back(
std::move(linkcollector));
317 auto output = std::make_unique<edm::DetSetVector<PixelDigi> >(digiVector);
318 auto outputlink = std::make_unique<edm::DetSetVector<PixelDigiSimLink> >(digiLinkVector);
333 collector.
data.emplace_back(ip.first, ip.second,
info.sig_tot);
339 collector.
data.emplace_back(ip.first, ip.second,
info.ot_bit);
343 template <
typename DigiType>
347 std::vector<edm::DetSet<DigiType> > digiVector;
348 std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
350 uint32_t rawId = det_u->geographicalId().rawId();
353 auto fiter =
algomap_.find(algotype);
357 std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
358 fiter->second->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo);
362 for (
auto const& digi_p : digi_map) {
364 addToCollector(collector, digi_p.first,
info);
365 for (
auto const& sim_p :
info.simInfoList) {
366 linkcollector.
data.emplace_back(digi_p.first,
367 sim_p.second->trackId(),
368 sim_p.second->hitIndex(),
369 sim_p.second->tofBin(),
370 sim_p.second->eventId(),
375 if (!collector.
data.empty())
376 digiVector.push_back(
std::move(collector));
377 if (!linkcollector.
data.empty())
378 digiLinkVector.push_back(
std::move(linkcollector));
382 auto output = std::make_unique<edm::DetSetVector<DigiType> >(digiVector);
383 auto outputlink = std::make_unique<edm::DetSetVector<PixelDigiSimLink> >(digiLinkVector);