Ignore:
Timestamp:
06/08/08 13:55:36 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhflux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r8695 r8929  
    1919!   Author(s): Wolfgang Wittek, 1/2002 <mailto:wittek@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: MAGIC Software Development, 2000-2008
    2222!
    2323!
     
    7070//  Input Container:
    7171//    MPointingPos
     72//    MRawRunHeader
     73//    MTime
    7274//
    7375//  Output Container:
     
    8183//   +  UInt_t fNumEvents;
    8284//   -  Int_t fNumEvents;
     85//
     86//  Class version 3:
     87//  ----------------
     88//   +  Double_t fTotalTime;
    8389//
    8490//
     
    276282#include "MParameters.h"
    277283#include "MPointingPos.h"
     284#include "MRawRunHeader.h"
    278285
    279286#include "MBinning.h"
     
    293300MHEffectiveOnTime::MHEffectiveOnTime(const char *name, const char *title)
    294301    : fPointPos(0), fTime(0), fParam(0), fIsFinalized(kFALSE),
    295     fNumEvents(200*60), fFirstBin(3)
     302    fNumEvents(200*60), fFirstBin(3), fTotalTime(-1)
    296303    //fNumEvents(2*60), fFirstBin(1)
    297304{
     
    469476       SetBinning(&fH2DeltaT, binsdtime, binstheta);
    470477
     478   fTotalTime = 0;
     479
    471480   return kTRUE;
     481}
     482
     483Bool_t MHEffectiveOnTime::ReInit(MParList *pList)
     484{
     485    MRawRunHeader *header = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     486    if (header)
     487    {
     488        *fLog << err << "MRawRunHeader not found... aborting." << endl;
     489        return kFALSE;
     490    }
     491
     492    fTotalTime += header->GetRunLength();
     493
     494    return kTRUE;
    472495}
    473496
     
    771794    text.SetTextSize(0.04);
    772795
    773     text.SetText(0.45, 0.94, Form("T_{eff} = %.1fs \\pm %.1fs", val, error));
    774     text.Paint();
    775 
    776     if (range<0)
    777         return;
    778 
    779     text.SetText(0.66, 0.94, Form("T_{axe} = %.1fs", range));
     796    TString txt = Form("T_{eff} = %.1fs \\pm %.1fs", val, error);
     797    if (range>0)
     798        txt += Form("     T_{axe} = %.1fs", range);
     799    if (fTotalTime>0)
     800        txt += Form("     T_{max} = %.1fs", fTotalTime);
     801
     802    text.SetText(0.35, 0.94, txt);
    780803    text.Paint();
    781804}
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.h

    r7818 r8929  
    5050    UInt_t fFirstBin;    // For bin for fit
    5151
     52    Double_t fTotalTime; //[s] Total time accumulated from run-header
     53
     54    // MHEffectiveOnTime
    5255    Bool_t FitH(TH1D *h, Double_t *res, Bool_t paint=kFALSE) const;
    5356    void FitThetaBins();
     
    6063    void PrintStatistics();
    6164
     65    // MH
    6266    Bool_t SetupFill(const MParList *pList);
     67    Bool_t ReInit(MParList *pList);
    6368    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
    6469    Bool_t Finalize();
    6570
     71    // MParContainer
    6672    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    6773
     
    6975    MHEffectiveOnTime(const char *name=NULL, const char *title=NULL);
    7076
     77    // Setter
    7178    void SetNumEvents(Int_t i) { fNumEvents=i; }
    7279    void SetFirstBin(Int_t i)  { fFirstBin=i;  }
     80
     81    // Getter
     82    Double_t GetTotalTime() const { return fTotalTime; }
    7383
    7484    const TH1D &GetHEffOnTheta() const { return fHThetaEffOn; }
     
    7787    const TH2D &GetH2DeltaT() const { return fH2DeltaT; }
    7888
     89    // TObject
    7990    void Draw(Option_t *option="");
    8091    void Paint(Option_t *opt="");
    8192
    82     ClassDef(MHEffectiveOnTime, 2) // Histogram to determin effective On-Time vs Time and Zenith Angle
     93    ClassDef(MHEffectiveOnTime, 3) // Histogram to determin effective On-Time vs Time and Zenith Angle
    8394};
    8495
Note: See TracChangeset for help on using the changeset viewer.