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 );
63 std::vector< std::pair<float,float> >::iterator si = subset.begin();
64 while( si != subset.end() )
67 si = subset.erase(si);
71 if ( subset.empty() )
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.;
bool IsStripBad(const uint32_t &detid, const short &strip) const
static float getNoiseFast(const uint16_t &strip, const Range &range)
std::vector< std::pair< short, float > > _vmedians
return(e1-e2)*(e1-e2)+dp *dp
const Range getRange(const uint32_t detID) const
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< ContainerIterator, ContainerIterator > Range