Changeset 9343 for trunk


Ignore:
Timestamp:
02/15/09 23:12:04 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9342 r9343  
    2020 2009/02/15 Thomas Bretz
    2121
     22   * ceres.rc:
     23     - added the MAGIC I high gain pulse as example
     24
     25   * sponde.cc:
     26     - redirect root error handler
     27     - added new option to force on-time fit
     28
     29   * datacenter/scripts/runcorsika:
     30     - added a comment
     31     - remove empty dat file after corsika finished
     32
     33   * mbase/MLog.cc:
     34     - added several more log-levels to handling root's error handler
     35
     36   * mbase/MPrint.cc:
     37     - flush buffer before printing
     38     - set output level to all
     39
     40   * melectronics/MPulseShape.h:
     41     - let clone also clone the spline
     42
     43   * mfileio/MWriteRootFile.cc:
     44     - don't output title if empty
     45
     46   * mhflux/MHAlpha.cc:
     47     - removed erronornously comittet SetSumw2
     48     - don't output the numbe rof excess events vs time
     49
     50   * mhflux/MHEffectiveOnTime.[h,cc]:
     51     - added new data mebers to store the result of the overall-fit
     52       which is now done in Finalize
     53     - output the results of the effective on-time fit as inf2
     54     - increased clas version accordingly
     55
     56   * mjobs/MJSimulation.[h,cc]:
     57     - simplified setting up the file structure
     58
     59   * mjobs/MJSpectrum.[h,cc]:
     60     - added the possibility to force a new on-time fit.
     61     - a MHEffectiveOnTime histogram is now always displayed
     62       for manual cross checks
     63
     64   * mjobs/MJStar.cc:
     65     - added MSrcPosCam for Monte Carlos to output
     66
    2267   * mpointing/MSrcPosCalc.cc:
    2368     - ignore the WobbleMode from the MMcCorsikaRunHeader
     
    4691     - support changing geometries (conversion factors) reading
    4792       a new geometry from a run header
     93     - increased class version by one
    4894
    4995   * mhflux/MMcSpectrumWeight.cc:
    5096     - replaced Form by MString::Format
     97
    5198     - made sure that nobody is mixing different energy-range monte
    5299       carlos and normalizes by integral (to be implemented)
  • trunk/MagicSoft/Mars/NEWS

    r9342 r9343  
    7676     displayes the MSrcPosCam data from the input star-files. Unfortunately,
    7777     this containes was never written to the star-files yet.
     78
     79   * A new Tab 'OnTime' is available which is an effective on-time
     80     fit as in star but for all data. This is mainly for manual cross-check
     81     of the effective on-time
     82
     83   * In some circumstances it might be necessary to re-calculate the
     84     eff. on-time from the fit in the new tab, e.g. when a zenith distance
     85     cut was made in ganymed. This can now be forced by ''--force-ontimefit''
    7886
    7987
  • trunk/MagicSoft/Mars/ceres.rc

    r9336 r9343  
    196196#MSimReadout.fConversionFactor: 1
    197197
     198# The number of sampling points is almost irrelevant because they
     199# are equidistant, i.e. calculated and no search is necessary.
     200# Nevertheless, you must make sure that there are enough points
     201# to sample the function accuratly enough.
     202#MPulseShape.Function.Name:  3.51308*exp(-1.4105*(exp(-0.5*x)+0.310942*x)) + 4.33521e-3*exp(-1.4105*(exp(-0.5*x)+6.09265e-3*x))
     203#MPulseShape.Function.Npx:   250
     204#MPulseShape.Function.Xmin:   -5
     205#MPulseShape.Function.Xmax:   45
  • trunk/MagicSoft/Mars/datacenter/scripts/runcorsika

    r9336 r9343  
    9292   echo "MAXPRT 0"
    9393   # Suppress file with partciles reaching ground (DATnnnnnn)
     94   # FIXME: Should we make this switchable by the database?
    9495   echo "PAROUT F F"
    9596   # Don't write a database file
     
    183184printinputcard | ./cc6501p-linux >> $logfile 2>&1
    184185
     186rm -f $outpath/dat`printf %06d $corsikarunno`
     187
    185188check1=$?
    186189
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h

    r8354 r9343  
    2020{
    2121private:
    22     Bool_t CheckRunType(MParList *pList) const;
    2322    Int_t  PreProcess(MParList *pList);
    2423    Int_t  Process();
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r9336 r9343  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MLog.cc,v 1.63 2009-02-15 13:24:59 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MLog.cc,v 1.64 2009-02-15 23:00:34 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    834834    // annoying errors in case of a log-scale set too early
    835835    if (level==kError && !strcmp(location, "THistPainter::PaintInit"))
    836         level=kInfo;
     836        level=kInfo+2;
    837837
    838838    gLog << std::flush;
     
    841841
    842842    if (level >= kInfo)
    843        gLog << inf;
     843        gLog << inf;
     844    if (level==kInfo+1)
     845        gLog << inf2;
     846    if (level==kInfo+2)
     847        gLog << inf3;
    844848    if (level >= kWarning)
    845849        gLog << warn;
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r5715 r9343  
    149149Int_t MPrint::Process()
    150150{
     151    gLog << flush << all;
    151152    if (TestBit(kSeparator))
    152153        gLog.Separator() << endl;
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r9037 r9343  
    584584    fTasksProcess.Clear();
    585585    while ((task=(MTask*)Next()))
    586         if (task->IsA()==MTask::Class() || task->OverwritesProcess())
     586        if (task->IsA()==MTask::Class() || task->Overwrites("Process"))
    587587            fTasksProcess.Add(task);
    588588
     
    621621    while ((task=(MTask*)Next()))
    622622    {
     623        // Supress output if not necessary
     624        if (!task->Overwrites("ReInit"))
     625            continue;
     626
    623627        *fLog << all << task->GetName() << "... " << flush;
    624628
  • trunk/MagicSoft/Mars/melectronics/MPulseShape.h

    r9312 r9343  
    1212{
    1313private:
    14     MSpline3          *fSpline;     //! Spline to describe the pulse shape
     14    MSpline3          *fSpline;     // Spline to describe the pulse shape
    1515
    1616    TString fFileName;              // File name of a file describing the pulse shape
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r9328 r9343  
    159159        }
    160160
    161         *fLog << inf3 << "New file '" << name << "' <Title=" << title << "> created." << endl;
     161        *fLog << inf3 << "New file '" << name << "' ";
     162        if (!TString(title).IsNull())
     163            *fLog << "<Title=" << title << "> ";
     164        *fLog << "created." << endl;
    162165
    163166        file->SetOption(option); // IMPORTANT!
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r9303 r9343  
    8888//   +  Double_t fTotalTime;
    8989//
     90//  Class version 4:
     91//  ----------------
     92//   +  Double_t fEffOnTime;    //[s] On time as fitted from the DeltaT distribution
     93//   +  Double_t fEffOnTimeErr; //[s] On time error as fitted from the DeltaT distribution
    9094//
    9195// ==========================================================================
     
    301305MHEffectiveOnTime::MHEffectiveOnTime(const char *name, const char *title)
    302306    : fPointPos(0), fTime(0), fParam(0), fIsFinalized(kFALSE),
    303     fNumEvents(200*60), fFirstBin(3), fTotalTime(-1)
     307    fNumEvents(200*60), fFirstBin(3), fTotalTime(-1),
     308    fEffOnTime(-1), fEffOnTimeErr(0)
    304309    //fNumEvents(2*60), fFirstBin(1)
    305310{
     
    479484   fTotalTime = 0;
    480485
     486   fEffOnTime    = -1;
     487   fEffOnTimeErr =  0;
     488
    481489   return kTRUE;
    482490}
     
    714722    fTime->Plus1ns();
    715723
    716     *fLog << fLastTime << ":  Val=" << res[0] << "  Err=" << res[1] << endl;
     724    *fLog << inf2 << fLastTime << ":  Val=" << res[0] << "  Err=" << res[1] << endl;
    717725}
    718726
     
    780788    FitThetaBins();
    781789    FitTimeBin();
     790
     791
     792    TH1D *h = fH2DeltaT.ProjectionX("FinalizeProjDeltaT", -1, -1, "E");
     793    Double_t res[7];
     794    if (FitH(h, res))
     795    {
     796        fEffOnTime    = res[0];
     797        fEffOnTimeErr = res[1];
     798    }
     799    delete h;
     800
    782801
    783802    fIsFinalized = kTRUE;
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.h

    r9153 r9343  
    5050    UInt_t fFirstBin;    // For bin for fit
    5151
    52     Double_t fTotalTime; //[s] Total time accumulated from run-header
     52    Double_t fTotalTime;    //[s] Total time accumulated from run-header
     53    Double_t fEffOnTime;    //[s] On time as fitted from the DeltaT distribution
     54    Double_t fEffOnTimeErr; //[s] On time error as fitted from the DeltaT distribution
    5355
    5456    // MHEffectiveOnTime
     
    8183    // Getter
    8284    Double_t GetTotalTime() const { return fTotalTime; }
     85    Double_t GetEffOnTime() const { return fEffOnTime; }
    8386
    8487    const TH1D &GetHEffOnTheta() const { return fHThetaEffOn; }
  • trunk/MagicSoft/Mars/mimage/MHHillas.cc

    r9340 r9343  
    1919!   Author(s): Wolfgang Wittek  2002 <mailto:wittek@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: MAGIC Software Development, 2000-2009
    2222!
    2323!
     
    2929//
    3030// This class contains histograms for the source independent image parameters
     31//
     32// ClassVersion 2:
     33// ---------------
     34//  - fMm2Deg
     35//  - fUseMmScale
    3136//
    3237/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mimage/MHHillas.h

    r9340 r9343  
    5454    //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
    5555
    56     ClassDef(MHHillas, 1) // Container which holds histograms for the source independent image parameters
     56    ClassDef(MHHillas, 2) // Container which holds histograms for the source independent image parameters
    5757};
    5858
  • trunk/MagicSoft/Mars/mimage/MHHillasExt.cc

    r9340 r9343  
    3434//  + fHSlopeL
    3535//
     36// ClassVersion 3:
     37// ---------------
     38//  - fMm2Deg
     39//  - fUseMmScale
     40//
    3641/////////////////////////////////////////////////////////////////////////////
    3742#include "MHHillasExt.h"
  • trunk/MagicSoft/Mars/mimage/MHHillasExt.h

    r9340 r9343  
    4444    void Draw(Option_t *opt=NULL);
    4545
    46     ClassDef(MHHillasExt, 2) // Container which holds histograms for the extended hillas parameters
     46    ClassDef(MHHillasExt, 3) // Container which holds histograms for the extended hillas parameters
    4747};
    4848
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc

    r9340 r9343  
    1818!   Author(s): Thomas Bretz  2001 <mailto:tbretz@uni-sw.gwdg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2009
    2121!
    2222!
     
    2828//
    2929// This class contains histograms for every Hillas parameter
     30//
     31// ClassVersion 2:
     32// ---------------
     33//  - fMm2Deg
     34//  - fUseMmScale
    3035//
    3136///////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.h

    r9340 r9343  
    4646
    4747
    48     ClassDef(MHHillasSrc, 1) // Container which holds histograms for the source dependant parameters
     48    ClassDef(MHHillasSrc, 2) // Container which holds histograms for the source dependant parameters
    4949};
    5050
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc

    r9340 r9343  
    1919!   Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2006
     21!   Copyright: MAGIC Software Development, 2000-2009
    2222!
    2323!
     
    2929//
    3030//
    31 // Version 2:
     31// ClassVersion 2:
    3232// ----------
    3333//  + TH1F fHistConcCOG;   // [ratio] concentration around the center of gravity (all pixels)
    3434//  + TH1F fHistConcCore;  // [ratio] concentration of signals inside ellipse (used pixels)
     35//
     36// ClassVersion 3:
     37// ---------------
     38//  - fMm2Deg
     39//  - fUseMmScale
    3540//
    3641////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar.h

    r9340 r9343  
    6161    void Paint(Option_t *opt="");
    6262
    63     ClassDef(MHNewImagePar, 2) // Histograms of new image parameters
     63    ClassDef(MHNewImagePar, 3) // Histograms of new image parameters
    6464};
    6565
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar2.cc

    r9340 r9343  
    1818!   Author(s): Thomas Bretz, 03/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2005
     20!   Copyright: MAGIC Software Development, 2000-2009
    2121!
    2222!
     
    2626//
    2727// MHNewImagePar2
     28//
     29// ClassVersion 2:
     30// ---------------
     31//  - fMm2Deg
     32//  - fUseMmScale
    2833//
    2934////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h

    r9341 r9343  
    2828    void Draw(Option_t *opt="");
    2929
    30     ClassDef(MHNewImagePar2, 1) // Histograms of new image parameters
     30    ClassDef(MHNewImagePar2, 2) // Histograms of new image parameters
    3131};
    3232
  • trunk/MagicSoft/Mars/mimage/MHVsSize.cc

    r9341 r9343  
    1919!   Author(s): Wolfgang Wittek  2002 <mailto:wittek@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2004
     21!   Copyright: MAGIC Software Development, 2000-2009
    2222!
    2323!
     
    2929//
    3030// This class contains histograms for the source independent image parameters
     31//
     32// ClassVersion 2:
     33// ---------------
     34//  - fMm2Deg
     35//  - fUseMmScale
    3136//
    3237/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mimage/MHVsSize.h

    r9341 r9343  
    4040    void Draw(Option_t *opt=NULL);
    4141
    42     ClassDef(MHVsSize, 1) // Container which holds histograms for image parameters vs size
     42    ClassDef(MHVsSize, 2) // Container which holds histograms for image parameters vs size
    4343};
    4444
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.cc

    r9336 r9343  
    209209}
    210210
     211void MJSimulation::SetupCommonFileStructure(MWriteRootFile &write) const
     212{
     213    // Common run headers
     214    write.AddContainer("MCorsikaRunHeader",   "RunHeaders", kFALSE);
     215    write.AddContainer("MRawRunHeader",       "RunHeaders");
     216    write.AddContainer("MGeomCam",            "RunHeaders");
     217    write.AddContainer("MMcRunHeader",        "RunHeaders");
     218
     219    // Common events
     220    write.AddContainer("MCorsikaEvtHeader",   "Events", kFALSE);
     221    write.AddContainer("MRawEvtHeader",       "Events");
     222    write.AddContainer("MMcEvt",              "Events");
     223}
     224
    211225Bool_t MJSimulation::Process(const MArgs &args)
    212226{
     
    429443    write3b.SetName("WriteCamMC");
    430444
    431     write1a.AddContainer("MCorsikaEvtHeader", "Events", kFALSE);
    432     write1a.AddContainer("MPhotonEvent",      "Events");
    433 
    434     write2a.AddContainer("MCorsikaRunHeader", "RunHeaders", kFALSE);
    435     write2a.AddContainer("MRawRunHeader",     "RunHeaders");
    436     write2a.AddContainer("MGeomCam",          "RunHeaders");
    437     write2a.AddContainer("MSignalCam",        "Events");
    438     write2a.AddContainer("MRawEvtHeader",     "Events",    kFALSE);
     445    SetupCommonFileStructure(write1a);
     446    SetupCommonFileStructure(write2a);
     447    SetupCommonFileStructure(write3a);
     448
     449    // R: Dedicated file structureedicated events
     450    write1a.AddContainer("MPhotonEvent", "Events");
     451
     452    // I: Dedicated file structureedicated events
    439453    write2a.AddContainer("MPedPhotFromExtractorRndm", "RunHeaders"); // FIXME: Needed for the signal files to be display in MARS
    440     write2a.AddContainer("MMcRunHeader",       "RunHeaders");
    441     /* Monte Carlo Headers
    442     write.AddContainer("MMcRunHeader",              "RunHeaders", kFALSE);
    443     write.AddContainer("MMcFadcHeader",             "RunHeaders", kFALSE);
    444     write.AddContainer("MMcTrigHeader",             "RunHeaders", kFALSE);
    445     write.AddContainer("MMcConfigRunHeader",        "RunHeaders", kFALSE);
    446     write.AddContainer("MMcCorsikaRunHeader",       "RunHeaders", kFALSE);
    447     // Monte Carlo
    448     write.AddContainer("MMcEvt",                    "Events",     kFALSE);
    449     write.AddContainer("MMcTrig",                   "Events",     kFALSE);
    450     */// Data tree
    451     //write.AddContainer("MPedPhotFromExtractor",     "Events");
    452     //write.AddContainer("MPedPhotFromExtractorRndm", "Events");
    453     //write.AddContainer("MTime",                     "Events",     kFALSE);
    454     //write.AddContainer("MRawEvtHeader",             "Events");
    455     //write.AddContainer("MTriggerPattern",           "Events");
    456 
    457     write3a.AddContainer("MRawEvtData",         "Events");
    458     write3a.AddContainer("MRawRunHeader",       "RunHeaders");
    459     write3a.AddContainer("MGeomCam",            "RunHeaders");
    460     write3a.AddContainer("MRawEvtHeader",       "Events",     kFALSE);
    461     //write3.AddContainer("MPedestalCam",  "RunHeaders", kFALSE);
    462     write3a.AddContainer("MMcRunHeader",        "RunHeaders");
    463     write3a.AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE);
    464     write3a.AddContainer("ElectronicNoise",     "RunHeaders", kFALSE);
    465     write3a.AddContainer("MMcEvt",              "Events",     kFALSE);
    466 
    467     write1b.AddContainer("MMcEvtBasic",         "OriginalMC");
    468     write2b.AddContainer("MMcEvtBasic",         "OriginalMC");
    469     write3b.AddContainer("MMcEvtBasic",         "OriginalMC");
     454    write2a.AddContainer("MSignalCam", "Events");
     455
     456    // D: Dedicated file structureedicated events
     457    write3a.AddContainer("ElectronicNoise", "RunHeaders");
     458    write3a.AddContainer("MRawEvtData", "Events");
     459
     460    // Basic MC data
     461    write1b.AddContainer("MMcEvtBasic", "OriginalMC");
     462    write2b.AddContainer("MMcEvtBasic", "OriginalMC");
     463    write3b.AddContainer("MMcEvtBasic", "OriginalMC");
    470464
    471465    // -------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.h

    r9317 r9343  
    99class MArgs;
    1010class MParList;
     11class MWriteRootFile;
    1112
    1213class MJSimulation : public MJob
     
    2223
    2324    void SetupHist(MHn &hist) const;
     25    void SetupCommonFileStructure(MWriteRootFile &write) const;
    2426
    2527public:
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r9335 r9343  
    6464
    6565// Spectrum
    66 #include "../mhflux/MAlphaFitter.h"
    67 #include "../mhflux/MHAlpha.h"
    68 #include "../mhflux/MHCollectionArea.h"
    69 #include "../mhflux/MHEnergyEst.h"
    70 #include "../mhflux/MMcSpectrumWeight.h"
     66#include "MAlphaFitter.h"
     67#include "MHAlpha.h"
     68#include "MHCollectionArea.h"
     69#include "MHEnergyEst.h"
     70#include "MMcSpectrumWeight.h"
     71#include "MHEffectiveOnTime.h"
    7172
    7273// Eventloop
     
    9192MJSpectrum::MJSpectrum(const char *name, const char *title)
    9293    : fCutQ(0), fCut0(0),fCut1(0), fCut2(0), fCut3(0), fCutS(0),
    93     fEstimateEnergy(0), fCalcHadronness(0),  fCalcDisp(0), fForceTheta(kFALSE)
     94    fEstimateEnergy(0), fCalcHadronness(0),  fCalcDisp(0),
     95    fForceTheta(kFALSE), fForceRunTime(kFALSE), fForceOnTimeFit(kFALSE)
    9496{
    9597    fName  = name  ? name  : "MJSpectrum";
     
    296298        return -1;
    297299
     300    // We don't have to proceed. We later overwrite the result anyway
     301    if (fForceOnTimeFit)
     302        return 0;
     303
    298304    const Double_t ufl = vstime->GetBinContent(0);
    299305    const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1);
     
    750756    MFillH fill2(Form("HistE    [%s]", cls.Data()), "", "FillHistE");
    751757
     758    // Fill a new MHEffectiveOnTime. It can either be used to
     759    // re-calculate the on-time or just for manual cross check
     760    MFillH fillT("MHEffectiveOnTime", "MTime", "FillOnTime");
     761    fillT.SetNameTab("OnTime");
     762
    752763    MFDataMember f0("DataType.fVal", '<', 0.5, "FilterOffData");
    753764    MFDataMember f1("DataType.fVal", '>', 0.5, "FilterOnData");
     
    755766    fill1.SetFilter(&f0);
    756767    fill2.SetFilter(&f1);
     768    fillT.SetFilter(&f1);
    757769
    758770    tlist.AddToList(&read);
    759771    //tlist.AddToList(&taskenv0); // not necessary, stored in file!
    760772    //tlist.AddToList(&taskenv1); // not necessary, stored in file!
     773    tlist.AddToList(&f1);
     774    tlist.AddToList(&fillT);
    761775    tlist.AddToList(fCutS);
    762776    tlist.AddToList(&taskenv2);
    763777    tlist.AddToList(&f0);
    764     tlist.AddToList(&f1);
    765778    tlist.AddToList(&fill1);
    766779    tlist.AddToList(&fill2);
     
    15451558    // Read from the ganymed file
    15461559    TH1D htheta, size;
    1547     const Float_t ontime = ReadInput(plist, htheta, size);
     1560    Float_t ontime = ReadInput(plist, htheta, size);
    15481561    if (ontime<0)
    15491562    {
     
    15621575    }
    15631576    plist.AddToList(&bins2); // For later use in MC processing
     1577
     1578    // -------------- Fill excess events versus energy ---------------
     1579
     1580    TH1D excess;
     1581
     1582    if (fForceOnTimeFit)
     1583    {
     1584        // Refill excess histogram to determine the excess events
     1585        // If we use the eff. on-time fit we have to loop over the data first
     1586        // This is not really desired, because if something is wrong with
     1587        // the Monte Carlos the program runs quite long before it fails
     1588        if (!Refill(plist, excess))
     1589            return kFALSE;
     1590
     1591        // Print the setup and result of the MAlphaFitter, print used cuts
     1592        PrintSetup(fit);
     1593
     1594        // ------------ On user request redo eff. on-time fit ------------
     1595        const MHEffectiveOnTime *htime = (MHEffectiveOnTime*)plist.FindObject("MHEffectiveOnTime");
     1596        if (!htime)
     1597        {
     1598            // This should never happen, bt you never know
     1599            *fLog << err;
     1600            *fLog << "ERROR - Use of new effective on-time fit requested for on-time determination," << endl;
     1601            *fLog << "        but MHEffectiveOnTime not found in parameter list... aborting." << endl;
     1602            return kFALSE;
     1603        }
     1604
     1605        const TH1D &h = htime->GetHEffOnTheta();
     1606        /*
     1607        if (!htime->IsConsistent() || h.GetNbinsX()!=htheta.GetNbinsX())
     1608        {
     1609            *fLog << err << "ERROR - Effective on-time from newly filles MHEffectiveOnTime (Tab='OnTime) invalid... aborting." << endl;
     1610            return kFALSE;
     1611        }*/
     1612
     1613        *fLog << inf;
     1614        *fLog << "Using eff. on-time from new MHEffectiveOnTime (see also 'OnTime')" << endl;
     1615        *fLog << "   Orig. value: " << ontime << "s" << endl;
     1616
     1617        // Copy ontime from newly filled and fitted eff on-time histogram
     1618        ontime = htime->GetEffOnTime();
     1619
     1620        *fLog << "   New   value: " << ontime << "s" << endl;
     1621
     1622        h.Copy(htheta);           // Copy contents of newly filled hist into on-time vs. theta
     1623        htheta.SetName("Theta");  // Copy overwrites the name needed in DisplayResult
     1624        htheta.SetDirectory(0);   // Remove from global directory added by SetName
     1625    }
     1626
     1627    // ---------------------------------------------------------------
    15641628
    15651629    // Initialize weighting to a new spectrum as defined in the resource file
     
    16121676        return kFALSE;
    16131677
    1614     // -------------- Fill excess events versus energy ---------------
    1615 
    16161678    // Refill excess histogram to determine the excess events
    1617     TH1D excess;
    1618     if (!Refill(plist, excess))
    1619         return kFALSE;
    1620 
    1621     // Print the setup and result of the MAlphaFitter, print used cuts
    1622     PrintSetup(fit);
    1623 
     1679    if (!fForceOnTimeFit)
     1680    {
     1681        if (!Refill(plist, excess))
     1682            return kFALSE;
     1683
     1684        // Print the setup and result of the MAlphaFitter, print used cuts
     1685        PrintSetup(fit);
     1686    }
    16241687
    16251688    // ------------------------- Final loop --------------------------
     
    17681831    fillsp.SetWeight();
    17691832
    1770     // Try to find the class used to determine the signal!
    17711833    // FIXME: To be done: A task checking the lower 1% after the lower
    17721834    // energy limit!
     
    17891851        return kFALSE;
    17901852    par->SetVal(2);
     1853
     1854    // Not really necessary but for sanity
     1855    TObject *cam = plist.FindObject("MSrcPosCam");
     1856    if (cam)
     1857        cam->Clear();
    17911858
    17921859    tlist2.AddToList(&read);
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.h

    r9335 r9343  
    3838    Bool_t fForceTheta;
    3939    Bool_t fForceRunTime;
     40    Bool_t fForceOnTimeFit;
    4041
    4142    // Setup Histograms
     
    7677    void ForceTheta(Bool_t b=kTRUE)   { fForceTheta=b; }
    7778    void ForceRunTime(Bool_t b=kTRUE) { fForceRunTime=b; }
     79    void ForceOnTimeFit(Bool_t b=kTRUE) { fForceOnTimeFit=b; }
    7880
    7981    void SetEnergyEstimator(const MTask *task);
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r9332 r9343  
    334334        write.AddContainer("MMcEvt",                "Events");
    335335        write.AddContainer("MMcTrig",               "Events", kFALSE);
     336        write.AddContainer("MSrcPosCam",            "Events");
    336337        // Monte Carlo Run Headers
    337338        write.AddContainer("MMcRunHeader",          "RunHeaders");
  • trunk/MagicSoft/Mars/sponde.cc

    r9276 r9343  
    5050    gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
    5151    gLog << " Operation Mode:" << endl;
    52     gLog << "   --force-theta             Force execution even with non-fitting theta distributions." << endl;
    53     gLog << "   --force-runtime           Force usage of runtime instead of eff. observation time." << endl;
     52    gLog << "   --force-theta             Force execution even with non-fitting theta" << endl;
     53    gLog << "                             distributions." << endl;
     54    gLog << "   --force-runtime           Force usage of runtime instead of effective" << endl;
     55    gLog << "                             observation time from fit in star." << endl;
     56    gLog << "   --force-ontimefit         Force usage of effective on-time from a new fit to" << endl;
     57    gLog << "                             the time-stamps (overwrites --force-runtime)." << endl;
    5458    gLog << endl;
    5559    gLog << " Options:" << endl;
     
    9599        return 0xff;
    96100
     101    MLog::RedirectErrorHandler(MLog::kColor);
     102
    97103    //
    98104    // Evaluate arguments
     
    129135    const Bool_t  kForceTheta    =  arg.HasOnlyAndRemove("--force-theta");
    130136    const Bool_t  kForceRunTime  =  arg.HasOnlyAndRemove("--force-runtime");
     137    const Bool_t  kForceOnTimeFit=  arg.HasOnlyAndRemove("--force-ontimefit");
    131138
    132139    //
     
    254261        job.ForceTheta(kForceTheta);
    255262        job.ForceRunTime(kForceRunTime);
     263        job.ForceOnTimeFit(kForceOnTimeFit);
    256264
    257265        if (!job.Process(seq))
Note: See TracChangeset for help on using the changeset viewer.