Changeset 196


Ignore:
Timestamp:
04/01/10 16:08:50 (15 years ago)
Author:
ogrimm
Message:
Fixed bug with default feedback gain from config file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/HVFeedback.cc

    r193 r196  
    7979
    8080  // Initial state
    81   Gain = atoi(m->GetConfig("DefaultGain"));
     81  Gain = atof(m->GetConfig("DefaultGain"));printf("Gain %d\n", Gain);
    8282  SetFBMode(FB_Off);
    8383  SetNumAverages(fDefaultNumAverage);
     
    112112
    113113  // Check for LED trigger channel on given channel and if feedback running
    114   //if (FBMode==FB_Off || m->WaveForm[fLedTrigBoard][fLedTrigChip][fLedTrigChannel][(fLedTrigSample+m->TriggerCell[fLedTrigBoard][fLedTrigChip])%kNumberOfBins] < fLedTrigThreshold) {
    115114  if (FBMode==FB_Off || m->WaveForm[fLedTrigBoard][fLedTrigChip][fLedTrigChannel][fLedTrigSample] < fLedTrigThreshold) {
    116115    return false;
     
    153152            Correction = -(Target[i][j][k] - Average[i][j][k])*Response[i][j][k]*Gain;
    154153        if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1;   // Limit changes to 100 mV
    155         if(Correction==0 || Target[i][j][k] ==0 || PixMap->DRS_to_Pixel(i,j,k).empty()) break;
    156 
     154                if(Correction==0 || Target[i][j][k]==0 || PixMap->DRS_to_Pixel(i,j,k).empty()) break;
    157155        printf("Average of board %d, chip %d, channel %d is %.2f +/- %.2f    Correction %.3f\n",i,j,k,Average[i][j][k],Sigma[i][j][k],Correction);
    158156
     
    354352
    355353  DimClient::sendCommand("Bias/Command", Textbuffer);
    356 
    357354  return true;
    358355}
Note: See TracChangeset for help on using the changeset viewer.