source: trunk/MagicSoft/Mars/mtemp/mmpi/macros/falsesourcemethod.C@ 4998

Last change on this file since 4998 was 4097, checked in by mazin, 20 years ago
*** empty log message ***
File size: 5.7 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 Cherenkov 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! Author(s): Daniel Mazin, 05/2004 <mailto:mazin@imppmu.mpg.de>
18!
19! Copyright: MAGIC Software Development, 2000-2004
20!
21!
22\* ======================================================================== */
23
24
25// Daniel Mazin 14.05.2004 mazin@mppmu.mpg.de
26// **********************************************************************************
27// this macro is used to produce false source plots
28// either using one sample only (usually used for OFF, set TYPEOPTION = kFALSE)
29// or in addition using the background estimation from OFF (set TYPEOPTION = kTRUE).
30// The later option can be used ONLY if false source method for the OFF data
31// has taken place before.
32// input: hillas parameter file
33// output: several 2D plots in a root file +
34// ascii file with parameters like significance, Nexcess etc.
35// **********************************************************************************
36
37
38// you may want to change these values:
39#define STEPGRID 0.05 // [deg]
40#define MINXGRID -1. // [deg]
41#define MINYGRID -1. // [deg]
42#define MAXXGRID 1. // [deg]
43#define MAXYGRID 1. // [deg]
44
45#define ALPHAMAX 10. // [deg], ON region in the alpha plot, maybe 5 deg is better
46 // NOTE: up to now only values of 5, 10, 15, 20 degrees are possible
47
48// if you wish to rotate set to kTRUE, else kFALSE
49const Bool_t ROTOPTION = kFALSE;
50const Bool_t TYPEOPTION = kFALSE; // kFALSE = estimate background from the same sample
51 // kTRUE = estimate background also from OFF data
52const Bool_t CUTOPTION = kTRUE; // kTRUE = dynamical cuts
53 // kFALSE = statical cuts
54
55/* ****************************************************** */
56 /* static cuts */
57#define LENGTHMIN 0.10 // deg
58#define LENGTHMAX 0.32 // deg
59#define WIDTHMIN 0.06 // deg
60#define WIDTHMAX 0.15 // deg
61#define SIZEMIN 2000. // photons
62#define DISTMIN 0.6 // deg
63#define DISTMAX 1.3 // deg
64#define LEAKMAX 0.25 // deg
65/* ****************************************************** */
66
67/* ****************************************************** */
68 /* dynamical cuts Crab 27th Jan 2004 */
69#define LENGTHMINParA 0.136 // deg
70#define LENGTHMINParB 0.036 //
71#define LENGTHMINParC -0.0038 //
72#define LENGTHMAXParA 0.332 // deg
73#define LENGTHMAXParB 0.037 //
74#define LENGTHMAXParC 0.0261 //
75#define WIDTHMINParA 0.063 // deg
76#define WIDTHMINParB 0.013 //
77#define WIDTHMINParC 0.0003 //
78#define WIDTHMAXParA 0.123 // deg
79#define WIDTHMAXParB 0.019 //
80#define WIDTHMAXParC 0.0005 //
81#define DISTMINParA 0.6 // deg
82#define DISTMINParB 0.059 //
83#define DISTMINParC 0. //
84#define DISTMAXParA 1.25 // deg
85#define DISTMAXParB 0.059 //
86#define DISTMAXParC 0. //
87/* ****************************************************** */
88
89 /* dynamical cuts Mrk 421 and Crab 15th Feb 2004 */
90
91/*
92#define LENGTHMINParA 0.12 // deg
93#define LENGTHMINParB 0.034 //
94#define LENGTHMINParC 0. //
95#define LENGTHMAXParA 0.32 // deg
96#define LENGTHMAXParB 0.034 //
97#define LENGTHMAXParC 0. //
98#define WIDTHMINParA 0.055 // deg
99#define WIDTHMINParB 0.013 //
100#define WIDTHMINParC 0.0 //
101#define WIDTHMAXParA 0.12 // deg
102#define WIDTHMAXParB 0.013 //
103#define WIDTHMAXParC 0.0 //
104#define DISTMINParA 0.6 // deg
105#define DISTMINParB 0.059 //
106#define DISTMINParC 0. //
107#define DISTMAXParA 1.25 // deg
108#define DISTMAXParB 0.059 //
109#define DISTMAXParC 0. //
110*/
111/* ****************************************************** */
112
113// please do not change these values:
114#define NUMSTEPS (int) ((MAXXGRID - MINXGRID) / STEPGRID + 1.5)
115#define GRIDBINS (int) (NUMSTEPS * NUMSTEPS + 0.5)
116
117
118#include "mtools.C"
119#include <skyplot.h> // needed histograms
120
121// this helps me to check if the binning is ok
122#define TOLERANCE 1e-3
123
124#include "hillasfileread.C"
125#include "gridloop.C"
126
127void falsesourcemethod()
128{
129
130 if (TYPEOPTION == kTRUE) // output of OFF data sample
131// DATPARAMIN = "data/ressignOffMrk3004.dat"; // 3000
132 DATPARAMIN = "paramOffCrab2701.dat"; // 2000
133
134
135 HILLASFILENAME = "~/data/Crab/2004_01_27/CrabHillasOFF.root";
136 DATPARAMOUT = "paramOffCrab2701.dat";
137 ROOTPLOTNAME = "/.magic/magicserv01/scratch/Daniel/plots/RootPlots/Crab/2004_01_27/CrabOffSkyPlots.root";
138 hillasfileread();
139 gridloop();
140
141/*
142// use this loop for different subsamples
143 for(Int_t i=1; i<10; i++)
144 {
145 HILLASFILENAME = "~/data/Crab15022004Update/sample";
146 DATPARAMOUT = "data/ressignOnOffCrab1502Samp";
147 ROOTPLOTNAME = "/.magic/magicserv01/scratch/Daniel/plots/RootPlots/Crab15022004Update/Crab1502Sample";
148
149 HILLASFILENAME += i;
150 HILLASFILENAME += "/";
151 HILLASFILENAME += "CrabHillasON";
152 HILLASFILENAME += ".root";
153
154 DATPARAMOUT += i;
155 DATPARAMOUT += "_AlphaCut";
156 DATPARAMOUT += TMath::Nint(ALPHAMAX);
157 DATPARAMOUT += "deg";
158 DATPARAMOUT += ".dat";
159
160 ROOTPLOTNAME += i;
161 ROOTPLOTNAME += "_AlphaCut";
162 ROOTPLOTNAME += TMath::Nint(ALPHAMAX);
163 ROOTPLOTNAME += "deg";
164 ROOTPLOTNAME += ".root";
165
166
167 hillasfileread();
168 gridloop();
169 }
170*/
171}
Note: See TracBrowser for help on using the repository browser.