26 DataMixingSiStripWorker::DataMixingSiStripWorker() { }
30 label_(ps.getParameter<std::
string>(
"Label"))
66 for (; DSViter!=input->end();DSViter++){
69 LogDebug(
"DataMixingSiStripWorker") <<
"Processing DetID " << DSViter->id;
73 LocalMap.reserve((DSViter->data).size());
74 LocalMap.
insert(LocalMap.end(),(DSViter->data).
begin(),(DSViter->data).
end());
86 LogDebug(
"DataMixingSiStripWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
90 boost::shared_ptr<Wrapper<edm::DetSetVector<SiStripDigi> >
const> inputPTR =
105 for (; DSViter!=input->
end();DSViter++){
108 LogDebug(
"DataMixingSiStripWorker") <<
"Pileups: Processing DetID " << DSViter->id;
113 SiGlobalIndex::const_iterator itest;
119 LocalMap = itest->second;
130 LocalMap.reserve((DSViter->data).size());
144 std::vector< edm::DetSet<SiStripDigi> > vSiStripDigi;
150 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
158 int formerStrip = -1;
162 OneDetectorMap::const_iterator iLocalchk;
163 OneDetectorMap::const_iterator iLocal = LocalMap.begin();
164 for(;iLocal != LocalMap.end(); ++iLocal) {
166 currentStrip = iLocal->strip();
168 if (currentStrip == formerStrip) {
169 ADCSum+=iLocal->adc();
173 if (ADCSum > 511) ADCSum = 255;
174 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
179 formerStrip = currentStrip;
180 ADCSum = iLocal->adc();
184 if((++iLocalchk) == LocalMap.end()) {
185 if (ADCSum > 511) ADCSum = 255;
186 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
192 vSiStripDigi.push_back(SSD);
197 LogInfo(
"DataMixingSiStripWorker") <<
"total # Merged strips: " << vSiStripDigi.size() ;
T getParameter(std::string const &) const
void push_back(const T &t)
EventID const & id() const
std::vector< SiStripDigi > OneDetectorMap
edm::InputTag SiStripPileInputTag_
static std::string const input
edm::InputTag SistripLabelSig_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
void addSiStripPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
virtual ~DataMixingSiStripWorker()
SiGlobalIndex SiHitStorage_
void insert(detset const &s)
Insert the given DetSet.
void addSiStripSignals(const edm::Event &e)
std::string SiStripDigiCollectionDM_
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
void putSiStrip(edm::Event &e)