| 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 | ! macro comprob.C
|
|---|
| 18 | !
|
|---|
| 19 | ! Author(s): Abelardo Moralejo
|
|---|
| 20 | ! Author(s): Thomas Bretz, 2002 <mailto:tbretz@astro.uni-wuerzburg.de>
|
|---|
| 21 | !
|
|---|
| 22 | ! Copyright: MAGIC Software Development, 2000-2002
|
|---|
| 23 | !
|
|---|
| 24 | !
|
|---|
| 25 | \* ======================================================================== */
|
|---|
| 26 |
|
|---|
| 27 | void comprob()
|
|---|
| 28 | {
|
|---|
| 29 | //
|
|---|
| 30 | // Create a empty Parameter List and an empty Task List
|
|---|
| 31 | // The tasklist is identified in the eventloop by its name
|
|---|
| 32 | //
|
|---|
| 33 | MParList plist;
|
|---|
| 34 |
|
|---|
| 35 | // Create task list and add it to the parameter list:
|
|---|
| 36 | MTaskList tlist;
|
|---|
| 37 | plist.AddToList(&tlist);
|
|---|
| 38 |
|
|---|
| 39 | // First task in list: read mars file
|
|---|
| 40 | MReadMarsFile read("Events", "star.root");
|
|---|
| 41 | read.DisableAutoScheme();
|
|---|
| 42 | tlist.AddToList(&read);
|
|---|
| 43 |
|
|---|
| 44 | // Task to do the composite analysis of Hillas parameters:
|
|---|
| 45 | MHCompProb compprob(500);
|
|---|
| 46 | compprob.Add("MHillas.fWidth", 500, 0, 160);
|
|---|
| 47 | compprob.Add("MHillas.fLength", 500, 0, 300);
|
|---|
| 48 | compprob.Add("abs(MHillas.fAsym)", 500, 0, 400);
|
|---|
| 49 | compprob.Add("HillasSource.fDist", 500, 0, 400);
|
|---|
| 50 | compprob.Add("abs(HillasSource.fHeadTail)", 500, 0, 400);
|
|---|
| 51 | compprob.Add("abs(MHillas.fM3Long)", 500, 0, 300);
|
|---|
| 52 | compprob.Add("abs(MHillas.fM3Trans)", 500, 0, 150);
|
|---|
| 53 | compprob.Add("MHillas.fConc1", 500, 0, 0.6);
|
|---|
| 54 | compprob.Add("MHillas.fConc", 500, 0, 0.9);
|
|---|
| 55 | compprob.Add("log10(MHillas.fSize)", 500, 0, 5);
|
|---|
| 56 |
|
|---|
| 57 | plist.AddToList(&compprob);
|
|---|
| 58 |
|
|---|
| 59 | MFillH fill(&compprob, "MMcEvt");
|
|---|
| 60 |
|
|---|
| 61 | // Energy filter:
|
|---|
| 62 | /*
|
|---|
| 63 | MF filter("MMcEvt.fEnergy < 100");
|
|---|
| 64 | fill->SetFilter(&filter);
|
|---|
| 65 | tlist.AddToList(&filter);
|
|---|
| 66 | */
|
|---|
| 67 |
|
|---|
| 68 | tlist.AddToList(&fill);
|
|---|
| 69 |
|
|---|
| 70 | //
|
|---|
| 71 | // Create and setup the eventloop
|
|---|
| 72 | //
|
|---|
| 73 | MEvtLoop evtloop;
|
|---|
| 74 | evtloop.SetParList(&plist);
|
|---|
| 75 |
|
|---|
| 76 | // Loop over all data to fill the "normal" histograms:
|
|---|
| 77 | if (!evtloop.Eventloop())
|
|---|
| 78 | return;
|
|---|
| 79 |
|
|---|
| 80 | tlist.PrintStatistics();
|
|---|
| 81 |
|
|---|
| 82 | gLog.SetDebugLevel(2);
|
|---|
| 83 |
|
|---|
| 84 | // Loop to fill the variable bin histograms:
|
|---|
| 85 | read.SetEventNum(0);
|
|---|
| 86 | if (!evtloop.Eventloop())
|
|---|
| 87 | return;
|
|---|
| 88 |
|
|---|
| 89 | // ------------------------------------------------------------------
|
|---|
| 90 |
|
|---|
| 91 | // Create task list and replace the old task list with the new one
|
|---|
| 92 | MTaskList tlist2;
|
|---|
| 93 | plist.Replace(&tlist2);
|
|---|
| 94 |
|
|---|
| 95 | // First task in list: read mars file
|
|---|
| 96 | MReadMarsFile read2("Events", "star2.root");
|
|---|
| 97 | read2.DisableAutoScheme();
|
|---|
| 98 | tlist2.AddToList(&read2);
|
|---|
| 99 |
|
|---|
| 100 | // create task to calculate composite probabilities
|
|---|
| 101 | MCompProbCalc calc;
|
|---|
| 102 | tlist2.AddToList(&calc);
|
|---|
| 103 |
|
|---|
| 104 | // fill probabilities (hadroness) into histogram
|
|---|
| 105 | MFillH fill2("MHHadroness");
|
|---|
| 106 | tlist2.AddToList(&fill2);
|
|---|
| 107 |
|
|---|
| 108 | // Loop to fill the hadronness histograms:
|
|---|
| 109 | if (!evtloop.Eventloop())
|
|---|
| 110 | return;
|
|---|
| 111 |
|
|---|
| 112 | plist.FindObject("MHHadroness")->DrawClone();
|
|---|
| 113 | plist.FindObject("MHHadroness")->Print();
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|