source: trunk/MagicSoft/Mars/mtemp/mifae/macros/DispSkymap.C@ 6032

Last change on this file since 6032 was 6030, checked in by domingo, 21 years ago
*** empty log message ***
File size: 3.6 KB
Line 
1//************************************************************************
2//
3// Authors : Eva Domingo, 1/2005 <mailto:domingo@ifae.es>
4//
5//
6// Macro for generating DISP Skymap of the FoV
7// -------------------------------------------
8//
9//************************************************************************
10
11void DispSkymap(TString filename = "hillasfile.root")
12{
13 //======================================================================
14 // Make Disp plots
15 //======================================================================
16
17 gLog << "-----------------------------------------------------" << endl;
18 gLog << "Make Disp related plots" << endl;
19 gLog << "-----------------------------------------------------" << endl;
20
21 // Input root file/s storing the computed Hillas and Disp parameters
22 gLog << "Input file/s: " << filename << endl;
23
24 //----------------------------------------------------
25 MTaskList tlist;
26 MParList plist;
27
28 // MReadMarsFile read("Events", filename);
29 MReadTree read("Parameters", filename);
30 read.DisableAutoScheme();
31
32 MGeomCamMagic geomcam;
33
34 // set cuts to select an event sample to apply Disp
35 MFDisp *fdisp = NULL;
36 // fdisp = new MFDisp;
37 // fdisp->SetCuts(0,1,7,600,0,600,0.,3000000.,0.,0.,0.,0.,0.,0.);
38 // MContinue contdisp(fdisp);
39
40 // make Disp plots
41 // SelectedPos = 1 means choose the right source position
42 // 2 wrong
43 // 3 the position according to M3Long
44 // 4 the position according to Asym
45 MHDisp hdisp1;
46 hdisp1.SetName("MHDispCorr");
47 hdisp1.SetSelectedPos(1);
48 MFillH filldisp1("MHDispCorr[MHDisp]", "");
49
50 MHDisp hdisp2;
51 hdisp2.SetName("MHDispWrong");
52 hdisp2.SetSelectedPos(2);
53 MFillH filldisp2("MHDispWrong[MHDisp]", "");
54
55 MHDisp hdisp3;
56 hdisp3.SetName("MHDispM3Long");
57 hdisp3.SetSelectedPos(3);
58 MFillH filldisp3("MHDispM3Long[MHDisp]", "");
59
60 MHDisp hdisp4;
61 hdisp4.SetName("MHDispAsym");
62 hdisp4.SetSelectedPos(4);
63 MFillH filldisp4("MHDispAsym[MHDisp]", "");
64
65
66 //*****************************
67 // entries in MParList
68 plist.AddToList(&tlist);
69 plist.AddToList(&geomcam);
70 plist.AddToList(&hdisp1);
71 plist.AddToList(&hdisp2);
72 plist.AddToList(&hdisp3);
73 plist.AddToList(&hdisp4);
74
75 //*****************************
76 // entries in MTaskList
77 tlist.AddToList(&read);
78 if (fdisp != NULL)
79 tlist.AddToList(&contdisp);
80 tlist.AddToList(&filldisp1);
81 // tlist.AddToList(&filldisp2);
82 tlist.AddToList(&filldisp3);
83 tlist.AddToList(&filldisp4);
84
85 //*****************************
86
87 //-------------------------------------------
88 // Execute event loop
89 //
90 MProgressBar bar;
91 MEvtLoop evtloop;
92 evtloop.SetParList(&plist);
93 evtloop.SetProgressBar(&bar);
94
95 Int_t maxevents = -1;
96 if ( !evtloop.Eventloop(maxevents) )
97 return;
98
99 tlist.PrintStatistics(0, kTRUE);
100
101 //-------------------------------------------
102 // Display the histograms
103 //
104 // hdisp1.DrawClone();
105 // hdisp2.DrawClone();
106 // hdisp3.DrawClone();
107 // hdisp4.DrawClone();
108
109 gLog << "Drawing DISP Skymap for the FoV (srcpos solution selected according Asym sign)..." << endl;
110 TCanvas *c = new TCanvas("c","Disp Skymap",0,0,900,900);
111 c->SetBorderMode(0);
112 gStyle->SetPalette(1);
113 TH2F *skymap = hdisp4.GetSkymapXY();
114 skymap->SetTitleOffset(1.2,"Y");
115 // skymap->SetStats(0);
116 skymap->DrawClone("COLZ");
117 skymap->SetBit(kCanDelete);
118
119
120 //-------------------------------------------
121 gLog << endl << "Disp plots were made for file '" << filename << endl;
122 gLog << "-----------------------------------------------------" << endl;
123
124}
125
126
127
128
129
130
131
132
133
134
Note: See TracBrowser for help on using the repository browser.