Ignore:
Timestamp:
05/04/04 15:27:25 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/macros
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/MagicHillas.C

    r2377 r3957  
    1616!
    1717!
    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>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
    2424
     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///////////////////////////////////////////////////////////////////////////
    2538
    2639void MagicHillas(const char *filename="~/data/Gamma_20_N*.root")
    2740{
    28     //
    29     // This is a demonstration program which calculates the Hillas
    30     // parameter out of a Magic root file (raw data file).
    31     //
    32 
    3341    //
    3442    // Create a empty Parameter List and an empty Task List
     
    8088    read.DisableAutoScheme();
    8189
     90    // Setup a task which makes sure that all used arrays have
     91    // the correct size
    8292    MGeomApply geomapl;
    8393
     94    // tasks used if MC files are detected to calculate pedestals
    8495    MMcPedestalCopy pcopy;
    8596    MMcPedestalNSBAdd pnsb;
    8697
     98    // calculate the signal in a very simple way
     99    // for real adat files use MCerPhotAnal2 instead which also
     100    // calculates the pedestal.
    87101    MCerPhotCalc ncalc;
    88102    //
     
    95109    //
    96110
     111    // setup image cleaning and blind pixel treatment
    97112    MImgCleanStd    clean;
    98113    MBlindPixelCalc blind;
     114
    99115    //
    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*)
    101118    //
    102119    // blind.SetUseInterpolation();
    103120    // blind.SetUseCetralPixel();
    104121    //
     122
     123    // setup tasks to calculate image parameters
    105124    MHillasCalc    hcalc;
    106125    MHillasSrcCalc csrc1;
    107126
     127    // setup tasks to fill histograms
    108128    MFillH hfill1("MHHillas", "MHillas");
    109129    MFillH hfill2("MHHillasExt");
     
    113133    MFillH hfill6("MHNewImagePar");
    114134
     135    // setup task to write containers to a file
    115136    MWriteRootFile write("hillas.root");
    116137    write.AddContainer("MHStarMap");
     
    121142    write.AddContainer("MHNewImagePar");
    122143
     144    // Setup the contents of zour tasklist
    123145    tlist.AddToList(&read);
    124146    tlist.AddToList(&geomapl);
  • trunk/MagicSoft/Mars/macros/comprob.C

    r1609 r3957  
    11/* ======================================================================== *\
    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-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\* ======================================================================== */
    2626
    27 // -------------------------------------------------------------------------
     27///////////////////////////////////////////////////////////////////////////
    2828//
    2929//  This macro demonstrates one way of gamma hadron separation using the
     
    3131//  a file ouput by the star.C macro containing image parameters)
    3232//
     33///////////////////////////////////////////////////////////////////////////
    3334void comprob()
    3435{
  • trunk/MagicSoft/Mars/macros/derotatedc.C

    r3785 r3957  
    2525/////////////////////////////////////////////////////////////////////////////
    2626//
    27 //  derotate.C - STandard Analysis and Reconstruction (MC example)
     27// derotatedc.C
     28// ============
    2829//
    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.
    3141//
    3242/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/macros/dohtml.C

    r3930 r3957  
    2222!
    2323\* ======================================================================== */
     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///////////////////////////////////////////////////////////////////////////
    2438
    2539void 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
    138void evtrate()
    239{
     40    // Setup parameter- and tasklist
    341    MParList plist;
    442    MTaskList tlist;
    543    plist.AddToList(&tlist);
    644
     45    // Setup reading task
    746    MReadMarsFile read("Events");
    847    read.DisableAutoScheme();
    948    read.AddFile("test-time.root");
    1049
     50    // Setup event rate calculator
    1151    MEventRateCalc calc;
     52    // Setup number of events to be averaged
    1253    calc.SetNumEvents(200);
    1354
     55    // Setup histogram to be filles with rate
    1456    MHVsTime rate("MEventRate.fRate");
    1557
     58    // Setup task to fill the histogram
    1659    MFillH fill(&rate, "MTime");
    1760
     61    // Setup tasklist
    1862    tlist.AddToList(&read);
    1963    tlist.AddToList(&calc);
    2064    tlist.AddToList(&fill);
    2165
     66    // Execute your eventloop
    2267    MEvtLoop loop;
    2368    loop.SetParList(&plist);
    2469
    25     loop.Eventloop();
     70    if (!loop.Eventloop())
     71        return;
    2672
     73    // print some execution statistics
     74    tlist.PrintStatistics();
     75
     76    // Draw result
    2777    rate.DrawClone();
    2878}
  • trunk/MagicSoft/Mars/macros/merpp.C

    r2222 r3957  
    1616!
    1717!
    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>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
    2424
    25 
    2625/////////////////////////////////////////////////////////////////////////////
     26//
     27// merpp.C
     28// =======
    2729//
    2830// This is an easy implementation of the Merging process (as root Macro)
    2931//
    30 // at the moment it reads a binary file ("rawtest.bin") which was written
     32// at the moment it reads a binary file ("rawtest.raw") which was written
    3133// in the DAQ raw format.
    3234//
     
    3537//
    3638// 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.
    3742//
    3843/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/macros/pixfirerate.C

    r2377 r3957  
    1717!
    1818!   Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
     19!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
    1920!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     21!   Copyright: MAGIC Software Development, 2000-2004
    2122!
    2223!
     
    2627//
    2728// pixfirerate.C
     29// =============
    2830//
    2931// This macro can help to  find "hot" pixels firing too often
     
    7375    tlist.AddToList(&geomapl);
    7476
     77    // A list of threshold which should be displayed. The last entry
     78    // MUST be -1.
    7579    Double_t threshold[] = { 10, 20, 100, 200, -1 };
    7680
     
    7882    while (threshold[cnt]>0) cnt++;
    7983
     84    // Create the corresponding fill tasks and containers
    8085    for (int i=0; i<cnt; i++)
    8186    {
     
    95100    }
    96101
     102    // create the eventloop
    97103    MEvtLoop evtloop;
    98104    evtloop.SetParList(&plist);
  • trunk/MagicSoft/Mars/macros/pixsatrate.C

    r2377 r3957  
    1717!
    1818!   Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
     19!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
    1920!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     21!   Copyright: MAGIC Software Development, 2000-2004
    2122!
    2223!
     
    2627//
    2728// pixfirerate.C
     29// =============
    2830//
    2931// This macro can help to  find "hot" pixels firing too often
     
    7375    tlist.AddToList(&geomapl);
    7476
     77    // Create histograms with saturation limits at 254
    7578    MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains");
    7679    MHTriggerLvl0 triglo(254, "SaturationLo", "Saturation Rate of Lo Gains");
     
    7881    triglo.SetType(2);
    7982
     83    // craete fill tasks to fill the histogarms
    8084    MFillH fillhi(&trighi, "MRawEvtData");
    8185    MFillH filllo(&triglo, "MRawEvtData");
     
    8387    tlist.AddToList(&filllo);
    8488
     89    // create eventloop
    8590    MEvtLoop evtloop;
    8691    evtloop.SetParList(&plist);
  • trunk/MagicSoft/Mars/macros/plot.C

    r2377 r3957  
    1919!   Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2002
     21!   Copyright: MAGIC Software Development, 2000-2004
    2222!
    2323!
    2424\* ======================================================================== */
    2525
    26 // -------------------------------------------------------------------------
     26///////////////////////////////////////////////////////////////////////////
    2727//
    2828//  plot.C
     29//  ======
    2930//
    3031//  This macro shows how to fill and display a histogram using Mars
    3132//
     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
    3245void plot()
    3346{
     47    // Create a status display for graphical output
    3448    MStatusDisplay *d = new MStatusDisplay;
    3549    d->SetLogStream(&gLog);
     
    5771
    5872    // Create a filter for Gammas
    59     MFParticleId fgamma("MMcEvt", '=', kGAMMA);
     73    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
    6074    tlist.AddToList(&fgamma);
    6175
    6276    // Create a filter for Non-Gammas
    63     MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
     77    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
    6478    tlist.AddToList(&fhadrons);
    6579
  • trunk/MagicSoft/Mars/macros/plot2.C

    r1543 r3957  
    1919!   Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2002
     21!   Copyright: MAGIC Software Development, 2000-2004
    2222!
    2323!
    2424\* ======================================================================== */
    2525
    26 // -------------------------------------------------------------------------
     26///////////////////////////////////////////////////////////////////////////
    2727//
    28 //  plot.C
     28//  plot2.C
     29//  =======
    2930//
    30 //  This macro shows how to fill and display a 2D histogram using Mars
     31//  This macro shows how to fill and display a histogram using Mars
    3132//
     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
    3244void plot2()
    3345{
     
    5264
    5365    // Create a filter for the gamma events
    54     MFParticleId fgamma("MMcEvt", '=', kGAMMA);
     66    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
    5567    tlist.AddToList(&fgamma);
    5668
    5769    // Create a filter for the non-gamma events
    58     MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
     70    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
    5971    tlist.AddToList(&fhadrons);
    6072
     
    6678    plist.AddToList(&cam);
    6779
     80    // Set the variables (converted to deg)
    6881    TString vary("MHillas.fWidth*MGeomCam.fConvMm2Deg");
    6982    TString varx("MHillas.fLength*MGeomCam.fConvMm2Deg");
    7083
     84    // Set the binning
    7185    MBinning binsy("BinningMH3Y");
    7286    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
    141/*
    242 class MGraph : public TGraph
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r3682 r3957  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
    19 !
    20 !   Copyright: MAGIC Software Development, 2000-2001
     18!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
     19!
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
    2424
     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///////////////////////////////////////////////////////////////////////////
    2538
    2639Bool_t HandleInput()
    2740{
     41    // This must be there to get accesss to the GUI while the macro
     42    // is still running!
     43
    2844    TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
    2945    while (1)
     
    4662}
    4763
     64//
     65// Setup the data-members of your 'virtual' class
     66//
    4867MHCamera display[4];
    4968
     
    5271MTaskList *fTaskList;
    5372
     73//
     74// Called like all PreProcess functions of tasks. Get the access to
     75// the containers necessary for you.
     76//
    5477Int_t PreProcess(MParList *plist)
    5578{
     79    // Get parameter and tasklist, see Process
    5680    fParList = plist;
    5781    fTaskList = (MTaskList*)plist->FindObject("MTaskList");
    5882
     83    // Get camera geoemtry
    5984    MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam");
    6085
     86    // setup canvas and camera-histograms
    6187    c = new TCanvas("Events", "Real Events", 600, 600);
    6288    c->SetBorderMode(0);
     
    7399}
    74100
     101//
     102// Called like all Process functions of tasks. Process a single
     103// event - here display it.
     104//
    75105Int_t Process()
    76106{
     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.
    77110    MReadMarsFile *read = (MReadMarsFile*)fTaskList->FindObject("MRead");
    78111    MClone *clone = (MClone*)fTaskList->FindObject("MClone");
     
    80113    MGeomCam *geom = (MGeomCam*)fParList->FindObject("MGeomCam");
    81114
     115    // Ouput event number
    82116    cout << "Event #" << read->GetNumEntry() << ":" << endl;
    83117
     118    // Fill the data into your camera-histograms
    84119    display[0].SetCamContent(*(MCerPhotEvt*)clone->GetClone());
    85120    display[1].SetCamContent(*(MCerPhotEvt*)fParList->FindObject("MCerPhotEvt"));
     
    87122    display[3].SetCamContent(*(MCameraData*)fParList->FindObject("MCameraData"));
    88123
     124    // Setup the cleaning level histogram
    89125    TArrayF lvl(2);
    90126    lvl[0] = clean->GetCleanLvl2();
     
    92128    display[3].SetLevels(lvl);
    93129
     130    // Update the display
    94131    for (int i=1; i<=4; i++)
    95132    {
     
    98135    }
    99136
     137    // print the data on the console
    100138    ((MHillas*)fParList->FindObject("MHillas"))->Print(*geom);
    101139    ((MHillasExt*)fParList->FindObject("MHillasExt"))->Print(*geom);
    102140    ((MNewImagePar*)fParList->FindObject("MNewImagePar"))->Print(*geom);
    103141
     142    // wait for 'return'
    104143    return HandleInput();
    105144}
    106145
     146//
     147// Called like all PostProcess functions of tasks. Delete
     148// instanciated objects.
     149//
    107150Int_t PostProcess()
    108151{
     
    111154
    112155void readMagic(const char *fname="../Proton*.root")
    113 {               
     156{
     157    // Setup parameter- and tasklist
    114158    MParList  plist;
    115159    MTaskList tlist;
     
    117161    plist.AddToList(&tlist);
    118162
     163    // setup reading task
    119164    MReadMarsFile read("Events", fname);
    120165    read.DisableAutoScheme();
    121166
     167    // setup a task making sure that all arrays are resized correctly
    122168    MGeomApply geomapl;
     169
     170    // Setup a print task calling TObject::Print
    123171    MPrint print1("MMcEvt");
    124172    MPrint print2("MRawEvtHeader");
     173    // Skip them if conatainers are not found
    125174    print1.EnableSkip();
    126175    print2.EnableSkip();
    127176
     177    // Copy MC pedestals to apropriate conatiners (if MC file)
    128178    MMcPedestalCopy   pcopy;
    129179    MMcPedestalNSBAdd pnsb;
     180
     181    // Calculate signal and pedestal from data (use MCerPhotCalc
     182    // in case of MC files)
    130183    MCerPhotAnal2     ncalc;
     184
     185    // Blind Pixel Treatment (deprecated, will be replaced by
     186    // MBadPixel*)
    131187    MBlindPixelCalc   blind;
    132188    blind.SetUseInterpolation();
     189
     190    // Clone MCerPhotEvt befor eimage cleaning
    133191    MClone            clone("MCerPhotEvt");
     192
     193    // Setup image cleaning
    134194    MImgCleanStd      clean;
     195
     196    // Setup calculation of Image parameters
    135197    MHillasCalc       hcalc;
     198
     199    // Setup intercative task calling the functions defined above
    136200    MTaskInteractive  mytask;
    137201
     
    139203    mytask.SetProcess(Process);
    140204
     205    // Setup your tasklist
    141206    tlist.AddToList(&read);
    142207    tlist.AddToList(&geomapl);
     
    152217    tlist.AddToList(&mytask);
    153218
     219    // Run your analysis
    154220    MEvtLoop evtloop;
    155221    evtloop.SetParList(&plist);
     
    158224        return;
    159225
     226    // Print statistics information about your loop
    160227    tlist.PrintStatistics();
    161228}
  • trunk/MagicSoft/Mars/macros/rootlogon.C

    r3927 r3957  
    1616!
    1717!
    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>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
     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///////////////////////////////////////////////////////////////////////////
    2447
    2548Bool_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
    143void Wrap(TString &str)
    244{
     45    // Wrap lines to 80 chars
    346    while (str.Length()>80)
    447    {
     
    1558void ProcessFile(TString fname, TString date)
    1659{
     60    // File processed
    1761    cout << fname << endl;
    1862
     63    // Open file
    1964    ifstream fin(fname);
    2065
     
    3277    while (!fin.eof())
    3378    {
     79        // Read file line by line
    3480        char *txt=new char[i];
    3581        fin.getline(txt, i-1);
     
    58104        }
    59105
     106        // Check whether line matches regexp
    60107        if (!line(r0).IsNull())
    61108            print = !line(r1).IsNull();
    62109
     110        // Wrap lines to 80 chars
    63111        if (print)
    64112            Wrap(line);
     
    71119void runbook(const char *d="20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]")
    72120{
     121    // Regexp to check for valid date
    73122    TString regexp = "20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]";
    74123
     
    85134    }
    86135
     136    // Tell which dierctories and files to search
    87137    MDirIter Next;
    88138    Next.AddDirectory("/home/MAGIC/online_data/runbook", "CC_*.rbk");
    89139
     140    // Loop over files
    90141    TString name;
    91142    while (1)
  • trunk/MagicSoft/Mars/macros/sectorvstime.C

    r3393 r3957  
    1818!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    2525/////////////////////////////////////////////////////////////////////////////
    2626//
    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.
    2935//
    3036/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/macros/star.C

    r2621 r3957  
    1818!   Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    2727//  STAR - STandard Analysis and Reconstruction
    2828//
    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.
    3137//
    3238/////////////////////////////////////////////////////////////////////////////
     
    3440void star()
    3541{
    36     //
    37     // This is a demonstration program which calculates the image
    38     // parameters from a Magic raw data root file.
    39 
    4042    //
    4143    // Create a empty Parameter List and an empty Task List
     
    101103    //
    102104    // tlist.SetSerialNumber(1); // Serial number of telescope
    103 
    104105    write.AddContainer(write.AddSerialNumber("MMcEvt"),       "Events", kFALSE);
    105106    write.AddContainer(write.AddSerialNumber("MSigmabar"),    "Events");
  • trunk/MagicSoft/Mars/macros/sumcurrents.C

    r2633 r3957  
    1818!   Author(s): Thomas Bretz, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
     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///////////////////////////////////////////////////////////////////////////
    2436
    2537void ProcessFile(TString fname)
     
    3951    //
    4052
     53    // Create the magic geometry
    4154    MGeomCamMagic geom;
    4255    plist.AddToList(&geom);
     
    4962    tlist.AddToList(&read);
    5063
     64    // create a task to fill a histogram
    5165    MFillH fill("MHCamEvent", "MCameraDC");
    5266    tlist.AddToList(&fill);
     
    6680    tlist.PrintStatistics();
    6781
     82    //
     83    // Now display the result of the loop
     84    //
    6885    MHCamEvent &h2 = *(MHCamEvent*)plist->FindObject("MHCamEvent");
    6986    MHCamera &h = *(MHCamera*)h2.GetHistByName("sum");
     
    129146}
    130147
    131 // -------------------------------------------------------------------------
    132 //
    133 //  plot.C
    134 //
    135 //  This macro shows how to fill and display a histogram using Mars
    136 //
    137148void sumcurrents(const char *dirname=".")
    138149{
  • 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///////////////////////////////////////////////////////////////////////////
    135void tar()
    236{
  • 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
    142void testenv()
    243{
  • trunk/MagicSoft/Mars/macros/weights.C

    r2474 r3957  
    1818!   Author(s): Marcos Lopez, 10/2003 <mailto:marcos@gae.ucm.es>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
    2323\* ======================================================================== */
    2424
    25 
    2625//////////////////////////////////////////////////////////////////////////////
    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//
    3234//////////////////////////////////////////////////////////////////////////////
    3335
    34 
    35 // --------------------------------------------------------------------------
    36 //
    37 //
    3836Double_t myfunction(Double_t *x, Double_t *par)
    3937{
     
    4341}
    4442
    45 
    46 
    47 // --------------------------------------------------------------------------
    48 //
    49 //
    5043void weights(TString filename="/up1/data/Magic-MC/CameraAll/Gammas/zbin0/Gamma_zbin0_0_7_1000to1009_w0-4:4:2.root")
    5144{
     
    109102    //-------------------------------------------------------------
    110103
    111 
    112104    MFillH hfill(&h1,"MMcEvt");
    113105    MFillH hfill2(&h2,"MMcEvt");
     
    118110    tasklist.AddToList(&hfill);
    119111    tasklist.AddToList(&hfill2);
    120 
    121112
    122113    //
     
    132123    parlist.Print();
    133124
    134 
    135     //
     125    //
    136126    // Draw the Results
    137127    //
     
    146136    hist1->DrawClone();
    147137    hist2->DrawClone("same");   
    148 
    149138}
    150 
    151 
    152 
    153 
    154 
    155 
    156 
    157 
    158 
    159 
    160 
    161 
    162 
Note: See TracChangeset for help on using the changeset viewer.