| 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): Martin Merck, 05/2004 <mailto:merck@astro.uni-wuerzburg.de>
|
|---|
| 19 | ! Markus Gaug, 11/2003 <mailto:markus@ifae.es>
|
|---|
| 20 | !
|
|---|
| 21 | ! Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 22 | !
|
|---|
| 23 | !
|
|---|
| 24 | \* ======================================================================== */
|
|---|
| 25 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 26 | //
|
|---|
| 27 | // stdPed.C
|
|---|
| 28 | //
|
|---|
| 29 | // This macros is based on the calibration macro from Markus Gaug.
|
|---|
| 30 | // It processes a Pedestal file and writes a file with the containers
|
|---|
| 31 | //
|
|---|
| 32 | // Needed arguments are retrieved from the file "marsconfig".
|
|---|
| 33 | // A typical config file looks like this:
|
|---|
| 34 | // inpath: /data/MAGIC/Period015/rootdata/2004_03_21/
|
|---|
| 35 | // outpath: /data/MAGIC/Period015/calibdata/2004_03_21/
|
|---|
| 36 | // pedfile001: 21297
|
|---|
| 37 | //
|
|---|
| 38 | // inpath: is the path to the merpped root files
|
|---|
| 39 | // outpath: is the path where to store the F0 files
|
|---|
| 40 | // pedfilexxx: specifies which pedestal files to use. If more then 1 file
|
|---|
| 41 | // is specified, all files are processed but only 1 output file
|
|---|
| 42 | // is written.
|
|---|
| 43 | //
|
|---|
| 44 | // The macro loops over the pedestal file using the class MJPedestal
|
|---|
| 45 | //
|
|---|
| 46 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 47 |
|
|---|
| 48 | void singlePed()
|
|---|
| 49 | {
|
|---|
| 50 | // turn of colors for logging to a file
|
|---|
| 51 | gLog.SetNoColors();
|
|---|
| 52 |
|
|---|
| 53 | const char* inpath = "/data/MAGIC/Period016/rootdata2/2004_04_16";
|
|---|
| 54 | const char* outpath = "/data/MAGIC/Period016/calibdata/2004_04_16";
|
|---|
| 55 | Int_t prun = 22351;
|
|---|
| 56 |
|
|---|
| 57 | //
|
|---|
| 58 | // Choose the signal Extractor:
|
|---|
| 59 | //
|
|---|
| 60 | // MExtractFixedWindowPeakSearch extractor;
|
|---|
| 61 | // MExtractSlidingWindow extractor;
|
|---|
| 62 | MExtractFixedWindow extractor;
|
|---|
| 63 |
|
|---|
| 64 | //
|
|---|
| 65 | // Set Ranges or Windows
|
|---|
| 66 | //
|
|---|
| 67 | extractor.SetRange(3,14,3,14);
|
|---|
| 68 | // extractor.SetWindows(8,8);
|
|---|
| 69 |
|
|---|
| 70 | //
|
|---|
| 71 | // Choose the arrival time Extractor:
|
|---|
| 72 | //
|
|---|
| 73 | // MExtractTimeHighestIntegral timeext;
|
|---|
| 74 | MExtractTimeFastSpline timeext;
|
|---|
| 75 | //
|
|---|
| 76 | // Set Ranges or Windows
|
|---|
| 77 | //
|
|---|
| 78 | timeext.SetRange(2,12,4,14);
|
|---|
| 79 |
|
|---|
| 80 | // Get all pedestal files to process
|
|---|
| 81 | // You can specify up to 999 files in the marsconfig file
|
|---|
| 82 | // all files are concatenated and processed as one single file.
|
|---|
| 83 | MRunIter pruns;
|
|---|
| 84 | pruns.AddRun(prun,inpath);
|
|---|
| 85 |
|
|---|
| 86 | gStyle->SetOptStat(1);
|
|---|
| 87 | gStyle->SetOptFit();
|
|---|
| 88 |
|
|---|
| 89 | // We do not use any display here.
|
|---|
| 90 | MStatusDisplay *display = new MStatusDisplay;
|
|---|
| 91 | display->SetUpdateTime(3000);
|
|---|
| 92 | display->Resize(850,700);
|
|---|
| 93 |
|
|---|
| 94 | /************************/
|
|---|
| 95 | /* PEDESTAL COMPUTATION */
|
|---|
| 96 | /************************/
|
|---|
| 97 |
|
|---|
| 98 | MCalibrationQECam qecam;
|
|---|
| 99 | MBadPixelsCam badcam;
|
|---|
| 100 | MGeomCamMagic geomcam;
|
|---|
| 101 | MGeomApply geomapl;
|
|---|
| 102 | //
|
|---|
| 103 | // If you want to exclude pixels from the beginning, read
|
|---|
| 104 | // an ascii-file with the corr. pixel numbers (see MBadPixelsCam)
|
|---|
| 105 | //
|
|---|
| 106 | // badcam.AsciiRead("badpixels.dat");
|
|---|
| 107 |
|
|---|
| 108 | MJPedestal pedloop;
|
|---|
| 109 | pedloop.SetExtractor(&extractor);
|
|---|
| 110 | pedloop.SetInput(&pruns);
|
|---|
| 111 | pedloop.SetOutputPath(outpath);
|
|---|
| 112 | pedloop.SetDisplay(display);
|
|---|
| 113 | pedloop.SetBadPixels(badcam);
|
|---|
| 114 |
|
|---|
| 115 | if (!pedloop.Process())
|
|---|
| 116 | return;
|
|---|
| 117 |
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|