Changeset 2383


Ignore:
Timestamp:
10/05/03 18:30:19 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r2359 r2383  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
     18!   Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    3232/////////////////////////////////////////////////////////////////////////////
    3333
    34 #include "MImgCleanStd.h"
    35 
    36 void star(Float_t clean1=3., Float_t clean2=2.5)
     34void star()
    3735{
    3836    //
     
    4745
    4846    MTaskList tlist;
    49 
    5047    plist.AddToList(&tlist);
    5148
     
    6966
    7067    // ------------- user change -----------------
    71     //    read.AddFile("Pro*.root");
    72     //    read.AddFile("Gamma_*_0_7_*.root");
    73     //    read.AddFile("Gamma_*.root");
     68    read.AddFile("magictest/test/Gamma_z*.root");
    7469
    75     gSystem->Exec("ls Gamma_*.root > files.txt");
    76 
    77     Float_t ratio = 1.;
    78 
    79     ifstream list;
    80     list.open("files.txt");
    81     while (1)
    82       {
    83         Char_t file[256];
    84         list >> file;
    85         if (!list.good()) break;
    86         TChain dummy("Events");
    87         dummy.Add(file);
    88         Int_t maxevents = ratio*dummy.GetEntries();
    89 
    90         read.AddFile(file,maxevents);
    91       }
    92     list.close();
    93     gSystem->Exec("rm files.txt");
    94  
    9570    MMcPedestalCopy   pcopy;
    9671    MMcPedestalNSBAdd pnsb;
    97 
    9872    MCerPhotCalc      ncalc;
    99 
    100     const Float_t x[15]={0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    101     const TArrayF w(15,(Float_t*)x);
    102     ncalc.SetWeights(w);
    10373
    10474    MBlindPixelCalc   blind;
    10575    blind.SetUseInterpolation();
    10676
    107     MImgCleanStd      clean(clean1, clean2);
    108 
     77    MSigmabarCalc     sgcal;
     78    MImgCleanStd      clean;
    10979    MHillasCalc       hcalc;
    11080    MHillasSrcCalc    scalc; // !!Preliminary!! Will be removed later!
    11181
    112 
    113     MContinue filtersize300("MHillas.fSize<300");
    114     MContinue filtersize500("MHillas.fSize<500");
    115     MContinue filtersize1000("MHillas.fSize<1000");
    116     MContinue filtersize2000("MHillas.fSize<2000");
    117 
    118     MFEventSelector eventselector1;
    119     eventselector1.SetNumSelectEvts(10000);
    120     MFEventSelector eventselector2;
    121     eventselector2.SetNumSelectEvts(17000);
    122     MFEventSelector eventselector3;
    123     eventselector3.SetNumSelectEvts(27000);
    124     MFEventSelector eventselector4;
    125     eventselector4.SetNumSelectEvts(63000);
    126     MFEventSelector eventselector5;
    127     eventselector5.SetNumSelectEvts(150000);
    128 
    12982    // ------------- user change -----------------
    130 
    131 
    132     Char_t dir[256];
    133     //    sprintf (dir, "Clean_%.1f_%.1f/", clean1, clean2);
    134     TString out = dir;
    135 
    136     out += "Sgt0/star_gammas.root";
    137     MWriteRootFile write1(out);
    138     write1.SetFilter(&eventselector1);
    139     write1.AddContainer("MRawRunHeader", "RunHeaders");
    140     write1.AddContainer("MMcRunHeader",  "RunHeaders");
    141     write1.AddContainer("MSrcPosCam",    "RunHeaders");
    142     write1.AddContainer("MMcEvt",        "Events");
    143     write1.AddContainer("MHillas",       "Events");
    144     write1.AddContainer("MHillasExt",    "Events");
    145     write1.AddContainer("MHillasSrc",    "Events");
    146     write1.AddContainer("MNewImagePar",  "Events");
    147 
    148     out = dir;
    149     out += "Sgt300/star_gammas.root";
    150     MWriteRootFile write2(out);
    151     write2.SetFilter(&eventselector2);
    152     write2.AddContainer("MRawRunHeader", "RunHeaders");
    153     write2.AddContainer("MMcRunHeader",  "RunHeaders");
    154     write2.AddContainer("MSrcPosCam",    "RunHeaders");
    155     write2.AddContainer("MMcEvt",        "Events");
    156     write2.AddContainer("MHillas",       "Events");
    157     write2.AddContainer("MHillasExt",    "Events");
    158     write2.AddContainer("MHillasSrc",    "Events");
    159     write2.AddContainer("MNewImagePar",  "Events");
    160 
    161     // Extra !
    162     write2.AddContainer("MMcTrigHeader", "RunHeaders");
    163     write2.AddContainer("MMcCorsikaRunHeader", "RunHeaders");
    164     write2.AddContainer("MMcFadcHeader",       "RunHeaders");
    165     write2.AddContainer("MMcTrig",       "Events");
    166     write2.AddContainer("MRawEvtData",   "Events");
    167     write2.AddContainer("MRawEvtHeader", "Events");
    168 
    169     out = dir;
    170     out += "Sgt500/star_gammas.root";
    171     MWriteRootFile write3(out);
    172     write3.SetFilter(&eventselector3);
    173     write3.AddContainer("MRawRunHeader", "RunHeaders");
    174     write3.AddContainer("MMcRunHeader",  "RunHeaders");
    175     write3.AddContainer("MSrcPosCam",    "RunHeaders");
    176     write3.AddContainer("MMcEvt",        "Events");
    177     write3.AddContainer("MHillas",       "Events");
    178     write3.AddContainer("MHillasExt",    "Events");
    179     write3.AddContainer("MHillasSrc",    "Events");
    180     write3.AddContainer("MNewImagePar",  "Events");
    181 
    182     out = dir;
    183     out += "Sgt1000/star_gammas.root";
    184     MWriteRootFile write4(out);
    185     write4.SetFilter(&eventselector4);
    186     write4.AddContainer("MRawRunHeader", "RunHeaders");
    187     write4.AddContainer("MMcRunHeader",  "RunHeaders");
    188     write4.AddContainer("MSrcPosCam",    "RunHeaders");
    189     write4.AddContainer("MMcEvt",        "Events");
    190     write4.AddContainer("MHillas",       "Events");
    191     write4.AddContainer("MHillasExt",    "Events");
    192     write4.AddContainer("MHillasSrc",    "Events");
    193     write4.AddContainer("MNewImagePar",  "Events");
    194 
    195     out = dir;
    196     out += "Sgt2000/star_gammas.root";
    197     MWriteRootFile write5(out);
    198     write5.SetFilter(&eventselector5);
    199     write5.AddContainer("MRawRunHeader", "RunHeaders");
    200     write5.AddContainer("MMcRunHeader",  "RunHeaders");
    201     write5.AddContainer("MSrcPosCam",    "RunHeaders");
    202     write5.AddContainer("MMcEvt",        "Events");
    203     write5.AddContainer("MHillas",       "Events");
    204     write5.AddContainer("MHillasExt",    "Events");
    205     write5.AddContainer("MHillasSrc",    "Events");
    206     write5.AddContainer("MNewImagePar",  "Events");
     83    MWriteRootFile write("starfile.root");
     84    write.AddContainer("MMcEvt",        "Events");
     85    write.AddContainer("MSigmabar",     "Events");
     86    write.AddContainer("MHillas",       "Events");
     87    write.AddContainer("MHillasExt",    "Events");
     88    write.AddContainer("MHillasSrc",    "Events");
     89    write.AddContainer("MNewImagePar",  "Events");
     90    write.AddContainer("MRawRunHeader", "RunHeaders");
     91    write.AddContainer("MMcRunHeader",  "RunHeaders");
     92    write.AddContainer("MSrcPosCam",    "RunHeaders");
    20793
    20894    tlist.AddToList(&read);
     
    21096    tlist.AddToList(&pnsb);
    21197    tlist.AddToList(&ncalc);
     98    tlist.AddToList(&blind);
     99    tlist.AddToList(&sgcal);
    212100    tlist.AddToList(&clean);
    213     tlist.AddToList(&blind);
    214101    tlist.AddToList(&hcalc);
    215102    tlist.AddToList(&scalc);
    216 
    217     tlist.AddToList(&eventselector1);
    218     tlist.AddToList(&write1);
    219     tlist.AddToList(&filtersize300);  //FILTER SIZE LINE
    220 
    221     tlist.AddToList(&eventselector2);
    222     tlist.AddToList(&write2);
    223     tlist.AddToList(&filtersize500);  //FILTER SIZE LINE
    224 
    225     tlist.AddToList(&eventselector3);
    226     tlist.AddToList(&write3);
    227     tlist.AddToList(&filtersize1000);  //FILTER SIZE LINE
    228 
    229     tlist.AddToList(&eventselector4);
    230     tlist.AddToList(&write4);
    231     tlist.AddToList(&filtersize2000);  //FILTER SIZE LINE
    232 
    233     tlist.AddToList(&eventselector5);
    234     tlist.AddToList(&write5);
     103    tlist.AddToList(&write);
    235104
    236105    //
     
    245114    //
    246115    // Execute your analysis
    247      //
     116    //
    248117    if (!evtloop.Eventloop())
    249118        return;
Note: See TracChangeset for help on using the changeset viewer.