Changeset 710 for trunk/MagicSoft


Ignore:
Timestamp:
03/30/01 11:30:32 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
18 added
10 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r708 r710  
    11                                                                  -*-*- END -*-*-
    22
     3 2000/03/30: Thomas Bretz
     4 
     5   * mdatacheck/MH*, mdatacheck/MFillH* moved to mhist
     6 
     7 
    38 2000/03/21: Thomas Bretz
    49                           
  • trunk/MagicSoft/Mars/Makefile

    r686 r710  
    3535#  ----->>>   mars libraries
    3636#
    37 SUBDIRS = mgui manalysis meventdisp mdatacheck mmontecarlo mbase mraw mmc
     37SUBDIRS = mgui        \
     38          manalysis   \
     39          meventdisp  \
     40          mdatacheck  \
     41          mmontecarlo \
     42          mhist       \
     43          mbase       \
     44          mraw        \
     45          mmc
    3846
    3947LIBRARIES = $(SUBDIRS:=.a)
     
    8593        @cd mraw; make mrproper; cd ..
    8694        @echo "cd .."
     95        @echo "cd mhist"
     96        @cd mhist; make mrproper; cd ..
     97        @echo "cd .."
    8798        @echo "cd mgui"
    8899        @cd mgui; make mrproper; cd ..
  • trunk/MagicSoft/Mars/macros/CT1Hillas.C

    r700 r710  
    2626    // finished you must create them yourself and add it to the list
    2727    //
    28     MHHillas *hists = new MHHillas;
     28    MHHillas  *hists = new MHHillas;
    2929    plist->AddToList(hists);
     30
     31    MHStarMap *smap = new MHStarMap;
     32    plist->AddToList(smap);
    3033
    3134    //
     
    3740    //  4) fill the hillas into the histograms
    3841    //
    39     MCT1ReadAscii read("CT1_99_on1.dat") ;
     42    MCT1ReadAscii read("CT1_97_on1.dat") ;
    4043    MImgCleanStd  clean;
    4144    MHillasCalc   hcalc;
    4245    MFillHHillas  hfill;
     46    MFillHStarMap sfill;
    4347
    4448    tlist.AddToList(&read);
     
    4650    tlist.AddToList(&hcalc);
    4751    tlist.AddToList(&hfill);
     52    tlist.AddToList(&sfill);
    4853
    4954    //
     
    6267    //
    6368    hists->Draw();
     69    smap->Draw();
    6470}
  • trunk/MagicSoft/Mars/macros/MagicHillas.C

    r700 r710  
    3232    plist->AddToList(hists);
    3333
     34    MHStarMap *smap = new MHStarMap;
     35    plist->AddToList(smap);
     36
    3437    //
    3538    // Now setup the tasks and tasklist:
     
    4043    //  4) fill the hillas into the histograms
    4144    //
    42     MReadTree    read("oscar_protons.root", "Events") ;
    43     MCerPhotCalc ncalc;
    44     MImgCleanStd clean;
    45     MHillasCalc  hcalc;
    46     MFillHHillas hfill;
     45    MReadTree    read("Events", "oscar_protons.root");
     46    read.AddFile("test.root");
     47
     48    MCerPhotCalc  ncalc;
     49    MImgCleanStd  clean;
     50    MHillasCalc   hcalc;
     51    MFillHHillas  hfill;
     52    MFillHStarMap sfill;
    4753
    4854    tlist.AddToList(&read);
     
    5157    tlist.AddToList(&hcalc);
    5258    tlist.AddToList(&hfill);
     59    tlist.AddToList(&sfill);
    5360
    5461    //
     
    6774    //
    6875    hists->Draw();
     76    smap->Draw();
    6977}
     78
  • trunk/MagicSoft/Mars/macros/readCT1.C

    r700 r710  
    1111    plist->AddToList(&tlist);
    1212
    13     MCT1ReadAscii read("CT1_99_on1.dat") ;
     13    MCT1ReadAscii read("CT1_99_off1.dat") ;
    1414    MImgCleanStd  clean;
    1515    MHillasCalc   hcalc;
     
    2929    Int_t icount = 0 ;
    3030    MCamDisplay display(&geomcam) ;
     31        display.DrawPhotNum(&phevt);
     32
    3133
    3234    while (read.Process())
    3335    {
    3436        cout << "Event: " << icount++  << endl  ;
    35 
    36         if (icount < 45 )
    37             continue;
    3837
    3938        display.DrawPhotNum(&phevt);
  • trunk/MagicSoft/Mars/mars.cc

    r669 r710  
    2626  // start the main window
    2727 
    28   MGMarsMain mainWin(gClient->GetRoot(), 400, 650);     
     28  MGMarsMain *mainWin = new MGMarsMain(400, 650);
    2929 
    3030  theApp.Run();
  • trunk/MagicSoft/Mars/mdatacheck/DataCheckIncl.h

    r462 r710  
    11#ifndef __CINT__
    22
    3 #include "MParList.h"
    4 
    5 #include "MRawRunHeader.h"
    6 #include "MRawEvtHeader.h"
    7 #include "MRawEvtData.h"
    8 #include "MRawCrateArray.h"
    9 #include "MTime.h"
    10 #include "MInputStreamID.h"
    11 
    12 #include "MReadTree.h"
    13 
    143#endif // __CINT__
  • trunk/MagicSoft/Mars/mdatacheck/DataCheckLinkDef.h

    r698 r710  
    55#pragma link off all functions;
    66
    7 #pragma link C++ class MHFadcCam;
    8 #pragma link C++ class MHFadcPix;
    9 #pragma link C++ class MHHillas;
    10 
    117#pragma link C++ class MShowSpect;
    12 
    13 #pragma link C++ class MFillHFadc;
    14 #pragma link C++ class MFillHHillas;
    15 
    168#pragma link C++ class MDumpEvtHeader;
    179
  • trunk/MagicSoft/Mars/mdatacheck/Makefile

    r698 r710  
    2222#  connect the include files defined in the config.mk file
    2323#
    24 INCLUDES = -I. -I../mbase -I../mraw -I../manalysis
     24INCLUDES = -I. -I../mbase -I../mraw -I../mhist
    2525
    2626#------------------------------------------------------------------------------
     
    2929
    3030SRCFILES = MDumpEvtHeader.cc \
    31            MFillHFadc.cc \
    32            MFillHHillas.cc \
    3331           MGDisplayAdc.cc \
    34            MHFadcPix.cc \
    35            MHFadcCam.cc \
    36            MHHillas.cc \
    3732           MShowSpect.cc \
    3833           MViewAdcSpectra.cc
  • trunk/MagicSoft/Mars/mgui/MGMarsMain.cc

    r587 r710  
    3131
    3232
    33 MGMarsMain::MGMarsMain(const TGWindow *p, UInt_t w, UInt_t h)
    34   : TGMainFrame(p, w, h)
     33MGMarsMain::MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
     34  : TGMainFrame(gClient->GetRoot(), w, h)
    3535{
    3636  //    First create the MenuBar.   
  • trunk/MagicSoft/Mars/mgui/MGMarsMain.h

    r706 r710  
    5656 
    5757 public:
    58   MGMarsMain(const TGWindow *p, UInt_t w, UInt_t h) ;
     58  MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h) ;
    5959 
    6060  ~MGMarsMain();
  • trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc

    r689 r710  
    3434                      50, 0., 500. ) ;
    3535
    36   fHistColl = new TH1D("collArea", "Collection Area",
    37                        50, 0., 5.) ;
     36  fHistCol = new TH1D("collArea", "Collection Area",
     37                      50, 0., 5.) ;
    3838 
    3939}
     
    4343  delete fHistAll ;
    4444  delete fHistSel ;
    45   delete fHistColl ;
     45  delete fHistCol ;
    4646}
    4747
     
    6868void MCollArea::Draw(Option_t* option)
    6969{
    70   fHistColl->Draw(option) ;
     70  fHistCol->Draw(option) ;
    7171}
    7272
    73 void MCollArea::CalculateEffi()
     73void MCollArea::CalcEfficiency()
    7474{
    75   //  first of all calculate the efficency
    76   //  do it here by hand to get the right error of efficency
    77  
    78   Int_t iBinx = ( (TAxis *) fHistSel->GetXaxis())->GetNbins() ;
    79   Int_t iBiny = ( (TAxis *) fHistSel->GetYaxis())->GetNbins() ;
    80  
    81   Float_t N, Nall ;
    82   Double_t effi, error ;
    83   for (Int_t ix=1; ix<=iBiny; ix++ )
     75    // Description!
     76
     77    //
     78    //  first of all calculate the efficency
     79    //  do it here by hand to get the right error of efficency
     80    //
     81    const Int_t iBinx = ((TAxis *)fHistSel->GetXaxis())->GetNbins();
     82    const Int_t iBiny = ((TAxis *)fHistSel->GetYaxis())->GetNbins();
     83
     84    for (Int_t ix=1; ix<=iBiny; ix++ )
    8485    {
    85       for (Int_t iy=1; iy<=iBiny; iy++ )
    86         {
    87           effi = error = 0. ;
     86        for (Int_t iy=1; iy<=iBiny; iy++ )
     87        {
     88            const Float_t N    = fHistSel->GetCellContent(ix, iy);
     89            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
    8890
    89           N    = fHistSel->GetCellContent(ix, iy) ;
    90           Nall = fHistAll->GetCellContent(ix, iy) ;
    91          
    92           if ( Nall > 0 ) {
    93             effi   = N / Nall ;
    94             error = sqrt ( Nall + Nall * N - N * N - N ) / (Nall * Nall ) ;
     91            if ( Nall <= 0 ) {
     92                // cout << ix << " " << iy << endl ;
     93                continue;
     94            }
    9595
    96             cout << ix << " " << iy
    97                  << " N " << N
    98                  << " Nall " << Nall
    99                  << " effi  " << effi
    100                  << " error " << error
    101                  << endl ;
     96            const Double_t eff = N / Nall ;
     97            const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
     98            /*
     99             cout << ix << " " << iy
     100             << " N " << N
     101             << " Nall " << Nall
     102             << " effi  " << eff
     103             << " error " << err
     104             << endl ;
     105             */
     106            fHistSel->SetCellContent(ix, iy, eff);
     107            fHistSel->SetCellError(ix, iy, err);
     108        }
     109    }
    102110
    103             fHistSel->SetCellContent(ix, iy, effi) ;
    104             fHistSel->SetCellError(ix, iy, error) ;
    105           }
    106           else
    107             cout << ix << " " << iy << endl ;
    108            
    109          
     111    //
     112    //  now calculate the Collection area for different
     113    //  energies
     114    //
     115    for (Int_t ix=1; ix<=iBiny; ix++ )
     116    {
     117        Double_t errA = 0;
     118        Double_t colA = 0;
    110119
    111          
    112         }
    113     }
    114  
    115   //
    116   //  now calculate the Collection area for different
    117   //  energies
    118   //   
    119  
    120  
    121   Double_t  r1, r2, eff, errEff, A, errA, collA ;
     120        for (Int_t iy=1; iy<=iBiny; iy++ )
     121        {
     122            const Double_t r1  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy);
     123            const Double_t r2  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy+1);
    122124
    123   for (Int_t ix=1; ix<=iBiny; ix++ )
    124     {
    125       A = errA = collA = errEff = 0. ;
    126      
    127       for (Int_t iy=1; iy<=iBiny; iy++ )
    128         {
    129           r1 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy) ;
    130           r2 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy+1) ;
    131           A  = 3.141592654 * ( r2*r2 - r1*r1 ) ;
    132           eff    = fHistSel->GetCellContent(ix, iy) ;
    133           errEff = fHistSel->GetCellError(ix, iy) ;
    134           collA += eff * A ;
    135          
    136           errA  += ( A * A ) * errEff * errEff ;
    137         }
     125            const Double_t A   = kPI * (r2*r2 - r1*r1);
    138126
    139       errA = sqrt( errA ) ;
     127            const Double_t eff = fHistSel->GetCellContent(ix, iy);
     128            const Double_t err = fHistSel->GetCellError(ix, iy);
    140129
    141       cout << ix << " --> " << A
    142            << endl ;
    143      
    144       fHistColl->SetBinContent(ix, collA ) ;
    145       fHistColl->SetBinError(ix, errA ) ;
    146      
     130            colA += eff*A;
     131            errA += (A*A) * err * err;
     132        }
    147133
    148     }
    149 }
     134        fHistCol->SetBinContent(ix, colA);
     135        fHistCol->SetBinError(ix, sqrt(errA));
     136    }
     137}
  • trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h

    r686 r710  
    99
    1010 private:
    11   TH2D  *fHistAll ; //!    all simulated showers
    12   TH2D  *fHistSel ; //!    the selected showers
    13   TH1D  *fHistColl ; //!   the collection area
     11  TH2D  *fHistAll ; //! all simulated showers
     12  TH2D  *fHistSel ; //! the selected showers
     13  TH1D  *fHistCol ; //  the collection area
    1414
    1515 public:
     
    2323  void DrawSel() ;
    2424  void Draw(Option_t* option = "") ;
    25   void CalculateEffi() ;
     25  void CalcEfficiency() ;
    2626
    2727  ClassDef(MCollArea, 1)  //  Data Container to calculate Collection Area
Note: See TracChangeset for help on using the changeset viewer.