27 DataMixingSiPixelWorker::DataMixingSiPixelWorker() { sel_=0;}
31 label_(ps.getParameter<std::string>(
"Label"))
69 LogDebug(
"DataMixingSiPixelWorker")<<
"===============> adding MC signals for "<<e.
id();
77 for (; DSViter!=input->end();DSViter++){
80 LogDebug(
"DataMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
83 uint32_t detID = DSViter->id;
90 for (icopy=begin; icopy!=
end; icopy++) {
104 LogDebug(
"DataMixingSiPixelWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
108 boost::shared_ptr<Wrapper<edm::DetSetVector<PixelDigi> >
const> inputPTR =
123 for (; DSViter!=input->
end();DSViter++){
126 LogDebug(
"DataMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
129 uint32_t detID = DSViter->id;
136 SiGlobalIndex::const_iterator itest;
145 for (icopy=begin; icopy!=
end; icopy++) {
156 for (icopy=begin; icopy!=
end; icopy++) {
173 std::vector< edm::DetSet<PixelDigi> > vPixelDigi;
179 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
187 int formerPixel = -1;
192 OneDetectorMap::const_iterator iLocalchk;
194 for(OneDetectorMap::const_iterator iLocal = LocalMap.begin();
195 iLocal != LocalMap.end(); ++iLocal) {
197 currentPixel = iLocal->first;
199 if (currentPixel == formerPixel) {
200 ADCSum+=(iLocal->second).
adc();
204 if (ADCSum > 511) ADCSum = 255;
205 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
210 formerPixel = currentPixel;
211 ADCSum = (iLocal->second).
adc();
215 if((++iLocalchk) == LocalMap.end()) {
216 if (ADCSum > 511) ADCSum = 255;
217 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
224 vPixelDigi.push_back(SPD);
229 LogInfo(
"DataMixingSiPixelWorker") <<
"total # Merged Pixels: " << vPixelDigi.size() ;
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
edm::InputTag pixeldigi_collectionSig_
void push_back(const T &t)
edm::InputTag pixeldigi_collectionPile_
std::string PixelDigiCollectionDM_
EventID const & id() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
void putSiPixel(edm::Event &e)
SiGlobalIndex SiHitStorage_
void addSiPixelPileups(const int bcr, edm::EventPrincipal *, unsigned int EventId)
std::multimap< int, PixelDigi > OneDetectorMap
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
virtual ~DataMixingSiPixelWorker()
void addSiPixelSignals(const edm::Event &e)