51 typedef std::map<uint32_t, std::vector<float> >
CMMap;
61 virtual void endJob()
override ;
81 _inputTag(conf.getParameter<edm::InputTag> (
"CMCollection")),
82 _Algorithm(conf.getParameter<std::
string>(
"Algorithm")),
83 _nEventsToUse(conf.getParameter<uint32_t>(
"NEvents"))
88 produces< edm::DetSetVector<SiStripProcessedRawDigi> > (
"MEANAPVCM");
116 std::vector<edm::DetSet<SiStripProcessedRawDigi> > meancm;
140 iEvent.
put( outputMeanCM,
"MEANAPVCM");
146 meancm.reserve(15000);
149 rawDigis = input.
begin(); rawDigis != input.
end(); rawDigis++) {
153 for(uint16_t
APV = 0;
APV < rawDigis->size()/128; ++
APV){
155 for(uint16_t strip =
APV*128; strip< (
APV+1)*128; ++strip){
156 uint16_t ped = (uint16_t)
pedestalHandle_->getPed(strip,detPedestalRange);
157 if(ped < MinPed) MinPed = ped;
159 if(MinPed>128) MinPed=128;
163 meancm.push_back(MeanCMDetSet);
170 CMMap::iterator itMap;
173 for(itInput = Input.
begin(); itInput != Input.
end(); ++itInput){
175 itMap =
_CMMap.find(detId);
177 std::vector<float> MeanCMNValue;
178 MeanCMNValue.clear();
180 std::vector< float >& MapContent = itMap->second;
181 std::vector<float>::iterator itMapVector = MapContent.begin();
182 for(itCM = itInput->
begin(); itCM != itInput->
end(); ++itCM, ++itMapVector){
183 MeanCMNValue.push_back(itCM->adc() + *itMapVector);
186 _CMMap.insert(itMap, std::pair<uint32_t, std::vector<float> >(detId,MeanCMNValue));
188 for(itCM = itInput->
begin(); itCM != itInput->
end(); ++itCM) MeanCMNValue.push_back(itCM->adc());
189 _CMMap.insert(std::pair<uint32_t, std::vector<float> >(detId,MeanCMNValue));
197 CMMap::iterator itMap;
198 std::vector<float>::const_iterator itMapVector;
201 meancm.reserve(15000);
203 for(itMap =
_CMMap.begin(); itMap !=
_CMMap.end(); ++itMap){
205 for(itMapVector = (itMap->second).begin(); itMapVector != (itMap->second).
end(); ++itMapVector) MeanCMDetSet.
push_back(*itMapVector/(
float)
_actualEvent);
206 meancm.push_back(MeanCMDetSet);
void push_back(const T &t)
#define DEFINE_FWK_MODULE(type)
std::pair< ContainerIterator, ContainerIterator > Range
static std::string const input
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
std::map< uint32_t, std::vector< float > > CMMap
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator