source: trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc@ 3379

Last change on this file since 3379 was 3379, checked in by moralejo, 22 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 5.4 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Oscar Blanch 11/2002 (blanch@ifae.es)
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MMcCorsikaRunHeader
28//
29// Root storage container for the CORSIKA run header
30//
31// It saves in a root file all variable that are in the CORSIKA run header, except
32// dummies.
33//
34////////////////////////////////////////////////////////////////////////////
35#include "MGeomCorsikaCT.h"
36#include "MMcCorsikaRunHeader.h"
37#include "MLog.h"
38#include "MLogManip.h"
39
40ClassImp(MMcCorsikaRunHeader);
41
42using namespace std;
43
44// --------------------------------------------------------------------------
45//
46// Default constructor.
47//
48//
49MMcCorsikaRunHeader::MMcCorsikaRunHeader(const char *name, const char *title,
50 int NumCT)
51 : fTelescopes(NumCT)
52{
53 fName = name ? name : "MMcCorsikaRunHeader";
54 fTitle = title ? title : "Translation of the CORSIKA header";
55
56 fRunNumber = 0;
57 fDate = 0;
58 fCorsikaVersion = 0;
59 fNumObsLev = 0;
60
61 for (int i=0; i<10; i++)
62 fHeightLev[i]=0;
63
64 fSlopeSpec = 0;
65 fELowLim = 0;
66 fEUppLim = 0;
67 fEGS4flag = 0;
68 fNKGflag = 0;
69 fEcutoffh = 0;
70 fEcutoffm = 0;
71 fEcutoffe = 0;
72 fEcutoffg = 0;
73
74 for(int i=0; i<50; i++) fC[i] = 0;
75 for(int i=0; i<40; i++) fCKA[i] = 0;
76 for(int i=0; i<5; i++) fCETA[i] = 0;
77 for(int i=0; i<11; i++) fCSTRBA[i] = 0;
78 for(int i=0; i<5; i++)
79 {
80 fAATM[i] = 0;
81 fBATM[i] = 0;
82 fCATM[i] = 0;
83 }
84 for (int i=0;i<4; i++) fNFL[i] = 0;
85
86 fViewconeAngles[0]=0.0;
87 fViewconeAngles[1]=0.0;
88
89 fWobbleMode=0;
90 fAtmosphericModel=0;
91
92 fNumCT=NumCT;
93
94 fTelescopes.SetOwner();
95
96 for (int i=0;i<NumCT;i++)
97 fTelescopes[i]= new MGeomCorsikaCT;
98
99 SetReadyToSave();
100}
101
102// -------------------------------------------------------------------------
103//
104// Fill Corsika Run Header
105//
106void MMcCorsikaRunHeader::Fill(const Float_t runnumber,
107 const Float_t date,
108 const Float_t vers,
109 const Float_t numobslev,
110 const Float_t height[10],
111 const Float_t slope,
112 const Float_t elow,
113 const Float_t eupp,
114 const Float_t egs4,
115 const Float_t nkg,
116 const Float_t eh,
117 const Float_t em,
118 const Float_t ee,
119 const Float_t eg,
120 const Float_t c[50],
121 const Float_t cka[40],
122 const Float_t ceta[5],
123 const Float_t cstrba[11],
124 const Float_t aatm[5],
125 const Float_t batm[5],
126 const Float_t catm[5],
127 const Float_t nfl[4],
128 const Float_t viewcone[2],
129 const Float_t wobble,
130 const Float_t atmospher
131 )
132{
133 fRunNumber = runnumber;
134 fDate = date;
135 fCorsikaVersion = vers;
136 fNumObsLev = numobslev;
137
138 for (int i=0; i<10; i++)
139 fHeightLev[i]=height[i];
140
141 fSlopeSpec = slope;
142 fELowLim = elow;
143 fEUppLim = eupp;
144 fEGS4flag = egs4;
145 fNKGflag = nkg;
146 fEcutoffh = eh;
147 fEcutoffm = em;
148 fEcutoffe = ee;
149 fEcutoffg = eg;
150
151 for (int i=0; i<50; i++) fC[i] = c[i];
152 for (int i=0; i<40; i++) fCKA[i] = cka[i];
153 for (int i=0; i<5 ; i++) fCETA[i] = ceta[i];
154 for (int i=0; i<11; i++) fCSTRBA[i] = cstrba[i];
155 for (int i=0; i<5; i++)
156 {
157 fAATM[i] = aatm[i];
158 fBATM[i] = batm[i];
159 fCATM[i] = catm[i];
160 }
161 for (int i=0; i<4; i++) fNFL[i] = nfl[i];
162
163 fViewconeAngles[0]=viewcone[0];
164 fViewconeAngles[1]=viewcone[1];
165
166 fWobbleMode=wobble;
167 fAtmosphericModel=atmospher;
168
169}
170
171// -------------------------------------------------------------------------
172//
173// Fill C Telescope information in Corsika Run Header
174//
175void MMcCorsikaRunHeader::FillCT(Float_t ctx, Float_t cty, Float_t ctz,
176 Float_t cttheta, Float_t ctphi,
177 Float_t ctdiam, Float_t ctfocal,
178 Int_t CTnum){
179
180 static_cast<MGeomCorsikaCT*>(fTelescopes.UncheckedAt(CTnum))
181 ->Fill(ctx, cty, ctz, cttheta, ctphi, ctdiam, ctfocal);
182
183}
184
185// -------------------------------------------------------------------------
186//
187// Returns a reference of the i-th entry (the telescope with the index i)
188//
189MGeomCorsikaCT &MMcCorsikaRunHeader::operator[](Int_t i) const
190{
191 return *static_cast<MGeomCorsikaCT*>(fTelescopes.UncheckedAt(i));
192}
193
194// --------------------------------------------------------------------------
195//
196// Prints the information of all telescopes
197//
198void MMcCorsikaRunHeader::Print(Option_t *) const
199{
200 //
201 // Print Information about the Geometry of the camera
202 //
203 *fLog << all << GetTitle() <<". Number of Telescopes: " << fNumCT << endl;
204
205 fTelescopes.Print();
206}
207
208
209
210
211
212
213
214
215
Note: See TracBrowser for help on using the repository browser.