source: trunk/MagicSoft/Mars/macros/pixfirerate.C@ 2179

Last change on this file since 2179 was 2162, checked in by moralejo, 22 years ago
*** empty log message ***
File size: 3.9 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 Cerenkov 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!
18! Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// pixfirerate.C
28//
29// This macro can help to find "hot" pixels firing too often
30// or pixels firing too rarely. It plots camera displays showing how many
31// times the FADC integral of each pixel has been found to be above pedestal
32// by 10, 20, 50, 100 or 200 ADC counts. As "pedestal" we now use simply
33// the signal in the first ADC slice, which seemed reasonable from a first
34// look at the available test data.
35//
36/////////////////////////////////////////////////////////////////////////////
37
38void pixfirerate(TString filename="20030603_01731_D_cosmics_E.root")
39{
40 //
41 // Update frequency by default = 1Hz
42 //
43 MStatusDisplay *d = new MStatusDisplay;
44
45 // Set update time to 5s
46 // d->SetUpdateTime(5000);
47
48 // Disable online update
49 // d->SetUpdateTime(-1);
50
51 d->SetLogStream(&gLog, kTRUE); // Disables output to stdout
52 gLog.SetOutputFile("status.log", kTRUE); // Enable output to file
53 //gLog.EnableOutputDevice(MLog::eStdout); // Enable output to stdout again
54
55 //
56 // Create a empty Parameter List and an empty Task List
57 // The tasklist is identified in the eventloop by its name
58 //
59 MParList plist;
60 MTaskList tlist;
61 plist.AddToList(&tlist);
62
63 // The geometry container must be created by yourself to make sure
64 // that you don't choose a wrong geometry by mistake
65 //
66 MGeomCamMagic geomcam;
67 plist.AddToList(&geomcam);
68
69 //
70 // Now setup the tasks and tasklist:
71 // ---------------------------------
72 //
73 MReadMarsFile read("Events");
74 read.DisableAutoScheme();
75
76 MHTrigLvl0 trigmap1(10.,"Above 10");
77 MHTrigLvl0 trigmap2(20.,"Above 20");
78 MHTrigLvl0 trigmap3(50.,"Above 50");
79 MHTrigLvl0 trigmap4(100.,"Above 100");
80 MHTrigLvl0 trigmap5(200.,"Above 200");
81
82 plist.AddToList(&trigmap1);
83 plist.AddToList(&trigmap2);
84 plist.AddToList(&trigmap3);
85 plist.AddToList(&trigmap4);
86 plist.AddToList(&trigmap5);
87
88 MFillH fill1("Above 10","MRawEvtData");
89 MFillH fill2("Above 20","MRawEvtData");
90 MFillH fill3("Above 50","MRawEvtData");
91 MFillH fill4("Above 100","MRawEvtData");
92 MFillH fill5("Above 200","MRawEvtData");
93
94 read.AddFile(filename);
95
96 tlist.AddToList(&read);
97 tlist.AddToList(&fill1);
98 tlist.AddToList(&fill2);
99 tlist.AddToList(&fill3);
100 tlist.AddToList(&fill4);
101 tlist.AddToList(&fill5);
102
103 MEvtLoop evtloop;
104 evtloop.SetParList(&plist);
105 evtloop.SetDisplay(d);
106
107 //
108 // Execute your analysis
109 //
110 if (!evtloop.Eventloop())
111 return;
112
113 tlist.PrintStatistics();
114
115 //
116 // Make sure the display hasn't been deleted by the user while the
117 // eventloop was running.
118 //
119 if ((d = evtloop.GetDisplay()))
120 {
121 // Save data in a postscriptfile (status.ps)
122 d->SaveAsPS();
123 /*
124 * ----------- Write status to a root file ------------
125 *
126 TFile file("status.root", "RECREATE");
127 d->Write();
128 file.Close();
129 delete d;
130 */
131 }
132
133}
Note: See TracBrowser for help on using the repository browser.