|
|
Go to the documentation of this file.
30 #include "CLHEP/Random/RandFlat.h"
69 typedef std::multimap<int, PixelDigi>
115 LogDebug(
"PreMixingSiPixelWorker") <<
"===============> adding MC signals for " <<
e.id();
122 for (; DSViter !=
input->end(); DSViter++) {
124 LogDebug(
"PreMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
127 uint32_t detID = DSViter->id;
134 for (icopy = begin; icopy !=
end; icopy++) {
144 LogDebug(
"PreMixingSiPixelWorker") <<
"\n===============> adding pileups from event " << pep.
principal().
id()
153 const auto&
input = *inputHandle;
157 for (; DSViter !=
input.end(); DSViter++) {
159 LogDebug(
"PreMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
162 uint32_t detID = DSViter->id;
169 SiGlobalIndex::const_iterator itest;
178 for (icopy = begin; icopy !=
end; icopy++) {
188 for (icopy = begin; icopy !=
end; icopy++) {
200 std::vector<PileupSummaryInfo>
const& ps,
204 std::vector<edm::DetSet<PixelDigi>> vPixelDigi;
212 uint32_t detID = IDet->first;
220 int formerPixel = -1;
224 OneDetectorMap::const_iterator iLocalchk;
226 for (OneDetectorMap::const_iterator iLocal = LocalMap.begin(); iLocal != LocalMap.end(); ++iLocal) {
227 currentPixel = iLocal->first;
229 if (currentPixel == formerPixel) {
230 ADCSum += (iLocal->second).
adc();
232 if (formerPixel != -1) {
235 else if (ADCSum > 253 && ADCSum < 512)
238 Signals.insert(std::make_pair(formerPixel, ADCSum));
241 formerPixel = currentPixel;
242 ADCSum = (iLocal->second).
adc();
246 if ((++iLocalchk) == LocalMap.end()) {
249 else if (ADCSum > 253 && ADCSum < 512)
251 Signals.insert(std::make_pair(formerPixel, ADCSum));
257 signal.insert(std::make_pair(detID, Signals));
262 edm::LogInfo(
"PreMixingSiPixelWorker") <<
"total # Merged Pixels: " << signal.size();
264 std::vector<edm::DetSet<PixelDigi>> theDigiVector;
276 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
283 if (PixelFEDChannelCollection_ ==
nullptr) {
284 throw cms::Exception(
"NullPointerError") <<
"PixelFEDChannelCollection not set in chooseScenario function.\n";
289 for (
const auto& iu : pDD.detUnits()) {
290 if (iu->type().isTrackerPixel()) {
293 iu->geographicalId().rawId());
295 digitizer_.
digitize(dynamic_cast<const PixelGeomDetUnit*>(iu), collector.data, linkcollector.data, tTopo, engine);
296 if (!collector.data.empty()) {
297 theDigiVector.push_back(
std::move(collector));
SiPixelDigitizerAlgorithm digitizer_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
static const std::string input
PreMixingSiPixelWorker(const edm::ParameterSet &ps, edm::ProducesCollector, edm::ConsumesCollector &&iC)
bool killBadFEDChannels() const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
~PreMixingSiPixelWorker() override=default
int bunchCrossing() const
std::map< uint32_t, signal_map_type > signalMaps
Log< level::Info, false > LogInfo
EventID const & id() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
void addSignals(edm::Event const &e, edm::EventSetup const &es) override
void init(const edm::EventSetup &es)
void init_DynIneffDB(const edm::EventSetup &)
edm::InputTag pixeldigi_collectionSig_
edm::EventPrincipal const & principal()
std::unique_ptr< PixelFEDChannelCollection > chooseScenario(PileupMixingContent *puInfo, CLHEP::HepRandomEngine *)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void addPileups(PileUpEventPrincipal const &, edm::EventSetup const &es) override
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
void calculateInstlumiFactor(PileupMixingContent *puInfo)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiPToken_
bool firstInitializeEvent_
collection_type::const_iterator const_iterator
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Container::value_type value_type
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiToken_
std::map< int, Amplitude, std::less< int > > signal_map_type
bool getData(T &iHolder) const
SiGlobalIndex SiHitStorage_
#define DEFINE_PREMIXING_WORKER(TYPE)
edm::InputTag pixeldigi_collectionPile_
std::map< uint32_t, OneDetectorMap > SiGlobalIndex
void put(edm::Event &e, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bs) override
std::multimap< int, PixelDigi > OneDetectorMap
T getParameter(std::string const &) const
std::string PixelDigiCollectionDM_
void setSimAccumulator(const std::map< uint32_t, std::map< int, int > > &signalMap)
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
void digitize(const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
collection_type::const_iterator const_iterator