~christopher-hunt08/maus/beam_selection_development

« back to all changes in this revision

Viewing changes to src/input/InputCppDAQData/UnpackEventLib.cc

  • Committer: Chris Rogers
  • Date: 2012-10-13 18:43:00 UTC
  • mfrom: (663.6.137 merge)
  • mto: (663.6.204 merge)
  • mto: This revision was merged to the branch mainline in revision 680.
  • Revision ID: chris.rogers@stfc.ac.uk-20121013184300-ry9q81m45dmtgejr
Bring control room branch into line with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
460
460
 
461
461
void fADCDataProcessor::set_pedestal() {
462
462
  double area = 0;
463
 
  unsigned int pedBins = 20;
 
463
  unsigned int pedBins = 10;
464
464
  if (_data.size() > pedBins) {
465
465
    for (unsigned int i = 0; i < pedBins; i++) {
466
466
       area += _data[i];
491
491
  min = min_element(_data.begin(), _data.end());
492
492
  pos = distance(_data.begin(), min);
493
493
 
494
 
  if (pos > 10) {
 
494
  if (pos > 15) { // was: pos > 10
495
495
    it = min -  10;
496
 
    while (it < min + 20 && it < _data.end()) {
497
 
      area += abs(*it - _pedestal);
 
496
    while (it < min + 30 && it < _data.end()) {
 
497
      // area += abs(*it - _pedestal);
 
498
      area += _pedestal- *it;
498
499
      it++;
499
500
    }
500
501
  }