source: trunk/MagicSoft/Simulation/Detector/ReflectorII/doc/Tdas0211.tex@ 1623

Last change on this file since 1623 was 1618, checked in by bigongia, 23 years ago
*** empty log message ***
File size: 43.5 KB
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%%% magic-tdas.tex -- template to write MAGIC-TDAS documents
3%%%-----------------------------------------------------------------
4%%% Kopyleft (K) 2000 J C Gonzalez
5%%% Max-Planck-Institut fuer Physik,
6%%% Foehringer Ring 6, 80805 Muenchen, Germany
7%%% E-mail: gonzalez@mppmu.mpg.de
8%%%-----------------------------------------------------------------
9%%% This program is free software; you can redistribute, copy,
10%%% modify, use it and its documentation for any purpose,
11%%% provided that the above copyright notice appear in all
12%%% copies and that both that copyright notice and this
13%%% permission notice appear in supporting documentation.
14%%%
15%%% This piece of code is distributed in the hope that it will
16%%% be useful, but WITHOUT ANY WARRANTY; without even the
17%%% implied warranty of FITNESS FOR A PARTICULAR PURPOSE.
18%%%
19%%% Although you can actually do whatever you want with this
20%%% file (following the copyright notice above), your are
21%%% strongly encouraged NOT to edit directly this file.
22%%% Instead, make a copy and edit the copy for your purposes.
23%%%
24%%% Modifying thie original file means that you actually have
25%%% the (very basic) knowledge needed to make things by your
26%%% own, and therefore... you will not get _any_ additional
27%%% support :-)
28%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29%%% Last update: Time-stamp: <Thu Mar 2 09:31:41 CET 2000>
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31%
32\documentclass[12pt]{article}
33
34\usepackage{magic-tdas}
35
36%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37%% BEGIN DOCUMENT
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39\begin{document}
40
41%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42%% Please, for the formatting just include here the standard
43%% elements: title, author, date, plus TDAScode
44%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45\title{ The Reflector simulation program v.0.6 }
46\author{A.Moralejo\\
47 \texttt{<moralejo@pd.infn.it>}}
48\date{November 14, 2002\\}
49\TDAScode{MAGIC-TDAS 02-11\\ 021114/AMoralejo}
50%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51
52%% title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53\maketitle
54
55%% abstract %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56\begin{abstract}
57In this document we provide a brief description of Reflector program
58(version 0.6) and a guide to install and run it. Some of the
59information contained in this document is also present in MAGIC-TDAS
6002-05 dealing with the previous version of the program, but it has also
61been included here for clarity. An important bug regarding the
62ray-tracing routine has been corrected in this new version.
63\end{abstract}
64
65%% contents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66\thetableofcontents
67
68\newpage
69
70%% body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71
72%------------------------------------------------------------
73\section{Introduction}
74
75The Reflector program was originally written by Jose Carlos Gonz\'alez
76and then improved by Harald Kornmayer. The Reflector program reads in
77MMCS output files (cerxxxxxx files from corsika) and writes an output
78file with the information about all the photons which reach the
79telescope focal plane (taking into account atmospheric and mirror
80absorption) and which are within the camera radius defined in the file
81{\bf magic.def}. In September 2001 D. Bastieri and C. Bigongiari
82released a new version (v.0.4) to adapt the program to a format change
83in the MMCS output. In June 2002 the version 0.5 was released, with
84small changes in the ouput file format and some bug fixing (see TDAS
8502-05).
86\par
87The aim of releasing the present version 0.6 was in principle only to
88add some missing information in the output. However, the ray-tracing
89routine was checked in detail and some inconsistencies were
90found. As a result of this, an important bug was detected which
91produced a systematic blurring of all the images. This bug, fixed in
92this version, is discussed in detail in section \ref{notes}.
93
94%------------------------------------------------------------
95\section{Description of simulation \label{descrip}}
96
97The main steps of the simulation are:
98
99\begin{enumerate}
100
101\item Atmospheric absorption.
102
103\item Checking if the photon hits the dish.
104
105\item Aluminum absorption.
106
107\item Determination of the mirror hitted.
108
109\item Mirror reflection.
110
111\item Checking if the photon is inside the camera borders.
112
113\item Calculation of photon arrival time on camera.
114
115\end{enumerate}
116
117The reflection of each mirror element is simulated in a realistic way
118by introducing a gaussian spread of the reflected photons positions on
119the camera plane. The sigma of this PSF is defined via the
120{\bf point\_spread} parameter in the telescope description file {\bf
121magic.def}, and has a value of 0.5 cm, which corresponds approximately
122to the quality of the MAGIC mirrors produced up to date. Also the
123possible misalignment of mirror elements is simulated (see section
124\ref{neededfiles}).
125
126\section{Notes on version 0.6 \label{notes}}
127
128\subsection {The bug fixed in the ray tracing}
129
130The previous versions of the reflector were extensively checked and a
131strange behaviour was found in them. It is a well known fact (see for
132instance the discussions in the MAGIC design report) that, to focus a
133telescope on an object placed at a finite distance, one has to shift
134the camera plane {\it away} from the mirror dish, with respect to the
135position in which an object at infinity (a star) would be
136focused (see fig. \ref{colimation}). For instance, with a paraboloid
137of focal distance f = 1697 cm, an object placed 10 km above the
138telescope would be focused on a plane at $\simeq 1700$ cm from the
139dish (a distance measured along the telescope axis).
140%
141\begin{figure}[h!]
142 \begin{center}
143 \epsfig{file=eps/colimation.eps,width=0.7\textwidth}
144 \caption{To focus an object at a finite distance h, the camera plane
145must be moved away from the mirror a distance d, given by the formula
146on the right. For MAGIC, the shift is of around 3 cm for a source
147located 10 km above the telescope.\label{colimation}}
148 \end{center}
149\end{figure}
150%
151\par
152With reflector program up to version 0.5, and using the mirror
153parameters in the standard magic.def file, we found out just the
154opposite behaviour. We wrote a program to produce files with the same
155structure as the Corsika Cherenkov output, but containing photons from
156a point source. If we set the source at infinity, we found the best
157spot placing the camera at a distance of 1697 cm (this can be changed in
158the magic.def file via the {\it focal\_distance} parameter). We can
159see the resulting spot in fig. \ref{spot_inf_f1697}. A completely
160independent ray-tracing program was used to verify that this is the
161spot that our 17 m tesellated paraboloid should produce.
162%
163\begin{figure}[h]
164 \begin{center}
165 \epsfig{file=eps/spot_inf_f1697.eps,width=0.85\textwidth}
166 \caption{Image of a point like source placed at infinity with
167Reflector 0.5 (units of x and y are cm). Camera plane placed at 1697 cm
168from the mirror. The circle on the left indicates (small) pixel
169size. On the right side, projections on x and y of the
170spot. \label{spot_inf_f1697}}
171 \end{center}
172\end{figure}
173%
174If we now
175place the source 10 km above the telescope, the best spot is achieved
176at 1694 cm from the dish, instead of the expected 1700 cm
177(figs. \ref{spot10kmf1700} and \ref{spot10kmf1694}). It must be
178noted that for these and the following checks we removed all the
179gaussian smearing which the program introduces to simulate the
180possible mirror misalignments and surface irregularities (by the way,
181a feature which somehow optimistically was not included in the
182simulations shown in the proposal). In this way we can check just the
183ray tracing.
184%
185\begin{figure}[h!]
186 \begin{center}
187 \epsfig{file=eps/spot10kmf1700.eps,width=0.85\textwidth}
188 \caption{Image of a point like source placed 10 km above the
189telescope with Reflector 0.5 (units of x and y are cm). Camera plane
190placed at f = 1700 cm from the mirror. The fact that the spot is so large
191indicates a problem in the simulation, since with this camera position
192the telescope should be focused at 10 km (see
193fig. \ref{spot_inf_f1697}) and hence produce a spot similar to the one
194shown in fig. \ref{spot_inf_f1697}. The hole in the middle of the spot
195corresponds to the hole in the mirror dish, and indicates by itself a
196focusing problem.
197\label{spot10kmf1700}}
198 \end{center}
199\end{figure}
200%
201\begin{figure}[h!]
202 \begin{center}
203 \epsfig{file=eps/spot10kmf1694.eps,width=0.85\textwidth}
204 \caption{Image of a point like source placed 10 km above the
205telescope with Reflector 0.5 (units of x and y are cm). Camera plane
206placed at f = 1694 cm from the mirror. Now the spot is small, but the
207camera plane is not at the expected position (see text).
208\label{spot10kmf1694}}
209 \end{center}
210\end{figure}
211%
212\par
213In order to rule out a possible mistake in the generation of the
214``false'' Cherenkov files, we repeated the check using real Corsika
215files, and directly looking at shower images ($\Theta = 10^\circ$
216incident gammas with a Crab-like spectrum). We must bear in mind that
217the shower maximum for gammas of 100 GeV lies around 10 km above the MAGIC
218level. From the result we can clearly see that the images are best
219focused at 1694 cm (fig. \ref{evcompare}), therefore confirming the
220existence of a real problem in the reflector simulation.
221%
222\begin{figure}[p]
223 \begin{center}
224 \epsfig{file=eps/evcompare.eps,width=0.85\textwidth}
225 \caption{Gamma shower images obtained with Reflector 0.5 placing
226the camera at 1700 cm (left) and 1694 cm (right) from the mirror
227dish. Primary gammas at $\theta = 10^\circ$, E = 16, 46 and 232 GeV.
228\label{evcompare}}
229 \end{center}
230\end{figure}
231%
232\paragraph {Check of the mirror parameters in the magic.def file\\}
233In the standard magic.def file we have been using up to now, the
234spherical mirrors centers were found to be distributed on the surface
235of a f = 1700 cm paraboloid. Their curvature radii, though discretized
236in 8 ``zones'' as explained in the design report, corresponded in
237average to the local mean curvature radius of the same parabolic
238surface. However, their orientations were those corresponding to a f =
2391697 cm paraboloid. Personally I do not think this is something
240intended, and looks more like an error, but anyway we checked that this
241was not the reason for the problems in the ray tracing: a test
242magic.def file was created with all parameters calculated as for a f =
2431697 cm paraboloid, and no significant difference could be seen. That
244is: i) the individual mirror orientations are the dominant factor, and
245the overall dish in the old reflector behaved indeed like a f = 1697
246cm parabolic
247mirror, and ii) the bug must be somewhere else. Even though the error
248was not there, a new magic.def file has been produced containing the
249parameters for the 956 mirrors of the final MAGIC design (instead of
250the 920 mirrors foreseen in the beginning).
251%
252\paragraph {Solution of the problem\\}
253Finally, a check of the routines in {\it ph2cph.c} revealed that the
254reflector program was actually misinterpreting the information read
255from the Cherenkov file written by Corsika. In figure \ref{coorsystems}
256we can see the definition of Corsika's coordinate system (see also the
257Corsika manual). In it, the x axis points north and the z axis points
258up. The zenith angle $\Theta$ of a particle trajectory is measured
259between the particle momentum and the negative z-axis, and the
260azimuthal angle $\Phi$ between the positive x-axis and the x-y
261component of the particle momentum, counterclockwise (0 -
2622$\pi$). When the direction cosines of a particle's trajectory are
263given, they refer also to its momentum vector (a downgoing
264vector). The same is true for the Cherenkov photons.
265%
266\begin{figure}[h]
267 \begin{center}
268 \epsfig{file=eps/coorsystems.eps,width=\textwidth}
269 \caption{Coordinate systems of Corsika and MAGIC.\label{coorsystems}}
270 \end{center}
271\end{figure}
272%
273\begin{figure}[h!]
274 \begin{center}
275 \epsfig{file=eps/parabola.eps,width=0.6\textwidth}
276 \caption{Misunderstanding of photon direction cosines from Corsika
277by Reflector v 0.5 and older versions.\label{parabola}}
278 \end{center}
279\end{figure}
280%
281Unfortunately, in the output of Corsika, only the direction cosines
282(u, v) with respect to the x and y axis are given. These completely
283determine the particle's trajectory as long as one knows that they
284refer to a downgoing versor, in which case one gets the third
285direction cosine as $w = -\sqrt{u^2+v^2}$, with a minus sign. However,
286in {\it ph2cph.c} we found exactly the opposite (lines 116 to 118 in
287v.05):
288
289\begin{verbatim}
290 r[0] = ph->u;
291 r[1] = ph->v;
292 r[2] = (float) sqrt(1.0 - r[0]*r[0] - r[1]*r[1]);
293\end{verbatim}
294
295This means that the program was interpreting u and v as the direction
296cosines of the {\it upgoing} versor towards which one should ``look''
297to see the incoming photon. The situation is depicted in figure
298\ref{parabola}. The two vectors at the bottom left of the plot are the
299two possible interpretations of the direction cosines u and v. These
300vectors have the same u and v, and differ only in the sign of their
301third components w. As the figure illustrates, the reflector
302simulation, by taking the wrong (positive) sign of w, was transforming
303the light coming from a point source 10 km away, into a convergent
304light beam which was then focused at a distance (1694 cm),
305shorter than the focal length of the paraboloid, and produced a
306blurred image at the theoretically optimal distance (1700 cm). Of
307course a paralel beam of light was focused at the right distance (1697
308cm) since in that case u = v = 0, and both the upgoing and downgoing
309versors have the same direction.
310\par
311The example in figure \ref{parabola} shows the case in which the
312telescope is pointing at zenith. It is easy to see that if the
313telescope was pointing in an arbitrary direction a few degrees away
314from zenith, the fact of taking the wrong sign in the third direction
315cosine would spoil the reflection completely, to the point that the
316spot would lie outside the camera limits. However, this is not what we
317observed: when using the older reflector versions for different zenith
318angles the images were still contained in the camera. The explanation
319is that the transformation between Corsika's coordinates system and
320the telescope system was also wrong, since the angles $\Phi$ and
321$\Theta$ which indicate the telescope orientation (see fixed\_target
322option in section \ref{commands}) follow the same convention taken
323from Corsika: for instance, for pointing the telescope towards North
324we should set $\Phi = 180^\circ$, because that would be the $\Phi$
325value for a particle or photon coming from North (see again
326fig. \ref{coorsystems}, left). This wrong transformation of coordinates
327oriented the telescope in a way that the situation was always like the
328one shown in fig. \ref{parabola}, and the image was formed in the
329camera also for $\Theta > 0$, though also defocused.
330\par
331The telescope coordinate system shown in figure \ref{coorsystems}
332(right) has its z-axis along the telescope axis, and the origin in the
333center of the mirror dish. This system is used in the ray tracing
334routine of the reflector simulation. When the telescope points up
335($\Theta = \Phi = 0$) this system matches exactly the one in Corsika.
336The general transformation between both is a simple rotation,
337since for the sake of simplicity we assume in the simulation that the
338origins always coincide. In Reflector v.05 or older the rotation
339matrix was wrong: it had been written assuming that ($\Phi$, $\Theta$)
340indicated the direction towards which the telescope pointed. Actually,
341for the reasons already exposed, the telescope must point to
342($\Phi +\pi$, $\Theta$). The function in charge of building the rotation
343matrix is {\it makeOmega} (a part of {\it ph2cph.c}), which is called
344from {\it reflector.c}. For the present version we have simply
345replaced $\Phi$ by $\Phi + \pi$ in the function call. The transformation of
346coordinates is shown in figure \ref{telecoor}, and can be seen as a
347rotation of angle $\Phi +\pi$ around the z axis of Corsika plus a
348rotation of angle $\Theta$ around the y'' axis of the telescope (the
349same way in which the real MAGIC points).
350%
351\paragraph {New coordinate system of the camera \label{newcoordi}}
352We have introduced another change in Reflector 0.6 regarding the
353coordinates. In versions up to 0.5 the coordinates ($x_{camera}$,
354$y_{camera}$) of the photon impact point on the camera plane were
355given in the telescope system (x'', y'', z'') described in
356fig. \ref{telecoor}. This was a bit confusing (a rotation of the
357telescope in the zenith axis resulted in a displacement in x'' of the
358images), in particular it would have been messy when working in wobble
359mode. We have now adopted the camera coordinate system proposed in
360TDAS 01-05: when the observer is looking from the center of the
361reflector in the direction of the telescope axis (towards the camera)
362the $x_{camera}$ axis points horizontally to the right, and the
363$y_{camera}$ axis points upwards. It is trivial from figure
364\ref{telecoor} to see that the transformation needed to obtain these
365coordinates is: $x_{camera} = -y''$, $\:y_{camera} = -x''$. This has been
366added at the end of {\it ph2cph.c}.
367%
368\begin{figure}[h]
369 \begin{center}
370 \epsfig{file=eps/telecoor.eps,width=\textwidth}
371 \caption{Transformation of coordinates between the Corsika and
372MAGIC coordinate systems.\label{telecoor}}
373 \end{center}
374\end{figure}
375%
376\paragraph {How old was the ray-tracing bug?\\}
377%
378The bug was certainly present in versions 0.4 and 0.5, but may be even
379older. Nevertheless, there is no doubt that the reflector program used
380for the simulation shown in the MAGIC design report (which must have been
381an early version of the present one) was working fine. Extensive proof
382of this is provided in an appendix of the design report. A plausible
383explanation could be that, up to some date, the data being read in by
384the reflector program (the Corsika output) contained direction cosines
385which really referred to the upgoing versors of the photon directions,
386and until then the program worked well. Then may be the output of
387Corsika was changed to its present form, and the change went unnoticed.
388The Corsika version used then was 4.52, whereas all further work has
389been done with Corsika 5.20 or later versions. The Corsika history
390file shows no record of any change in this respect, but given that we
391have always used a slightly modified Corsika, it would not be
392surprising if the Cherenkov output was modified at some point. There
393is no documentation on this, so if anyone has any relevant information,
394please make it public.
395%
396\paragraph {Influence of the bug on image analysis\\}
397The fixing of the bug (resulting in sharper images) will for sure
398improve the results of the image analysis, in particular with regard
399to gamma / hadron separation. This could in part explain the
400differences we have been observing in the expected performance of
401MAGIC with respect to what was foreseen in the design report. However,
402we note here again that in the simulation used there, not only was the
403reflector working well, but also no noise was introduced in the
404reflecting process. This was surely too optimistic, and it implies
405that it will be hard to reproduce those results using a more realistic
406approach which accounts for mirror imperfections. However, the
407introduction of the noise (fig. \ref{refl06images}) has a less
408dramatic effect than the defocusing which the bug was producing.
409%
410\subsection {Performance of the new version}
411In figure \ref{coma} we show the images of a point-like source at 10
412km from the telescope, produced with the Reflector version 0.6,
413and using the new version of the magic.def file (see see next
414section). No noise has been introduced in the reflection, the observed
415spots are just the result of optical aberrations. The light source has
416been put at slightly different viewing angles
417from the telescope. The results are comparable to those in the design
418report, actually these are a bit better, the difference probably being
419that the focal lengths of the mirror tiles in the older magic.def file
420were discretized in only eight values, while now they change rather
421continuously. Some images of a point source at infinity (a star) can be
422seen in fig. \ref{coma_star}. We can see that for any incidence angle,
423the area within which 50$\%$ of the light is concentrated is smaller
424than that of a small pixel.
425\par
426In figure \ref{refl06images} the images of three gamma events ($\theta
427= 10^\circ$, E = 16, 46, 232 GeV), the same of fig. \ref{evcompare}
428are shown. They have been produced with Reflector 0.6 assuming perfect
429spherical mirrors (left) and realistic ones (right). The images look
430reasonable, much sharper than with the older versions, even when the
431mirror imperfections are taken into account.
432\par
433%
434\begin{figure}[p]
435 \begin{center}
436 \epsfig{file=eps/coma.eps,width=0.85\textwidth}
437 \caption{Reflector 0.6. Images of a point-like source at
43810 km from the telescope for different incident angles (from on-axis
439to 2 degrees off-axis). The quantity d50 indicates the diameter of a
440circle (plotted) containing 50$\%$ of the reflected light. Note that
441the z-axis scale is logarithmic, and the same in the first five
442plots. The last plot shows the x-axis projections in linear scale.
443 \label{coma}}
444 \end{center}
445\vspace*{-1cm}
446\end{figure}
447%
448\begin{figure}[p]
449 \begin{center}
450 \epsfig{file=eps/refl06images.eps,width=0.85\textwidth}
451 \caption{Reflector 0.6. Images of the three gamma showers shown in
452fig. \ref{evcompare}, without noise added in the reflection (left) and
453with the standard noise (right) as described in section
454\ref{descrip}. Note that the orientation of the images has changed as a
455result of the introduction of a new camera coordinate system (see page
456\pageref{newcoordi}).
457 \label{refl06images}}
458 \end{center}
459\vspace*{-1cm}
460\end{figure}
461%
462\begin{figure}[p]
463 \begin{center}
464 \epsfig{file=eps/coma_star.eps,width=0.85\textwidth}
465 \caption{Reflector 0.6. Images of a star. The quantity d50
466indicates the diameter of a circle (plotted) containing 50$\%$ of the
467reflected light.
468 \label{coma_star}}
469 \end{center}
470\vspace*{-1cm}
471\end{figure}
472%
473\subsection{The new magic.def file}
474A new magic.def file (see sect. \ref{neededfiles}) has been created
475and included in the Reflector 0.6 package. Now the number of
476individual mirror tiles is 956, matching
477the number and distribution of the final MAGIC design. The mirror
478centers and orientations are those corresponding to a paraboloid of
4791697 cm focal (hence the camera plane is placed at 1700 cm from the
480dish). The focal lengths have been calculated by R. Mirzoyan taking
481into account the so called ``shortening effect'' (see design report).
482A new axisdev.dat file (se again \ref{neededfiles}) with data for the
483956 mirrors is also included.
484%
485\subsection{The {\itshape cermaker} program}
486A test program to produce cer files (input for the reflector)
487containing photons from a point-light source of light placed in any
488position has been added to the Reflector package {\it
489(tester/cermaker.c)}. This is the same program used to produce the
490plots shown in this report. The usage is as follows:
491\begin{verbatim}
492cermaker source_x(cm) source_y(cm) source_z(cm) [events]
493\end{verbatim}
494The source position is given with respect to the telescope. The output
495file is called {\it cer000001}, and can be read by the reflector program.
496%
497\subsection{Other changes in Reflector 0.6}
498
499Some other minor improvements have been introduced in Reflector 0.6:
500
501\begin{enumerate}
502
503\item reflector.c: Introduced NaN (Not a Number) check in the photon
504loop. If NaNs are found in a photon data block (there are some in the
505Corsika output from time to time, for unkown reason), it is not processed.
506
507\item ph2cph.c: Introduced "check of positiveness" before taking a
508square root in the calculation of the photon trajectory intersection
509with the paraboloid (resulted sometimes in NaNs when the photon did
510not intersect the paraboloid).
511
512\item Added an option for the wobble mode in the input card (see
513section \ref{opt}).
514
515\item New output format (see sect. \ref{out}): added a Run header,
516which is like that of Corsika, plus a couple of variables concerning
517the reflector parameters: the wobble mode and the atmospheric model
518used for the simulation. The event header has also been changed to
519include all the information present in the Corsika event
520header. We also added in the event header three new variables which
521tell us for each event what fraction of the Cherenkov photons on the
522camera plane has been produced by electrons, muons, or other
523particles.
524\par
525Finally, the ascii files {\it magic.def}, {\it
526axisdev.dat} and {\it reflectivity.dat} which the program has used as
527input are now attached at the end of the output file, so that each
528output file contains all the relevant information on how it was
529produced.
530
531\end{enumerate}
532
533%------------------------------------------------------------
534\section{How to Install Reflector Program \label{installation}}
535
536You can get the current version of the Reflector Program from the
537MAGIC web page: \\
538{\bf http://hegra1.mppmu.mpg.de/MAGICWeb/ }\\
539You can find
540the latest public version of this program as tarred gzipped file in
541the Monte Carlo Download area (you need the usual password). You have to
542download the file reflector\_0.6.tar.gz and then follow the
543instructions below:
544
545\begin{description}
546\item[Decompress the file using:]
547 gunzip reflector*.tar.gz
548\item[Unpack the tar file with:]
549 tar xvf reflector*.tar
550\item[Go to the directory where the source files are:]
551 cd MagicProgs/Simulation/Detector/Reflector\_0.6/
552\item[Make symbolic links running the script:]
553 refl-install
554\item[Check if all dependencies are fulfilled:]
555 make depend
556\item[Compile the program:]
557 make
558\end{description}
559
560If everything goes right you should have an executable file called
561{\bf reflector}.
562
563%------------------------------------------------------------
564\section{How to Run Reflector Program \label{running}}
565
566You need a steering card to run the Reflector program. You can find an
567example in the {\bf MagicProgs/Simulation/Detector/Reflector\_0.6/input.card}
568file. You have to modify this file according to your needs (see below
569for instructions about steering card) and then run the program with the
570following statement:\\
571
572\hspace{1cm}{\bf reflector $<$ input.card}
573
574%------------------------------------------------------------
575\section{Needed Files \label{neededfiles}}
576
577The Reflector program needs some other files to run. These files are
578the following:
579\begin{itemize}
580\item {\bf magic.def}: contains the description of MAGIC telescope
581geometry, together with some other parameters needed by the Reflector
582program.
583\item {\bf axisdev.dat}: contains data to simulate the possible
584deviation of the spot of each single mirror on the camera plane due
585to its non perfect alignment. The values are x, y coordinates
586distributed at random (according to a gaussian with $\sigma =
5870.5$ cm).
588\item {\bf reflectivity.dat}: contains the mirror reflectivity index as
589a function of the wavelength.
590\end{itemize}
591
592All these files are usually in the {\bf
593MagicProgs/Simulation/Detector/Data/} directory and {\it in principle} you
594should {\bf not} make any change in them to run the program.
595
596%------------------------------------------------------------
597\section{Steering Card}
598
599The steering card sets all the parameters and options
600to steer the reflection simulation. Each line of the steering card is
601a statement with its parameters, if it is the case. Lines beginning
602with \# are considered comments. The Reflector program parses all the
603lines sequentially. Then if you repeat a statement with different
604options only the last one will be considered.
605
606\subsection{Mandatory Commands \label{commands}}
607
608\begin{description}
609
610\item[reflector 0.6]
611
612 This statement must be the first line of the steering card
613 file. The Reflector program checks it to verify if it is reading
614 a steering card.
615
616\item[output\_file /disk99/reflex/Gamma\_0\_7\_1001to1010\_w0.rfl]
617
618 The output\_file command specifies the name and the
619 path of the output file. The path can be absolute, like in the
620 example above, or relative. Although any name can be used,
621 conventionally the Reflector program
622 output file name has the .rfl extension, and starts with
623 the primary particle name. The first number indicates the
624 zenith angle of the incident primaries, the second one
625 indicates the production site (7 is for Padua) and is related
626 to the random number generator seed used by CORSIKA. Then the run
627 number range is shown (10 runs in this case, from 1001 to
628 1010). Each run corresponds to 10000 showers. Finally, the
629 label "w0" means no wobble mode was used (telescope pointing
630 at the source). Alternatively, the "w+" or "w-" labels (only
631 in gamma files) refer to the two pointings in the
632 Wobble-observation mode (see TDAS 01-05 by W. Wittek).
633
634\item[ct\_file ../Data/magic.def]
635
636 The ct\_file statement defines where the program can find the
637 telescope characteristics. The path in the example above is
638 correct to run reflector in
639 MagicProgs/Simu\-la\-tion/De\-tector/Reflector\_0.6/ directory.
640 If you want to run it in a different directory you have to modify the
641 path accordingly.
642
643\item[atm\_model ATM\_CORSIKA]
644 The atm\_model statement says to the program what kind of
645 atmospheric absorption model to use. Possible choices are:
646 ATM\_CORSIKA, ATM\_ISO\-THERMAL, ATM\_90\-PER\-CENT and
647 ATM\_NO\-ATMO\-SPHE\-RE.
648
649\item[cer\_files]
650
651 All the lines following this statement are considered files to
652 be processed by the Reflector program, one for each line,
653 eventually with their paths (see the example below). Therefore this
654 command must be the last one.\\
655 \\
656 cer\_files\\
657 /disk99/cer001001\\
658 /disk99/cer001002\\
659 /disk99/cer001003\\
660 ........ \\
661 /disk99/cer001009\\
662 /disk99/cer001010\\
663 \\
664 The cer file name can be followed by two numbers, for example:
665 \\
666 /disk99/cer001001 376 5723\\
667 \\
668 In this case the program processes only the events between and
669 including the numbers given.
670
671\end{description}
672
673\subsection{Optional Commands \label{opt}}
674
675\begin{description}
676
677\item[verbose\_level 1]
678
679 Sets the quantity of information printed out by Reflector
680 when running. Possible values are 0 to 4
681
682\item[max\_events 50000]
683
684 Fixes the maximum number of events to process.
685
686\item[energy\_cuts 100 1000]
687
688 This statement forces the Reflector to process only showers
689 with primary energy between the given values (GeV).
690
691\item[seeds n1 n2]
692
693 Seeds for the random number generators to used by the program
694 for the simulation of the absorption (both in the atmosphere
695 and on the mirror). Default values are 3141592 and
696 2718182.
697
698\item[telescope\_position x y]
699
700 Option included in version 0.5 of Reflector. Usually it is
701 not needed, since for normal MC production for MAGIC the
702 telescope is placed at the origin of coordinates (0,0). But,
703 if for some reason, we produce cerxxxxxx files with the
704 telescope in a different position, we must inform the
705 Reflector program in the input card using this option
706 (otherwise Reflector will fail to {\it find} the photons
707 in the cer file).
708
709\item[reflectivity\_file /path/reflectivity.dat]
710
711 File containing mirror reflectivity as a function of
712 wavelength (see section \ref{neededfiles}). If this option is
713 not supplied, the program will look for
714 ``../Data/reflectivity.dat'' as previous versions of
715 Reflector did.
716
717\item[axisdev\_file /path/axisdev.dat]
718
719 File containing single mirror spot deviation in {\bf x} and
720 {\bf y} on the camera in cm (see section
721 \ref{neededfiles}) for each mirror. If this option is not
722 supplied, the program will look for ``../Data/axisdev.dat''
723 as previous versions of Reflector did.
724
725\item[fixed\_target $\Theta$ $\Phi$]
726
727 This statement fixes the telescope axis position. The first
728 number is the zenith angle $\Theta$ (deg) while the second is
729 the azimuthal angle $\Phi$ (deg). This corresponds to {\it
730 CORSIKA}'s definition of primary particle incident direction
731 (see fig. \ref{coorsystems}, left). For instance, $\phi = 90^\circ$
732 means that the telescope is pointing towards East. If this
733 option is omitted the telescope will always point in the
734 direction of the Corsika primary (whatever it is), or a
735 slightly modified direction if the wobble\_mode option is used
736 (see next point). When running the reflector over gamma data
737 generated in a range of zenith angles, one should therefore
738 ommit the fixed\_target option.
739
740\item[wobble\_mode w]
741
742 Indicates whether the reflection should be done in the wobble
743 mode, that is, with shifted pointing with respect to the
744 nominal telescope orientation (given by fixed\_target or
745 otherwise, see above). The wobble mode is described in TDAS
746 01-05. Possible values for w are 0 (no wobble mode), 1, -1
747 (image shift along $x_{camera}$ axis) and 3 (image shift along
748 $y_{camera}$ axis).
749
750\end{description}
751
752%------------------------------------------------------------
753
754\newpage
755\section{Output file \label{out}}
756The output file begins with two ascii lines:\\
757\\
758\verb"reflector 0.6" \\
759\verb"START---RUN" \\
760After the \verb"START---RUN" flag there is a carriage return, and then
761the run header which is basically the one from Corsika with two added
762variables, {\it wobble\_mode} and {\it atmospheric\_model}. Check the
763Corsika manual for the meaning and units of the rest of them. All of the
764variables 4-byte real numbers except the first, which is a 4 character
765string containing the run header ascii label from Corsika:
766\vspace*{0.5cm}
767\\
768%
769\begin{tabular}{ll}
770\parbox{5cm}{Variable} & Description \\
771\hline
772& \\
773ASCII Label & 'RUNH' \\
774RunNumber & \\
775date & \\
776Corsika\_version & \\
777NumObsLev & \\
778HeightLev[10] & \\
779SlopeSpec & \\
780ELowLim & \\
781EUppLim & \\
782EGS4\_flag & \\
783NKG\_flag & \\
784Ecutoffh & \\
785Ecutoffe & \\
786Ecutoffg & \\
787C[50] & \\
788wobble\_mode & Wobble mode with which the reflector was run (TDAS
78901-05) \\
790atmospheric\_model & Atmospheric model used for the absorption
791simulation \\
792& 0 = no atmosphere; 1 = atm\_90percent; \\
793& 2 = atm\_isothermal; 3 = atm\_corsika. \\
794dummy1[18] & not used \\
795CKA[40] & \\
796CETA[5] & \\
797CSTRBA[11] & \\
798dummy2[104] & not used \\
799AATM[5] & \\
800BATM[5] & \\
801CATM[5] & \\
802NFL[4] & \\
803&\\
804\hline
805\end{tabular}
806
807\newpage
808
809Then there comes a ``\verb"START-EVENT"'' flag, followed by a carriage
810return and then the binary event header. Each variable is a 4-byte
811float number except for the first one which is the event header label
812from Corsika (a string of 4 characters). Some of of the variables from
813Corsika are not explained here (see Corsika manual instead).
814\vspace*{0.5cm}
815\\
816\begin{tabular}{ll}
817\parbox{5cm}{Variable} & Description \\
818\hline
819& \\
820ASCII label & 'EVTH' \\
821EvtNumber & Event Number \\
822PrimaryID & Primary particle identification code \\
823Etotal & Primary particle total energy (GeV) \\
824Thick0 & CORSIKA's starting altitude in g/cm2 \\
825FirstTarget & CORSIKA's number of first target if fixed \\
826zFirstInt & Height of first interaction in cm \\
827p[3] & Primary particle momentum in x,y,-z directions (GeV) \\
828Theta & Primary particle zenith angle (rad) \\
829Phi & Primary particle azimuth angle (rad) \\
830
831NumRndSeq & Number of different CORSIKA random sequences (max. 10) \\
832RndData[10][3] & RndData[i][0]: integer seed of sequence i \\
833 & RndData[i][1]: number of offset random calls (mod $10^6$) of sequence i. \\
834 & RndData[i][2]: number of offset random calls ($/10^6$) of sequence i. \\
835
836RunNumber & Run number \\
837DateRun & Date of run yymmdd \\
838Corsika\_version & Version of {\it CORSIKA} \\
839
840NumObsLev & Number of observation levels (should be always 1 for
841us) \\
842HeightLev[10] & Height of observation levels in cm \\
843
844SlopeSpec & Energy spectrum slope \\
845ELowLim & Energy lower limit (GeV) \\
846EUppLim & Energy upper limit (GeV) \\
847Ecutoffh & \\
848Ecutoffm & \\
849Ecutoffe & \\
850Ecutoffg & \\
851NFLAIN & \\
852NFLDIF & \\
853NFLPI0 & \\
854NFLPIF & \\
855NFLCHE & \\
856NFRAGM & \\
857Bx & \\
858By & \\
859EGS4yn & \\
860NKGyn & \\
861GHEISHAyn & \\
862VENUSyn & \\
863& \\
864\hline
865\end{tabular}
866%
867\newpage
868%
869
870\begin{tabular}{ll}
871
872\parbox{5cm}{Variable} & Description \\
873\hline
874& \\
875CERENKOVyn & \\
876NEUTRINOyn & \\
877HORIZONTyn & \\
878COMPUTER & \\
879
880ThetaMin & Minimum Theta of primaries (deg) \\
881ThetaMax & Maximum Theta of primaries (deg) \\
882PhiMin & Minimum Phi of primaries (deg) \\
883PhiMax & Maximum Phi of primaries (deg) \\
884CBunchSize & \\
885CDetInX & \\
886CDetInY & \\
887CSpacInX & \\
888CSpacInY & \\
889CLenInX & \\
890CLenInY & \\
891COutput & \\
892AngleNorthX & \\
893MuonInfo & \\
894StepLength & \\
895CWaveLower & Wavelength lower limit (nm) \\
896CWaveUpper & Wavelength upper limit (nm) \\
897Multipl & \\
898CorePos[2][20] & Core positions of randomized shower \\
899SIBYLL[2] & \\
900QGSJET[2] & \\
901DPMJET[2] & \\
902VENUS\_cross & \\
903mu\_mult\_scat & \\
904NKG\_range & \\
905EFRCTHN[2] & \\
906WMAX[2] & \\
907rthin\_rmax & \\
908viewcone\_angles[2] & Inner and outer angles of Corsika's VIEWCONE
909option. \\
910telescopePhi & Telescope azimuth (rad). Measured from South, counter-clockwise \\
911telescopeTheta & Telescope zenith angle (rad) \\
912TimeFirst & Arrival time on camera of first photon (ns) \\
913TimeLast & Arrival time on camera of last photon (ns) \\
914
915& 6 next variables: CORSIKA longitudinal particle fit parameters \\
916& \hspace{0.5cm} (see CORSIKA manual for precise meaning and units)\\
917longi\_Nmax & Numer of charged particles at maximum \\
918longi\_t0 & Atmospheric depth of shower starting point (N=0) \\
919longi\_tmax & Atmospheric depth of shower maximum (g/cm$^2$) \\
920longi\_a & \\
921longi\_b & For {\bf longi\_a}, {\bf longi\_b}, {\bf longi\_c}, see CORSIKA manual \\
922longi\_c & \\
923longi\_chi2 & $\chi^2/dof$ of the fit\\
924& \\
925\hline
926\end{tabular}
927
928\newpage
929
930\begin{tabular}{ll}
931\parbox{5cm}{Variable} & Description \\
932\hline
933& \\
934CORSIKAPhs & Original photons written by {\it CORSIKA} \\
935AtmAbsPhs & Photons absorbed by the atmosphere \\
936MirrAbsPhs & Photons absorbed by the mirror \\
937OutOfMirrPhs & Photons outside the mirror \\
938BlackSpotPhs & Photons lost in the "black spot" \\
939OutOfChamPhs & Photons outside the camera \\
940CPhotons & Photons reaching the camera \\
941
942elec\_cph\_fraction & Fraction of C-photons produced by electrons \\
943muon\_cph\_fraction & Fraction of C-photons produced by muons \\
944other\_cph\_fraction & Fraction of C-photons produced by electrons \\
945& \\
946\hline
947\end{tabular}
948
949\vspace*{1cm}
950The event header is followed by 8-word blocks, one for each photon
951that reaches the camera. A photon block contains the following
952variables:
953\vspace*{0.5cm}
954\\
955\begin{tabular}{ll}
956Variable & Description \\
957\hline
958& \\
959w & Wavelength (nm) \\
960x, y & Impact point in camera coordinates (cm) \\
961u, v & Director cosines \\
962t & Arrival time on camera (ns) \\
963h & Production height (cm) \\
964phi & Incidence angle with respect to camera plane (rad) \\
965& \\
966\hline
967\end{tabular}
968\vspace*{0.5cm}
969\\
970After the last event photon block there is a blank line, an \verb$END---EVENT$
971flag, another blank line and then the following event. After the last
972event in a run it appears the flag ``\verb$END-----RUN$'', while after all
973the processed runs, a ``\verb$END----FILE$'' flag is written. Finally,
974after this flag an ``ascii tail'' has been added to the file: it
975consists of the ascii files {\it magic.def}, {\it axisdev.dat} and {\it
976reflectivity.dat} one after the other separated by blank lines. In
977this way all the relevant parameters used to produce the output are
978kept together with the reflected events.
979
980%------------------------------------------------------------
981
982\section{Appendix A}
983
984The list of all Reflector files follows.
985\begin{verbatim}
986
987MagicProgs/Simulation/Detector/Reflector_0.6/Changelog
988MagicProgs/Simulation/Detector/Reflector_0.6/Makefile
989MagicProgs/Simulation/Detector/Reflector_0.6/atm.c
990MagicProgs/Simulation/Detector/Reflector_0.6/atm.h
991MagicProgs/Simulation/Detector/Reflector_0.6/attach.c
992MagicProgs/Simulation/Detector/Reflector_0.6/attenu.f
993MagicProgs/Simulation/Detector/Reflector_0.6/config.mk.linux
994MagicProgs/Simulation/Detector/Reflector_0.6/config.mk.linux-gnu
995MagicProgs/Simulation/Detector/Reflector_0.6/config.mk.osf1
996MagicProgs/Simulation/Detector/Reflector_0.6/diag.c
997MagicProgs/Simulation/Detector/Reflector_0.6/diag.h
998MagicProgs/Simulation/Detector/Reflector_0.6/geometry.c
999MagicProgs/Simulation/Detector/Reflector_0.6/geometry.h
1000MagicProgs/Simulation/Detector/Reflector_0.6/header.c
1001MagicProgs/Simulation/Detector/Reflector_0.6/header.h
1002MagicProgs/Simulation/Detector/Reflector_0.6/init.c
1003MagicProgs/Simulation/Detector/Reflector_0.6/init.h
1004MagicProgs/Simulation/Detector/Reflector_0.6/input.card
1005MagicProgs/Simulation/Detector/Reflector_0.6/lagrange.h
1006MagicProgs/Simulation/Detector/Reflector_0.6/parms.c
1007MagicProgs/Simulation/Detector/Reflector_0.6/parms.h
1008MagicProgs/Simulation/Detector/Reflector_0.6/ph2cph.c
1009MagicProgs/Simulation/Detector/Reflector_0.6/refl-install
1010MagicProgs/Simulation/Detector/Reflector_0.6/reflector.c
1011MagicProgs/Simulation/Detector/Reflector_0.6/version.h
1012
1013MagicProgs/Simulation/Detector/Reflector_0.6/doc/Tdas0211.ps.gz
1014MagicProgs/Simulation/Detector/Reflector_0.6/doc/Tdas0211.tex
1015MagicProgs/Simulation/Detector/Reflector_0.6/doc/magic-tdas.sty
1016MagicProgs/Simulation/Detector/Reflector_0.6/doc/magiclogo.eps
1017MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/colimation.eps.gz
1018MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/coma.eps.gz
1019MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/coma_star.eps.gz
1020MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/coorsystems.eps.gz
1021MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/evcompare.eps.gz
1022MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/parabola.eps.gz
1023MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/refl06images.eps.gz
1024MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/spot10kmf1694.eps.gz
1025MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/spot10kmf1700.eps.gz
1026MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/spot_inf_f1697.eps.gz
1027MagicProgs/Simulation/Detector/Reflector_0.6/doc/eps/telecoor.eps.gz
1028
1029MagicProgs/Simulation/Detector/Reflector_0.6/tester/Makefile
1030MagicProgs/Simulation/Detector/Reflector_0.6/tester/cermaker.c
1031
1032MagicProgs/Simulation/Detector/Data/axisdev.dat
1033MagicProgs/Simulation/Detector/Data/magic.def
1034MagicProgs/Simulation/Detector/Data/reflectivity.dat
1035
1036MagicProgs/Simulation/Detector/lib/libranlib.a.osf1
1037MagicProgs/Simulation/Detector/lib/libranlib.a.linux
1038
1039\end{verbatim}
1040
1041%%% BIBLIOGRAPHY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1042
1043%%>>>> Use the following if you are using BibTeX for bibliography
1044%\theBibliography
1045
1046%%>>>> Or the following if you include here by hand your
1047%%>>>> bibliographic entries
1048
1049\end{document}
1050%
1051%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1052%%% Upper-case A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1053%%% Lower-case a b c d e f g h i j k l m n o p q r s t u v w x y z
1054%%% Digits 0 1 2 3 4 5 6 7 8 9
1055%%% Exclamation ! Double quote " Hash (number) #
1056%%% Dollar $ Percent % Ampersand &
1057%%% Acute accent ' Left paren ( Right paren )
1058%%% Asterisk * Plus + Comma ,
1059%%% Minus - Point . Solidus /
1060%%% Colon : Semicolon ; Less than <
1061%%% Equals = Greater than > Question mark ?
1062%%% At @ Left bracket [ Backslash \
1063%%% Right bracket ] Circumflex ^ Underscore _
1064%%% Grave accent ` Left brace { Vertical bar |
1065%%% Right brace } Tilde ~
1066%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1067%% Local Variables:
1068%% mode:latex
1069%% mode:font-lock
1070%% mode:auto-fill
1071%% time-stamp-line-limit:100
1072%% End:
1073%% EOF
Note: See TracBrowser for help on using the repository browser.