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 | // Daniel Mazin 26.09.2004 mazin@mppmu.mpg.de
|
---|
25 | //**********************************************************
|
---|
26 | // this macro :
|
---|
27 | // 1) take Hillas Parameters and produce a sky plot
|
---|
28 | //**********************************************************
|
---|
29 |
|
---|
30 | gROOT->Reset();
|
---|
31 |
|
---|
32 | //************************************************************************
|
---|
33 | void MySkyPlot(const char *onfile)
|
---|
34 | {
|
---|
35 |
|
---|
36 | TString fileON = onfile;
|
---|
37 |
|
---|
38 | // name of input root file
|
---|
39 | TString filenamein(fileON);
|
---|
40 |
|
---|
41 |
|
---|
42 | // set up the task list:
|
---|
43 | //-----------------------------------------------------------
|
---|
44 | MTaskList tlist;
|
---|
45 | MParList plist;
|
---|
46 |
|
---|
47 |
|
---|
48 | TString XPosMaxString ("MSrcPosCam.fX<0.1");
|
---|
49 | MContinue XPosMaxCut(XPosMaxString);
|
---|
50 | XPosMaxCut.SetInverted();
|
---|
51 |
|
---|
52 | TString XPosMinString ("MSrcPosCam.fX>-0.1");
|
---|
53 | MContinue XPosMinCut(XPosMinString);
|
---|
54 | XPosMinCut.SetInverted();
|
---|
55 |
|
---|
56 | TString YPosMaxString ("MSrcPosCam.fY<0.1");
|
---|
57 | MContinue YPosMaxCut(YPosMaxString);
|
---|
58 | YPosMaxCut.SetInverted();
|
---|
59 |
|
---|
60 | TString YPosMinString ("MSrcPosCam.fY>-0.1");
|
---|
61 | MContinue YPosMinCut(YPosMinString);
|
---|
62 | YPosMinCut.SetInverted();
|
---|
63 |
|
---|
64 |
|
---|
65 |
|
---|
66 | MSkyPlot skyplot;
|
---|
67 | skyplot.SetMinDist(0.2);
|
---|
68 | //skyplot.ReadCuts("/local/supercuts/OptSCParametersONOFFThetaRange0_1570mRad.root");
|
---|
69 | //skyplot.ReadCuts("/remote/home/pc1/operator/mazin/supercuts/2004_09_13/Zd20_60all/Cuts.root");
|
---|
70 | //skyplot.ReadCuts("/local/supercuts/2004_09_13/OptDynCuts2000CrabNebula.root");
|
---|
71 | //skyplot.ReadCuts("/remote/home/pc17/operator/OnlineA/supercuts/OptDynCuts2000CrabNebula.root");
|
---|
72 | //skyplot.ReadCuts("/home/pcmagic04/pratik/crab_analysis/sept2k4/gt2000/RootFileDynCuts_crabsept_GREEN_15o30deg.root");
|
---|
73 | skyplot.ReadCuts("/home/pcmagic04/pratik/crab_analysis/sept2k4/gt2000/RootFileDynCuts_20to30deg_alldata.root");
|
---|
74 | skyplot.SetSkyPlot(-1.,1.,-1.,1.,0.05);
|
---|
75 | skyplot.SetSizeMin(2000.);
|
---|
76 | skyplot.SetSizeMax(1e6);
|
---|
77 | skyplot.SetOutputAlphaName("Crab21_UV.root");
|
---|
78 | skyplot.SetOutputSkyName("Crab21_UV.root");
|
---|
79 |
|
---|
80 |
|
---|
81 | MObservatory mobs;
|
---|
82 |
|
---|
83 | plist.AddToList(&mobs);
|
---|
84 |
|
---|
85 | // geometry is needed in MHHillas... classes
|
---|
86 | const MGeomCam *fGeom =
|
---|
87 | (MGeomCam*)plist->FindCreateObj("MGeomCamMagic", "MGeomCam");
|
---|
88 |
|
---|
89 | //-------------------------------------------
|
---|
90 | // create the tasks which should be executed
|
---|
91 | //
|
---|
92 |
|
---|
93 | MReadReports read;
|
---|
94 | read.AddTree("Drive");
|
---|
95 | // read.AddTree("CC");
|
---|
96 | // read.AddTree("Events");
|
---|
97 | read.AddTree("Events","MTime.",kTRUE);
|
---|
98 |
|
---|
99 | read.AddFile(filenamein);
|
---|
100 |
|
---|
101 | read.AddToBranchList("MReportDrive.*");
|
---|
102 | // read.AddToBranchList("MRawEvtHeader.*");
|
---|
103 |
|
---|
104 |
|
---|
105 | //MReadMarsFile read("Events", filenamein);
|
---|
106 | //MReadMarsFile read(filenamein);
|
---|
107 | //read.DisableAutoScheme();
|
---|
108 |
|
---|
109 | MGeomApply apply;
|
---|
110 |
|
---|
111 |
|
---|
112 |
|
---|
113 | //*****************************
|
---|
114 | // entries in MParList
|
---|
115 |
|
---|
116 | plist.AddToList(&tlist);
|
---|
117 |
|
---|
118 | // pliston.AddToList(&source);
|
---|
119 |
|
---|
120 | //*****************************
|
---|
121 | // entries in MTaskList
|
---|
122 |
|
---|
123 |
|
---|
124 | tlist.AddToList(&read);
|
---|
125 | tlist.AddToList(&apply);
|
---|
126 |
|
---|
127 | tlist.AddToList(&XPosMaxCut);
|
---|
128 | tlist.AddToList(&XPosMinCut);
|
---|
129 |
|
---|
130 | tlist.AddToList(&YPosMaxCut);
|
---|
131 | tlist.AddToList(&YPosMinCut);
|
---|
132 |
|
---|
133 | tlist.AddToList(&skyplot);
|
---|
134 |
|
---|
135 | //*****************************
|
---|
136 |
|
---|
137 | //-------------------------------------------
|
---|
138 | // Execute event loop
|
---|
139 | //
|
---|
140 | MProgressBar bar;
|
---|
141 | MEvtLoop evtloop;
|
---|
142 | evtloop.SetParList(&plist);
|
---|
143 | evtloop.SetProgressBar(&bar);
|
---|
144 | /*
|
---|
145 | Int_t maxevents = -1;
|
---|
146 | //Int_t maxevents = 1000;
|
---|
147 | if ( !evtloop.Eventloop(maxevents) )
|
---|
148 | return;
|
---|
149 | */
|
---|
150 | if (!evtloop.PreProcess())
|
---|
151 | return;
|
---|
152 |
|
---|
153 | Int_t counter=0;
|
---|
154 | while(tlist.Process())
|
---|
155 | {
|
---|
156 | counter++;
|
---|
157 | if(counter%10000 == 0) cout << "events = " << counter << endl;
|
---|
158 | // MReportDrive * mrepdrive = (MReportDrive *)pliston.FindObject("MReportDrive");
|
---|
159 | // cout << "Ra " << mrepdrive->GetRa() << ", Dec " << mrepdrive->GetDec() << endl;
|
---|
160 | // MHillasSrc * mhs = (MHillasSrc*)pliston.FindObject("MHillasSrc");
|
---|
161 | // mhs->Print();
|
---|
162 | }
|
---|
163 |
|
---|
164 | evtloop.PostProcess();
|
---|
165 |
|
---|
166 | tlist.PrintStatistics(0, kTRUE);
|
---|
167 |
|
---|
168 | }
|
---|
169 |
|
---|
170 |
|
---|
171 |
|
---|