27 DataMixingSiStripWorker::DataMixingSiStripWorker() { }
31 label_(ps.getParameter<std::
string>(
"Label"))
72 for (; DSViter!=input->end();DSViter++){
75 LogDebug(
"DataMixingSiStripWorker") <<
"Processing DetID " << DSViter->id;
79 LocalMap.
reserve((DSViter->data).size());
80 LocalMap.insert(LocalMap.end(),(DSViter->data).
begin(),(DSViter->data).
end());
92 LogDebug(
"DataMixingSiStripWorker") <<
"\n===============> adding pileups from event "<<ep->
id()<<
" for bunchcrossing "<<bcr;
96 std::shared_ptr<Wrapper<edm::DetSetVector<SiStripDigi> >
const> inputPTR =
111 for (; DSViter!=input->
end();DSViter++){
114 LogDebug(
"DataMixingSiStripWorker") <<
"Pileups: Processing DetID " << DSViter->id;
119 SiGlobalIndex::const_iterator itest;
125 LocalMap = itest->second;
136 LocalMap.
reserve((DSViter->data).size());
150 std::vector< edm::DetSet<SiStripDigi> > vSiStripDigi;
156 for(SiGlobalIndex::const_iterator IDet =
SiHitStorage_.begin();
164 int formerStrip = -1;
168 OneDetectorMap::const_iterator iLocalchk;
169 OneDetectorMap::const_iterator iLocal = LocalMap.begin();
170 for(;iLocal != LocalMap.end(); ++iLocal) {
172 currentStrip = iLocal->strip();
174 if (currentStrip == formerStrip) {
175 ADCSum+=iLocal->adc();
179 if (ADCSum > 511) ADCSum = 255;
180 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
185 formerStrip = currentStrip;
186 ADCSum = iLocal->adc();
190 if((++iLocalchk) == LocalMap.end()) {
191 if (ADCSum > 511) ADCSum = 255;
192 else if (ADCSum > 253 && ADCSum < 512) ADCSum = 254;
198 vSiStripDigi.push_back(SSD);
203 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)