Changeset 5841


Ignore:
Timestamp:
01/14/05 14:50:06 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5839 r5841  
    3131
    3232
     33
    3334 2005/01/14 Thomas Bretz
    3435 
     
    6970   * msignal/MExtractTimeFastSpline.cc:
    7071     - fixed delete --> delete[]
     72
     73   * mbadpixels/MBadPixelsCalc.cc:
     74     - slight change to some output
     75
     76   * mbase/MTaskEnv.h:
     77     - set name of default task when pointer is given
     78
     79   * mjobs/MJCalibrateSignal.cc:
     80     - fixed handling of extraction range for various cases
     81     - fixed handling in case no arrival times are calculated
     82
     83   * mjobs/MJCalibration.cc:
     84     - write at least a default arrival time calibration container
     85       to make further processing easier
     86
     87   * mjobs/MJPedestal.[h,cc]:
     88     - fixed handling of extraction range for various cases
     89
    7190
    7291
  • trunk/MagicSoft/Mars/NEWS

    r5796 r5841  
    3737     MTriggerPattern, MTriggerPatternDecode and MFTriggerPattern
    3838
    39    - changed callisto to calculate two kinds of pedestals and pedestal rms:
     39   - implemented filters to callisto to skip calibration events
     40
     41   - changed callisto to calculate three kinds of pedestals and pedestal rms:
    4042     + fundamental pedestal (MPedPhotFundamental): extracted directly from
    4143       the slices by statistics                             
    4244     + pedestal from extractor (MPedPhotFromExtractor): extracted with the
    4345       signal extractor without randomization
     46     + random pedestal from extractor (MPedPhotFromExtractorRndm): extracted
     47       with the signal extractor with randomization (extraction window is
     48       randomly fixed)
    4449     The thir kind of pedestal is not yet implemented (for speed reasons) as
    4550     long as nobody really needs it:
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc

    r5777 r5841  
    120120    }
    121121
    122     *fLog << inf << "Name of MPedPhotCam to get 'pedestal rms' from used: " << fNamePedPhotCam << endl;
     122    *fLog << inf << "Name of MPedPhotCam to get pedestal rms from: " << fNamePedPhotCam << endl;
    123123    if (fPedestalLevel)
    124124        *fLog << "Checking mean 'pedestal rms' against absolute value with level " << fPedestalLevel << endl;
  • trunk/MagicSoft/Mars/mbase/MTaskEnv.h

    r5557 r5841  
    3232    void SetOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
    3333
    34     void SetDefault(MTask *task) { fTask = task; if (!task) SetBit(kIsDummy); }
     34    void SetDefault(MTask *task) { fTask = task; if (fTask) fTask->SetName(fName); else SetBit(kIsDummy); }
    3535    void SetDefault(const char *def);
    3636
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r5810 r5841  
    177177//
    178178// For more details see the class description and the corresponding Getters
    179 // 
     179//
    180180Bool_t MJCalibrateSignal::CheckEnvLocal()
    181181{
     
    282282    plist.AddToList(&calibcont);
    283283
    284     pedcamab.SetName("MPedestalFundamental");
    285     plist.AddToList(&pedcamab);
    286 
    287284    // Setup Tasklist
    288285    MTaskList tlist;
     
    364361    if (extractor1)
    365362    {
    366         // FIXME: How to get the fixed value 15 automatically?
    367         const Float_t win = extractor1->GetNumHiGainSamples();
    368         pedlo1.SetExtractWindow(15, (UShort_t)TMath::Nint(win));
    369         pedlo2.SetExtractWindow(15, (UShort_t)TMath::Nint(win));
    370         pedlo3.SetExtractWindow(15, (UShort_t)TMath::Nint(win));
     363        extractor1->SetPedestals(&pedcamab);
    371364
    372365        if (extractor1->InheritsFrom("MExtractTimeAndCharge"))
     
    374367            pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1);
    375368            pedlo3.SetExtractor((MExtractTimeAndCharge*)extractor1);
    376             extractor1->SetPedestals(&pedcamab);
     369            pedlo1.SetExtractWindow(15, 0/*obsolete*/);
     370            pedlo2.SetExtractWindow(15, 0/*obsolete*/);
     371            pedlo3.SetExtractWindow(15, 0/*obsolete*/);
    377372        }
    378     }
     373        else
     374        {
     375            // FIXME: How to get the fixed value 15 automatically?
     376            const Int_t f = (Int_t)(15.5+extractor1->GetHiGainFirst());
     377            const Int_t n = (Int_t)(15.5+extractor1->GetNumHiGainSamples());
     378            pedlo1.SetExtractWindow(f, n);
     379            pedlo2.SetExtractWindow(f, n);
     380            pedlo3.SetExtractWindow(f, n);
     381        }
     382    }
     383    if (extractor2)
     384        extractor2->SetPedestals(&pedcamab);
    379385
    380386    MFCosmics fcosmics;
     
    414420    treat.AddNamePedPhotCam("MPedPhotFromExtractor");
    415421    treat.AddNamePedPhotCam("MPedPhotFromExtractorRndm");
     422    if (!extractor2 && !extractor1->InheritsFrom("MExtractTimeAndCharge"))
     423        treat.SetProcessTimes(kFALSE);
    416424
    417425
     
    461469    write.AddContainer("MTime",                     "Events",     kFALSE);
    462470    write.AddContainer("MRawEvtHeader",             "Events");
    463     write.AddContainer("MArrivalTime",              "Events");
     471    write.AddContainer("MArrivalTime",              "Events",     kFALSE);
    464472    // Slow-Control: Current
    465473    write.AddContainer("MTimeCurrents",             "Currents",   kFALSE);
     
    509517    tlist2.AddToList(&fill2);
    510518    tlist2.AddToList(&calib);
    511     tlist2.AddToList(&caltm);
     519    if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge"))
     520        tlist2.AddToList(&caltm);
    512521    tlist2.AddToList(&bpcal);
    513522    tlist2.AddToList(&treat);
     
    516525    tlist2.AddToList(&fill4);
    517526    tlist2.AddToList(&fill5);
    518     tlist2.AddToList(&fill7);
     527    if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge"))
     528        tlist2.AddToList(&fill7);
    519529
    520530    // Setup List for Drive-tree
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r5810 r5841  
    17111711    {
    17121712        taskenv2.SetDefault(fTimeExtractor);
    1713     
     1713   
    17141714        if (IsRelTimes())
    17151715            tlist.AddToList(&taskenv2);
     
    17601760    }
    17611761
    1762     if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask()))
     1762    if (!WriteTasks(taskenv.GetTask(), IsRelTimes() ? taskenv2.GetTask() : 0))
    17631763        return kFALSE;
    17641764
     
    19951995    cont.Add(&fCalibrationPINDiode);
    19961996
    1997     if (IsRelTimes())
    1998         cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
     1997    //if (IsRelTimes())
     1998    cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
    19991999
    20002000    if (!geom)
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r5810 r5841  
    783783}
    784784
    785 Bool_t MJPedestal::SetupExtractor(MParList &plist, MExtractPedestal &extped)
    786 {
    787     if (!fExtractor)
    788         return kTRUE;
    789 
    790     if (fExtractionType==kFundamental || !fExtractor->InheritsFrom("MExtractTimeAndCharge"))
    791         return kFALSE;
    792 
    793     extped.SetPedestalsIn(&fPedestalCamIn);
    794     extped.SetExtractor((MExtractTimeAndCharge*)fExtractor);
    795     extped.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
    796 
    797     return kTRUE;
    798 }
    799 
    800785Bool_t MJPedestal::ProcessFile()
    801786{
     
    908893    }
    909894
     895    // ----------------------------------------------------------------------
     896    //   Now we make sure, that in all cases the ranges are setup correctly
     897    // ----------------------------------------------------------------------
    910898    MTaskEnv taskenv("ExtractPedestal");
    911899    switch (fExtractType)
    912900    {
     901    case kUsePedRun:
     902        // In case  other than 'fundamental' second argument is obsolete
     903        pedcalc.SetExtractWindow(0, 13);  // kUsePedRun
     904        taskenv.SetDefault(&pedcalc);
     905        tlist.AddToList(&taskenv);
     906        break;
     907
    913908    case kUseData:
     909        // In case  other than 'fundamental' second argument is obsolete
     910        pedlogain.SetExtractWindow(15, 28); // kUseData
    914911        taskenv.SetDefault(&pedlogain);
    915912        tlist.AddToList(&taskenv);
    916 
    917         if (!SetupExtractor(plist, pedlogain))
    918             pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
    919         break;
    920 
    921     case kUsePedRun:
    922         taskenv.SetDefault(&pedcalc);
    923         tlist.AddToList(&taskenv);
    924 
    925         if (!SetupExtractor(plist, pedcalc))
    926             pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(), TMath::Nint(fExtractor->GetNumHiGainSamples()));
    927913        break;
    928914
     
    940926    }
    941927
     928    pedcalc.SetPedestalsIn(&fPedestalCamIn);
     929    pedlogain.SetPedestalsIn(&fPedestalCamIn);
     930
     931     // kFundamental
     932    if (fExtractor)
     933    {
     934        if (!fExtractor->InheritsFrom("MExtractTimeAndCharge"))
     935        {
     936            const Float_t f = 0.5+fExtractor->GetHiGainFirst();
     937            const Float_t n = 0.5+fExtractor->GetNumHiGainSamples();
     938            pedcalc.SetExtractWindow((Int_t)f, (Int_t)n);
     939            pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)(15+n));
     940
     941            if (fExtractionType!=kFundamental)
     942            {
     943                *fLog << inf;
     944                *fLog << "Signal extractor doesn't inherit from MExtractTimeAndCharge..." << endl;
     945                *fLog << " --> falling back to fundamental pedestal extraction." << endl;
     946                fExtractionType=kFundamental;
     947            }
     948        }
     949        else
     950        {
     951            pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);
     952            pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);
     953        }
     954
     955        if (fExtractionType!=kFundamental)
     956        {
     957            pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
     958            pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
     959        }
     960    }
     961
     962    /*
     963    switch (fExtractType)
     964    {
     965    case kUseData:
     966        *fLog << all << "TYPE: USEDATA " << fExtractor << endl;
     967        taskenv.SetDefault(&pedlogain);
     968        tlist.AddToList(&taskenv);
     969
     970        if (!SetupExtractor(plist, pedlogain))
     971        {
     972            *fLog << all <<  "SETTING TO: " << fExtractor << " " << fExtractor->GetNumHiGainSamples() << endl;
     973            fExtractor->Print();
     974            pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
     975        }
     976        break;
     977
     978    case kUsePedRun:
     979        *fLog << all <<  "TYPE: USEPEDRUN " << fExtractor << endl;
     980        taskenv.SetDefault(&pedcalc);
     981        tlist.AddToList(&taskenv);
     982
     983        if (!SetupExtractor(plist, pedcalc))
     984            pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(), TMath::Nint(fExtractor->GetNumHiGainSamples()));
     985        break;
     986
     987    case kUseHists:
     988        if (!fExtractor)
     989        {
     990            *fLog << err << GetDescriptor() << " - ERROR: ";
     991            *fLog << "Extraction Type is kUseHists, but no extractor was set" << endl;
     992            return kFALSE;
     993        }
     994
     995        tlist.AddToList(fExtractor);
     996        tlist.AddToList(&fillped);
     997        break;
     998    } */
     999
    9421000    /*
    9431001    if (!fPathIn.IsNull())
Note: See TracChangeset for help on using the changeset viewer.