Changeset 8618


Ignore:
Timestamp:
06/28/07 21:30:25 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8617 r8618  
    3434   * mmain/Makefile:
    3535     - added inlcude of mjobs for MSequence
     36
     37   * mbadpixels/MBadPixelsTreat.cc:
     38     - we assume now that the maximum arrival time difference
     39       is calibrated already in nanoseconds
     40
     41   * mcalib/MCalibrateRelTimes.[h,cc]:
     42     - the arrival time is now converted from slices into nanoseconds
     43
     44   * mfilter/MFSoftwareTrigger.cc:
     45     - the arrival time is now assumed to be in nanoseconds.
     46       the default is changed accordingly from 0.5 to 1.7
     47
     48   * mjobs/MJCalibrateSignal.cc:
     49     - changed axis label of PulsePos plot (now in nanosec)
    3650
    3751
  • trunk/MagicSoft/Mars/NEWS

    r8612 r8618  
    2929     use the summary file instead.
    3030
     31   - mars: new ways to call mars are implemented. Instead
     32     of calling
     33         mars filename.root
     34     you can now also use
     35         mars sequence.txt
     36     or
     37         mars sequence.txt inputpath
     38     or replace sequence.txt by the sequence number if the default
     39     sequence file should be used.
     40
    3141   - callisto: was broken for MCs... fixed.
    3242
     
    4757     pixel treatment is now in units of nanoseconds, which leads to 3.0ns
    4858     for both, old FADC and MUX-FADC, data.
     59
     60   - callisto: Be aware that callisto is now calibrating the arrival time
     61     in nanoseconds rather than time slices. Also all following tasks
     62     have been changed to assume ns units now. If you star data
     63     calibrated with an older version it might be necessary to adapt
     64     some timimng parameters (Muon Analysis and MFSoftwareTrigger)
     65     to obtain optimal results. The plot in the PulsePos tab
     66     will now be in ns, too.
    4967
    5068   - ganymed: From XXXX on a real starguider calibration with a real
  • trunk/MagicSoft/Mars/ganymed_onoff.rc

    r8456 r8618  
    100100# -------------------------------------------------------------------------
    101101# There are three cuts:
    102 #   Cut0: After energy estimation, before writing summary file
     102#   CutQ: Cut after reading file
     103#   Cut0: After calculation of src dependant parameters, energy estimation
     104#         and disp calculation, before writing summary file
    103105#   Cut1: After writing summary file before filling false source plots
    104106#   Cut2: After filling false source plots before filling alpha plots
    105107#   Cut3: After filling alpha plots (eg. Alpha cuts) for image parameter
    106 #         display
     108#         display, eg. write only events after alpha cut to ganymed file
    107109# -------------------------------------------------------------------------
     110CutQ.Inverted: Yes
    108111Cut0.Inverted: Yes
    109112Cut1.Inverted: Yes
     
    112115
    113116# Get rid of triangular events...
    114 Cut0.Condition: ({0} || {1}) && {2} && {3} && {4} && {5} && {6}
    115 Cut0.0: MImagePar.fNumSatPixelsHG < 1
    116 Cut0.1: MHillas.GetArea*(MGeomCam.fConvMm2Deg^2) > (0.003*MImagePar.fNumSatPixelsHG) + 0.0325
    117 Cut0.2: MNewImagePar.fNumUsedPixels>5
    118 Cut0.3: MNewImagePar.fLeakage1 < 0.3
    119 Cut0.4: MImagePar.fNumSatPixelsLG<2
    120 Cut0.5: MImagePar.fNumIslands<3
    121 Cut0.6: log10(MNewImagePar.fConc1) < (-0.371)*log10(MHillas.fSize) + 0.596
     117CutQ.Condition: ({0} || {1}) && {2} && {3} && {4} && {5} && {6}
     118CutQ.0: MImagePar.fNumSatPixelsHG < 1
     119CutQ.1: MHillas.GetArea*(MGeomCam.fConvMm2Deg^2) > (0.003*MImagePar.fNumSatPixelsHG) + 0.0325
     120CutQ.2: MNewImagePar.fNumUsedPixels>5
     121CutQ.3: MNewImagePar.fLeakage1 < 0.3
     122CutQ.4: MImagePar.fNumSatPixelsLG<2
     123CutQ.5: MImagePar.fNumIslands<3
     124CutQ.6: log10(MNewImagePar.fConc1) < (-0.371)*log10(MHillas.fSize) + 0.596
    122125
    123126# ---------- SETUP FOR ONOFF-MODE -----------
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc

    r8577 r8618  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MBadPixelsTreat.cc,v 1.39 2007-06-18 14:11:08 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MBadPixelsTreat.cc,v 1.40 2007-06-28 20:13:17 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    445445void MBadPixelsTreat::InterpolateTimes() const
    446446{
    447     const Double_t maxdiff = fMaxArrivalTimeDiff*fRawRunHeader->GetFreqSampling()/1000.;
    448 
    449447    const Int_t n = fEvt->GetNumPixels();
    450448    for (int i=0; i<n; i++)
     
    491489
    492490            // Calculate mean arrival time of pixel probably inside the shower
    493             if (TMath::Abs(tm1 - tm2)<maxdiff)
     491            if (TMath::Abs(tm1 - tm2)<fMaxArrivalTimeDiff)
    494492            {
    495493                sum2 += tm1+tm2;
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r7808 r8618  
    8989// this name in the parameter list (by MEvtLoop::SetParList)
    9090//
    91 MTaskList::MTaskList(const char *name, const char *title)
     91MTaskList::MTaskList(const char *name, const char *title) : fNumPasses(0), fNumPass(0)
    9292{
    9393    fName  = name  ? name  : gsDefName.Data();
     
    108108//   TaskList in the new TaskList.
    109109//
    110 MTaskList::MTaskList(MTaskList &ts) : MTask()
     110MTaskList::MTaskList(const MTaskList &ts) : MTask(), fNumPasses(ts.fNumPasses)
    111111{
    112112    fTasks->AddAll(ts.fTasks);
     
    612612}
    613613
    614 // --------------------------------------------------------------------------
    615 //
    616 // do the event execution of all tasks in the task-list
    617 //
    618 Int_t MTaskList::Process()
    619 {
    620     //
    621     // Check whether there is something which can be processed, otherwise
    622     // stop the eventloop.
    623     //
    624     if (fTasksProcess.GetSize()==0)
    625     {
    626         *fLog << warn << "Warning: No entries in " << GetDescriptor() << " for Processing." << endl;
    627         return kFALSE;
    628     }
    629 
    630     //
    631     // Reset the ReadyToSave flag.
    632     // Reset all containers.
    633     //
    634     // Make sure, that the parameter list is not reset from a tasklist
    635     // running as a task in another tasklist.
    636     //
    637     const Bool_t noreset = fParList->TestBit(MParList::kIsProcessing);
    638     if (!noreset)
    639     {
    640         fParList->SetBit(MParList::kIsProcessing);
    641         if (!HasAccelerator(kAccDontReset))
    642             fParList->Reset();
    643     }
    644 
     614Int_t MTaskList::ProcessTaskList()
     615{
    645616    //
    646617    //  create the Iterator for the TaskList
     
    707678    }
    708679
     680    return rc;
     681}
     682
     683// --------------------------------------------------------------------------
     684//
     685// do the event execution of all tasks in the task-list.
     686//
     687// If a task returns kCONTINUE, kCONTINUE is propagated if the
     688// number of passes==0, otherwise kTRUE is returned instead.
     689//
     690Int_t MTaskList::Process()
     691{
     692    //
     693    // Check whether there is something which can be processed, otherwise
     694    // stop the eventloop.
     695    //
     696    if (fTasksProcess.GetSize()==0)
     697    {
     698        *fLog << warn << "Warning: No entries in " << GetDescriptor() << " for Processing." << endl;
     699        return kFALSE;
     700    }
     701
     702    //
     703    // Reset the ReadyToSave flag.
     704    // Reset all containers.
     705    //
     706    // Make sure, that the parameter list is not reset from a tasklist
     707    // running as a task in another tasklist.
     708    //
     709    const Bool_t noreset = fParList->TestBit(MParList::kIsProcessing);
     710    if (!noreset)
     711    {
     712        fParList->SetBit(MParList::kIsProcessing);
     713        if (!HasAccelerator(kAccDontReset))
     714            fParList->Reset();
     715    }
     716
     717    // Initialize storage variable for the return code
     718    Int_t rc = kTRUE;
     719
     720    // Execute the task list at least once
     721    const UInt_t cnt = fNumPasses==0 ? 1 : fNumPasses;
     722    for (fNumPass=0; fNumPass<cnt; fNumPass++)
     723    {
     724        // Execute the tasklist once
     725        rc = ProcessTaskList();
     726        // In cae of error or a stop-request leave loop
     727        if (rc==kERROR || rc==kFALSE)
     728            break;
     729    }
     730
     731    // Reset to the default
    709732    if (!noreset)
    710733    {
     
    713736    }
    714737
     738    // If the number of passes==0 <default> propagete kCONTINUE
     739    if (rc==kCONTINUE)
     740        return fNumPasses==0 ? kCONTINUE : kTRUE;
     741
     742    // Return return code
    715743    return rc;
    716744}
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r7808 r8618  
    2828    MParList *fParList;      //! The parameter list given in PreProcess
    2929
     30    UInt_t fNumPasses;
     31    UInt_t fNumPass; //!
     32
    3033    enum { kIsOwner = BIT(14) };
    3134
     
    3336    void   StreamPrimitive(ostream &out) const;
    3437    Bool_t CheckAddToList(MTask *task, /*const char *tType,*/ const MTask *where=NULL) const;
     38    Int_t  ProcessTaskList();
    3539
    3640public:
    3741    MTaskList(const char *name=NULL, const char *title=NULL);
    38     MTaskList(MTaskList &ts);
     42    MTaskList(const MTaskList &ts);
    3943
    4044    ~MTaskList();
     
    4347    void SetDisplay(MStatusDisplay *d);
    4448    void SetAccelerator(Byte_t acc=kAccStandard);
     49    void SetNumPasses(UInt_t cnt=0) { fNumPasses=cnt; }
     50
     51    UInt_t GetNumPass() const { return fNumPass; }
     52    UInt_t GetNumPasses() const { return fNumPasses; }
    4553
    4654    Bool_t AddToListBefore(MTask *task, const MTask *where, const char *tType="All");
  • trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc

    r7876 r8618  
    6060#include "MSignalPix.h"
    6161
     62#include "MRawRunHeader.h"
     63
    6264ClassImp(MCalibrateRelTimes);
    6365
     
    8688{
    8789    fSignals = (MArrivalTimeCam*)pList->FindObject(AddSerialNumber("MArrivalTimeCam"));
    88 
    8990    if (!fSignals)
    9091    {
     
    99100    fCalibrations = (MCalibrationRelTimeCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam"));
    100101    if (!fCalibrations)
    101       {
     102    {
    102103        *fLog << err << AddSerialNumber("MCalibrationRelTimeCam") << " not found ... aborting." << endl;
    103104        return kFALSE;
    104       }
     105    }
    105106
    106107    fArrivalTime = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam"));
     
    108109        return kFALSE;
    109110   
     111    return kTRUE;
     112}
     113
     114Bool_t MCalibrateRelTimes::ReInit(MParList *pList)
     115{
     116    MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     117    if (!runheader)
     118    {
     119        *fLog << err << AddSerialNumber("MRawRunHeader") << " not found ... aborting." << endl;
     120        return kFALSE;
     121    }
     122
     123    fFreq = runheader->GetFreqSampling();
     124
    110125    return kTRUE;
    111126}
     
    131146        const Float_t offset = pix.GetTimeOffset();
    132147
    133         (*fArrivalTime)[idx].SetArrivalTime(signal-offset);
     148        // convert from slices to ns
     149        const Float_t time = 1000*(signal-offset)/fFreq; // [ns]
     150
     151        (*fArrivalTime)[idx].SetArrivalTime(time);
    134152
    135153        // FIXME: Is this necessary or explicitly done by the signal-
  • trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h

    r7829 r8618  
    1010class MCalibrationRelTimeCam;
    1111class MArrivalTimeCam;
     12class MRawRunHeader;
    1213class MSignalCam;
    1314
     
    2122    MSignalCam             *fArrivalTime;  // Calibrated arrival times
    2223
    23     Int_t PreProcess(MParList *pList);
    24     Int_t Process();
     24    UShort_t fFreq;                        //! [MHz] Sampling Frequency
     25
     26    Int_t  PreProcess(MParList *pList);
     27    Bool_t ReInit(MParList *pList);
     28    Int_t  Process();
    2529
    2630public:
  • trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc

    r8489 r8618  
    8888MFSoftwareTrigger::MFSoftwareTrigger(const char *name, const char *title)
    8989    : fCam(NULL), fEvt(NULL), fThreshold(5),
    90     fTimeWindow(0.5), fNumNeighbors(4), fType(kSinglePixelNeighbors)
     90    fTimeWindow(1.7), fNumNeighbors(4), fType(kSinglePixelNeighbors)
    9191{
    9292    fName  = name  ? name  : "MFSoftwareTrigger";
     
    435435    *fLog << " Threshold=" << fThreshold << ", Number=" << (int)fNumNeighbors;
    436436    if (fTimeWindow>0)
    437         *fLog << ", Time Window=" << fTimeWindow;
     437        *fLog << ", Time Window=" << fTimeWindow << "ns";
    438438    *fLog << endl;
    439439    *fLog << dec << setfill(' ');
  • trunk/MagicSoft/Mars/mhbase/MFillH.h

    r7804 r8618  
    6262    void SetRuleForIdx(MData *rule);
    6363
     64    void ResetWeight() { fWeight=0; fWeightName=""; }
    6465    void SetWeight(MParameterD *w)   { fWeight = w; }
    6566    void SetWeight(const char *name="MWeight") { fWeightName = name; }
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r8582 r8618  
    573573    // MHCamEvent evt7(  6, "Times",      "Calibrated Arrival Time;;T [fadc sl]");
    574574    MHCamEvent evt8(  0, "Conv",       "Calibration Conv. Factors;;[phe/cnts]");
    575     MHCamEvent evt9(  7, "PulsePos",   "Pulse Position of cosmics (>50phe);;T");
     575    MHCamEvent evt9(  7, "PulsePos",   "Pulse Position of cosmics (>50phe);;T [ns]");
    576576    MHCamEvent evtR(  4, "HiLoCal",    "Hi-/Lo-Gain ratio;;Ratio");
    577577    MHCamEvent evtO(  7, "HiLoOff",    "Lo-/Hi-Gain Offset;;Offset");
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r8590 r8618  
    8989MJCut::MJCut(const char *name, const char *title)
    9090    : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE),
    91     fFullDisplay(kTRUE),
    92     fRndmSrcPos(kFALSE), fNameHist("MHThetaSq"),
     91    fFullDisplay(kTRUE), fRndmSrcPos(kFALSE), fNumOffSourcePos(3),
     92    fNameHist("MHThetaSq"),
    9393    fCalcHadronness(0), fCalcDisp(0), fEstimateEnergy(0)
    9494{
     
    347347    EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay));
    348348    EnableRandomSrcPos(GetEnv("RandomSourcePosition", fRndmSrcPos));
     349
     350    fNumOffSourcePos = GetEnv("NumOffSourcePositions", (Int_t)fNumOffSourcePos);
    349351    //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction));
    350352
     
    626628    // --------------------------------------------------------------------------------
    627629
     630    MParameterD scale;
     631    scale.SetVal(1./fNumOffSourcePos);
     632
    628633    // Setup fitter and histograms
    629634    MAlphaFitter fit;
    630635    plist.AddToList(&fit);
    631636    if (set.IsWobbleMode())
     637    {
    632638        fit.SetScaleMode(MAlphaFitter::kNone);
     639        fit.SetScaleUser(1./fNumOffSourcePos);
     640    }
    633641
    634642    MHAlpha *halphaoff = CreateNewHist(plist, "Off");
     
    638646
    639647    // FIXME: If fPathIn read cuts and energy estimator from file!
     648    MContinue contq("", "CutQ");
    640649    MContinue cont0("", "Cut0");
    641650    MContinue cont1("", "Cut1");
    642651    MContinue cont2("", "Cut2");
    643652    MContinue cont3("", "Cut3");
     653    contq.SetAllowEmpty();
    644654    cont0.SetAllowEmpty();
    645655    cont1.SetAllowEmpty();
     
    691701    setrunnum.SetNameParameter("RunNumber");
    692702
    693     //    MFillH fill0a("OnPos [MHSrcPosCam]", "MSrcPosCam", "FillSrcPosCam");
    694703    MFillH fill1a("MHHillasOffPre  [MHHillas]",      "MHillas",      "FillHillasPre");
    695704    MFillH fill2a("MHHillasOffPost [MHHillas]",      "MHillas",      "FillHillasPost");
     
    715724    print2.EnableSkip();
    716725
     726    MTaskList tlist2;
     727    if (set.IsWobbleMode())
     728    {
     729        tlist2.SetNumPasses(fNumOffSourcePos);
     730        fill2a.SetWeight(&scale);
     731        fill3a.SetWeight(&scale);
     732        fill4a.SetWeight(&scale);
     733        fill5a.SetWeight(&scale);
     734        fill6a.SetWeight(&scale);
     735        fill7a.SetWeight(&scale);
     736    }
     737
    717738    // How to get source position from off- and on-data?
    718739    MSrcPosCalc scalc;
    719740    scalc.SetMode(set.IsWobbleMode()?MSrcPosCalc::kWobble:MSrcPosCalc::kOffData); /********************/
     741    scalc.SetCallback(&tlist2);
    720742
    721743    MSrcPosCorrect scor;
     
    730752    MSrcPosRndm srcrndm;
    731753
    732     MTaskList tlist2;
    733754    tlist2.AddToList(&scalc);
    734755    tlist2.AddToList(&scor);
    735756    tlist2.AddToList(&srcrndm);
    736     //if (fRndmSrcPos && !set.IsWobbleMode())
    737     //   tlist2.AddToList(&fill0a);
    738757    tlist2.AddToList(&hcalc);
    739758    if (set.IsWobbleMode())
    740759        tlist2.AddToList(&hcalc2);
    741760    //tlist2.AddToList(&taskenv1);
    742     tlist2.AddToList(&cont0);
     761    tlist2.AddToList(&cont0); 
    743762    tlist2.AddToList(&taskenv2);
    744763    tlist2.AddToList(&taskenv3);
     
    747766    if (write0)
    748767        tlist2.AddToList(write0);
    749     if (!fWriteOnly)
    750         tlist2.AddToList(&fill1a);
    751768    tlist2.AddToList(&cont1);
    752769    if (!fWriteOnly && (!set.IsWobbleMode() || !fNameHistFS.IsNull()))
     
    786803        tlist.AddToList(&print2, "EffectiveOnTime");
    787804    tlist.AddToList(&devcalc, "Starguider");
     805    tlist.AddToList(&contq,   "Events");
     806    if (!fWriteOnly)
     807        tlist.AddToList(&fill1a, "Events");
    788808    tlist.AddToList(&tlist2,  "Events");
    789809
     
    802822
    803823    TObjArray cont;
     824    cont.Add(&contq);
    804825    cont.Add(&cont0);
    805826    cont.Add(&cont1);
     
    879900    fill6b.SetDrawOption(set.HasOffSequences()||set.IsWobbleMode()?"same":"");
    880901    fill7b.SetDrawOption(set.HasOffSequences()||set.IsWobbleMode()?"same":"");
    881 
    882902    //fill9b.SetFilter(&fbin);
    883903
     
    922942    fillphi.SetDrawOption("anticut");
    923943
     944    tlist2.SetNumPasses();
     945
    924946    tlist.Replace(&readon);
    925947    if (fRndmSrcPos && !set.IsWobbleMode())
    926     {
    927 //        tlist2.RemoveFromList(&fill0a);
    928948        tlist2.RemoveFromList(&srcrndm);
    929     }
    930949
    931950    MFillH fillsrc(&hsrcpos, "MSrcPosCam", "FillSrcPosCam");
     
    936955    if (!fWriteOnly)
    937956    {
    938         tlist2.Replace(&fill1b);
     957        tlist.Replace(&fill1b);
    939958/*        if (fIsWobble)
    940959        {
  • trunk/MagicSoft/Mars/mjobs/MJCut.h

    r8456 r8618  
    2424    Bool_t  fRndmSrcPos;
    2525    //Bool_t  fSubstraction;
     26
     27    UInt_t fNumOffSourcePos;
    2628
    2729    TString fNameSummary;
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc

    r8601 r8618  
    6868
    6969#include "MParList.h"
     70#include "MTaskList.h"
    7071
    7172#include "MLog.h"
     
    9495MSrcPosCalc::MSrcPosCalc(const char *name, const char *title)
    9596    : fObservatory(NULL), fPointPos(NULL), fSourcePos(NULL), fDeviation(NULL),
    96     fSrcPosCam(NULL), fSrcPosAnti(NULL), fGeom(NULL), fTime(NULL), fMode(kDefault)
     97    fSrcPosCam(NULL), fSrcPosAnti(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL),
     98    fMode(kDefault)
    9799{
    98100    fName  = name  ? name  : "MSrcPosCalc";
     
    196198    //*fLog << "Pointing Position: " << GetRaDec(*fPointPos)  << endl;
    197199    *fLog << "Source Position: " << GetRaDec(*fSourcePos) << endl;
     200    if (fCallback)
     201        *fLog << "Using " << fCallback->GetNumPasses() << " off-regions." << endl;
    198202
    199203    // For the case ReInit is never called we try:
     
    215219    {
    216220        fSrcPosAnti->SetXY(v);
    217         v *= -1;
     221
     222        if (fCallback)
     223        {
     224            const Double_t step = TMath::TwoPi()/(fCallback->GetNumPasses()+1);
     225            v = v.Rotate(step*(fCallback->GetNumPass()+1));
     226        }
     227        else
     228            v *= -1;
     229
    218230        fSrcPosCam->SetXY(v);
    219231    }
  • trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h

    r7287 r8618  
    1717class MTime;
    1818class MVector3;
     19class MTaskList;
    1920
    2021class MSrcPosCalc : public MTask
     
    3940    MGeomCam     *fGeom;
    4041    MTime        *fTime;
     42    MTaskList    *fCallback;
    4143
    4244    UShort_t fRunType;            //! Run Type to decide where to get pointing position from
     
    6870    void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); } // Make MSrcPosCalc owner of fSourcePos
    6971    void SetMode(Mode_t m=kDefault) { fMode = m; }
     72    void SetCallback(MTaskList *list) { fCallback=list; }
    7073
    7174    ClassDef(MSrcPosCalc, 0) // Calculates the source position in the camera
Note: See TracChangeset for help on using the changeset viewer.