28 DataMixingSiPixelWorker::DataMixingSiPixelWorker() { }
32 label_(ps.getParameter<
std::
string>(
"Label"))
64 LogDebug(
"DataMixingSiPixelWorker")<<
"===============> adding MC signals for "<<e.
id();
72 for (; DSViter!=input->end();DSViter++){
75 LogDebug(
"DataMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
78 uint32_t detID = DSViter->id;
85 for (icopy=begin; icopy!=
end; icopy++) {
100 LogDebug(
"DataMixingSiPixelWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
104 std::shared_ptr<Wrapper<edm::DetSetVector<PixelDigi> >
const> inputPTR =
119 for (; DSViter!=input->
end();DSViter++){
122 LogDebug(
"DataMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
125 uint32_t detID = DSViter->id;
132 SiGlobalIndex::const_iterator itest;
141 for (icopy=begin; icopy!=
end; icopy++) {
152 for (icopy=begin; icopy!=
end; icopy++) {
169 std::vector< edm::DetSet<PixelDigi> > vPixelDigi;
175 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
183 int formerPixel = -1;
188 OneDetectorMap::const_iterator iLocalchk;
190 for(OneDetectorMap::const_iterator iLocal = LocalMap.begin();
191 iLocal != LocalMap.end(); ++iLocal) {
193 currentPixel = iLocal->first;
195 if (currentPixel == formerPixel) {
196 ADCSum+=(iLocal->second).
adc();
200 if (ADCSum > 511) ADCSum = 255;
201 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
206 formerPixel = currentPixel;
207 ADCSum = (iLocal->second).
adc();
211 if((++iLocalchk) == LocalMap.end()) {
212 if (ADCSum > 511) ADCSum = 255;
213 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
220 vPixelDigi.push_back(SPD);
225 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_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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
Container::value_type value_type
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > PixelDigiPToken_
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)