21 DataMixingSiPixelWorker::DataMixingSiPixelWorker() {}
25 : label_(ps.getParameter<
std::
string>(
"Label"))
51 LogDebug(
"DataMixingSiPixelWorker") <<
"===============> adding MC signals for " << e.
id();
58 for (; DSViter != input->end(); DSViter++) {
60 LogDebug(
"DataMixingSiPixelWorker") <<
"Processing DetID " << DSViter->id;
63 uint32_t detID = DSViter->id;
70 for (icopy = begin; icopy !=
end; icopy++) {
83 LogDebug(
"DataMixingSiPixelWorker") <<
"\n===============> adding pileups from event " << ep->
id()
84 <<
" for bunchcrossing " << bcr;
89 std::shared_ptr<Wrapper<edm::DetSetVector<PixelDigi>>
const> inputPTR =
101 for (; DSViter != input->
end(); DSViter++) {
103 LogDebug(
"DataMixingSiPixelWorker") <<
"Pileups: Processing DetID " << DSViter->id;
106 uint32_t detID = DSViter->id;
113 SiGlobalIndex::const_iterator itest;
122 for (icopy = begin; icopy !=
end; icopy++) {
133 for (icopy = begin; icopy !=
end; icopy++) {
146 std::vector<edm::DetSet<PixelDigi>> vPixelDigi;
159 int formerPixel = -1;
163 OneDetectorMap::const_iterator iLocalchk;
165 for (OneDetectorMap::const_iterator iLocal = LocalMap.begin(); iLocal != LocalMap.end(); ++iLocal) {
166 currentPixel = iLocal->first;
168 if (currentPixel == formerPixel) {
169 ADCSum += (iLocal->second).
adc();
171 if (formerPixel != -1) {
174 else if (ADCSum > 253 && ADCSum < 512)
180 formerPixel = currentPixel;
181 ADCSum = (iLocal->second).
adc();
185 if ((++iLocalchk) == LocalMap.end()) {
188 else if (ADCSum > 253 && ADCSum < 512)
196 vPixelDigi.push_back(SPD);
201 LogInfo(
"DataMixingSiPixelWorker") <<
"total # Merged Pixels: " << vPixelDigi.size();
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_
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
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)