Changeset 8929 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8924 r8929  
    2222 2008/06/06 Thomas Bretz
    2323
     24   * datacenter/macros/plotdb.C:
     25     - added average temperature and wind speed
     26     - reviewed some ranges
     27
     28   * mhbase/MH3.cc:
     29     - in the 2D case with labels and boxes use blue line color
     30
     31   * mhflux/MHEffectiveOnTime.[h,cc]:
     32     - added a new data member fTotalTime counting the total run-time
     33       from the run-headers
     34     - added the new data member to the display
     35     - increased class version number accordingly
     36
     37   * mjobs/MJCalibrateSignal.cc:
     38     - let sum-trigger events pass to get calibrated
     39     - improved DefineLabel table for trigger patterns
     40     - added MTriggerPattern to output
     41
     42   * mjobs/MJStar.cc:
     43     - added a new tab "Rate" showing the remaining rates per run and
     44       trigger pattern after image cleaning
     45     - let only event with Lvl1 trigger pass to effective on-time
     46       calculation
     47     - changed title in plot of avg dc currents and pedestal rms
     48
     49   * mtrigger/MFTriggerPattern.[h,cc]:
     50     - added a counter counting the trigger decision
     51     - print the result in the PostProcess
     52
     53
     54
     55 2008/06/06 Thomas Bretz
     56
    2457   * datacenter/macros/fillstar.C:
    2558     - added windspeed and temperature
     59
     60   * datacenter/macros/fillcalib.C, datacenter/macros/fillsignal.C,
     61     datacenter/macros/fillstar.C:
     62     - use MSQLMagic instead of MSQLServer
     63
     64   * datacenter/macros/plotdb.C:
     65     - added wind speed and temperature
     66
     67   * datacenter/macros/plotstat.C:
     68     - added a plot showing the observation time per exposure (based on
     69       the source key)
     70
     71   * mbase/MStatusDisplay.cc:
     72     - fixed the SaveAs. A wrong version was comitted
     73
     74   * mextralgo/MExtralgoSpline.h:
     75     - added the missing inclusion of TMath (root 5.18)
    2676
    2777
     
    4494   * mcalib/MCalibrationChargeCam.cc,
    4595     mcalib/MCalibrationChargePINDiode.cc:
    46      - added the missing inclusion of TMath
     96     - added the missing inclusion of TMath (root 5.18)
    4797
    4898   * mgeom/MGeomCam.[h,cc]:
  • trunk/MagicSoft/Mars/datacenter/macros/plotdb.C

    r8796 r8929  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.38 2007-12-20 11:54:22 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.39 2008-06-08 12:55:22 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    534534    plot.Plot("Calibration.fArrTimeMeanInner", 0, 40.0, 0.1);
    535535    plot.SetDescription("RMS Arrival Time inner Camera;\\sigma_{T,I} [sl]", "RmsArrTmI");
    536     plot.Plot("Calibration.fArrTimeRmsInner",  0, 3.0, 0.01);
     536    plot.Plot("Calibration.fArrTimeRmsInner",  0, 4.5, 0.01);
    537537    plot.SetDescription("Number of unsuitable pixels inner Camera;N{I}", "UnsuitI");
    538538    plot.Plot("Calibration.fUnsuitableInner",  0, 75, 1);
     
    550550    plot.Plot("Calibration.fPulsePosCheckMean", 1, 50.0, 0.1);
    551551    plot.SetDescription("Rms PulsePosCheck (falling edge) inner camera;T [sl]", "ChkRms");
    552     plot.Plot("Calibration.fPulsePosCheckRms", 0, 10.0, 0.1);
     552    plot.Plot("Calibration.fPulsePosCheckRms", 0, 12.0, 0.1);
    553553    plot.SetDescription("Mean calibrated PulsePos;T", "PulPos");
    554554    plot.Plot("Calibration.fPulsePosMean", 1, 40.0, 0.1);
     
    559559    plot.Plot("Calibration.fPulsePosOffMed", -0.33, 0.5, 0.01);
    560560    plot.SetDescription("Hi-/Lo-Gain ratio;", "HiLoRatio");
    561     plot.Plot("Calibration.fHiLoGainRatioMed", 10, 12.5, 0.05);
     561    plot.Plot("Calibration.fHiLoGainRatioMed", 10, 15, 0.05);
    562562
    563563    //plot.SetDescription("Pulse Variance;", "PulVar");
     
    588588    plot.SetDescription("Maximum Humidity [%]", "Hum");
    589589    plot.Plot("Star.fMaxHumidity",             0, 100, 1);
     590    plot.SetDescription("Average Temperature [\\circ C];T [\\circ C]", "Temp");
     591    plot.Plot("Star.fAvgTemperature",        -5, 25, 1);
     592    plot.SetDescription("Average Wind Speed [km/h];v [km/h]", "Wind");
     593    plot.Plot("Star.fAvgWindSpeed",        0, 50, 1);
    590594
    591595    //muon
     
    616620    plot.Plot("Calibration.fArrTimeMeanOuter", 0, 45, 0.1);
    617621    plot.SetDescription("RMS Arrival Time outer Camera;\\sigma_{T,O} [sl]", "RmsArrTmO");
    618     plot.Plot("Calibration.fArrTimeRmsOuter",  0, 3.0, 0.01);
     622    plot.Plot("Calibration.fArrTimeRmsOuter",  0, 4.5, 0.01);
    619623    plot.SetDescription("Number of unsuitable pixels outer Camera;N{O}", "UnsuitO");
    620624    plot.Plot("Calibration.fUnsuitableOuter",  0, 25, 1);
  • trunk/MagicSoft/Mars/mhbase/MH3.cc

    r8910 r8929  
    932932    str.ToLower();
    933933
    934     if (str.IsNull() && GetLabels() && fDimension==2)
    935         str = "colz";
     934    if (GetLabels())
     935    {
     936        if (str.IsNull() && fDimension==2)
     937            str = "colz";
     938
     939        if (str.Contains("box", TString::kIgnoreCase) && fDimension==2)
     940            fHist->SetLineColor(kBlue);
     941    }
    936942
    937943    const Bool_t only  = str.Contains("only")  && TMath::Abs(fDimension)==2;
  • 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
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r8914 r8929  
    410410    //hpat.DefineLabelsY("1=Lvl1;2=Cal;3=Cal;4=Lvl2;5=Cal;7=Cal;8=Ped;9=Ped+Trig;13=Ped+Trig;16=Pin;32=Sum");
    411411    hpat.DefaultLabelY("UNKNOWN");
    412     hpat.DefineLabelY( 0, "0");        // 0: No pattern
    413     hpat.DefineLabelY( 1, "Trig");     // Lvl1
    414     hpat.DefineLabelY( 2, "Cal");      // Cal
    415     hpat.DefineLabelY( 3, "Cal");      // Cal+Lvl1
    416     hpat.DefineLabelY( 4, "Trig");     // Lvl2
    417     hpat.DefineLabelY( 5, "Trig");     // Lvl1+Lvl2
    418     hpat.DefineLabelY( 7, "Cal");      // Cal+Lvl1+Lvl2
    419     hpat.DefineLabelY( 8, "Ped");      // Ped
    420     hpat.DefineLabelY( 9, "Ped+Trig"); // Ped+Lvl1
    421     hpat.DefineLabelY(13, "Ped+Trig"); // Ped+Lvl2
    422     hpat.DefineLabelY(16, "Pin");
    423     hpat.DefineLabelY(32, "Sum");      // Sum
    424     hpat.DefineLabelY(33, "Sum");      // Sum+Lvl1
    425     hpat.DefineLabelY(37, "Sum");      // Sum+Lvl1+Lvl2
     412    hpat.DefineLabelY( 0, "0");        //  0: No pattern
     413    hpat.DefineLabelY( 1, "Trig");     //  1: Lvl1
     414    hpat.DefineLabelY( 2, "Cal");      //  2: Cal
     415    hpat.DefineLabelY( 3, "Cal");      //     Cal+Lvl1
     416    hpat.DefineLabelY( 4, "Trig");     //  4: Lvl2
     417    hpat.DefineLabelY( 5, "Trig");     //     Lvl2+Lvl1
     418    hpat.DefineLabelY( 7, "Cal");      //     Lvl2+Cal+Lvl
     419    hpat.DefineLabelY( 8, "Ped");      //  8: Ped
     420    hpat.DefineLabelY( 9, "Ped+Trig"); //     Ped+Lvl1
     421    hpat.DefineLabelY(10, "Ped+Cal");  //     Ped+Cal
     422    hpat.DefineLabelY(12, "Ped+Trig"); //     Ped+Lvl2
     423    hpat.DefineLabelY(13, "Ped+Trig"); //     Ped+Lvl2+Lvl1
     424    hpat.DefineLabelY(16, "Pin");      // 16: Pin
     425    hpat.DefineLabelY(32, "Sum");      // 32: Sum
     426    hpat.DefineLabelY(33, "Trig");     //     Sum+Lvl1
     427    hpat.DefineLabelY(34, "Cal");      //     Sum+Cal
     428    hpat.DefineLabelY(35, "Cal");      //     Sum+Cal+Lvl1
     429    hpat.DefineLabelY(36, "Trig");     //     Sum+Lvl2
     430    hpat.DefineLabelY(37, "Trig");     //     Sum+Lvl1+Lvl2
     431    hpat.DefineLabelY(39, "Cal");      //     Sum+Lvl2+Cal+Lvl1
    426432
    427433    MFillH fillpat(&hpat, "", "FillPattern");
     
    439445    fcalped.AllowTriggerLvl1();
    440446    fcalped.AllowTriggerLvl2();
    441     //fcalped.AllowSumTrigger();
     447    fcalped.AllowSumTrigger();
    442448
    443449    // This will skip interleaved events with a cal- or ped-trigger
     
    699705    write.AddContainer("MTime",                     "Events",     kFALSE);
    700706    write.AddContainer("MRawEvtHeader",             "Events");
     707    write.AddContainer("MTriggerPattern",           "Events");
    701708
    702709    // Slow-Control: Current-tree
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r8903 r8929  
    1818!   Author(s): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2007
     20!   Copyright: MAGIC Software Development, 2000-2008
    2121!
    2222!
     
    3535#include <TFile.h>
    3636
     37// Core
    3738#include "MLog.h"
    3839#include "MLogManip.h"
     
    4546#include "MStatusDisplay.h"
    4647
     48// Histograms
    4749#include "MHSectorVsTime.h"
    4850#include "MHEffectiveOnTime.h"
     
    5052#include "MBinning.h"
    5153
     54///NEEWWWW
     55#include "MH3.h"
     56
     57// Tasks
    5258#include "MReadReports.h"
    5359#include "MReadMarsFile.h"
    54 #include "MFDataPhrase.h"
    55 #include "MFilterList.h"
    56 #include "MFDataMember.h"
    57 #include "MFDeltaT.h"
    58 #include "MFSoftwareTrigger.h"
    5960#include "MContinue.h"
    6061#include "MGeomApply.h"
     
    6970#include "MWriteRootFile.h"
    7071
     72// Filter
     73#include "MFDataPhrase.h"
     74#include "MFTriggerPattern.h"
     75#include "MFilterList.h"
     76#include "MFDataMember.h"
     77#include "MFDeltaT.h"
     78#include "MFSoftwareTrigger.h"
     79
     80// Parameter container
    7181#include "MMuonSetup.h"
    7282#include "MObservatory.h"
     83//#include "MTriggerPattern.h"
    7384#include "MPointingPosCalc.h"
    7485
     
    242253    fill0d.SetNameTab("Sparks");
    243254
     255    // FIXME: This should be replaced by a cut working for all triggers!
     256    MTriggerPattern par;   // An empty trigger pattern for older files
     257    plist.AddToList(&par); // without MTriggerPattern stored in the file
     258
     259    // For the effective on-time calculation we don't want SUM-only events
     260    MFTriggerPattern fsum;
     261    fsum.SetDefault(kTRUE);
     262    fsum.DenySumTrigger();
     263    fsum.AllowTriggerLvl1();
     264    fill9.SetFilter(&fsum);
     265
     266    // Plot the trigger pattern rates vs. run-number
     267    MH3 hrate("MRawRunHeader.fRunNumber", "MTriggerPattern.GetUnprescaled");
     268    hrate.SetWeight("1./MRawRunHeader.GetRunLength");
     269    hrate.SetName("Rate");
     270    hrate.SetTitle("Event rate after cleaning [Hz];Run Number;Trigger Type;");
     271    hrate.InitLabels(MH3::kLabelsX);
     272    hrate.DefaultLabelY("ERROR");
     273    hrate.DefineLabelY( 0, "0");        //  0: No pattern
     274    hrate.DefineLabelY( 1, "Trig");     //  1: Lvl1
     275    hrate.DefineLabelY( 4, "Trig");     //  4: Lvl2
     276    hrate.DefineLabelY( 5, "Trig");     //     Lvl2+Lvl1
     277    hrate.DefineLabelY(32, "Sum");      // 32: Sum
     278    hrate.DefineLabelY(33, "Trig");     //     Sum+Lvl1
     279    hrate.DefineLabelY(36, "Trig");     //     Sum+Lvl2
     280    hrate.DefineLabelY(37, "Trig");     //     Sum+Lvl1+Lvl2
     281
     282    MFillH frate(&hrate, "", "FillRate");
     283    frate.SetDrawOption("box");
     284
    244285    // ------------------ Setup write task ----------------
    245286
     
    260301    write.AddContainer("MRawEvtHeader",             "Events");
    261302    write.AddContainer("MPointingPos",              "Events");
     303    write.AddContainer("MTriggerPattern",           "Events");
    262304
    263305    // Run Header
     
    333375        tlist2.AddToList(&rate);
    334376        tlist2.AddToList(&fillvs);
     377        tlist2.AddToList(&fsum);
    335378        tlist2.AddToList(&fill9);
    336379        tlist2.AddToList(&writet);
     
    358401    tlist2.AddToList(&fill0d);
    359402    tlist2.AddToList(&fill0b);
     403    tlist2.AddToList(&frate);
    360404    tlist2.AddToList(&fill1);
    361405    tlist2.AddToList(&fill2);
     
    409453    MHSectorVsTime histdc, histrms;
    410454    histdc.SetNameTime("MTimeCurrents");
    411     histdc.SetTitle("Mean of all DC Currents;;<I> [nA]");
     455    histdc.SetTitle("Average DC currents of all pixels vs time;;<I> [nA]");
    412456    histdc.SetMinimum(0);
    413457    histdc.SetMaximum(10);
    414458    histrms.SetNameTime("MTimeCurrents");
    415     histrms.SetTitle("Mean pedestal rms of all pixels;;<\\sigma_{p}> [phe]");
     459    histrms.SetTitle("Average pedestal rms of all pixels vs time;;<\\sigma_{p}> [phe]");
    416460    histrms.SetType(5);
    417461    histrms.SetMinimum(0);
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc

    r8903 r8929  
    9393    }
    9494
     95    memset(fCounter, 0, sizeof(fCounter));
     96
    9597    return kTRUE;
    9698}
     
    103105// If any bit matches the fMasDenied* mask fResult is forced to be false.
    104106//
    105 Int_t MFTriggerPattern::Process()
     107Int_t MFTriggerPattern::Eval() const
    106108{
    107109    const Byte_t p = fPattern->GetPrescaled();
     
    109111    if (p==0 && u==0)
    110112    {
    111         fResult = fDefault;
    112         return kTRUE;
     113        return fDefault;
    113114    }
    114115
    115     fResult = kFALSE;
     116    Bool_t rc = kFALSE;
    116117
    117118    // Check whether all the bits required are ON
    118119    if ( ((p & fMaskRequiredPrescaled)   == fMaskRequiredPrescaled) &&
    119120         ((u & fMaskRequiredUnprescaled) == fMaskRequiredUnprescaled))
    120       fResult = kTRUE;
     121      rc = kTRUE;
    121122
    122123    // Now overwrite the result if one of the bits is denied
    123124    if ( (p & fMaskDeniedPrescaled) || (u & fMaskDeniedUnprescaled) )
    124       fResult = kFALSE;
     125        return kFALSE;
     126
     127    return rc;
     128}
     129
     130// --------------------------------------------------------------------------
     131//
     132// If Prescaled and Unprescaled pattern is 0 return default.
     133// If all bits of the fMaskRequired* mask are found in the pattern set
     134// fResult to true.
     135// If any bit matches the fMasDenied* mask fResult is forced to be false.
     136//
     137Int_t MFTriggerPattern::Process()
     138{
     139    fResult = Eval();
     140    fCounter[fResult ? 0 : 1]++;
     141
     142    return kTRUE;
     143}
     144
     145// --------------------------------------------------------------------------
     146//
     147Int_t MFTriggerPattern::PostProcess()
     148{
     149    const UInt_t n = GetNumExecutions();
     150    if (n==0)
     151        return kTRUE;
     152
     153    *fLog << inf << endl;
     154    *fLog << GetDescriptor() << " execution statistics:" << endl;
     155    *fLog << dec << setfill(' ');
     156
     157    *fLog << " " << setw(7) << fCounter[0] << " (" << setw(3) ;
     158    *fLog << (int)(fCounter[0]*100/n);
     159    *fLog << "%) Accepted trigger pattern." << endl;
     160
     161    *fLog << " " << setw(7) << fCounter[1] << " (" << setw(3) ;
     162    *fLog << (int)(fCounter[1]*100/n);
     163    *fLog << "%) Rejected trigger pattern!" << endl;
     164    *fLog << endl;
    125165
    126166    return kTRUE;
  • trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h

    r8903 r8929  
    2929
    3030  Bool_t fDefault;                  // Default which is used if trigger pattern has default value (p==0&&u==0)
     31
    3132  Bool_t fResult;                   //! Calculated result to be returned by IsExpressionTrue
     33  Int_t  fCounter[2];               //! Counter for results
    3234
    3335  // MFTriggerPattern
     
    3638  void Allow(const Byte_t mask, Prescale_t prescaled=kUnPrescaled);
    3739
     40  Int_t Eval() const;
     41
    3842  // MTask
    3943  Int_t PreProcess(MParList *pList);
    4044  Int_t Process();
     45  Int_t PostProcess();
    4146
    4247  // MFilter
Note: See TracChangeset for help on using the changeset viewer.