Changeset 3957 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 05/04/04 15:27:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/MagicHillas.C
r2377 r3957 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz et al,12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // MagicHillas.C 28 // ============= 29 // 30 // This is a demonstration program which calculates image (Hillas +) 31 // parameters using as input a Merpp output file (raw data). 32 // All parameters are written to an output file called hillas.root. Also 33 // filles histograms are displayed. 34 // For the calculation an arbitrary signal extractor (MCerPhotAnal2/Calc) 35 // is used. 36 // 37 /////////////////////////////////////////////////////////////////////////// 25 38 26 39 void MagicHillas(const char *filename="~/data/Gamma_20_N*.root") 27 40 { 28 //29 // This is a demonstration program which calculates the Hillas30 // parameter out of a Magic root file (raw data file).31 //32 33 41 // 34 42 // Create a empty Parameter List and an empty Task List … … 80 88 read.DisableAutoScheme(); 81 89 90 // Setup a task which makes sure that all used arrays have 91 // the correct size 82 92 MGeomApply geomapl; 83 93 94 // tasks used if MC files are detected to calculate pedestals 84 95 MMcPedestalCopy pcopy; 85 96 MMcPedestalNSBAdd pnsb; 86 97 98 // calculate the signal in a very simple way 99 // for real adat files use MCerPhotAnal2 instead which also 100 // calculates the pedestal. 87 101 MCerPhotCalc ncalc; 88 102 // … … 95 109 // 96 110 111 // setup image cleaning and blind pixel treatment 97 112 MImgCleanStd clean; 98 113 MBlindPixelCalc blind; 114 99 115 // 100 // Instead of unmapping the pixels you can also 116 // Instead of unmapping the pixels you can also (The use of this 117 // class is deprecated, it will be replaced by MBadPixels*) 101 118 // 102 119 // blind.SetUseInterpolation(); 103 120 // blind.SetUseCetralPixel(); 104 121 // 122 123 // setup tasks to calculate image parameters 105 124 MHillasCalc hcalc; 106 125 MHillasSrcCalc csrc1; 107 126 127 // setup tasks to fill histograms 108 128 MFillH hfill1("MHHillas", "MHillas"); 109 129 MFillH hfill2("MHHillasExt"); … … 113 133 MFillH hfill6("MHNewImagePar"); 114 134 135 // setup task to write containers to a file 115 136 MWriteRootFile write("hillas.root"); 116 137 write.AddContainer("MHStarMap"); … … 121 142 write.AddContainer("MHNewImagePar"); 122 143 144 // Setup the contents of zour tasklist 123 145 tlist.AddToList(&read); 124 146 tlist.AddToList(&geomapl); -
trunk/MagicSoft/Mars/macros/comprob.C
r1609 r3957 1 1 /* ======================================================================== *\ 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ! Copyright: MAGIC Software Development, 2000-2002 23 24 25 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 ! macro comprob.C 18 ! 19 ! Author(s): Abelardo Moralejo 20 ! Author(s): Thomas Bretz, 2002 <mailto:tbretz@astro.uni-wuerzburg.de> 21 ! 22 ! Copyright: MAGIC Software Development, 2000-2004 23 ! 24 ! 25 \* ======================================================================== */ 26 26 27 // -------------------------------------------------------------------------27 /////////////////////////////////////////////////////////////////////////// 28 28 // 29 29 // This macro demonstrates one way of gamma hadron separation using the … … 31 31 // a file ouput by the star.C macro containing image parameters) 32 32 // 33 /////////////////////////////////////////////////////////////////////////// 33 34 void comprob() 34 35 { -
trunk/MagicSoft/Mars/macros/derotatedc.C
r3785 r3957 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // derotate.C - STandard Analysis and Reconstruction (MC example) 27 // derotatedc.C 28 // ============ 28 29 // 29 // Derotate a MCamEvent and fill a histogram with derotated data 30 // (sky-plot) 30 // Derotate a MCamEvent and fill a histogram with derotated data 31 // (sky-plot). 32 // 33 // As an input you need a merpped root file conataining DC information 34 // from a camera report file. To be able to derotate you also need 35 // aproproitate time-stamps and the corresponding pointing information. 36 // 37 // All events are filled into a 2D histograms - derotated. 38 // 39 // The example shows the usage of MHCamEventRot. The output is the derotated 40 // sky-plot. 31 41 // 32 42 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/macros/dohtml.C
r3930 r3957 22 22 ! 23 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // dohtml.C 28 // ======== 29 // 30 // This is a service macro used to create the html-documentation from 31 // source code (THtml) 32 // 33 // Add here all directories in which files are stored from which the 34 // documentation should be created an add all macros which should be 35 // converted to HTML. 36 // 37 /////////////////////////////////////////////////////////////////////////// 24 38 25 39 void dohtml() -
trunk/MagicSoft/Mars/macros/evtrate.C
r2626 r3957 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): Thomas Bretz, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // evtrate.C 28 // ========= 29 // 30 // Example macro how to calulate the eventrate (per event) and display 31 // the result versus time. 32 // 33 // As an input you need a merpped raw-data file containing correct times. 34 // The output is the plot: Eventrate vs. time. 35 // 36 /////////////////////////////////////////////////////////////////////////// 37 1 38 void evtrate() 2 39 { 40 // Setup parameter- and tasklist 3 41 MParList plist; 4 42 MTaskList tlist; 5 43 plist.AddToList(&tlist); 6 44 45 // Setup reading task 7 46 MReadMarsFile read("Events"); 8 47 read.DisableAutoScheme(); 9 48 read.AddFile("test-time.root"); 10 49 50 // Setup event rate calculator 11 51 MEventRateCalc calc; 52 // Setup number of events to be averaged 12 53 calc.SetNumEvents(200); 13 54 55 // Setup histogram to be filles with rate 14 56 MHVsTime rate("MEventRate.fRate"); 15 57 58 // Setup task to fill the histogram 16 59 MFillH fill(&rate, "MTime"); 17 60 61 // Setup tasklist 18 62 tlist.AddToList(&read); 19 63 tlist.AddToList(&calc); 20 64 tlist.AddToList(&fill); 21 65 66 // Execute your eventloop 22 67 MEvtLoop loop; 23 68 loop.SetParList(&plist); 24 69 25 loop.Eventloop(); 70 if (!loop.Eventloop()) 71 return; 26 72 73 // print some execution statistics 74 tlist.PrintStatistics(); 75 76 // Draw result 27 77 rate.DrawClone(); 28 78 } -
trunk/MagicSoft/Mars/macros/merpp.C
r2222 r3957 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 24 25 26 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // merpp.C 28 // ======= 27 29 // 28 30 // This is an easy implementation of the Merging process (as root Macro) 29 31 // 30 // at the moment it reads a binary file ("rawtest. bin") which was written32 // at the moment it reads a binary file ("rawtest.raw") which was written 31 33 // in the DAQ raw format. 32 34 // … … 35 37 // 36 38 // This containers are written to a root file ("rawtest.root") 39 // 40 // It also demonstrates how you can loop over files in a single or more 41 // than one directory and process them. For details see MRunIter. 37 42 // 38 43 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/macros/pixfirerate.C
r2377 r3957 17 17 ! 18 18 ! Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it> 19 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 20 ! 20 ! Copyright: MAGIC Software Development, 2000-200 321 ! Copyright: MAGIC Software Development, 2000-2004 21 22 ! 22 23 ! … … 26 27 // 27 28 // pixfirerate.C 29 // ============= 28 30 // 29 31 // This macro can help to find "hot" pixels firing too often … … 73 75 tlist.AddToList(&geomapl); 74 76 77 // A list of threshold which should be displayed. The last entry 78 // MUST be -1. 75 79 Double_t threshold[] = { 10, 20, 100, 200, -1 }; 76 80 … … 78 82 while (threshold[cnt]>0) cnt++; 79 83 84 // Create the corresponding fill tasks and containers 80 85 for (int i=0; i<cnt; i++) 81 86 { … … 95 100 } 96 101 102 // create the eventloop 97 103 MEvtLoop evtloop; 98 104 evtloop.SetParList(&plist); -
trunk/MagicSoft/Mars/macros/pixsatrate.C
r2377 r3957 17 17 ! 18 18 ! Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it> 19 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 20 ! 20 ! Copyright: MAGIC Software Development, 2000-200 321 ! Copyright: MAGIC Software Development, 2000-2004 21 22 ! 22 23 ! … … 26 27 // 27 28 // pixfirerate.C 29 // ============= 28 30 // 29 31 // This macro can help to find "hot" pixels firing too often … … 73 75 tlist.AddToList(&geomapl); 74 76 77 // Create histograms with saturation limits at 254 75 78 MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains"); 76 79 MHTriggerLvl0 triglo(254, "SaturationLo", "Saturation Rate of Lo Gains"); … … 78 81 triglo.SetType(2); 79 82 83 // craete fill tasks to fill the histogarms 80 84 MFillH fillhi(&trighi, "MRawEvtData"); 81 85 MFillH filllo(&triglo, "MRawEvtData"); … … 83 87 tlist.AddToList(&filllo); 84 88 89 // create eventloop 85 90 MEvtLoop evtloop; 86 91 evtloop.SetParList(&plist); -
trunk/MagicSoft/Mars/macros/plot.C
r2377 r3957 19 19 ! Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 221 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! 24 24 \* ======================================================================== */ 25 25 26 // -------------------------------------------------------------------------26 /////////////////////////////////////////////////////////////////////////// 27 27 // 28 28 // plot.C 29 // ====== 29 30 // 30 31 // This macro shows how to fill and display a histogram using Mars 31 32 // 33 // The advantage of using Mars histograms instead of root-trees is that 34 // you can fill values in your histogram which is calculated in the 35 // eventloop. 36 // 37 // In this particular sample we fill a histogram with the size parameter 38 // of gammas and one with hadron's size. At the end we display both in a 39 // single plot. 40 // 41 // The input is a star-macro already conatining image parameters. 42 // 43 /////////////////////////////////////////////////////////////////////////// 44 32 45 void plot() 33 46 { 47 // Create a status display for graphical output 34 48 MStatusDisplay *d = new MStatusDisplay; 35 49 d->SetLogStream(&gLog); … … 57 71 58 72 // Create a filter for Gammas 59 MFParticleId fgamma("MMcEvt", '=', kGAMMA);73 MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA); 60 74 tlist.AddToList(&fgamma); 61 75 62 76 // Create a filter for Non-Gammas 63 MFParticleId fhadrons("MMcEvt", '!', kGAMMA);77 MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA); 64 78 tlist.AddToList(&fhadrons); 65 79 -
trunk/MagicSoft/Mars/macros/plot2.C
r1543 r3957 19 19 ! Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 221 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! 24 24 \* ======================================================================== */ 25 25 26 // -------------------------------------------------------------------------26 /////////////////////////////////////////////////////////////////////////// 27 27 // 28 // plot.C 28 // plot2.C 29 // ======= 29 30 // 30 // This macro shows how to fill and display a 2Dhistogram using Mars31 // This macro shows how to fill and display a histogram using Mars 31 32 // 33 // The advantage of using Mars histograms instead of root-trees is that 34 // you can fill values in your histogram which is calculated in the 35 // eventloop. 36 // 37 // In this particular sample we fill a histogram with width vs length 38 // of gammas and hadrons. At the end we display both in a single plot. 39 // 40 // The input is a star-macro already conatining image parameters. 41 // 42 /////////////////////////////////////////////////////////////////////////// 43 32 44 void plot2() 33 45 { … … 52 64 53 65 // Create a filter for the gamma events 54 MFParticleId fgamma("MMcEvt", '=', kGAMMA);66 MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA); 55 67 tlist.AddToList(&fgamma); 56 68 57 69 // Create a filter for the non-gamma events 58 MFParticleId fhadrons("MMcEvt", '!', kGAMMA);70 MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA); 59 71 tlist.AddToList(&fhadrons); 60 72 … … 66 78 plist.AddToList(&cam); 67 79 80 // Set the variables (converted to deg) 68 81 TString vary("MHillas.fWidth*MGeomCam.fConvMm2Deg"); 69 82 TString varx("MHillas.fLength*MGeomCam.fConvMm2Deg"); 70 83 84 // Set the binning 71 85 MBinning binsy("BinningMH3Y"); 72 86 MBinning binsx("BinningMH3X"); -
trunk/MagicSoft/Mars/macros/pointing.C
r3909 r3957 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): Thomas Bretz, 5/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // pointing.C 28 // ========== 29 // 30 // This macro is a demonstartion how check plots for a subsystem 31 // (here the drive) can be made using Mars. 32 // 33 // In this case a merpped (root-) cc-report file is read in. The data 34 // of the Drive branch is extracted using MReadReports and the 35 // Stream-Id feature of MTaskList (second argument in AddToList). 36 // 37 // The output are plots showing (hopefully) the peformance of the system. 38 // 39 ///////////////////////////////////////////////////////////////////////////// 40 1 41 /* 2 42 class MGraph : public TGraph -
trunk/MagicSoft/Mars/macros/readMagic.C
r3682 r3957 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 118 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // readMagic.C 28 // =========== 29 // 30 // This is a demonstration program showing how to do particular processing 31 // on a single event basis. Here we simply display uncleand und cleand 32 // images. 33 // Therefor MInteractiveTask is used, which gives you the possibility 34 // to develop new tasks without the need of compilation. 35 // The input is a merpp raw-data file. 36 // 37 /////////////////////////////////////////////////////////////////////////// 25 38 26 39 Bool_t HandleInput() 27 40 { 41 // This must be there to get accesss to the GUI while the macro 42 // is still running! 43 28 44 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 29 45 while (1) … … 46 62 } 47 63 64 // 65 // Setup the data-members of your 'virtual' class 66 // 48 67 MHCamera display[4]; 49 68 … … 52 71 MTaskList *fTaskList; 53 72 73 // 74 // Called like all PreProcess functions of tasks. Get the access to 75 // the containers necessary for you. 76 // 54 77 Int_t PreProcess(MParList *plist) 55 78 { 79 // Get parameter and tasklist, see Process 56 80 fParList = plist; 57 81 fTaskList = (MTaskList*)plist->FindObject("MTaskList"); 58 82 83 // Get camera geoemtry 59 84 MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam"); 60 85 86 // setup canvas and camera-histograms 61 87 c = new TCanvas("Events", "Real Events", 600, 600); 62 88 c->SetBorderMode(0); … … 73 99 } 74 100 101 // 102 // Called like all Process functions of tasks. Process a single 103 // event - here display it. 104 // 75 105 Int_t Process() 76 106 { 107 // For simplicity we search in the Process function for the 108 // objects. This is deprectaed! Store the pointers to the objects 109 // as data member and get the pointers in PreProcess. 77 110 MReadMarsFile *read = (MReadMarsFile*)fTaskList->FindObject("MRead"); 78 111 MClone *clone = (MClone*)fTaskList->FindObject("MClone"); … … 80 113 MGeomCam *geom = (MGeomCam*)fParList->FindObject("MGeomCam"); 81 114 115 // Ouput event number 82 116 cout << "Event #" << read->GetNumEntry() << ":" << endl; 83 117 118 // Fill the data into your camera-histograms 84 119 display[0].SetCamContent(*(MCerPhotEvt*)clone->GetClone()); 85 120 display[1].SetCamContent(*(MCerPhotEvt*)fParList->FindObject("MCerPhotEvt")); … … 87 122 display[3].SetCamContent(*(MCameraData*)fParList->FindObject("MCameraData")); 88 123 124 // Setup the cleaning level histogram 89 125 TArrayF lvl(2); 90 126 lvl[0] = clean->GetCleanLvl2(); … … 92 128 display[3].SetLevels(lvl); 93 129 130 // Update the display 94 131 for (int i=1; i<=4; i++) 95 132 { … … 98 135 } 99 136 137 // print the data on the console 100 138 ((MHillas*)fParList->FindObject("MHillas"))->Print(*geom); 101 139 ((MHillasExt*)fParList->FindObject("MHillasExt"))->Print(*geom); 102 140 ((MNewImagePar*)fParList->FindObject("MNewImagePar"))->Print(*geom); 103 141 142 // wait for 'return' 104 143 return HandleInput(); 105 144 } 106 145 146 // 147 // Called like all PostProcess functions of tasks. Delete 148 // instanciated objects. 149 // 107 150 Int_t PostProcess() 108 151 { … … 111 154 112 155 void readMagic(const char *fname="../Proton*.root") 113 { 156 { 157 // Setup parameter- and tasklist 114 158 MParList plist; 115 159 MTaskList tlist; … … 117 161 plist.AddToList(&tlist); 118 162 163 // setup reading task 119 164 MReadMarsFile read("Events", fname); 120 165 read.DisableAutoScheme(); 121 166 167 // setup a task making sure that all arrays are resized correctly 122 168 MGeomApply geomapl; 169 170 // Setup a print task calling TObject::Print 123 171 MPrint print1("MMcEvt"); 124 172 MPrint print2("MRawEvtHeader"); 173 // Skip them if conatainers are not found 125 174 print1.EnableSkip(); 126 175 print2.EnableSkip(); 127 176 177 // Copy MC pedestals to apropriate conatiners (if MC file) 128 178 MMcPedestalCopy pcopy; 129 179 MMcPedestalNSBAdd pnsb; 180 181 // Calculate signal and pedestal from data (use MCerPhotCalc 182 // in case of MC files) 130 183 MCerPhotAnal2 ncalc; 184 185 // Blind Pixel Treatment (deprecated, will be replaced by 186 // MBadPixel*) 131 187 MBlindPixelCalc blind; 132 188 blind.SetUseInterpolation(); 189 190 // Clone MCerPhotEvt befor eimage cleaning 133 191 MClone clone("MCerPhotEvt"); 192 193 // Setup image cleaning 134 194 MImgCleanStd clean; 195 196 // Setup calculation of Image parameters 135 197 MHillasCalc hcalc; 198 199 // Setup intercative task calling the functions defined above 136 200 MTaskInteractive mytask; 137 201 … … 139 203 mytask.SetProcess(Process); 140 204 205 // Setup your tasklist 141 206 tlist.AddToList(&read); 142 207 tlist.AddToList(&geomapl); … … 152 217 tlist.AddToList(&mytask); 153 218 219 // Run your analysis 154 220 MEvtLoop evtloop; 155 221 evtloop.SetParList(&plist); … … 158 224 return; 159 225 226 // Print statistics information about your loop 160 227 tlist.PrintStatistics(); 161 228 } -
trunk/MagicSoft/Mars/macros/rootlogon.C
r3927 r3957 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // rootlogon.C 28 // =========== 29 // 30 // This file is the startup script ("autoexec.bat") executed when root is 31 // started. The definition which file to start is done in ".rootrc". 32 // There are three files which are automatically processed by root at 33 // startup: A systemwide .rootrc, one in your home directory and one 34 // in the current directory. 35 // So rootlogon.C is correctly executed if your start root from your 36 // Mars directory. 37 // 38 // The script setupts some small environmental things and makes 39 // sure that the Mars shared object (libmars.so) is loaded. This shared 40 // object gives you access to all Mars features from within the root 41 // interpreter. 42 // 43 // If libmars.so is not found in the current directory we search in the 44 // directory given in "MARSSYS" environment variable. 45 // 46 /////////////////////////////////////////////////////////////////////////// 24 47 25 48 Bool_t isloaded() -
trunk/MagicSoft/Mars/macros/runbook.C
r2197 r3957 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): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // runbook.C 28 // ========= 29 // 30 // This is an example macro how to extract the runbook information of 31 // a given date from the runbook files. 32 // 33 // The argument is a date in regexp format, eg. 34 // .x runbook.C("2004-05-1[0-9]") 35 // 36 // With an MDirIter you can tell the macro which directories and files 37 // should be searched. 38 // 39 // The output are the runbook entries matching your query. 40 // 41 /////////////////////////////////////////////////////////////////////////// 42 1 43 void Wrap(TString &str) 2 44 { 45 // Wrap lines to 80 chars 3 46 while (str.Length()>80) 4 47 { … … 15 58 void ProcessFile(TString fname, TString date) 16 59 { 60 // File processed 17 61 cout << fname << endl; 18 62 63 // Open file 19 64 ifstream fin(fname); 20 65 … … 32 77 while (!fin.eof()) 33 78 { 79 // Read file line by line 34 80 char *txt=new char[i]; 35 81 fin.getline(txt, i-1); … … 58 104 } 59 105 106 // Check whether line matches regexp 60 107 if (!line(r0).IsNull()) 61 108 print = !line(r1).IsNull(); 62 109 110 // Wrap lines to 80 chars 63 111 if (print) 64 112 Wrap(line); … … 71 119 void runbook(const char *d="20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]") 72 120 { 121 // Regexp to check for valid date 73 122 TString regexp = "20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]"; 74 123 … … 85 134 } 86 135 136 // Tell which dierctories and files to search 87 137 MDirIter Next; 88 138 Next.AddDirectory("/home/MAGIC/online_data/runbook", "CC_*.rbk"); 89 139 140 // Loop over files 90 141 TString name; 91 142 while (1) -
trunk/MagicSoft/Mars/macros/sectorvstime.C
r3393 r3957 18 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // This macro is an example of how to plot the value of a part of the 28 // camera or the whole camera. 27 // sectorvstime.C 28 // ============== 29 // 30 // In this example we plot the mean content of the right and left half of 31 // camera. As an input we use a class derived from MCamEvent. Here this 32 // are dc currents read directly from a camera control report file. 33 // 34 // The output are two histograms one for each half. 29 35 // 30 36 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/macros/star.C
r2621 r3957 18 18 ! Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 27 27 // STAR - STandard Analysis and Reconstruction 28 28 // 29 // This macro is the standard converter to convert raw data into image 30 // parameters 29 // This macro is the standard converter to convert raw data into image 30 // parameters. It is a demonstration how the star-executable implementation 31 // looks like. 32 // 33 // As an input you need a Merpp output file (raw data). 34 // All parameters are written to an output file called starfile.root. 35 // For the calculation an arbitrary signal extractor (MCerPhotAnal2/Calc) 36 // is used. 31 37 // 32 38 ///////////////////////////////////////////////////////////////////////////// … … 34 40 void star() 35 41 { 36 //37 // This is a demonstration program which calculates the image38 // parameters from a Magic raw data root file.39 40 42 // 41 43 // Create a empty Parameter List and an empty Task List … … 101 103 // 102 104 // tlist.SetSerialNumber(1); // Serial number of telescope 103 104 105 write.AddContainer(write.AddSerialNumber("MMcEvt"), "Events", kFALSE); 105 106 write.AddContainer(write.AddSerialNumber("MSigmabar"), "Events"); -
trunk/MagicSoft/Mars/macros/sumcurrents.C
r2633 r3957 18 18 ! Author(s): Thomas Bretz, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // sumcurrents.C 28 // ============= 29 // 30 // This is a demonstration macro to display mean DC currents for all pixels. 31 // The input is cc report file. The output are histograms and plots. 32 // Using the MDirIter functionality you can process more than one file 33 // in one or more directories. For more information see MDirIter. 34 // 35 /////////////////////////////////////////////////////////////////////////// 24 36 25 37 void ProcessFile(TString fname) … … 39 51 // 40 52 53 // Create the magic geometry 41 54 MGeomCamMagic geom; 42 55 plist.AddToList(&geom); … … 49 62 tlist.AddToList(&read); 50 63 64 // create a task to fill a histogram 51 65 MFillH fill("MHCamEvent", "MCameraDC"); 52 66 tlist.AddToList(&fill); … … 66 80 tlist.PrintStatistics(); 67 81 82 // 83 // Now display the result of the loop 84 // 68 85 MHCamEvent &h2 = *(MHCamEvent*)plist->FindObject("MHCamEvent"); 69 86 MHCamera &h = *(MHCamera*)h2.GetHistByName("sum"); … … 129 146 } 130 147 131 // -------------------------------------------------------------------------132 //133 // plot.C134 //135 // This macro shows how to fill and display a histogram using Mars136 //137 148 void sumcurrents(const char *dirname=".") 138 149 { -
trunk/MagicSoft/Mars/macros/tar.C
r2611 r3957 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): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // tar.C 28 // ===== 29 // 30 // Service script. used to create the tar archive for an release. It makes 31 // sure that the correct files are included and the name of the archive is 32 // the name of the current directory (+.tar.gz) 33 // 34 /////////////////////////////////////////////////////////////////////////// 1 35 void tar() 2 36 { -
trunk/MagicSoft/Mars/macros/testenv.C
r1902 r3957 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): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 ! 22 ! 23 \* ======================================================================== */ 24 25 /////////////////////////////////////////////////////////////////////////// 26 // 27 // testenv.C 28 // ========= 29 // 30 // This example reads an config-file (steering card, input card, ...) 31 // The contents of the file a forwarded to the apropriate eventloop 32 // setup in your file. 33 // 34 // All tasks and containers in an eventloop should implement the 35 // ReadEnv/WriteEnv function (for an example see the tasks used below). 36 // 37 // The functions gets the corresponding setup data from the file as an 38 // argument and can change their behaviour and setup on this information. 39 // 40 /////////////////////////////////////////////////////////////////////////// 41 1 42 void testenv() 2 43 { -
trunk/MagicSoft/Mars/macros/weights.C
r2474 r3957 18 18 ! Author(s): Marcos Lopez, 10/2003 <mailto:marcos@gae.ucm.es> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! 23 23 \* ======================================================================== */ 24 24 25 26 25 ////////////////////////////////////////////////////////////////////////////// 27 // // 28 // This macro shows how to use the class MMcWeightEnergySpecCalc // 29 // to convert the energy spectrum of the MC showers generated with Corsika, // 30 // to a different one. // 31 // // 26 // 27 // weights.C 28 // ========= 29 // 30 // This macro shows how to use the class MMcWeightEnergySpecCalc 31 // to convert the energy spectrum of the MC showers generated with Corsika, 32 // to a different one. 33 // 32 34 ////////////////////////////////////////////////////////////////////////////// 33 35 34 35 // --------------------------------------------------------------------------36 //37 //38 36 Double_t myfunction(Double_t *x, Double_t *par) 39 37 { … … 43 41 } 44 42 45 46 47 // --------------------------------------------------------------------------48 //49 //50 43 void weights(TString filename="/up1/data/Magic-MC/CameraAll/Gammas/zbin0/Gamma_zbin0_0_7_1000to1009_w0-4:4:2.root") 51 44 { … … 109 102 //------------------------------------------------------------- 110 103 111 112 104 MFillH hfill(&h1,"MMcEvt"); 113 105 MFillH hfill2(&h2,"MMcEvt"); … … 118 110 tasklist.AddToList(&hfill); 119 111 tasklist.AddToList(&hfill2); 120 121 112 122 113 // … … 132 123 parlist.Print(); 133 124 134 135 // 125 // 136 126 // Draw the Results 137 127 // … … 146 136 hist1->DrawClone(); 147 137 hist2->DrawClone("same"); 148 149 138 } 150 151 152 153 154 155 156 157 158 159 160 161 162
Note:
See TracChangeset
for help on using the changeset viewer.