source: trunk/MagicSoft/Simulation/Detector/ReflectorII/header.c@ 1432

Last change on this file since 1432 was 1431, checked in by bigongia, 22 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1#include <string.h>
2#include "header.h"
3
4/* Need to be defined the procedures to set the values in
5 float TimeFirst;
6 float TimeLast; */
7
8static RflHeader rhead; RflHeader *rheadp = &rhead;
9static CerHeader chead; CerHeader *cheadp = &chead;
10
11extern float fixed_Phi, fixed_Theta;
12extern int ct_NMirrors;
13extern float mean_refl;
14
15void TranslateHeader(RflHeader *r, CerHeader *c)
16{
17 r->EvtNumber = c->EvtNumber;
18 r->PrimaryID = c->PrimaryID;
19 r->Etotal = c->Etotal;
20 r->Thick0 = c->Thick0;
21 r->FirstTarget = c->FirstTarget;
22 r->zFirstInt = c->zFirstInt;
23 r->Theta = c->Theta;
24 r->Phi = c->Phi;
25 r->NumRndSeq = c->NumRndSeq;
26 r->RunNumber = c->RunNumber;
27 r->DateRun = c->DateRun;
28 r->Corsika_version= c->Corsika_version;
29 r->NumObsLev = c->NumObsLev;
30 r->HeightLev = c->HeightLev[0];
31
32
33 r->SlopeSpec = c->SlopeSpec;
34 r->ELowLim = c->ELowLim;
35 r->EUppLim = c->EUppLim;
36 r->ThetaMin = c->ThetaMin;
37 r->ThetaMax = c->ThetaMax;
38 r->PhiMin = c->PhiMin;
39 r->PhiMax = c->PhiMax;
40 r->CWaveLower = c->CWaveLower;
41 r->CWaveUpper = c->CWaveUpper;
42
43 memcpy(r->p, c->p, 3*sizeof(float));
44 memcpy(r->RndData, c->RndData, 30*sizeof(float));
45 memcpy(r->CorePos, c->CorePos, 40*sizeof(float));
46
47 /* Next 4 variables added in June 2002, AM */
48 r->telescopePhi = fixed_Phi;
49 r->telescopeTheta = fixed_Theta;
50 r->num_mirrors = ct_NMirrors;
51 r->mean_reflectivity = mean_refl;
52
53 if (c->Corsika_version >= 6.) /* Viewcone option implemented only in c6xx */
54 {
55 if (c->viewcone_angles[0] > 0.)
56 {
57 printf ("ERROR: Input cer file was run using Corsika option\n");
58 printf (" VIEWCONE VUECON(1) VUECON(2) with VUECON(1) > 0\n");
59 printf (" The reflector program only supports VUECON(1) = 0\n\n");
60 exit(-1);
61 }
62 else
63 r->ViewConeRadius = c->viewcone_angles[1]; /* degrees */
64 }
65 else
66 r->ViewConeRadius = 0.;
67
68} /* end of TranslateHeader */
69
70
Note: See TracBrowser for help on using the repository browser.