27 DataMixingSiPixelWorker::DataMixingSiPixelWorker() { }
31 label_(ps.getParameter<std::
string>(
"Label"))
59 LogDebug(
"DataMixingSiPixelWorker")<<
"===============> adding MC signals for "<<e.
id();
67 for (; DSViter!=input->end();DSViter++){
70 LogDebug(
"DataMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
73 uint32_t detID = DSViter->id;
80 for (icopy=begin; icopy!=
end; icopy++) {
95 LogDebug(
"DataMixingSiPixelWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
99 boost::shared_ptr<Wrapper<edm::DetSetVector<PixelDigi> >
const> inputPTR =
114 for (; DSViter!=input->
end();DSViter++){
117 LogDebug(
"DataMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
120 uint32_t detID = DSViter->id;
127 SiGlobalIndex::const_iterator itest;
136 for (icopy=begin; icopy!=
end; icopy++) {
147 for (icopy=begin; icopy!=
end; icopy++) {
164 std::vector< edm::DetSet<PixelDigi> > vPixelDigi;
170 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
178 int formerPixel = -1;
183 OneDetectorMap::const_iterator iLocalchk;
185 for(OneDetectorMap::const_iterator iLocal = LocalMap.begin();
186 iLocal != LocalMap.end(); ++iLocal) {
188 currentPixel = iLocal->first;
190 if (currentPixel == formerPixel) {
191 ADCSum+=(iLocal->second).
adc();
195 if (ADCSum > 511) ADCSum = 255;
196 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
201 formerPixel = currentPixel;
202 ADCSum = (iLocal->second).
adc();
206 if((++iLocalchk) == LocalMap.end()) {
207 if (ADCSum > 511) ADCSum = 255;
208 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
215 vPixelDigi.push_back(SPD);
220 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
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.
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_
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)