29 subtract_(
const uint32_t& detId,
const uint16_t& firstAPV, std::vector<T>& digis){
34 typename std::vector<T>::iterator fs,
ls;
36 std::vector< std::pair<float,float> > subset;
41 uint16_t
APV=firstAPV;
42 for( ; APV< digis.size()/128+firstAPV; ++
APV)
46 for (uint16_t istrip=APV*128; istrip<(APV+1)*128; ++istrip)
50 std::pair<float,float> pin((
float)digis[istrip-firstAPV*128], (
float)
noiseHandle->getNoiseFast(istrip,detNoiseRange));
51 subset.push_back( pin );
56 if (subset.size() != 0)
63 std::vector< std::pair<float,float> >::iterator si = subset.begin();
64 while( si != subset.end() )
67 si = subset.erase(si);
71 if ( subset.size() == 0 )
break;
75 _vmedians.push_back(std::pair<short,float>(APV,offset));
78 fs = digis.begin()+(APV-firstAPV)*128;
79 ls = digis.begin()+(APV-firstAPV+1)*128;
81 *fs =
static_cast<T>(*fs-
offset);
91 std::vector<std::pair<float,float> >::iterator mid =
sample.begin() +
sample.size()/2;
95 return ( (*std::max_element(
sample.begin(), mid)).first + (*mid).first ) / 2.;
unsigned int offset(bool)
std::vector< std::pair< short, float > > _vmedians
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< ContainerIterator, ContainerIterator > Range