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): Thomas Bretz, 4/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // derotate.C - STandard Analysis and Reconstruction (MC example)
|
---|
28 | //
|
---|
29 | // Derotate a MCamEvent and fill a histogram with derotated data
|
---|
30 | // (sky-plot)
|
---|
31 | //
|
---|
32 | /////////////////////////////////////////////////////////////////////////////
|
---|
33 |
|
---|
34 | void derotatedc()
|
---|
35 | {
|
---|
36 | //
|
---|
37 | // Create a empty Parameter List and an empty Task List
|
---|
38 | // The tasklist is identified in the eventloop by its name
|
---|
39 | //
|
---|
40 | MParList plist;
|
---|
41 |
|
---|
42 | MTaskList tlist;
|
---|
43 | plist.AddToList(&tlist);
|
---|
44 |
|
---|
45 | // Define Observatory location (for derotation)
|
---|
46 | MObservatory obs;
|
---|
47 | plist.AddToList(&obs);
|
---|
48 |
|
---|
49 | // Set the camera geometry (for histogram size)
|
---|
50 | MGeomCamMagic cam;
|
---|
51 | plist.AddToList(&cam);
|
---|
52 |
|
---|
53 | // setup pointing position
|
---|
54 | MPointingPos ppos;
|
---|
55 | ppos.SetSkyPosition(MAstro::Hms2Hor(5, 34, 31.9), MAstro::Dms2Deg(22, 0, 52.0));
|
---|
56 | plist.AddToList(&ppos);
|
---|
57 |
|
---|
58 | // Define which file to read
|
---|
59 | MReadTree read("Currents", "../dc.root");
|
---|
60 | read.DisableAutoScheme();
|
---|
61 |
|
---|
62 | // Derotated histogram to fill
|
---|
63 | MHCamEventRot hist;
|
---|
64 |
|
---|
65 | // Set name of time container corresponding to your data
|
---|
66 | hist.SetNameTime("MTimeCurrents");
|
---|
67 |
|
---|
68 | // Setup fill task
|
---|
69 | MFillH fill(&hist, "MCameraDC");
|
---|
70 |
|
---|
71 | // Set a draw option for your 2D histogram
|
---|
72 | //fill.SetDrawOption("colz");
|
---|
73 |
|
---|
74 | // Setup tasklist
|
---|
75 | tlist.AddToList(&read);
|
---|
76 | tlist.AddToList(&fill);
|
---|
77 |
|
---|
78 | //
|
---|
79 | // Create and setup the eventloop
|
---|
80 | //
|
---|
81 | MEvtLoop evtloop;
|
---|
82 | evtloop.SetParList(&plist);
|
---|
83 |
|
---|
84 | MStatusDisplay *d = new MStatusDisplay;
|
---|
85 | evtloop.SetDisplay(d);
|
---|
86 |
|
---|
87 | //
|
---|
88 | // Execute your analysis
|
---|
89 | //
|
---|
90 | if (!evtloop.Eventloop())
|
---|
91 | return;
|
---|
92 |
|
---|
93 | tlist.PrintStatistics();
|
---|
94 | }
|
---|