source: trunk/MagicSoft/Mars/macros/pixsatrate.C@ 2952

Last change on this file since 2952 was 2377, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.4 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 pixsatrate(TString filename="rawfile.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 MTaskList tlist;
60 MParList plist;
61 plist.AddToList(&tlist);
62
63 //
64 // Now setup the tasks and tasklist:
65 // ---------------------------------
66 //
67 MReadMarsFile read("Events");
68 read.DisableAutoScheme();
69 read.AddFile(filename);
70 tlist.AddToList(&read);
71
72 MGeomApply geomapl;
73 tlist.AddToList(&geomapl);
74
75 MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains");
76 MHTriggerLvl0 triglo(254, "SaturationLo", "Saturation Rate of Lo Gains");
77 trighi.SetType(1);
78 triglo.SetType(2);
79
80 MFillH fillhi(&trighi, "MRawEvtData");
81 MFillH filllo(&triglo, "MRawEvtData");
82 tlist.AddToList(&fillhi);
83 tlist.AddToList(&filllo);
84
85 MEvtLoop evtloop;
86 evtloop.SetParList(&plist);
87 evtloop.SetDisplay(d);
88
89 //
90 // Execute your analysis
91 //
92 if (!evtloop.Eventloop())
93 return;
94
95 tlist.PrintStatistics();
96
97 //
98 // Make sure the display hasn't been deleted by the user while the
99 // eventloop was running.
100 //
101 if ((d = evtloop.GetDisplay()))
102 {
103 // Save data in a postscriptfile (status.ps)
104 d->SaveAsPS();
105 /*
106 * ----------- Write status to a root file ------------
107 *
108 TFile file("status.root", "RECREATE");
109 d->Write();
110 file.Close();
111 delete d;
112 */
113 }
114
115}
Note: See TracBrowser for help on using the repository browser.