Changeset 1004 for trunk/MagicSoft


Ignore:
Timestamp:
10/29/01 11:35:19 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r998 r1004  
    11                                                                  -*-*- END -*-*-
     2
     3 2001/10/29: Thomas Bretz
     4
     5   * Makefile.rules:
     6     - changed the output
     7
     8   * macros/rootlogon.C:
     9     - Added IgnorTObjectStreamer
     10
     11   * manalysis/MCT1ReadAscii.cc:
     12     - changed fFileNames to a TList of TNamed objects
     13
     14   * mbase/MArray.h:
     15     - removed include of MArray.h
     16
     17   * mbase/MParContainer.[h,cc]:
     18     - changed fName, fTitle from pointer to static object
     19     - Changed ClassVersion to 0
     20
     21   * mbase/MParList.[h,cc]:
     22     - changed fName, fTitle from pointer to static object
     23     - changed include of TObjArray to a forward declaration
     24       (for faster compilation)
     25     - simplified the code
     26
     27   * mbase/MInputStreamID.[h,cc]:
     28     - changed fStreamId from char* to TString
     29     - Changed ClassVersion to 0
     30 
     31   * mbase/MReadTree.[h,cc]:
     32     - changed veto-list to an array of TNamed objects
     33     - implemented auto enabeling
     34
     35   * mbase/MTask.[h,cc]:
     36     - implemented fListOfBranches for auto enabeling
     37     
     38   * mbase/MTaskList.[h,cc]:
     39     - changed fName, fTitle from pointer to static object
     40     - changed include of TObjArray to a forward declaration
     41       (for faster compilation)
     42
     43   * mbase/MWriteRootFile.cc:
     44     - changed fName, fTitle from pointer to static object
     45     - set splitlevel in TTree::Branch to default
     46     - changed kSaveNow to kFillTree
     47
     48   * mhist/MFillH.cc:
     49     - changed fName, fTitle from pointer to static object
     50     - check inharitance from MH
     51
     52   * mhist/MH.[h,cc]:
     53     - changed fName, fTitle from pointer to static object
     54     - implementation of simplified static MakeDefCanvas
     55
     56   * mhist/MHFadcCam.h:
     57     - removed include of TH1
     58
     59   * mhist/MHFadcPix.[h,cc]:
     60     - implemented persistent pixid
     61     - get rid of 'fixed string sizes'
     62     - Delete histograms from file structure (SetDirectory)
     63     - changed Root's MakeDefCanvas to TH1::MakeDefCanvas
     64     - removed include of TH1
     65
     66   * mhist/MHHillas.cc
     67     - changed fName, fTitle from pointer to static object
     68     - Delete histograms from file structure (SetDirectory)
     69     - changed Root's MakeDefCanvas to TH1::MakeDefCanvas
     70     - changed DrawClone to DrawCopy
     71
     72   * mhist/MHMcCollectionArea.[h,cc]:
     73     - changed fName, fTitle from pointer to static object
     74     - Delete histograms from file structure (SetDirectory)
     75     - changed Root's MakeDefCanvas to TH1::MakeDefCanvas
     76     - changed DrawClone to DrawCopy
     77     - changed binning to log scale
     78     - removed include of TH1
     79
     80   * mhist/MHMcEnergy.cc, mhist/MHStarMap.cc:
     81     - changed fName, fTitle from pointer to static object
     82     - Delete histograms from file structure (SetDirectory)
     83     - changed Root's MakeDefCanvas to TH1::MakeDefCanvas
     84
     85   * manalysis/MCerPhotCalc.cc, manalysis/MCerPhotEvt.cc,
     86     manalysis/MHillas.cc, manalysis/MHillasCalc.cc,
     87     manalysis/MImgCleanStd.cc, manalysis/MMcPedestalCopy.cc,
     88     manalysis/MPedCalcPedRun.cc, manalysis/MPedestalCam.cc,
     89     mbase/MClone.cc, mbase/MPrint.cc, mbase/MTime.h,
     90     mbase/MWriteAsciiFile.cc, mgui/MGeomCam.cc,
     91     mhist/MHFadcCam.cc, mhist/MHMcRate.cc,
     92     mmc/MMcTrig.cxx, mmontecarlo/MMcThresholdCalc.cc,
     93     mmontecarlo/MMcTriggerRateCalc.cc,
     94     mraw/MRawCrateArray.cc, mraw/MRawEvtData.cc,
     95     mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc:
     96     - changed fName, fTitle from pointer to static object
     97
     98   * mraw/MRawFileWrite.cc:
     99     - changed fName, fTitle from pointer to static object
     100     - changed TTree::Branch to use default split level (99)
     101     - added the missing important '.' to the Branch names!
     102
     103   * mraw/MRawRunHeader.[h,cc]:
     104     - changed fName, fTitle from pointer to static object
     105     - implemented enum for Run Type
     106
     107
    2108
    3109 2001/10/26: Thomas Bretz
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r1003 r1004  
    7878    virtual void AsciiWrite(ofstream &fout) const;
    7979
    80     ClassDef(MParContainer, 1)  //The basis for all parameter containers
     80    ClassDef(MParContainer, 0)  //The basis for all parameter containers
    8181};
    8282*/
  • trunk/MagicSoft/Mars/mbase/MWriteFile.h

    r961 r1004  
    66#endif
    77
    8 class TFile;
    9 
    108class MWriteFile : public MTask
    119{
    1210private:
    13     virtual Bool_t IsFileOpen() const = 0;
    14     virtual void CheckAndWrite() const = 0;
    15     virtual Bool_t GetContainer(MParList *pList) = 0;
     11    Bool_t PreProcess(MParList *pList);
     12    Bool_t Process();
     13    Bool_t PostProcess();
     14
     15    virtual Bool_t      IsFileOpen() const = 0;
     16    virtual void        CheckAndWrite() const = 0;
     17    virtual Bool_t      GetContainer(MParList *pList) = 0;
    1618    virtual const char *GetFileName() const = 0;
    17 
    18 public:
    19 
    20     virtual Bool_t PreProcess(MParList *pList);
    21     virtual Bool_t Process();
    22     virtual Bool_t PostProcess();
    2319
    2420    ClassDef(MWriteFile, 0)     // Base class for tasks to write single containers to several output formats
  • trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc

    r1003 r1004  
    4646ClassImp(MWriteRootFile);
    4747
    48 #define kFillTree BIT(1)
     48#define kFillTree BIT(14)
    4949
    5050// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r967 r1004  
    6060void MFillH::Init(const char *name, const char *title)
    6161{
    62     *fName  = name  ? name  : "MFillH";
    63     *fTitle = title ? title : "Task to fill Mars histograms";
     62    fName  = name  ? name  : "MFillH";
     63    fTitle = title ? title : "Task to fill Mars histograms";
    6464
    6565    fH            = NULL;
     
    162162    }
    163163
     164    if (!fH->InheritsFrom("MH"))
     165    {
     166        *fLog << dbginf << fH->GetName() << " [" << fH->ClassName();
     167        *fLog << "] doesn't inherit from MH - cannot be used for MFillH... aborting." << endl;
     168        return kFALSE;
     169    }
     170
    164171    return kTRUE;
    165172}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r961 r1004  
    1010#endif
    1111
     12class TCanvas;
     13
    1214class MH : public MParContainer
    1315{
    1416public:
    15      MH(const char *name=NULL, const char *title=NULL);
     17    MH(const char *name=NULL, const char *title=NULL);
    1618
    1719    virtual void Fill(const MParContainer *par) = 0;
     20
     21    static TCanvas *MakeDefCanvas(const char *name=NULL, const char *title="",
     22                                  const UInt_t w=700, const UInt_t h=500);
     23    static TCanvas *MakeDefCanvas(const TObject *obj,
     24                                  const UInt_t w=700, const UInt_t h=500);
    1825
    1926    ClassDef(MH, 1) //A histogram base class for Mars histograms
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.cc

    r887 r1004  
    3434#include "MHFadcCam.h"
    3535
    36 #include <TH1.h>
    37 
    3836#include "MRawEvtData.h"
    3937#include "MRawEvtPixelIter.h"
     
    5250    //
    5351   
    54     *fName  = name  ? name  : "MHFadcCam" ;
    55     *fTitle = title ? title : "Container for ADC spectra histograms" ;
     52    fName  = name  ? name  : "MHFadcCam" ;
     53    fTitle = title ? title : "Container for ADC spectra histograms" ;
    5654
    5755    //
     
    7270}
    7371
     72// --------------------------------------------------------------------------
    7473void MHFadcCam::Fill(const MParContainer *par)
    7574{
     
    113112    //
    114113
    115     fHistLo->Write() ;
    116     fHistHi->Write() ;
     114    fHistLo->Write();
     115    fHistHi->Write();
    117116}
    118117
  • trunk/MagicSoft/Mars/mhist/MHFadcCam.h

    r887 r1004  
    1717#endif
    1818
    19 class TH1F;
     19#ifndef ROOT_TH1
     20#include <TH1.h>
     21#endif
    2022
    2123class MHFadcCam : public MH
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.cc

    r959 r1004  
    3535#include "MHFadcPix.h"
    3636
     37#include <TH1.h>
    3738#include <TPad.h>
     39
     40#include "MH.h"
    3841
    3942ClassImp(MHFadcPix);
     
    4346// Creates the histograms for lo and hi gain of one pixel
    4447//
    45 MHFadcPix::MHFadcPix(UInt_t pixid)
     48MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid)
    4649{
    47     // FIXME! Set the right axis titles and ... and ...
    48     Char_t tmp1[40];
    49     Char_t tmp2[40];
     50    Char_t *name  = StrDup(pixid ? Form("HiGain%03d", pixid) : "HiGain");
     51    Char_t *title = StrDup(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
    5052
    51     //    if (pixid)
    52     //    {
    53     sprintf(tmp1, "HiGain%03d", pixid);
    54     sprintf(tmp2, "Hi Gain Pixel #%d", pixid);
    55     //    }
    56     fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
     53    fHistHi =  new TH1F(name, title, 256, 0, 255);
    5754
    58     //    if (pixid)
    59     //    {
    60     sprintf(tmp1, "LoGain%03d", pixid);
    61     sprintf(tmp2, "Lo Gain Pixel #%d", pixid);
    62     //    }
    63     fHistLo = new TH1F(tmp2, tmp2, 256, 0, 255);
     55    fHistHi->SetDirectory(NULL);
     56    fHistHi->SetXTitle("Time/Slices");
     57    fHistHi->SetYTitle("Signal");
     58
     59    delete [] name;
     60    delete [] title;
     61
     62    name  = StrDup(pixid ? Form("LoGain%03d", pixid) : "LoGain");
     63    title = StrDup(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
     64
     65    fHistLo = new TH1F(name, title, 256, 0, 255);
     66
     67    fHistLo->SetDirectory(NULL);
     68    fHistLo->SetXTitle("Time/Slices");
     69    fHistLo->SetYTitle("Signal");
     70
     71    delete [] name;
     72    delete [] title;
    6473}
    6574
     
    7281
    7382// --------------------------------------------------------------------------
     83inline void MHFadcPix::FillHi(Byte_t i)
     84{
     85    fHistHi->Fill(i);
     86}
     87
     88// --------------------------------------------------------------------------
     89inline void MHFadcPix::FillLo(Byte_t i)
     90{
     91    fHistLo->Fill(i);
     92}
     93
     94// --------------------------------------------------------------------------
     95inline void MHFadcPix::DrawHi()
     96{
     97    fHistHi->Draw();
     98}
     99
     100// --------------------------------------------------------------------------
     101inline void MHFadcPix::DrawLo()
     102{
     103    fHistLo->Draw();
     104}
     105
     106// --------------------------------------------------------------------------
    74107void MHFadcPix::Draw(Option_t *)
    75108{
    76109    if (!gPad)
    77110    {
    78         if (!gROOT->GetMakeDefCanvas())
    79             return;
    80         (gROOT->GetMakeDefCanvas())();
     111        const char *name  = StrDup(fPixId ? Form("Pixel #%d", fPixId) : "Pixel");
     112        const char *title = StrDup(fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
     113        MH::MakeDefCanvas(name, title);
     114        delete [] name;
     115        delete [] title;
    81116    }
    82117
    83118    gPad->Divide(1, 2);
    84119
    85     gPad->cd(0);
     120    gPad->cd(1);
    86121    fHistHi->Draw();
    87122
    88     gPad->cd(1);
     123    gPad->cd(2);
    89124    fHistLo->Draw();
    90125}
  • trunk/MagicSoft/Mars/mhist/MHFadcPix.h

    r712 r1004  
    66#endif
    77
    8 #ifndef ROOT_TH1
    9 #include <TH1.h>
    10 #endif
     8//#ifndef ROOT_TH1
     9//#include <TH1.h>
     10//#endif
     11
     12class TH1F;
    1113
    1214class MHFadcPix : public TObject
     
    1517    TH1F *fHistHi;
    1618    TH1F *fHistLo;
     19
     20    UInt_t fPixId;
    1721
    1822public:
     
    2327    TH1F *GetHistLo() { return fHistLo; }
    2428
    25     void FillHi(Byte_t i) { fHistHi->Fill(i); }
    26     void FillLo(Byte_t i) { fHistLo->Fill(i); }
     29    void FillHi(Byte_t i);
     30    void FillLo(Byte_t i);
    2731
    28     void DrawHi() { fHistHi->Draw(); }
    29     void DrawLo() { fHistLo->Draw(); }
     32    void DrawHi();
     33    void DrawLo();
    3034
    3135    void Draw(Option_t *opt=NULL);
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r995 r1004  
    2626{
    2727    //
    28     //  default constructor
    29     //  creates an a list of histograms for all pixels and both gain channels
    30     //
    31 
    32     //
    3328    //   set the name and title of this object
    3429    //
    35    
    36     *fName  = name  ? name  : "MHHillas" ;
    37     *fTitle = title ? title : "Container for Hillas histograms" ;
     30    fName  = name  ? name  : "MHHillas" ;
     31    fTitle = title ? title : "Container for Hillas histograms" ;
    3832
    3933    //
     
    4236    // connect all the histogram with the container fHist
    4337    //
    44     // FIXME! Make the histograms looking that they can be used for
    45     //        presentations (axis title, ...)
    46     //
    4738    fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
    4839    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
    4940    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
    5041    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
     42
     43    fAlpha->SetDirectory(NULL);
     44    fLength->SetDirectory(NULL);
     45    fDist->SetDirectory(NULL);
     46    fWidth->SetDirectory(NULL);
    5147
    5248    fAlpha->GetXaxis()->SetTitle("Alpha [deg]");
     
    9894TObject *MHHillas::DrawClone(Option_t *opt) const
    9995{
    100     TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
    101     c->Divide(2,2);
     96    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
     97    c->Divide(2, 2);
    10298
    10399    gROOT->SetSelectedPad(NULL);
     
    107103    //
    108104    c->cd(1);
    109     fAlpha->DrawClone()->SetBit(kCanDelete);
     105    fAlpha->DrawCopy();
    110106
    111107    c->cd(2);
    112     fLength->DrawClone()->SetBit(kCanDelete);
     108    fLength->DrawCopy();
    113109
    114110    c->cd(3);
    115     fDist->DrawClone()->SetBit(kCanDelete);
     111    fDist->DrawCopy();
    116112
    117113    c->cd(4);
    118     fWidth->DrawClone()->SetBit(kCanDelete);
     114    fWidth->DrawCopy();
    119115
    120116    c->Modified();
     
    133129{
    134130    if (!gPad)
    135     {
    136         if (!gROOT->GetMakeDefCanvas())
    137             return;
    138         (gROOT->GetMakeDefCanvas())();
    139     }
     131        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
    140132
    141     //TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
    142133    gPad->Divide(2,2);
    143134
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc

    r970 r1004  
    2929#include <TCanvas.h>
    3030
     31#include "MH.h"
     32
    3133ClassImp(MHMcCollectionArea);
    3234
     
    4850
    4951 
    50     *fName  = name  ? name  : "MHMcCollectionArea";
    51     *fTitle = title ? title : "Data to Calculate Coll-Area";
    52 
    53 
    54     fHistAll = new TH2D("AllEvents", "All showers - Radius vs log(E) distribution",
    55                         50, 0., 5.,
    56                         50, 0., 500.);
    57 
    58     fHistAll->SetXTitle("log(E/GeV)");
    59     fHistAll->SetYTitle("r/m");
     52    fName  = name  ? name  : "MHMcCollectionArea";
     53    fTitle = title ? title : "Data to Calculate Collection Area";
     54
     55    const Int_t  nbins = 50;
     56    const Float_t maxx = 5;
     57    const Float_t maxy = 500;
     58
     59    Float_t *binsx = new Float_t[nbins+1];
     60    for (int i=0; i<nbins+1; i++)
     61        binsx[i] = pow(10, maxx*i/nbins);
     62
     63    Float_t *binsy = new Float_t[nbins+1];
     64    for (int i=0; i<nbins+1; i++)
     65        binsy[i] = maxy*i/nbins;
     66
     67    fHistAll = new TH2D("AllEvents", "All showers - Radius vs Energy distribution",
     68                        nbins, binsx, nbins, binsy);
     69    fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs Energy distribution",
     70                        nbins, binsx, nbins, binsy);
     71    fHistCol = new TH1D("CollectionArea", "Collection Area vs. Energy",
     72                        nbins, binsx);
     73
     74    delete binsx;
     75    delete binsy;
     76
     77    fHistAll->SetDirectory(NULL);
     78    fHistSel->SetDirectory(NULL);
     79    fHistCol->SetDirectory(NULL);
     80
     81    fHistAll->SetXTitle("E [GeV]");
     82    fHistAll->SetYTitle("r [m]");
    6083    fHistAll->SetZTitle("N");
    6184
    62     fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs log(E) distribution",
    63                         50, 0., 5.,
    64                         50, 0., 500.);
    65 
    66     fHistSel->SetXTitle("log(E/GeV)");
    67     fHistSel->SetYTitle("r/m");
     85    fHistSel->SetXTitle("E [GeV]");
     86    fHistSel->SetYTitle("r [m]");
    6887    fHistSel->SetYTitle("N");
    6988
    70     fHistCol = new TH1D("CollectionArea", "Collection Area vs. log(E)",
    71                         50, 0., 5.);
    72 
    73     fHistCol->SetXTitle("log(E/GeV)");
    74     fHistCol->SetYTitle("A/m^{2}");
     89    fHistCol->SetXTitle("E [GeV]");
     90    fHistCol->SetYTitle("A [m^{2}]");
    7591}
    7692
     
    90106// Fill data into the histogram which contains all showers
    91107//
    92 void MHMcCollectionArea::FillAll(Float_t log10E, Float_t radius)
    93 {
    94     fHistAll->Fill(log10E, radius);
     108void MHMcCollectionArea::FillAll(Float_t energy, Float_t radius)
     109{
     110    fHistAll->Fill(energy, radius);
    95111}
    96112
     
    99115// Fill data into the histogram which contains the selected showers
    100116//
    101 void MHMcCollectionArea::FillSel(Float_t log10E, Float_t radius)
    102 {
    103     fHistSel->Fill(log10E, radius);
     117void MHMcCollectionArea::FillSel(Float_t energy, Float_t radius)
     118{
     119    fHistSel->Fill(energy, radius);
    104120}
    105121
     
    111127{
    112128    if (!gPad)
    113     {
    114         if (!gROOT->GetMakeDefCanvas())
    115             return;
    116         (gROOT->GetMakeDefCanvas())();
    117     }
    118 
    119     //TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle());
     129        MH::MakeDefCanvas(fHistAll);
    120130
    121131    fHistAll->Draw(option);
     132
     133    gPad->SetLogx();
    122134
    123135    gPad->Modified();
     
    132144{
    133145    if (!gPad)
    134     {
    135         if (!gROOT->GetMakeDefCanvas())
    136             return;
    137         (gROOT->GetMakeDefCanvas())();
    138     }
    139 
    140     //TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle());
     146        MH::MakeDefCanvas(fHistSel);
    141147
    142148    fHistSel->Draw(option);
     149
     150    gPad->SetLogx();
    143151
    144152    gPad->Modified();
     
    154162TObject *MHMcCollectionArea::DrawClone(Option_t* option) const
    155163{
    156     TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
     164    TCanvas *c = MH::MakeDefCanvas(fHistCol);
    157165
    158166    //
     
    161169    gROOT->SetSelectedPad(NULL);
    162170
    163     fHistCol->DrawClone(option);
     171    fHistCol->DrawCopy(option);
     172
     173    gPad->SetLogx();
    164174
    165175    c->Modified();
     
    172182{
    173183    if (!gPad)
    174     {
    175         if (!gROOT->GetMakeDefCanvas())
    176             return;
    177         (gROOT->GetMakeDefCanvas())();
    178     }
    179     //   TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
     184        MH::MakeDefCanvas(fHistCol);
    180185
    181186    fHistCol->Draw(option);
     187
     188    gPad->SetLogx();
    182189
    183190    gPad->Modified();
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h

    r985 r1004  
    99#endif
    1010
    11 //
    12 // because of some strange reason this cannot be put into MonteCarloIncl
    13 //
    14 #ifndef ROOT_TH1
    15 #include <TH1.h>
    16 #endif
    17 
     11class TH1D;
    1812class TH2D;
    1913
     
    3125    ~MHMcCollectionArea();
    3226
    33     void FillAll(Float_t log10E, Float_t radius);
    34     void FillSel(Float_t log10E, Float_t radius);
     27    void FillAll(Float_t energy, Float_t radius);
     28    void FillSel(Float_t energy, Float_t radius);
    3529
    3630    void DrawAll(Option_t *option="");
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r986 r1004  
    4141#include <TPaveLabel.h>
    4242
     43#include "MH.h"
     44
    4345ClassImp(MHMcEnergy);
    4446
     
    4951MHMcEnergy::MHMcEnergy(const char *name, const char *title)
    5052{
    51     *fTitle = title ? title : "Container for an energy distribution histogram";
     53    fTitle = title ? title : "Container for an energy distribution histogram";
    5254
    5355    //  - we initialize the histogram
     
    5557    //    root don't allow us to have diferent histograms with the same name
    5658
    57     fHist = new TH1F("", "", 40, 0.5, 4.5);
     59    fHist = new TH1F("", "", 20, 0.5, 4.5);
     60
     61    fHist->SetDirectory(NULL);
    5862    fHist->SetXTitle("log(E/GeV)");
    5963    fHist->SetYTitle("dN/dE");
     
    7781    UInt_t idx = semicolon ? atoi(semicolon+1) : 0;
    7882
    79     *fName = cname;
     83    fName = cname;
    8084
    8185    char text[256];
     
    8690
    8791    char aux[256];
    88     strcpy(aux, "log(E)");
     92    strcpy(aux, "Threshold");
    8993
    9094    if (idx>0)
     
    163167{
    164168    if (!gPad)
    165     {
    166         if (!gROOT->GetMakeDefCanvas())
    167             return;
    168         (gROOT->GetMakeDefCanvas())();
    169     }
    170     //TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
     169        MH::MakeDefCanvas(fHist);
    171170
    172171    fHist->Draw(option);
     
    180179TObject *MHMcEnergy::DrawClone(Option_t *option) const
    181180{
    182     TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
     181    TCanvas *c = MH::MakeDefCanvas(fHist);
    183182
    184183    //
  • trunk/MagicSoft/Mars/mhist/MHMcRate.cc

    r986 r1004  
    3333void MHMcRate::Init(const char *name, const char *title)
    3434{
    35     *fName  = name  ? name  : "MMcTriggerRate";
    36     *fTitle = title ? title : "Task to calc the collection area ";
     35    fName  = name  ? name  : "MMcTriggerRate";
     36    fTitle = title ? title : "Task to calc the collection area ";
    3737
    3838    fPartId=0;               // Type of particle
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r970 r1004  
    3535#include "MHStarMap.h"
    3636
    37 #include <TH2.h>      // TH2F
    3837#include <TStyle.h>   // gStyle
    3938#include <TColor.h>   // SetRGB
     
    5958    //
    6059   
    61     *fName  = name  ? name  : "MHStarMap" ;
    62     *fTitle = title ? title : "Container for a Star Map" ;
     60    fName  = name  ? name  : "MHStarMap" ;
     61    fTitle = title ? title : "Container for a Star Map" ;
    6362
    6463    //
     
    6766    //   connect all the histogram with the container fHist
    6867    //
    69     fStarMap = new TH2F("StarMap", "Counts",
     68    fStarMap = new TH2F("StarMap", "2D Hillas Star Map",
    7069                        150, -300, 300,
    7170                        150, -300, 300);
     71
     72    fStarMap->SetDirectory(NULL);
     73
     74    fStarMap->SetXTitle("x/mm");
     75    fStarMap->SetYTitle("y/mm");
     76    fStarMap->SetZTitle("Counts");
    7277}
    7378
     
    171176TObject *MHStarMap::DrawClone(Option_t *opt) const
    172177{
    173     TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
     178    TCanvas *c=MakeDefCanvas(fStarMap, 500, 500);
    174179
    175180    //
     
    180185    PrepareDrawing();
    181186
    182     fStarMap->DrawClone("colz")->SetBit(kCanDelete);
     187    fStarMap->DrawCopy("colz");
    183188
    184189    c->Modified();
     
    197202{
    198203    if (!gPad)
    199     {
    200         if (!gROOT->GetMakeDefCanvas())
    201             return;
    202         (gROOT->GetMakeDefCanvas())();
    203     }
    204 
    205     // TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
     204        MakeDefCanvas(fStarMap, 500, 500);
    206205
    207206    PrepareDrawing();
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r970 r1004  
    1111
    1212#ifndef ROOT_TH2
    13 // what's the reason that we need this here? cint complains about it
    14 // if it is missing...
    1513#include <TH2.h>
    1614#endif
  • trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc

    r988 r1004  
    6969    : fDimension(dim), fMcTrig(NULL), fEnergy(NULL)
    7070{
    71     *fName  = name  ? name  : "MMcThresholdCalc";
    72     *fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
     71    fName  = name  ? name  : "MMcThresholdCalc";
     72    fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
    7373}
    7474
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r993 r1004  
    4141                              const char *name, const char *title)
    4242{
    43     *fName  = name  ? name  : "MMcTriggerRateCalc";
    44     *fTitle = title ? title : "Task to calc the trigger rate ";
     43    fName  = name  ? name  : "MMcTriggerRateCalc";
     44    fTitle = title ? title : "Task to calc the trigger rate ";
    4545
    4646    fMcTrig = NULL;
  • trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc

    r859 r1004  
    5151MRawCrateArray::MRawCrateArray(const char *name, const char *title)
    5252{
    53     *fName  = name  ? name  : "MRawCrateArray";
    54     *fTitle = title ? title : "Array of MRawCrateData Information";
     53    fName  = name  ? name  : "MRawCrateArray";
     54    fTitle = title ? title : "Array of MRawCrateData Information";
    5555
    5656    //
  • trunk/MagicSoft/Mars/mraw/MRawCrateData.h

    r988 r1004  
    44#ifndef MAGIC_H
    55#include "MAGIC.h"
    6 #endif
    7 #ifndef ROOT_TObject
    8 #include <TObject.h>
    96#endif
    107
     
    2118    MRawCrateData();
    2219
    23     ~MRawCrateData()
    24     {
    25     }
    26 
    27     UChar_t GetDAQCrateNumber() const
    28     {
    29         return fDAQCrateNumber;
    30     }
    31 
    32     UInt_t  GetFADCEvtNumber() const
    33     {
    34         return fFADCEvtNumber;
    35     }
    36 
    37     UInt_t  GetFADCClockTick() const
    38     {
    39         return fFADCClockTick;
    40     }
     20    UChar_t GetDAQCrateNumber() const  { return fDAQCrateNumber; }
     21    UInt_t  GetFADCEvtNumber() const   { return fFADCEvtNumber;  }
     22    UInt_t  GetFADCClockTick() const   { return fFADCClockTick;  }
    4123
    4224    void Print(Option_t *t=NULL) const;
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r859 r1004  
    7171MRawEvtData::MRawEvtData(const char *name, const char *title)
    7272{
    73     *fName  = name  ? name  : "MRawEvtData";
    74     *fTitle = title ? title : "Raw Event Data Information";
     73    fName  = name  ? name  : "MRawEvtData";
     74    fTitle = title ? title : "Raw Event Data Information";
    7575
    7676    InitArrays();
     
    241241
    242242        TGraph *graph = new TGraph(n, x, y);
    243         graph->SetMaximum (256) ;
    244         graph->SetMinimum (0) ;
     243        graph->SetMaximum(256);
     244        graph->SetMinimum(0);
    245245
    246246        graph->SetBit(kCanDelete);
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc

    r988 r1004  
    111111MRawEvtHeader::MRawEvtHeader(const char *name, const char *title)
    112112{
    113     *fName  = name  ? name  : "MRawEvtHeader";
    114     *fTitle = title ? title : "Raw Event Header Information";
     113    fName  = name  ? name  : "MRawEvtHeader";
     114    fTitle = title ? title : "Raw Event Header Information";
    115115
    116116    //
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h

    r988 r1004  
    1212
    1313//
    14 // Trigger Typed (TT)
     14// Trigger Type (TT)
    1515//
    1616enum {
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r961 r1004  
    9191MRawFileRead::MRawFileRead(const char *fname, const char *name, const char *title)
    9292{
    93     *fName  = name  ? name  : "MRawFileRead";
    94     *fTitle = title ? title : "Read task to read DAQ binary files";
     93    fName  = name  ? name  : "MRawFileRead";
     94    fTitle = title ? title : "Read task to read DAQ binary files";
    9595
    9696    //
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc

    r949 r1004  
    6565                             const char *name, const char *title)
    6666{
    67     *fName  = name  ? name  : "MRawFileWrite";
    68     *fTitle = title ? title : "Write task to write DAQ root files";
     67    fName  = name  ? name  : "MRawFileWrite";
     68    fTitle = title ? title : "Write task to write DAQ root files";
    6969
    7070    //
     
    159159    //
    160160    TTree   *rh = new TTree("RunHeaders", "Run headers of all runs in this file");
    161     TBranch *tb = rh->Branch("MRawRunHeader", "MRawRunHeader", &fRawRunHeader, 32000, 1);
     161    TBranch *tb = rh->Branch("MRawRunHeader", "MRawRunHeader", &fRawRunHeader, 32000);
    162162    rh->Fill();
    163163    rh->Write();
     
    175175    // create all branches which are necessary
    176176    //
    177     fTData       ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
    178     fTPedestal   ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
    179     fTCalibration->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
    180     fTData       ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
    181     fTPedestal   ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
    182     fTCalibration->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
    183     fTData       ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    32000, 1);
    184     fTPedestal   ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000, 1);
    185     fTCalibration->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000, 1);
     177    fTData       ->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
     178    fTPedestal   ->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
     179    fTCalibration->Branch("MTime.",          "MTime",          &fRawEvtTime,    32000);
     180    fTData       ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
     181    fTPedestal   ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
     182    fTCalibration->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
     183    fTData       ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    32000);
     184    fTPedestal   ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
     185    fTCalibration->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
    186186    //fTree->Branch("MRawCrateArray",  fRawCrateArray->GetArray(),      32000, 1);
    187     fTData       ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
    188     fTPedestal   ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
    189     fTCalibration->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
     187    fTData       ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
     188    fTPedestal   ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
     189    fTCalibration->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
    190190
    191191    return kTRUE;
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.h

    r860 r1004  
    1919{
    2020private:
    21     MParList *pParList;             
     21    MParList *pParList;
    2222
    23     MTime          *fRawEvtTime;   
    24     MRawRunHeader  *fRawRunHeader; 
    25     MRawEvtHeader  *fRawEvtHeader; 
    26     MRawEvtData    *fRawEvtData;   
    27     MRawCrateArray *fRawCrateArray; 
     23    MTime          *fRawEvtTime;
     24    MRawRunHeader  *fRawRunHeader;
     25    MRawEvtHeader  *fRawEvtHeader;
     26    MRawEvtData    *fRawEvtData;
     27    MRawCrateArray *fRawCrateArray;
    2828
    2929    TTree *fTData;                  //!
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r988 r1004  
    4848MRawRunHeader::MRawRunHeader(const char *name, const char *title) : fPixAssignment(NULL)
    4949{
    50     *fName  = name  ? name  : "MRawRunHeader";
    51     *fTitle = title ? title : "Raw Run Header Information";
     50    fName  = name  ? name  : "MRawRunHeader";
     51    fTitle = title ? title : "Raw Run Header Information";
    5252
    5353    fPixAssignment = new MArrayS(0);
    54 
    55     // This is only valid for root > 3.0
    56     // IsA()->CanIgnoreTObjectStreamer();
    5754}
    5855
     
    132129    switch (fRunType)
    133130    {
    134     case 0:
     131    case kRTData:
    135132        *fLog << "Data";
    136133        break;
    137     case 1:
     134    case kRTPedestal:
    138135        *fLog << "Pedestal";
    139136        break;
    140     case 2:
     137    case kRTCalibration:
    141138        *fLog << "Calibration";
    142139        break;
    143     case 256:
     140    case kRTMonteCarlo:
    144141        *fLog << "Monte Carlo Data";
    145142        break;
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r988 r1004  
    1919//
    2020const UShort_t kMagicNumber = 0xc0c0;
     21
     22enum {
     23    kRTData        = 0,
     24    kRTPedestal    = 1,
     25    kRTCalibration = 2,
     26    kRTMonteCarlo  = 256
     27};
    2128
    2229class MRawRunHeader : public MParContainer
     
    5057    ~MRawRunHeader();
    5158
    52     void SetMagicNumber(UShort_t a){fMagicNumber=a;}
    53     void SetFormatVersion(UShort_t a){fFormatVersion=a;}   
    54     void SetSoftVersion(UShort_t a){fSoftVersion=a;}
    55     void SetRunType(UShort_t a){ fRunType=a;}
    56     void SetRunNumber(UInt_t a){fRunNumber=a;}
     59    void SetMagicNumber(UShort_t a)  { fMagicNumber=a; }
     60    void SetFormatVersion(UShort_t a){ fFormatVersion=a; }
     61    void SetSoftVersion(UShort_t a)  { fSoftVersion=a; }
     62    void SetRunType(UShort_t a)      { fRunType=a; }
     63    void SetRunNumber(UInt_t a)      { fRunNumber=a; }
     64    void SetNumEvents(UInt_t a)      { fNumEvents=a; }
    5765    void SetNumSamples(UShort_t low, UShort_t high)
    58       {fNumSamplesLoGain=low;fNumSamplesHiGain=high;}
    59     void SetNumEvents(UInt_t a){fNumEvents=a;}
     66    {
     67        fNumSamplesLoGain=low;
     68        fNumSamplesHiGain=high;
     69    }
    6070
    61     UShort_t GetMagicNumber() const      { return fMagicNumber; }
    62     UShort_t GetFormatversion() const    { return fFormatVersion; }
    63     UShort_t GetSoftVersion() const      { return fSoftVersion; }
    64     UShort_t GetRunType() const          { return fRunType; }
    65     UInt_t   GetRunNumber() const        { return fRunNumber; }
    66     const Char_t  *GetProjectName() const      { return fProjectName; }
    67     const Char_t  *GetSourceName() const       { return fSourceName; }
     71    UShort_t GetMagicNumber() const       { return fMagicNumber; }
     72    UShort_t GetFormatversion() const     { return fFormatVersion; }
     73    UShort_t GetSoftVersion() const       { return fSoftVersion; }
     74    UShort_t GetRunType() const           { return fRunType; }
     75    UInt_t   GetRunNumber() const         { return fRunNumber; }
     76    const Char_t  *GetProjectName() const { return fProjectName; }
     77    const Char_t  *GetSourceName() const  { return fSourceName; }
    6878    //Float_t  GetSourceRa() const         { return fSourceRA; }
    6979    //Float_t  GetSourceDec() const        { return fSourceDEC; }
    7080    const Char_t  *GetSourceEpocheChar() const { return fSourceEpochChar; }
    71     UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
    72     Float_t  GetMJD() const              { return fMJD; }
    73     UShort_t GetDateYear() const         { return fDateYear; }
    74     Byte_t   GetDateMonth() const        { return fDateMonth; }
    75     Byte_t   GetDateDay() const          { return fDateDay; }
    76     UShort_t GetNumCrates() const        { return fNumCrates; }
    77     UShort_t GetNumPixInCrate() const    { return fNumPixInCrate; }
    78     UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
    79     UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
    80     UShort_t GetNumEvents() const        { return fNumEvents; }
     81    UShort_t GetSourceEpocheDate() const  { return fSourceEpochDate; }
     82    Float_t  GetMJD() const               { return fMJD; }
     83    UShort_t GetDateYear() const          { return fDateYear; }
     84    Byte_t   GetDateMonth() const         { return fDateMonth; }
     85    Byte_t   GetDateDay() const           { return fDateDay; }
     86    UShort_t GetNumCrates() const         { return fNumCrates; }
     87    UShort_t GetNumPixInCrate() const     { return fNumPixInCrate; }
     88    UShort_t GetNumSamplesLoGain() const  { return fNumSamplesLoGain; }
     89    UShort_t GetNumSamplesHiGain() const  { return fNumSamplesHiGain; }
     90    UShort_t GetNumEvents() const         { return fNumEvents; }
    8191    UShort_t GetPixAssignment(UShort_t i) const;
    8292
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx

    r991 r1004  
    2323
    2424 
    25   *fName  = "MMcTrig";
    26   *fTitle = "Trigger info from Monte Carlo";
     25  fName  = "MMcTrig";
     26  fTitle = "Trigger info from Monte Carlo";
    2727
    2828   
Note: See TracChangeset for help on using the changeset viewer.