// Implementation of the routines for the object detector. This
// object is defined very similarly to the one of STOKES.
//
// ANALYZE, version 1.0, Nov 2004


#include <iostream.h>
#include <fstream.h>
#include <math.h>
#include "detector-analyze-v1.0.h"


// definition of pi
const double pi = 3.1415926535898;


// initialize detector by setting all channels to zero
Screen::Screen()
{
  int i;

  for(i = 0; i < ResMax; i++)
  {
    I[i] = 0;
    Q[i] = 0;
    U[i] = 0;
    V[i] = 0;
  }
}


// add 'value' to Stokes parameter n at channel l
void Screen::AddTo(int n,int l,double value)
{
  switch(n)
  {
    case 0:
      I[l] = I[l]+value;
      break;
    case 1:
      Q[l] = Q[l]+value;
      break;
    case 2:
      U[l] = U[l]+value;
      break;
    default:
      V[l] = V[l]+value;
      break;
  }
}
