Changeset 7064 for trunk


Ignore:
Timestamp:
05/19/05 15:38:38 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7063 r7064  
    4545   * mmain/MEventDisplay.cc:
    4646     - removed MC trigger display
     47
     48   * mbase/MTaskList.[h,cc]:
     49     - member function to use MTaskList in a TIter
     50
     51   * mhflux/MAlphaFitter.[h,cc]:
     52     - improved the output line plotted into the histogram
     53     - implemented getter for fSigInt
     54
     55   * mhflux/MHAlpha.[h,cc]:
     56     - added some comments
     57     - improved DistancetoPrimitive
     58
     59   * mhflux/MHThetaSq.[h,cc]:
     60     - derives the binning now from the cut value or the MAlphaFitter
    4761
    4862
     
    13171331
    13181332
    1319 
    13201333 2005/04/14 Thomas Bretz
    13211334
     
    26102623     - include MCalibrationPulseTimeCam to display
    26112624
     2625
     2626
    26122627 2005/02/18 Thomas Bretz
    26132628
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r5779 r7064  
    928928    return kTRUE;
    929929}
     930
     931// --------------------------------------------------------------------------
     932//
     933// Can be used to create an iterator over all tasks, eg:
     934//   MTaskList tlist;
     935//   TIter Next(tlist); // Be aware: Use a object here rather than a pointer!
     936//   TObject *o=0;
     937//   while ((o=Next()))
     938//   {
     939//       [...]
     940//   }
     941//
     942MTaskList::operator TIterator*() const
     943{
     944    return new TListIter(fTasks);
     945}
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r5692 r7064  
    8484    Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const;
    8585
     86    operator TIterator*() const;
     87
    8688    ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop
    8789};
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r7005 r7064  
    293293{
    294294    const Double_t w  = GetGausSigma();
    295     const Int_t    l  = w<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(w));
    296     const TString fmt = Form("\\sigma_{Li/Ma}=%%.1f  \\omega=%%.%df\\circ  E=%%d  (\\alpha<%%.1f\\circ)  (\\chi_{b}^{2}/ndf=%%.1f  \\chi_{s}^{2}/ndf=%%.1f  c_{0}=%%.1f)",
    297                              l<1?1:l);
     295    const Double_t m  = fIntegralMax;
     296
     297    const Int_t    l1 = w<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(w));
     298    const Int_t    l2 = m<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(m));
     299    const TString fmt = Form("\\sigma_{Li/Ma}=%%.1f  \\omega=%%.%df\\circ  E=%%d  B=%%d  (x<%%.%df)  (\\chi_{b}^{2}/ndf=%%.1f  \\chi_{s}^{2}/ndf=%%.1f  c_{0}=%%.1f)",
     300                             l1<1?1:l1+1, l2<1?1:l2+1);
    298301
    299302    TLatex text(x, y, Form(fmt.Data(), fSignificance, w, (int)fEventsExcess,
    300                            fIntegralMax, fChiSqBg, fChiSqSignal,
     303                           fEventsBackground, m, fChiSqBg, fChiSqSignal,
    301304                           fCoefficients[3]));
    302305
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h

    r6949 r7064  
    109109        fCoefficients.Set(3+s+1); fCoefficients.Reset(); }
    110110
     111    Double_t GetSignalIntegralMax() const  { return fSigInt; }
     112
    111113    Double_t GetEventsExcess() const       { return fEventsExcess; }
    112114    Double_t GetEventsSignal() const       { return fEventsSignal; }
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r6994 r7064  
    148148}
    149149
    150 Double_t MHAlpha::GetVal() const
    151 {
    152     return static_cast<const MHillasSrc*>(fParameter)->GetAlpha();
    153 }
    154 
    155150Float_t MHAlpha::FitEnergyBins(Bool_t paint)
    156151{
     
    206201}
    207202
     203// --------------------------------------------------------------------------
     204//
     205// Return the value from fParemeter which should be filled into the plots
     206//
     207Double_t MHAlpha::GetVal() const
     208{
     209    return static_cast<const MHillasSrc*>(fParameter)->GetAlpha();
     210}
     211
     212
     213// --------------------------------------------------------------------------
     214//
     215// Store the pointer to the parameter container storing the plotted value
     216// (here MHillasSrc) in fParameter.
     217//
     218// return whether it was found or not.
     219//
    208220Bool_t MHAlpha::GetParameter(const MParList &pl)
    209221{
     
    921933    return rc;
    922934}
     935
     936Int_t MHAlpha::DistancetoPrimitive(Int_t px, Int_t py)
     937{
     938    // If pad has no subpad return (we are in one of the subpads)
     939    if (gPad->GetPad(1)==NULL)
     940        return 9999;
     941
     942    // If pad has a subpad we are in the main pad. Check its value.
     943    return gPad->GetPad(1)->DistancetoPrimitive(px,py)==0 ? 0 : 9999;
     944}
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.h

    r6988 r7064  
    3434    MParContainer *fParameter;  //!
    3535
    36 private:
    3736    const TH3D *fOffData;
    3837
    3938    MAlphaFitter fFit;          // SEEMS THAT STREAMER HAS SOME PROBLEMS... MAYBE IF FUNC IS USED AT THE SAME TIME FOR FITS (PAINT)
    4039
     40private:
    4141    TH1D fHEnergy;              // excess events vs energy
    4242    TH1D fHTheta;               // excess events vs theta
     
    7474    void PaintText(Double_t val, Double_t error) const;
    7575
    76     Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
     76    Int_t DistancetoPrimitive(Int_t px, Int_t py);
    7777
    7878    virtual Bool_t      GetParameter(const MParList &pl);
  • trunk/MagicSoft/Mars/mhflux/MHThetaSq.cc

    r7001 r7064  
    2929// This is a MHAlpha using "ThetaSquared [MParameterD]" as 'alpha'
    3030//
     31// The default binning is determined from the integration range set in
     32// MAlphaFitter.
     33//
    3134// For more detailes see MHAlpha.
    3235//
     
    3942#include "MBinning.h"
    4043#include "MParList.h"
     44#include "MTaskList.h"
     45#include "MParameters.h"
    4146
    4247#include "MLog.h"
     
    8893}
    8994
     95// --------------------------------------------------------------------------
     96//
     97// Overwrites the binning in Alpha (ThetaSq) with a binning for which
     98// the upper edge of the 5th bin (bin=5) fit the signal integration window.
     99// In total 75 bins are setup.
     100//
     101// In case of fOffData!=NULL the binnings are taken later from fOffData anyhow.
     102//
     103Bool_t MHThetaSq::SetupFill(const MParList *pl)
     104{
     105    // Default is from default fitter
     106    // if a user defined fitter is in the parlist: use this range
     107    MAlphaFitter *fit = (MAlphaFitter*)pl->FindObject("MAlphaFitter");
     108    if (!fit)
     109        fit = &fFit;
     110
     111    MParameterD *cut = (MParameterD*)pl->FindObject("ThetaSquaredCut", "MParameterD");
     112    if (cut)
     113        fit->SetSignalIntegralMax(cut->GetVal());
     114
     115    // Get Histogram binnings
     116    MBinning binst, binse;
     117    binst.SetEdges(fHist, 'x');
     118    binse.SetEdges(fHist, 'y');
     119
     120    // Calculate bining which fits alpha-cut
     121    const Double_t intmax = fit->GetSignalIntegralMax();
     122    const UInt_t   nbins  = 75;
     123    const UInt_t   nsig   =  5;
     124
     125    MBinning binsa(nbins, 0, nbins*intmax/nsig);
     126
     127    // Apply binning
     128    binsa.Apply(fHistTime);
     129    MH::SetBinning(&fHist, &binst, &binse, &binsa);
     130
     131    // Remark: Binnings might be overwritten in MHAlpha::SetupFill
     132    return MHAlpha::SetupFill(pl);
     133}
     134
     135// --------------------------------------------------------------------------
     136//
     137// Store the pointer to the parameter container storing the plotted value
     138// (here ThetaSq) in fParameter.
     139//
     140// return whether it was found or not.
     141//
    90142Bool_t MHThetaSq::GetParameter(const MParList &pl)
    91143{
     
    98150}
    99151
     152// --------------------------------------------------------------------------
     153//
     154// Return the value from fParemeter which should be filled into the plots
     155//
    100156Double_t MHThetaSq::GetVal() const
    101157{
  • trunk/MagicSoft/Mars/mhflux/MHThetaSq.h

    r7001 r7064  
    66#endif
    77
     8class MTaskList;
     9
    810class MHThetaSq : public MHAlpha
    911{
    1012private:
    11     MParameterD  *fThetaSq;     //!
     13    MParameterD  *fThetaSq; //!
    1214
    1315    Bool_t      GetParameter(const MParList &pl);
     
    1820    }
    1921
     22    Bool_t SetupFill(const MParList *pl);
     23
    2024public:
    2125    MHThetaSq(const char *name=NULL, const char *title=NULL);
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r7054 r7064  
    433433    tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal);
    434434    tlist.AddToList(&pcalc,  ismc ? "Events" : "Drive");
     435    tlist.AddToList(&tlist2, "Events");
    435436    if (!ismc)
    436437        tlist.AddToList(&fillw,  "CC");
    437     tlist.AddToList(&tlist2, "Events");
    438438    tlist.AddToList(&write);
    439439
Note: See TracChangeset for help on using the changeset viewer.