| 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 |
|
|---|
| 38 | void 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 | // 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 | read.AddFile(filename);
|
|---|
| 76 | tlist.AddToList(&read);
|
|---|
| 77 |
|
|---|
| 78 | MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains");
|
|---|
| 79 | MHTriggerLvl0 triglo(254, "SaturationLo", "Saturation Rate of Lo Gains");
|
|---|
| 80 | trighi.SetType(1);
|
|---|
| 81 | triglo.SetType(2);
|
|---|
| 82 |
|
|---|
| 83 | MFillH fillhi(&trighi, "MRawEvtData");
|
|---|
| 84 | MFillH filllo(&triglo, "MRawEvtData");
|
|---|
| 85 | tlist.AddToList(&fillhi);
|
|---|
| 86 | tlist.AddToList(&filllo);
|
|---|
| 87 |
|
|---|
| 88 | MEvtLoop evtloop;
|
|---|
| 89 | evtloop.SetParList(&plist);
|
|---|
| 90 | evtloop.SetDisplay(d);
|
|---|
| 91 |
|
|---|
| 92 | //
|
|---|
| 93 | // Execute your analysis
|
|---|
| 94 | //
|
|---|
| 95 | if (!evtloop.Eventloop())
|
|---|
| 96 | return;
|
|---|
| 97 |
|
|---|
| 98 | tlist.PrintStatistics();
|
|---|
| 99 |
|
|---|
| 100 | //
|
|---|
| 101 | // Make sure the display hasn't been deleted by the user while the
|
|---|
| 102 | // eventloop was running.
|
|---|
| 103 | //
|
|---|
| 104 | if ((d = evtloop.GetDisplay()))
|
|---|
| 105 | {
|
|---|
| 106 | // Save data in a postscriptfile (status.ps)
|
|---|
| 107 | d->SaveAsPS();
|
|---|
| 108 | /*
|
|---|
| 109 | * ----------- Write status to a root file ------------
|
|---|
| 110 | *
|
|---|
| 111 | TFile file("status.root", "RECREATE");
|
|---|
| 112 | d->Write();
|
|---|
| 113 | file.Close();
|
|---|
| 114 | delete d;
|
|---|
| 115 | */
|
|---|
| 116 | }
|
|---|
| 117 |
|
|---|
| 118 | }
|
|---|