Ignore:
Timestamp:
07/31/02 18:03:51 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1443 r1463  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     18!   Author(s): Thomas Bretz et al,  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2002
    2121!
    2222!
     
    2424
    2525
    26 void MagicHillas(const char *filename="~/data/gamma*.root")
     26void MagicHillas(const char *filename="~/data/Gamma*.root")
    2727{
    2828    //
    2929    // This is a demonstration program which calculates the Hillas
    30     // parameter out of a Magic root file.
     30    // parameter out of a Magic root file (raw data file).
     31    //
    3132
    3233    //
     
    4344    // of MHillas
    4445    //
    45     //MHillasExt hext;
    46     //plist.AddToList(&hext);
     46    /*
     47     MHillasExt hext;
     48     plist.AddToList(&hext);
     49     */
    4750
    4851    //
     
    5457
    5558    //
    56     // Setup binning for your histograms.
     59    // Use this if you want to change the binning of one of
     60    // the histograms
    5761    //
    58     MBinning binswidth("BinningWidth");
    59     binswidth.SetEdges(100, 0, 1);   // 100 bins from 0 to 1 deg
     62    /*
     63     MBinning binswidth("BinningWidth");
     64     binswidth.SetEdges(100, 0, 0.1);     // 100 bins from 0 to 1 deg
     65     plist.AddToList(&binswidth);
    6066
    61     MBinning binslength("BinningLength");
    62     binslength.SetEdges(100, 0, 1);  // 100 bins from 0 to 1 deg
     67     MBinning binslength("BinningLength");
     68     binslength.SetEdges(100, 0, 1);      // 100 bins from 0 to 1 deg
     69     plist.AddToList(&binslength);
    6370
    64     MBinning binsalpha("BinningAlpha");
    65     binsalpha.SetEdges(90, 0, 90);   // 90 bins from 0 to 90 deg
     71     MBinning binsdist("BinningDist");
     72     binsdist.SetEdges(100, 0, 1.5);      // 100 bins from 0 to 1 deg
     73     plist.AddToList(&binsdist);
    6674
    67     MBinning binsdist("BinningDist");
    68     binsdist.SetEdges(100, 0, 2);    // 100 bins from 0 to 2 deg
     75     MBinning binsht("BinningHeadTail");
     76     binsht.SetEdges(100, -1.5, 1.5);     // 100 bins from 0 to 1 deg
     77     plist.AddToList(&binsht);
    6978
    70     plist.AddToList(&binswidth);
    71     plist.AddToList(&binslength);
    72     plist.AddToList(&binsalpha);
    73     plist.AddToList(&binsdist);
     79     MBinning binsalpha("BinningAlpha");
     80     binsalpha.SetEdges(90, 0, 90);       // 90 bins from 0 to 90 deg
     81     plist.AddToList(&binsalpha);
     82
     83     MBinning binscam("BinningCamera");
     84     binscam.SetEdges(50, -1.5, 1.5);     //  20 bins from -2 to 2 deg
     85     plist.AddToList(&binscam);
     86    */
    7487
    7588    //
     
    101114    MMcPedestalCopy   pcopy;
    102115    MMcPedestalNSBAdd pnsb;
     116
    103117    MCerPhotCalc      ncalc;
    104 
    105 //  Alternative photon calculation:
    106 //    MCerPhotCalc2     ncalc;
    107 //  Example: use only 2nd to 6th FADC slices for photon calculation:
    108 //    const Float_t x[15]={0., 1., 1., 1., 1., 1., 0.,0.,0.,0.,0.,0.,0.,0.,0.};
    109 //    TArrayF w(15,x);
    110 //    ncalc.SetWeights(w);
     118    //
     119    //  Alternative photon calculation:
     120    //  Example: use only 2nd to 6th FADC slices for photon calculation:
     121    //
     122    //    MCerPhotCalc2 ncalc;
     123    //    const Float_t x[15]={0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
     124    //    TArrayF w(15,x);
     125    //    ncalc.SetWeights(w);
     126    //
    111127
    112128    MImgCleanStd      clean;
     
    121137    MFillH hfill2a("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
    122138
     139    MWriteRootFile write("hillas.root");
     140    write.AddContainer("MHillas",       "Hillas");
     141    write.AddContainer("HillasSource",  "Hillas");
     142    write.AddContainer("HillasAntiSrc", "Hillas");
     143    write.AddContainer("MHStarMap");
     144    write.AddContainer("MMcEvt","Hillas");
     145
    123146    /*
    124      MWriteRootFile write("hillas.root");
    125      write.AddContainer("MHillas",       "Hillas");
    126      write.AddContainer("HillasSource",  "Hillas");
    127      write.AddContainer("HillasAntiSrc", "Hillas");
    128      write.AddContainer("MMcEvt",        "Hillas");
    129      write.AddContainer("MHStarMap");
    130 
    131147     MWriteAsciiFile write("hillas.txt");
    132148     write.AddColumn("MHillas.fLength*MGeomCam.fConvMm2Deg");
     
    143159    tlist.AddToList(&hcalc);
    144160    tlist.AddToList(&csrc1);
     161
    145162    tlist.AddToList(&csrc2);
    146163    tlist.AddToList(&hfill);
     
    148165    tlist.AddToList(&hfill2s);
    149166    tlist.AddToList(&hfill2a);
     167    tlist.AddToList(&write);
    150168
    151169    //
     
    165183    //
    166184    // After the analysis is finished we can display the histograms
    167 
     185    //
     186    plist.FindObject("HistSource")->DrawClone();
    168187    plist.FindObject("MHHillas")->DrawClone();
    169     plist.FindObject("HistSource")->DrawClone();
    170188    plist.FindObject("HistAntiSrc")->DrawClone();
    171189    plist.FindObject("MHStarMap")->DrawClone();
    172190}
     191
Note: See TracChangeset for help on using the changeset viewer.