Changeset 8894 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
05/20/08 14:14:27 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8893 r8894  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2008/05/20 Thomas Bretz
     22
     23   * mjobs/MJCalibrateSignal.cc:
     24     - added a MH3-histogram to be filled. It contains the
     25       rate of the trigger pattern per run.
     26     - the filter selecting the calibration or pedestal
     27       events has been renamed from ftp to fcalped
     28     - the MContinue rejecting these events has been renamed
     29       from conttp to contcalped
     30     - the filter selecting the pedestal events have been
     31       renamed from ftp2 to fped
     32     - In the case of MUX data (no lo-gain) this filter
     33       is now also rejecting lvl1 and lvl2 triggered events
     34     - the ftp2-filter for the pedestal extraction tasks and
     35       the corresponding histogram fillers is obsolete
     36     - the previouls "PedestalFilter" is obsolete. 
     37     - it doesn't make sense not to extract the signal (filter
     38       of teskenv1, taskenv2 and taskenv3) but process the
     39       rest of the tasklist
     40     - the pedestal extraction (as the calibration was already)
     41       has been moved to its own tasklist with the corresponding
     42       filter applied.
     43     - tlist3 has been renamed to tlist4
     44     - contped has been removed from the tasklist
     45
     46
    2047
    2148 2008/05/19 Thomas Bretz
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r8795 r8894  
    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!
     
    5959
    6060// General histograms
     61#include "MH3.h"
    6162#include "MHCamEvent.h"
    6263#include "MHVsTime.h"
     
    227228}
    228229
     230#include "MParameterCalc.h" // FIXME
    229231Bool_t MJCalibrateSignal::Process(MPedestalCam &pedcamab, MPedestalCam &pedcambias,
    230232                                  MPedestalCam &pedcamextr)
     
    401403    MTriggerPatternDecode     decode;
    402404
     405    MH3 hpat("MRawRunHeader.fRunNumber", "MTriggerPattern.GetUnprescaled");
     406    hpat.SetWeight("1./MRawRunHeader.GetRunLength");
     407    hpat.SetName("TrigPat");
     408    hpat.SetTitle("Rate of the trigger pattern [Hz];Run Number;Trigger Pattern;Rate [Hz]");
     409    hpat.InitLabels(MH3::kLabelsXY);
     410    //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");
     411    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
     426
     427    MFillH fillpat(&hpat, "", "FillPattern");
     428    fillpat.SetDrawOption("box");
     429
    403430    // This will make that for data with version less than 5, where
    404431    // trigger patterns were not yet correct, all the events in the real
    405432    // data file will be processed. In any case there are no interleaved
    406433    // calibration events in such data, so this is fine.
    407     MFTriggerPattern ftp;
    408     ftp.SetDefault(kTRUE);
     434    MFTriggerPattern fcalped;
     435    fcalped.SetInverted();
     436    fcalped.SetDefault(kTRUE);
    409437    //    ftp.RequireCalibration();
    410     ftp.DenyCalibration();
    411     ftp.DenyPedestal();
     438    fcalped.DenyCalibration();
     439    fcalped.DenyPedestal();
    412440    //    ftp.DenyPinDiode();
    413     ftp.SetInverted();
    414 
    415     // This will skip interleaved calibration events and pedestal events (if any)
    416     // --> tlist2
    417     MContinue conttp(&ftp, "ContTrigPattern");
     441
     442    // This will skip interleaved events with a cal- or ped-trigger
     443    MContinue contcalped(&fcalped, "ContTrigPattern");
    418444
    419445    // Create the pedestal subtracted raw-data
     
    468494
    469495    //------------------------------
    470     MFTriggerPattern ftp2;
    471     ftp2.SetDefault(kTRUE);
    472     ftp2.DenyCalibration();
     496    MFTriggerPattern fped;
     497    fped.SetDefault(kTRUE);
     498    fped.DenyCalibration();
    473499    if (!extractor1->HasLoGain())
    474         ftp2.RequirePedestal();
    475 
    476     pedlo1.SetFilter(&ftp2);
    477     pedlo2.SetFilter(&ftp2);
    478     pedlo3.SetFilter(&ftp2);
    479 
    480     MContinue contftp2(&ftp2, "ContPedestal");
     500    {
     501        fped.RequirePedestal();
     502        fped.DenyTriggerLvl1();
     503        fped.DenyTriggerLvl2();
     504    }
     505
    481506    //------------------------------
    482507
     
    493518    taskenv2.SetDefault(extractor2);
    494519    taskenv3.SetDefault(extractor3);
    495 
    496     MFilterList flistftp2("PedestalFilter");
    497     flistftp2.SetInverted();
    498     flistftp2.AddToList(&ftp2);
    499 
    500     if (!extractor1->HasLoGain())
    501     {
    502         taskenv1.SetFilter(&flistftp2);
    503         taskenv2.SetFilter(&flistftp2);
    504         taskenv3.SetFilter(&flistftp2);
    505     }
    506520
    507521    //
     
    523537    fcalib.SetDefault(kFALSE);
    524538    fcalib.RequireCalibration();
     539    //fcalib.DenyPedestal(); // This should never happen!
    525540
    526541    MCalibrationChargeCalc  chcalc;
     
    617632     fillP.SetNameTab("Pulse");
    618633     */
    619 
    620     if (!extractor1->HasLoGain())
    621     {
    622         fill0.SetFilter(&ftp2);
    623         fill1.SetFilter(&ftp2);
    624     }
    625634
    626635    /*
     
    693702    */
    694703
    695     // Now setup tasklist for events
     704    //-----------------------------------------------------------
     705    // Build tasklist
     706
    696707    MTaskList tlist2;
    697708
    698709    tlist2.AddToList(&caldec);
    699710    tlist2.AddToList(&decode);
     711    tlist2.AddToList(&fillpat);
    700712    tlist2.AddToList(&apply);
    701713    //tlist2.AddToList(&merge);
    702714    tlist2.AddToList(&pedsub);
    703     tlist2.AddToList(&ftp2);
    704     tlist2.AddToList(&pedlo1);
    705     tlist2.AddToList(&pedlo2);
    706     tlist2.AddToList(&pedlo3);
    707     tlist2.AddToList(&fill0);        // fill pedestal events
    708     tlist2.AddToList(&fill1);        // fill pedestal events
    709715
    710716    //-----------------------------------------------------------
     717    // Pedestal extraction
    711718
    712719    MTaskList tlist3;
    713     tlist3.SetFilter(&fcalib);
     720    tlist3.SetFilter(&fped);         // Deny events with cal-trigger
     721
     722    tlist2.AddToList(&fped);         // If no lo-gain require ped-trigger
     723    tlist2.AddToList(&tlist3);       //  and deny cosmics (lvl1/2) trigger
     724
     725    tlist3.AddToList(&pedlo1);       // extract pedestal events
     726    tlist3.AddToList(&pedlo2);       // extract pedestal events
     727    tlist3.AddToList(&pedlo3);       // extract pedestal events
     728    tlist3.AddToList(&fill0);        // fill pedestal events
     729    tlist3.AddToList(&fill1);        // fill pedestal events
     730
     731    //-----------------------------------------------------------
     732    // Calibration
     733
     734    MTaskList tlist4;
     735    tlist4.SetFilter(&fcalib);       // process only events with cal-trigger
    714736
    715737    //MFDataPhrase filcalco("MCalibrationConstCam.IsReadyToSave>0.5", "CalibConstFilter");
     
    717739    {
    718740        tlist2.AddToList(&fcalib);     // MFTriggerPattern
    719         tlist2.AddToList(&tlist3);
     741        tlist2.AddToList(&tlist4);
    720742        if (IsUsePINDiode())
    721             tlist3.AddToList(&pinext); // MExtractPINDiode
     743            tlist4.AddToList(&pinext); // MExtractPINDiode
    722744        if (IsUseBlindPixel())
    723             tlist3.AddToList(&bldext); // MExtractBlindPixel
    724         tlist3.AddToList(&taskenv3);
    725         tlist3.AddToList(&pacalc);     // MCalibCalcFromPast
     745            tlist4.AddToList(&bldext); // MExtractBlindPixel
     746        tlist4.AddToList(&taskenv3);
     747        tlist4.AddToList(&pacalc);     // MCalibCalcFromPast
    726748        /*
    727749         tlist3.AddToList(&filcalco);   // CalibConstFilter (IsReadyToSave)
     
    730752         */
    731753
    732         tlist3.AddToList(&filcam);     // FillChargeCam
     754        tlist4.AddToList(&filcam);     // FillChargeCam
    733755        if (fIsRelTimesUpdate)
    734           tlist3.AddToList(&filtme);   // FillRelTime
     756          tlist4.AddToList(&filtme);   // FillRelTime
    735757        if (IsUseBlindPixel())
    736             tlist3.AddToList(&filbnd); // FillBlindCam
     758            tlist4.AddToList(&filbnd); // FillBlindCam
    737759        if (IsUsePINDiode())
    738             tlist3.AddToList(&filpin); // FillPINDiode
    739         tlist3.AddToList(&chcalc);     // MCalibrationChargeCalc
     760            tlist4.AddToList(&filpin); // FillPINDiode
     761        tlist4.AddToList(&chcalc);     // MCalibrationChargeCalc
    740762        if (fIsRelTimesUpdate)
    741             tlist3.AddToList(&recalc); // MCalibrationRelTimeCam
     763            tlist4.AddToList(&recalc); // MCalibrationRelTimeCam
    742764
    743765        //tlist3.AddToList(&writecal);   // MWriteRootFile
    744766    }
    745767
    746     // Continue for all non-cosmic events
    747     if (!extractor1->HasLoGain())
    748         tlist2.AddToList(&contftp2); // remove pedestal events from processing
    749     tlist2.AddToList(&conttp);       // remove calib events from processing
     768    //-----------------------------------------------------------
     769    // Cosmics extraction
     770
     771    // remove all events with a cal- or ped-trigger (no matter
     772    // whether they have lvl1 or lvl2 or any other flag
     773    tlist2.AddToList(&contcalped);
     774
     775    // Extract the signal
    750776    if (extractor1)
    751777      tlist2.AddToList(&taskenv1);
     778
     779    // remove all events which definitly don#t have a signal
     780    // using MFCosmics (ContTrigEvts)
     781    tlist2.AddToList(&contcos);     
     782
     783    // Extract arrival time (if a dedicated extrator given)
    752784    if (extractor2)
    753       tlist2.AddToList(&taskenv2);
    754     tlist2.AddToList(&contcos);      // MFCosmics (ContTrigEvts)
     785        tlist2.AddToList(&taskenv2);
     786
    755787    /*
    756788    if (fIsHiLoCalibration)
     
    766798    }
    767799    */
     800
    768801    tlist2.AddToList(&fill2);
    769802    tlist2.AddToList(&fill8);        // FillConv
Note: See TracChangeset for help on using the changeset viewer.