source: trunk/MagicSoft/Mars/macros/multidimdist.C@ 1354

Last change on this file since 1354 was 1337, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.6 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): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
19! Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26void multidimdist()
27{
28 //
29 // This is a demonstration program which calculates the Hillas
30 // parameter out of a Magic root file.
31
32 //
33 // Create a empty Parameter List and an empty Task List
34 // The tasklist is identified in the eventloop by its name
35 //
36 MParList plist;
37
38 MTaskList tlist;
39 plist.AddToList(&tlist);
40
41 //
42 // Now setup the tasks and tasklist:
43 // ---------------------------------
44 //
45 // The first argument is the tree you want to read.
46 // Events: Cosmic ray events
47 // PedEvents: Pedestal Events
48 // CalEvents: Calibration Events
49 //
50 MReadMarsFile read("Events", "star.root");
51 read.DisableAutoScheme();
52 tlist.AddToList(&read);
53
54 MFParticleId fgamma("MMcEvt", '=', kGAMMA);
55 tlist.AddToList(&fgamma);
56
57 MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
58 tlist.AddToList(&fhadrons);
59
60 MHMatrix matrix("MatrixGammas");
61 matrix.AddColumn("MHillas.fWidth");
62 matrix.AddColumn("MHillas.fLength");
63 matrix.AddColumn("MHillas.fWidth*MHillas.fLength/MHillas.fSize");
64 matrix.AddColumn("abs(MHillas.fAsym)");
65 matrix.AddColumn("abs(MHillas.fM3Long)");
66 matrix.AddColumn("abs(MHillas.fM3Trans)");
67 matrix.AddColumn("abs(HillasSource.fHeadTail)");
68 matrix.AddColumn("MHillas.fConc");
69 matrix.AddColumn("MHillas.fConc1");
70 matrix.AddColumn("HillasSource.fDist");
71 matrix.AddColumn("log10(MHillas.fSize)");
72 plist.AddToList(&matrix);
73
74 MHMatrix matrix2("MatrixHadrons");
75 matrix2.AddColumns(&matrix);
76 plist.AddToList(&matrix2);
77
78 MFillH fillmat("MatrixGammas");
79 fillmat.SetFilter(&fgamma);
80 tlist.AddToList(&fillmat);
81
82 MFillH fillmat2("MatrixHadrons");
83 fillmat2.SetFilter(&fhadrons);
84 tlist.AddToList(&fillmat2);
85
86 //
87 // Create and setup the eventloop
88 //
89 MEvtLoop evtloop;
90 evtloop.SetParList(&plist);
91
92 //
93 // Execute your analysis
94 //
95 if (!evtloop.Eventloop())
96 return;
97
98 tlist.PrintStatistics();
99
100 // ---------------------------------------------------------
101
102 MTaskList tlist2;
103
104 plist.Replace(&tlist2);
105
106 MReadMarsFile read2("Events", "star2.root");
107 read2.DisableAutoScheme();
108 tlist2.AddToList(&read2);
109
110 MMultiDimDistCalc calc(5);
111 tlist2.AddToList(&calc);
112
113 MFillH fillh("MHHadroness");
114
115 /*
116 MF filter("MMcEvt.fEnergy < 100");
117 fillh.SetFilter(&filter);
118 tlist2.AddToList(&filter);
119 */
120
121 tlist2.AddToList(&fillh);
122
123 //
124 // Execute your analysis
125 //
126 if (!evtloop.Eventloop())
127 return;
128
129 tlist2.PrintStatistics();
130
131 plist.FindObject("MHHadroness")->DrawClone();
132 plist.FindObject("MHHadroness")->Print();
133}
Note: See TracBrowser for help on using the repository browser.