- Timestamp:
- 12/16/09 08:30:44 (15 years ago)
- Location:
- drsdaq
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
drsdaq/HVFeedback.cc
r110 r140 64 64 ReadCard("DefaultResponse", Response, 'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels); 65 65 ReadCard("DefaultTarget", Target, 'f', File, m->NumBoards*kNumberOfChips*kNumberOfChannels); 66 // Add also initial gain to configuration parameters 66 67 fclose(File); 67 68 } … … 69 70 70 71 // Initial state 71 Gain = 1;72 Gain = 0.2; 72 73 SetFBMode(FB_Off); 73 74 SetNumAverages(fDefaultNumAverage); … … 112 113 bool HVFeedback::ProcessEvent() { 113 114 int i,j,k,q; 114 float Correction, Integral, Difference , EffectiveGain;115 float Correction, Integral, Difference; 115 116 116 117 // Check for LED trigger channel on given channel and if feedback running … … 153 154 case FB_Active: // Determine correction from response maxtrix and change voltages 154 155 Difference = Target[i][j][k] - Average[i][j][k]; 155 EffectiveGain = Gain*pow(0.5*(1+(Difference/Sigma[i][j][k]-1)/(Difference/Sigma[i][j][k]+1)),2); 156 Correction = -Difference*Response[i][j][k]*EffectiveGain; 157 if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1; // Limit changes to 100 mV 156 Correction = -Difference*Response[i][j][k]*Gain; 157 //if (fabs(Correction) > 0.1) Correction = fabs(Correction)/Correction*0.1; // Limit changes to 100 mV 158 158 if(Correction!=0 && Target[i][j][k]!=0 && !PixMap->DRS_to_Pixel(i,j,k).empty()) { 159 159 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); -
drsdaq/History.txt
r110 r140 56 56 23/9/2009 Fixed bug in RawDataCTX.cc: sequential event number in a file is only 57 57 the same as the event number in the run for the first file part 58 16/12/2009 Removed automatic gain adaption in feedback (caused spikes in the correction)
Note:
See TracChangeset
for help on using the changeset viewer.