source: trunk/MagicSoft/Mars/macros/optim/optimdisp.C@ 8955

Last change on this file since 8955 was 8656, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1/* More explanations at the end of the file */
2void optimdisp()
3{
4 MJOptimizeDisp opt; // Initialize optimization class
5 opt.SetDebug(2); // Choose the level of output
6 opt.SetOptimizer(MJOptimize::kMigrad); // Choose the fit algorithm (see MJOptimize)
7 opt.EnableTestTrain(); // Split sample into test and train
8
9 // -------------------- Setup ----------------------------
10
11 opt.AddParameter("1-MHillas.fWidth/MHillas.fLength"); // M[0]
12 opt.AddParameter("MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg"); // M[1]
13 opt.AddParameter("MNewImagePar.fLeakage1"); // M[2]
14 opt.AddParameter("log10(MHillas.fSize)"); // M[3]
15
16 // -------------- Parametrization --------------------
17
18 char *r = "M[0]*([0] + [1]*M[1] + [2]*M[2] + (M[3]>[3])*[4]*(M[3]-[3])^2)";
19
20 opt.FixParameter(0, 1.266195);
21 opt.FixParameter(1, 0.100577);
22 opt.FixParameter(2, 1.80309);
23 opt.FixParameter(3, 2.87177);
24 opt.FixParameter(4, 0.616823);
25
26 opt.AddPreCut("MNewImagePar.fLeakage1>0");
27 opt.AddPreCut("log10(MHillas.fSize)<3.2");
28
29 //opt.AddPreCut("abs(MHillasSrc.fDCA*MGeomCam.fConvMm2Deg)<0.2");
30 //opt.AddPreCut("(MHillasSrc.fDist*MGeomCam.fConvMm2Deg-0.5)*7.2>MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg");
31 opt.AddPreCut("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg>-0.07");
32 opt.AddPreCut("DataType.fVal>0.5");
33
34 // -------------------- Run ----------------------------
35
36 MStatusDisplay *d = new MStatusDisplay;
37 opt.SetDisplay(d);
38
39 /*
40 -------------------- Magic-Cuts ----------------------
41 MFMagicCuts cuts;
42 cuts.SetHadronnessCut(MFMagicCuts::kArea);
43 cuts.SetThetaCut(MFMagicCuts::kNone);
44
45 TArrayD arr(10);
46 arr[0]= 1.3245;
47 arr[1]= 0.208700;
48 arr[2]= 0.0836169;
49 arr[3]= 5.63973;
50 arr[4]= 0.0844195;
51 arr[5]= -0.07;
52 arr[6]= 13.2;
53 arr[7]= 1.0;
54 arr[8]= 7.2;
55 arr[9]= 0.5;
56
57 cuts.SetVariables(arr);
58
59 opt.AddPreCut(&cuts);
60
61 -------------------- Energy Slope --------------------
62 MFEnergySlope slope(-2.8);
63 opt.AddPreCut(&slope);
64
65 -------------------- Other cuts ----------------------
66 */
67
68 opt.RunDisp("ganymed00000001-summary.root", r);
69}
70
71/* ------------------ Good strategy -------------------
72
73 Par | 0 1 2 3 4 | Cut
74 -------+---------------------------------+-----------------------
75 Fit 1 | 1.3 0.8 fix=0 fix=0 fix=0 | Leak1==0 lgSize<2.5
76 Fit 2 | fix fix fix=0 2.4 0.3 | Leak1==0
77 Fit 2 | fix fix 1.8 fix fix | Leak1>0
78 Fit 3 | free free fix fix fix | -/-
79 -------+---------------------------------+-----------------------
80*/
Note: See TracBrowser for help on using the repository browser.