// Header file listing all routines of the object 'observe'. This
// object is fairly similar to the one defined in STOKES and manages a
// web of detectors. The program ANALYZE will store the sum of all
// data files in these detectors and finally save their contents to
// a new set of STOKES files and to convenient output files for the
// polarization data.
//
// ANALYZE, version 1.0, Nov 2004


#ifndef observe_h
#define observe_h


#include "detector-analyze-v1.0.h"


// maximum number of detectors in the theta direction
const int ScreenNumThetaMax = 40;


// maximum number of detectors in the azimuthal direction
const int ScreenNumPhiMax = 80;


// type definition of the detector system
class Monitor
{


public:


  // initialize detectors by setting all channels to zero
  Monitor();

  // add 'value' to the channel l of the detector given by the theta and
  // phi position i and j; n denotes the number of the Stokes parameter
  void AddTo(int i,int j,int n,int l,double value);


  // save the data of all detectors to new combined STOKES files and to
  // convenient output files
  void SaveResults(char outfile[20],char resfile[20],int n,double Data[]);


private:


  // type definition of a line of detectors for a given theta angle
  struct Column
  {
    Screen Row[ScreenNumPhiMax];
  };

  // type definition of a pointer for Column
  typedef Column* ColumnPtr;


  // declare a line of detectors as a dynamical array
  ColumnPtr Col;


};


#endif
