31 #include "CLHEP/Random/RandFlat.h" 117 LogDebug(
"PreMixingSiPixelWorker")<<
"===============> adding MC signals for "<<e.
id();
125 for (; DSViter!=input->end();DSViter++){
128 LogDebug(
"PreMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
131 uint32_t detID = DSViter->id;
138 for (icopy=begin; icopy!=
end; icopy++) {
160 const auto&
input = *inputHandle;
164 for (; DSViter!=
input.end();DSViter++){
167 LogDebug(
"PreMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
170 uint32_t detID = DSViter->id;
177 SiGlobalIndex::const_iterator itest;
186 for (icopy=begin; icopy!=
end; icopy++) {
197 for (icopy=begin; icopy!=
end; icopy++) {
214 std::vector< edm::DetSet<PixelDigi> > vPixelDigi;
221 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
224 uint32_t detID = IDet->first;
232 int formerPixel = -1;
237 OneDetectorMap::const_iterator iLocalchk;
239 for(OneDetectorMap::const_iterator iLocal = LocalMap.begin();
240 iLocal != LocalMap.end(); ++iLocal) {
242 currentPixel = iLocal->first;
244 if (currentPixel == formerPixel) {
245 ADCSum+=(iLocal->second).
adc();
249 if (ADCSum > 511) ADCSum = 255;
250 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
252 Signals.insert( std::make_pair(formerPixel, ADCSum));
255 formerPixel = currentPixel;
256 ADCSum = (iLocal->second).
adc();
260 if((++iLocalchk) == LocalMap.end()) {
261 if (ADCSum > 511) ADCSum = 255;
262 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
263 Signals.insert( std::make_pair(formerPixel, ADCSum));
269 signal.insert( std::make_pair( detID, Signals));
274 edm::LogInfo(
"PreMixingSiPixelWorker") <<
"total # Merged Pixels: " << signal.size() ;
277 std::vector<edm::DetSet<PixelDigi> > theDigiVector;
296 if(iu->type().isTrackerPixel()) {
305 if(!collector.data.empty()) {
306 theDigiVector.push_back(
std::move(collector));
int adc(sample_type sample)
get the ADC sample (12 bits)
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
void init(const edm::EventSetup &es)
int bunchCrossing() const
const std::string geometryType_
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void init_DynIneffDB(const edm::EventSetup &, const unsigned int &)
void put(edm::Event &e, edm::EventSetup const &iSetup, std::vector< PileupSummaryInfo > const &ps, int bs) override
std::multimap< int, PixelDigi > OneDetectorMap
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiPToken_
void addPileups(PileUpEventPrincipal const &, edm::EventSetup const &es) override
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag pixeldigi_collectionSig_
edm::InputTag pixeldigi_collectionPile_
EventID const & id() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
bool firstInitializeEvent_
static std::string const input
edm::EventPrincipal const & principal()
Container::value_type value_type
~PreMixingSiPixelWorker() override=default
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiToken_
SiPixelDigitizerAlgorithm digitizer_
void digitize(const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
std::string PixelDigiCollectionDM_
void addSignals(edm::Event const &e, edm::EventSetup const &es) override
void setSimAccumulator(const std::map< uint32_t, std::map< int, int > > &signalMap)
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
void calculateInstlumiFactor(PileupMixingContent *puInfo)
std::map< uint32_t, signal_map_type > signalMaps
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
edm::ESHandle< TrackerGeometry > pDD
StreamID streamID() const
std::map< int, Amplitude, std::less< int > > signal_map_type
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
#define DEFINE_PREMIXING_WORKER(TYPE)
T const * product() const
SiGlobalIndex SiHitStorage_
PreMixingSiPixelWorker(const edm::ParameterSet &ps, edm::ProducerBase &producer, edm::ConsumesCollector &&iC)
std::map< uint32_t, OneDetectorMap > SiGlobalIndex