Skip to content

Commit

Permalink
extra check on mcms
Browse files Browse the repository at this point in the history
  • Loading branch information
cbetanco committed Jul 11, 2018
1 parent d0adbbc commit 18da84e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Ana_tests.C
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,28 @@ void Ana_tests::Check_noise() {
bool Ana_tests::Check_MCMS(float ADC[128], int mcm1, int mcm2, int mcm_ch, int mcm_v) {

int mcm_ch_calc=0;
int mcm_v_calc=0;

for(int i=0; i < 128; i++) {
if((ADC[i] >= mcm2) && (ADC[i] < mcm1)) mcm_ch_calc++;

}




if(mcm_ch_calc != mcm_ch) return false;

for(int i=0; i < 128; i++) {

if((ADC[i] >= mcm2) && (ADC[i] < mcm1)) mcm_v_calc=+ADC[i]/mcm_ch;


}

if(abs(mcm_v-mcm_v_calc)>1 ) return false;


return true;
}

Expand Down

0 comments on commit 18da84e

Please sign in to comment.