Changeset 1967


Ignore:
Timestamp:
04/20/03 15:39:13 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1966 r1967  
    22
    33 2003/04/21: Thomas Bretz
     4
     5   * manalysis/MBlindPixels.h:
     6     - IsBlind -> const
     7     
     8   * mhist/HistLinkDef.h, mhist/Makefile:
     9     - added MHBlindPixels
     10   
     11   * mhist/MH.[h,cc]:
     12     - changed the two DrawClone functions to one.
     13     
     14   * mhist/MHHadronness.[h,cc]:
     15     - changed to fit the requirements of MStatusDisplay
     16     
     17   * mhist/MHMatrix.cc:
     18     - SetDirectory(NULL) for all histograms created
     19
     20   * mhist/MHSigmaTheta.cc:
     21     - removed fNpix    (is already in MHHillas)
     22     - removed fBlindId (--> MHBlindPixels)
     23
     24   * mhist/MHBlindPixels.[h,cc]:
     25     - new
    426
    527   * macros/plot.C:
     
    830   * macros/status.C:
    931     - added MHNewImagePar
     32     - added MHHadronness
    1033
    1134   * manalysis/MBlindPixelCalc.cc:
  • trunk/MagicSoft/Mars/macros/status.C

    r1966 r1967  
    8080
    8181    // ------------- user change -----------------
     82    read.AddFile("data/Pro*.root");
    8283    read.AddFile("data/Gam*.root");
    83     //read.AddFile("200*.root");
    8484
    8585    MMcPedestalCopy   pcopy;
     
    9494    MHillasSrcCalc    scalc; // !!Preliminary!! Will be removed later!
    9595    MNewImageParCalc  icalc;
     96    MCT1SupercutsCalc calc1;
    9697
    9798    // -------------------------------------------
     
    103104    MFillH hfill5("MHStarMap", "MHillas");
    104105    MFillH hfill6("MHCerPhotEvt", "MCerPhotEvt");
     106    MFillH hfill7("MHHadronness", "MHadronness");
    105107
    106108    tlist.AddToList(&read);
     
    114116    tlist.AddToList(&scalc);
    115117    tlist.AddToList(&icalc);
     118    tlist.AddToList(&calc1);
     119    tlist.AddToList(&hfill7);
    116120    tlist.AddToList(&hfill1);
    117121    tlist.AddToList(&hfill2);
     
    140144    {
    141145        // Save data in a postscriptfile (status.ps)
    142         d->SaveAsPS();
     146       // d->SaveAsPS();
    143147        /*
    144148         * ----------- Write status to a root file ------------
  • trunk/MagicSoft/Mars/manalysis/MBlindPixels.h

    r1466 r1967  
    2323    void Clear(Option_t *o="")  { fPixels.Reset(); }
    2424
    25     Bool_t IsBlind(UShort_t id) { return fPixels.GetSize() && fPixels[id]; }
     25    Bool_t IsBlind(UShort_t id) const { return fPixels.GetSize() && ((TArrayC)fPixels)[id]; }
    2626
    2727    ClassDef(MBlindPixels, 1) // container to store blind pixels
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r1940 r1967  
    1919
    2020#pragma link C++ class MHCerPhotEvt+;
     21
     22#pragma link C++ class MHBlindPixels+;
    2123
    2224#pragma link C++ class MHStarMap+;
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r1966 r1967  
    588588    gPad->Update();
    589589
    590     h1->SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum()));
    591     h1->SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum()));
     590    // FIXME: Also align max/min with set Maximum/Minimum
     591     const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
     592     const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
     593     h1->SetMaximum(max);
     594     h1->SetMinimum(min);
    592595
    593596    TPaveText *t = (TPaveText*)gPad->FindObject("title");
     
    655658    gPad->Update();
    656659
    657     hist1.SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum()));
    658     hist1.SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum()));
     660    // FIXME: Also align max/min with set Maximum/Minimum
     661    /*
     662     const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
     663     const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
     664     hist1.SetMaximum(max);
     665     hist1.SetMinimum(min);
     666     */
    659667
    660668    TPaveText *t = (TPaveText*)gPad->FindObject("title");
     
    711719//
    712720// If the opt string contains 'nonew' or gPad is not given NULL is returned.
    713 // Other wise the present gPad is cleared and returned.
     721// Otherwise the present gPad is returned.
    714722//
    715723TVirtualPad *MH::GetNewPad(Option_t *opt)
     
    720728        return NULL;
    721729
    722     gPad->Clear();
    723730    return gPad;
    724731}
     
    726733// --------------------------------------------------------------------------
    727734//
    728 // The object is cloned and drawn to the present pad. The kCanDelete
    729 // bit is set for the clone.
    730 //
    731 TObject *MH::DrawClone(Option_t *opt="") const
    732 {
     735// If the opt string contains 'nonew' or gPad is not given a new canvas
     736// with size w/h is created. Otherwise the object is cloned and drawn
     737// to the present pad. The kCanDelete bit is set for the clone.
     738//
     739TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const
     740{
     741    TVirtualPad *p = GetNewPad(opt);
     742    if (!p)
     743        p = MakeDefCanvas(this, w, h);
     744    else
     745        p->Clear();
     746
    733747    gROOT->SetSelectedPad(NULL);
    734748
     
    737751    return o;
    738752}
    739 
    740 // --------------------------------------------------------------------------
    741 //
    742 // If the opt string contains 'nonew' or gPad is not given a new canvas
    743 // with size w/h is created. Otherwise the object is cloned and drawn
    744 // to the present pad. The kCanDelete bit is set for the clone.
    745 //
    746 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const
    747 {
    748     TVirtualPad *p = GetNewPad(opt);
    749     if (!p)
    750         p = MakeDefCanvas(this, w, h);
    751 
    752     return MH::DrawClone(opt);
    753 }
  • trunk/MagicSoft/Mars/mhist/MH.h

    r1965 r1967  
    7070
    7171    void Draw(Option_t *o="") { MParContainer::Draw(o); }
    72     TObject *DrawClone(Option_t *opt="") const;
    73     TObject *DrawClone(Option_t *opt, Int_t w, Int_t h) const;
     72    TObject *DrawClone(Option_t *opt, Int_t w=580, Int_t h=435) const;
    7473
    7574    static TVirtualPad *GetNewPad(Option_t *opt);
  • trunk/MagicSoft/Mars/mhist/MH3.h

    r1879 r1967  
    2222    TString     fDataMember[3];  // Data member which should be filled into the histogram x
    2323    MDataChain *fData[3];        // Object from which the data is filled
    24     Double_t    fScale[3];
     24    Double_t    fScale[3];       // Scale for the three axis (eg unit)
    2525
    2626    void StreamPrimitive(ofstream &out) const;
     
    6060    void SetColors() const;
    6161    void Draw(Option_t *opt=NULL);
    62     TObject *DrawClone(Option_t *opt=NULL) const;
    6362
    6463    MParContainer *New() const;
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r1948 r1967  
    693693    //
    694694    TH1F hta;
     695    hta.SetDirectory(NULL);
    695696    hta.SetName("hta");
    696697    hta.SetTitle("Distribution after reduction");
     
    793794    //
    794795    TH1F hth("th", "Distribution before reduction", nbins, frombin, tobin);
     796    hth.SetDirectory(NULL);
    795797    for (Int_t j=0; j<nrows; j++)
    796798        hth.Fill(fM(j, refcolumn));
    797799
    798800    TH1F hthd("thd", "Correction factors", nbins, frombin, tobin);
     801    hthd.SetDirectory(NULL);
    799802    hthd.Divide((TH1F*)&thsh, &hth, 1, 1);
    800803
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r1966 r1967  
    1717!
    1818!   Author(s): Wolfgang Wittek 1/2003 <mailto:wittek@mppmu.mpg.de>
    19 !
    20 !   Copyright: MAGIC Software Development, 2000-2002
     19!   Author(s): Thomas Bretz 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
     20!
     21!   Copyright: MAGIC Software Development, 2000-2003
    2122!
    2223!
     
    2728//  MHSigmaTheta (extension of Robert's MHSigmabarTheta)                    //
    2829//                                                                          //
    29 //  calculates - the 1D-histogram   ID of blind pixels
    30 //             - the 1D-histogram   no.of pixels in MCerPhotEvt, and        //
    31 //             - the 2D-histogram   sigmabar vs. Theta, and                 //
     30//  calculates - the 2D-histogram   sigmabar vs. Theta, and                 //
    3231//             - the 3D-histogram   sigma, pixel no., Theta                 //
    3332//             - the 3D-histogram   (sigma^2-sigmabar^2), pixel no., Theta  //
     
    7170    fTitle = title ? title : "2D histogram sigmabar vs. Theta";
    7271
    73     fNpix.SetDirectory(NULL);
    74     fNpix.SetName("1D-Npix");
    75     fNpix.SetTitle("1D : no.of used pixels in MCerPhotEvt");
    76     fNpix.SetXTitle("no. of used pixels in MCerPhotEvt");
    77     fNpix.SetYTitle("Counts");
    78 
    79     fBlindId.SetDirectory(NULL);
    80     fBlindId.SetName("1D-BlindId");
    81     fBlindId.SetTitle("1D : Id of blind pixel");
    82     fBlindId.SetXTitle("Id of blind pixel");
    83     fBlindId.SetYTitle("Counts");
    84 
    8572    fSigmaTheta.SetDirectory(NULL);
    8673    fSigmaTheta.SetName("2D-ThetaSigmabar");
    87     fSigmaTheta.SetTitle("2D : Sigmabar, \\Theta");
     74    fSigmaTheta.SetTitle("2D: \\bar{\\sigma}_{ped}, \\Theta");
    8875    fSigmaTheta.SetXTitle("\\Theta [\\circ]");
    89     fSigmaTheta.SetYTitle("Sigmabar");
     76    fSigmaTheta.SetYTitle("\\bar{\\Theta}");
    9077
    9178    fSigmaPixTheta.SetDirectory(NULL);
    9279    fSigmaPixTheta.SetName("3D-ThetaPixSigma");
    93     fSigmaPixTheta.SetTitle("3D : \\Theta, pixel no., Sigma");
     80    fSigmaPixTheta.SetTitle("3D : \\Theta, Pixel Id, \\sigma_{ped}");
    9481    fSigmaPixTheta.SetXTitle("\\Theta [\\circ]");
    95     fSigmaPixTheta.SetYTitle("pixel number");
    96     fSigmaPixTheta.SetZTitle("Sigma");
     82    fSigmaPixTheta.SetYTitle("Pixel Id");
     83    fSigmaPixTheta.SetZTitle("\\sigma_{ped}");
    9784
    9885    fDiffPixTheta.SetDirectory(NULL);
    9986    fDiffPixTheta.SetName("3D-ThetaPixDiff");
    100     fDiffPixTheta.SetTitle("3D : \\Theta, pixel, Sigma^2-Sigmabar^2");
     87    fDiffPixTheta.SetTitle("3D : \\Theta, Pixel Id, \\sigma_{ped}^{2}-\\bar{\\sigma}^{2}");
    10188    fDiffPixTheta.SetXTitle("\\Theta [\\circ]");
    102     fDiffPixTheta.SetYTitle("pixel number");
    103     fDiffPixTheta.SetZTitle("Sigma^2-sigmabar^2");
     89    fDiffPixTheta.SetYTitle("Pixel Id");
     90    fDiffPixTheta.SetZTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}^{2}");
    10491}
    10592
     
    180167   binspix.SetEdges(npix+1, -0.5, 0.5+npix );
    181168
    182    SetBinning(&fNpix,    &binspix);
    183    SetBinning(&fBlindId, &binspix);
    184169   SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma);
    185170   SetBinning(&fDiffPixTheta,  binstheta, &binspix, binsdiff);
     
    194179Bool_t MHSigmaTheta::Fill(const MParContainer *par)
    195180{
    196   //*fLog << "entry Fill" << endl;
    197 
    198181    Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
    199182    Double_t mySig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
    200183
    201     //*fLog << "MHSigmaTheta::Fill; theta, mySig = " << theta << ",  "
    202     //      << mySig << endl;
    203 
    204184    fSigmaTheta.Fill(theta, mySig);
    205185
    206186    const UInt_t npix = fEvt->GetNumPixels();
    207187
    208     Int_t npixused=0;
    209188    for (UInt_t i=0; i<npix; i++)
    210189    {
    211       MCerPhotPix cerpix = fEvt->operator[](i);
     190      MCerPhotPix cerpix = (*fEvt)[i];
    212191      if (!cerpix.IsPixelUsed())
    213       {
    214         fBlindId.Fill( cerpix.GetPixId() );       
    215         continue;
    216       }
    217       npixused++;
    218 
    219       /*     
    220       if (cerpix.GetNumPhotons() == 0)
    221         continue;
    222       */       
     192          continue;
    223193
    224194      const Int_t id = cerpix.GetPixId();
     
    233203      const Double_t diff = sigma*sigma/area - mySig*mySig;
    234204      fDiffPixTheta.Fill(theta, (Double_t)id, diff);
    235 
    236       //*fLog << "theta, id, sigma, diff, area  = " << theta << ",  " << id
    237       //      << ",  "
    238       //      << sigma << ",  " << diff << ",  " << area << endl;
    239205    }
    240     fNpix.Fill(npixused);
    241206
    242207    return kTRUE;
  • trunk/MagicSoft/Mars/mhist/Makefile

    r1965 r1967  
    4545           MHAlphaEnergyTime.cc \
    4646           MHAlphaEnergyTheta.cc \
     47           MHBlindPixels.cc \
    4748           MHEffOnTime.cc \
    4849           MHTimeDiffTime.cc \
  • trunk/MagicSoft/Mars/mimage/MHHillas.cc

    r1965 r1967  
    316316
    317317    pad->cd(1);
     318    gPad->SetBorderMode(0);
    318319    MH::Draw(*fWidth, *fLength, "Width'n'Length");
    319320
  • trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc

    r1966 r1967  
    431431    //lient->ProcessEventsFor(this);
    432432    gSystem->ProcessEvents();
     433
     434    //TSeqCollection   *GetListOfCleanups() const   {return fCleanups;}
     435
    433436}
    434437
     
    440443MStatusDisplay::~MStatusDisplay()
    441444{
     445    SetLogStream(NULL);
     446
    442447    delete fList;
    443448
Note: See TracChangeset for help on using the changeset viewer.