source: trunk/Mars/macros/optim/optimdisp.C@ 15843

Last change on this file since 15843 was 9308, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 2.9 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.15136);
21 opt.FixParameter(1, 0.0681437);
22 opt.FixParameter(2, 2.62932);
23 opt.FixParameter(3, 1.51279);
24 opt.FixParameter(4, 0.0507821);
25
26 opt.AddPreCut("MNewImagePar.fLeakage1>0");
27 //opt.AddPreCut("log10(MHillas.fSize)<2.5"); //3.2
28
29 opt.AddPreCut("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg>-0.07");
30 opt.AddPreCut("DataType.fVal>0.5");
31
32 //opt.AddPreCut("abs(MHillasSrc.fDCA*MGeomCam.fConvMm2Deg)<0.2");
33 //opt.AddPreCut("(MHillasSrc.fDist*MGeomCam.fConvMm2Deg-0.5)*7.2>MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg");
34
35 // -------------------- Run ----------------------------
36
37 MStatusDisplay *d = new MStatusDisplay;
38 opt.SetDisplay(d);
39
40 /*
41 -------------------- Magic-Cuts ----------------------
42 MFMagicCuts cuts;
43 cuts.SetHadronnessCut(MFMagicCuts::kArea);
44 cuts.SetThetaCut(MFMagicCuts::kNone);
45
46 TArrayD arr(10);
47 arr[0]= 1.3245;
48 arr[1]= 0.208700;
49 arr[2]= 0.0836169;
50 arr[3]= 5.63973;
51 arr[4]= 0.0844195;
52 arr[5]= -0.07;
53 arr[6]= 13.2;
54 arr[7]= 1.0;
55 arr[8]= 7.2;
56 arr[9]= 0.5;
57
58 cuts.SetVariables(arr);
59
60 opt.AddPreCut(&cuts);
61
62 -------------------- Energy Slope --------------------
63 MFEnergySlope slope(-2.8);
64 opt.AddPreCut(&slope);
65
66 -------------------- Other cuts ----------------------
67 */
68
69 // opt.SetPathOut("optimdisp.root");
70 opt.RunDisp("ganymed00000001-summary.root", r);
71}
72
73/* ------------------ Good strategy -------------------
74
75 Par | 0 1 2 3 4 | Cut
76 -------+---------------------------------+-----------------------
77 Fit 1 | 1.3 0.1 fix=0 fix=0 fix=0 | Leak1==0 lgSize<2.5
78 Fit 2 | fix fix fix=0 2.5 0.2 | Leak1==0
79 Fit 2 | fix fix 1.8 fix fix | Leak1>0
80 Fit 3 | free free fix fix fix | -/-
81 Fit 4 | fix fix fix free free | -/-
82 Fit 5 | fix fix free fix fix | -/-
83 -------+---------------------------------+-----------------------
84*/
Note: See TracBrowser for help on using the repository browser.