Ignore:
Timestamp:
04/25/05 15:37:35 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r6958 r6978  
    4848#include "MPrint.h"
    4949#include "MContinue.h"
    50 #include "MEnergyEstimate.h"
     50//#include "MEnergyEstimate.h"
    5151#include "MTaskEnv.h"
    5252#include "MSrcPosCalc.h"
     
    5656
    5757#include "../mhflux/MAlphaFitter.h"
     58#include "../mhflux/MHAlpha.h"
     59
    5860#include "MH3.h"
    5961#include "MBinning.h"
     
    7173// Default constructor.  Set defaults for fStoreSummary, fStoreresult,
    7274// fWriteOnly, fIsWobble and fFullDisplay to kFALSE and initialize
    73 // fEstimateEnergy and fCalcHadronness with NULL.
     75// /*fEstimateEnergy and*/ fCalcHadronness with NULL.
    7476//
    7577MJCut::MJCut(const char *name, const char *title)
    76     : fStoreSummary(kFALSE), fStoreResult(kFALSE), fWriteOnly(kFALSE),
     78    : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE),
    7779    fIsWobble(kFALSE), fIsMonteCarlo(kFALSE),  fFullDisplay(kFALSE), /*fSubstraction(kFALSE),*/
    78     fEstimateEnergy(0), fCalcHadronness(0)
     80    /*fEstimateEnergy(0),*/ fCalcHadronness(0)
    7981{
    8082    fName  = name  ? name  : "MJCut";
     
    8890MJCut::~MJCut()
    8991{
    90     if (fEstimateEnergy)
    91         delete fEstimateEnergy;
     92    //if (fEstimateEnergy)
     93    //    delete fEstimateEnergy;
    9294    if (fCalcHadronness)
    9395        delete fCalcHadronness;
     
    132134// Setup a task estimating the energy. The given task is cloned.
    133135//
     136/*
    134137void MJCut::SetEnergyEstimator(const MTask *task)
    135138{
     
    138141    fEstimateEnergy = task ? (MTask*)task->Clone() : 0;
    139142}
     143*/
    140144
    141145// --------------------------------------------------------------------------
     
    246250    TObjArray arr;
    247251
     252    // Save all MBinnings
    248253    TIter Next(plist);
    249254    TObject *o=0;
     
    252257            arr.Add(o);
    253258
     259    // Save also the result, not only the setup
     260    const MHAlpha *halpha = (MHAlpha*)plist.FindObject("MHAlpha");
     261    if (halpha)
     262        arr.Add((TObject*)(&halpha->GetAlphaFitter()));
     263
    254264    const TString fname(GetOutputFile(num));
    255265
     266    // If requested, write to already open output file
    256267    if (fNameResult.IsNull() && fStoreResult)
    257268    {
     
    413424        fit.SetScaleMode(MAlphaFitter::kNone);
    414425
     426    MHAlpha halphaoff("MHAlphaOff");
     427    halphaoff.ForceUsingSize();
     428    plist.AddToList(&halphaoff);
     429
    415430    MFillH falpha("MHAlphaOff [MHAlpha]", "MHillasSrc", "FillAlpha");
    416431    MFillH ffs("MHFalseSourceOff [MHFalseSource]", "MHillas", "FillFS");
     
    452467    SetupWriter(write1, "WriteAfterCut3");
    453468
    454 
     469/*
    455470    MEnergyEstimate est;
    456471
    457472    MTaskEnv taskenv1("EstimateEnergy");
    458473    taskenv1.SetDefault(fEstimateEnergy ? fEstimateEnergy : &est);
    459 
     474  */
    460475    MTaskEnv taskenv2("CalcHadronness");
    461476    taskenv2.SetDefault(fCalcHadronness);
     
    495510    if (fIsWobble)
    496511        tlist2.AddToList(&hcalc2);
    497     tlist2.AddToList(&taskenv1);
     512    //tlist2.AddToList(&taskenv1);
    498513    tlist2.AddToList(&taskenv2);
    499514    tlist2.AddToList(&cont0);
     
    539554
    540555    TObjArray cont;
    541     cont.Add(&fit);
    542556    cont.Add(&cont0);
    543557    cont.Add(&cont1);
    544558    cont.Add(&cont2);
    545559    cont.Add(&cont3);
    546     if (taskenv1.GetTask())
    547         cont.Add(taskenv1.GetTask());
     560    //if (taskenv1.GetTask())
     561    //    cont.Add(taskenv1.GetTask());
    548562    if (taskenv2.GetTask())
    549563        cont.Add(taskenv2.GetTask());
     
    641655    }
    642656    */
     657    MHAlpha halphaon("MHAlpha");
     658    halphaon.ForceUsingSize();
     659    plist.AddToList(&halphaon);
     660
    643661    MFillH falpha2("MHAlpha", "MHillasSrc", "FillAlpha");
    644662    MFillH ffs2("MHFalseSource", "MHillas", "FillFS");
Note: See TracChangeset for help on using the changeset viewer.