#include <string.h>
#include "header.h"

static RflEventHeader rhead;  RflEventHeader *rheadp = &rhead;
static CerEventHeader chead;  CerEventHeader *cheadp = &chead;

extern float fixed_Phi, fixed_Theta;
extern int   is_Fixed_Target;

void TranslateHeader(RflEventHeader *r, CerEventHeader *c)
{
  memcpy(r,c,154*sizeof(float));

  if (is_Fixed_Target)  // <- Added in September 2002, AM
    {
      /* Next 2 variables added in June 2002, AM */
      r->telescopePhi      = fixed_Phi;
      r->telescopeTheta    = fixed_Theta; 
    }
  // If no fixed target, telescope always points towards shower. AM Sep 2002
  else
    {
      r->telescopePhi      = cheadp->Phi;
      r->telescopeTheta    = cheadp->Theta; 
    }
} /*	end of TranslateHeader  */


