27 DataMixingSiPixelWorker::DataMixingSiPixelWorker() { }
31 label_(ps.getParameter<std::
string>(
"Label"))
63 LogDebug(
"DataMixingSiPixelWorker")<<
"===============> adding MC signals for "<<e.
id();
71 for (; DSViter!=input->end();DSViter++){
74 LogDebug(
"DataMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
77 uint32_t detID = DSViter->id;
84 for (icopy=begin; icopy!=
end; icopy++) {
99 LogDebug(
"DataMixingSiPixelWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
103 boost::shared_ptr<Wrapper<edm::DetSetVector<PixelDigi> >
const> inputPTR =
118 for (; DSViter!=input->
end();DSViter++){
121 LogDebug(
"DataMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
124 uint32_t detID = DSViter->id;
131 SiGlobalIndex::const_iterator itest;
140 for (icopy=begin; icopy!=
end; icopy++) {
151 for (icopy=begin; icopy!=
end; icopy++) {
168 std::vector< edm::DetSet<PixelDigi> > vPixelDigi;
174 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
182 int formerPixel = -1;
187 OneDetectorMap::const_iterator iLocalchk;
189 for(OneDetectorMap::const_iterator iLocal = LocalMap.begin();
190 iLocal != LocalMap.end(); ++iLocal) {
192 currentPixel = iLocal->first;
194 if (currentPixel == formerPixel) {
195 ADCSum+=(iLocal->second).
adc();
199 if (ADCSum > 511) ADCSum = 255;
200 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
205 formerPixel = currentPixel;
206 ADCSum = (iLocal->second).
adc();
210 if((++iLocalchk) == LocalMap.end()) {
211 if (ADCSum > 511) ADCSum = 255;
212 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
219 vPixelDigi.push_back(SPD);
224 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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag pixeldigi_collectionPile_
std::string PixelDigiCollectionDM_
EventID const & id() const
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiToken_
void addSiPixelPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
static std::string const input
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiPToken_
Container::value_type value_type
iterator end()
Return the off-the-end iterator.
void putSiPixel(edm::Event &e)
SiGlobalIndex SiHitStorage_
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)