Ignore:
Timestamp:
11/11/04 10:32:21 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r5324 r5381  
    332332        apply.SetGeometry(geom);
    333333    MBadPixelsMerge        merge(&badpix);
     334
    334335    MPedCalcFromLoGain     pedlo;
     336    pedlo.SetPedestalUpdate(kTRUE);
     337    // FIXME: How to get the fixed value 15 automatically?
     338    pedlo.SetExtractWindow(15, (Int_t)static_cast<MExtractor*>(extractor1)->GetNumHiGainSamples());
     339
    335340    MMcPedestalCopy        pcopy;
    336341    MTaskEnv taskenv1("ExtractSignal");
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r5361 r5381  
    503503Bool_t MJPedestal::CheckEnvLocal()
    504504{
    505 
    506   SetDataCheck(GetEnv("DataCheck", fDataCheck));
    507  
    508   if (HasEnv("DataCheckDisplay"))
    509     fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
    510 
    511   if (HasEnv("UseData"))
    512     fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
    513  
    514   if (HasEnv("UseExtractor"))
    515     if (GetEnv("UseExtractor",kFALSE))
    516       fExtractType = kUseExtractor;
    517 
    518   SetNoStorage   ( GetEnv("DisableOutput", IsNoStorage()   ));
    519  
    520   return kTRUE;
     505    SetDataCheck(GetEnv("DataCheck", fDataCheck));
     506
     507    if (HasEnv("DataCheckDisplay"))
     508        fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
     509
     510    if (HasEnv("UseData"))
     511        fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
     512
     513    if (HasEnv("UseExtractor"))
     514        if (GetEnv("UseExtractor",kFALSE))
     515            fExtractType = kUseExtractor;
     516
     517    SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
     518
     519    return kTRUE;
    521520}
    522521
     
    666665
    667666    MTaskEnv taskenv("ExtractPedestal");
    668     if (IsUseData())
    669       taskenv.SetDefault(&pedlogain);
    670     else if (IsUseExtractor())
    671       taskenv.SetDefault(fExtractor);
    672     else
    673       taskenv.SetDefault(&pedcalc);
    674 
    675     if (fExtractor)
    676     {
    677       if (IsUseData())
    678         pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples());         
    679       else if (IsUsePedRun())
     667    switch (fExtractType)
     668    {
     669    case kUseData:
     670        taskenv.SetDefault(&pedlogain);
     671        if (!fExtractor)
     672            break;
     673        pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples());
     674        break;
     675
     676    case kUsePedRun:
     677        if (!fExtractor)
     678            break;
     679        taskenv.SetDefault(&pedcalc);
     680        pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples());
     681        pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast());
     682        break;
     683
     684    case kUseExtractor:
     685        if (!fExtractor)
    680686        {
    681           pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples());
    682           pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast());
     687            *fLog << err << GetDescriptor();
     688            *fLog << "Extraction Type kUseExtractor is chosen, but no extractor has been handed over" << endl;
     689            return kFALSE;
    683690        }
    684       else if (IsUseExtractor())
    685         if (!fExtractor->IsNoiseCalculation())
    686           {
    687             *fLog << err << GetDescriptor()
    688                   << "Extraction Type kUseExtractor is chosen, but the extractor has no flag kNoiseCalculation set! " << endl;
    689             return kFALSE;
    690           }
    691     }
    692     else if (IsUseExtractor())
    693       {
    694         *fLog << err << GetDescriptor()
    695               << "Extraction Type kUseExtractor is chosen, but no extractor has been handed over" << endl;
    696         return kFALSE;
    697       }
    698    
    699   /*
    700     else
    701     {
     691        taskenv.SetDefault(fExtractor);
     692        if (fExtractor->IsNoiseCalculation())
     693            break;
     694
    702695        *fLog << warn << GetDescriptor();
    703         *fLog << ": No extractor has been chosen, take default number of FADC samples " << endl;
    704     }
    705     */
     696        *fLog <<"Extraction type is kUseExtractor, but extractor has kNoiseCalculation not set... set." << endl;
     697        fExtractor->SetNoiseCalculation();
     698        return kFALSE;
     699    }
    706700
    707701    tlist.AddToList(&geomapl);
Note: See TracChangeset for help on using the changeset viewer.