26 DataMixingSiStripWorker::DataMixingSiStripWorker() { }
30 label_(ps.getParameter<std::
string>(
"Label"))
71 for (; DSViter!=input->end();DSViter++){
74 LogDebug(
"DataMixingSiStripWorker") <<
"Processing DetID " << DSViter->id;
78 LocalMap.
reserve((DSViter->data).size());
79 LocalMap.insert(LocalMap.end(),(DSViter->data).
begin(),(DSViter->data).
end());
91 LogDebug(
"DataMixingSiStripWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
95 boost::shared_ptr<Wrapper<edm::DetSetVector<SiStripDigi> >
const> inputPTR =
110 for (; DSViter!=input->
end();DSViter++){
113 LogDebug(
"DataMixingSiStripWorker") <<
"Pileups: Processing DetID " << DSViter->id;
118 SiGlobalIndex::const_iterator itest;
124 LocalMap = itest->second;
135 LocalMap.
reserve((DSViter->data).size());
149 std::vector< edm::DetSet<SiStripDigi> > vSiStripDigi;
155 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
163 int formerStrip = -1;
167 OneDetectorMap::const_iterator iLocalchk;
168 OneDetectorMap::const_iterator iLocal = LocalMap.begin();
169 for(;iLocal != LocalMap.end(); ++iLocal) {
171 currentStrip = iLocal->strip();
173 if (currentStrip == formerStrip) {
174 ADCSum+=iLocal->adc();
178 if (ADCSum > 511) ADCSum = 255;
179 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
184 formerStrip = currentStrip;
185 ADCSum = iLocal->adc();
189 if((++iLocalchk) == LocalMap.end()) {
190 if (ADCSum > 511) ADCSum = 255;
191 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
197 vSiStripDigi.push_back(SSD);
202 LogInfo(
"DataMixingSiStripWorker") <<
"total # Merged strips: " << vSiStripDigi.size() ;
T getParameter(std::string const &) const
void push_back(const T &t)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
iterator end()
Return the off-the-end iterator.
void addSiStripPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *)
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > SiStripDigiToken_
virtual ~DataMixingSiStripWorker()
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > SiStripDigiPToken_
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)