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

Legend:

Unmodified
Added
Removed
  • 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.