Ignore:
Timestamp:
10/24/06 09:26:10 (18 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

    r8141 r8154  
    9494#include "MFTriggerPattern.h"
    9595#include "MGeomApply.h"
     96#include "MPedestalSubtract.h"
    9697//#include "MMcPedestalCopy.h"
    9798#include "MPointingPosCalc.h"
     
    450451    MContinue conttp(&ftp, "ContTrigPattern");
    451452
     453    // Create the pedestal subtracted raw-data
     454    MPedestalSubtract pedsub;
     455    pedsub.SetPedestalCam(&pedcamab);
     456
    452457    // Do signal and pedestal calculation
    453458    MPedCalcFromLoGain     pedlo1("MPedCalcFundamental");
     
    471476        extractor1->SetPedestals(&pedcamab);
    472477
     478        // Setup to use the hi-gain extraction window in the lo-gain
     479        // range (the start of the lo-gain range is added automatically
     480        // by MPedCalcFromLoGain)
     481        //
     482        // The window size of the extractor is not yet initialized,
     483        // so we have to stick to the extraction range
     484        const Int_t f = extractor1->GetHiGainFirst();
     485        const Int_t l = extractor1->GetHiGainLast();
     486        const Int_t w = (l-f+1)&~1;
     487
     488        pedlo1.SetExtractWindow(f, w);
     489
    473490        if (extractor1->InheritsFrom("MExtractTimeAndCharge"))
    474491        {
    475492            pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1);
    476493            pedlo3.SetExtractor((MExtractTimeAndCharge*)extractor1);
     494            /*
    477495            const Int_t win = ((MExtractTimeAndCharge*)extractor1)->GetWindowSizeHiGain();
    478496            pedlo1.SetExtractWindow(15, win);
    479             pedlo2.SetExtractWindow(15, win/*obsolete*/);
    480             pedlo3.SetExtractWindow(15, win/*obsolete*/);
     497            pedlo2.SetExtractWindow(15, win//obsolete//);
     498            pedlo3.SetExtractWindow(15, win//obsolete//);
     499            */
    481500        }
    482501        else
    483502        {
     503            /*
    484504            // FIXME: How to get the fixed value 15 automatically?
    485505            const Int_t f = (Int_t)(15.5+extractor1->GetHiGainFirst());
     
    488508            pedlo2.SetExtractWindow(f, n);
    489509            pedlo3.SetExtractWindow(f, n);
     510            */
     511            pedlo2.SetExtractWindow(f, w);
     512            pedlo3.SetExtractWindow(f, w);
     513
    490514        }
    491515    }
     
    657681    tlist2.AddToList(&apply);
    658682    tlist2.AddToList(&merge);
     683    tlist2.AddToList(&pedsub);
    659684    tlist2.AddToList(&pedlo1);
    660685    tlist2.AddToList(&pedlo2);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8141 r8154  
    154154#include "MRawFileRead.h"
    155155#include "MGeomApply.h"
     156#include "MPedestalSubtract.h"
    156157#include "MTaskEnv.h"
    157158#include "MBadPixelsMerge.h"
     
    19071908    tlist.AddToList(&apply);
    19081909
    1909     MPedCalcPedRun           pedcalc;
    1910     pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(),TMath::Nint(fExtractor->GetNumHiGainSamples()));
     1910    // Produce pedestal subtracted raw-data
     1911    MPedestalSubtract pedsub;
     1912    pedsub.SetPedestalCam(fExtractor->GetPedestals());
     1913    tlist.AddToList(&pedsub);
     1914
     1915    // Setup to use the hi-gain extraction window in the lo-gain
     1916    // range (the start of the lo-gain range is added automatically
     1917    // by MPedCalcFromLoGain)
     1918    //
     1919    // The window size of the extractor is not yet initialized,
     1920    // so we have to stick to the extraction range
     1921    const Int_t f = fExtractor->GetHiGainFirst();
     1922    const Int_t l = fExtractor->GetHiGainLast();
     1923    const Int_t w = (l-f+1)&~1;
     1924
     1925    MPedCalcPedRun pedcalc;
     1926    pedcalc.SetExtractWindow(f, w);
    19111927
    19121928    if (IsIntensity())
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r7739 r8154  
    8282#include "MRawEvtData.h"
    8383#include "MGeomApply.h"
     84#include "MPedestalSubtract.h"
    8485#include "MTriggerPatternDecode.h"
    8586#include "MBadPixelsMerge.h"
     
    10641065    //
    10651066    if (!fBadPixelsFile.IsNull())
    1066       {
     1067    {
    10671068        *fLog << inf << "Excluding: " << fBadPixelsFile << endl;
    1068         ifstream fin(fBadPixelsFile.Data());
    1069         fBadPixels.AsciiRead((istream&)fin);
    1070       }
     1069        ifstream fin(fBadPixelsFile);
     1070        fBadPixels.AsciiRead(fin);
     1071    }
    10711072
    10721073    MGeomApply geomapl;
     
    10741075
    10751076    MPedCalcPedRun pedcalc;
    1076     pedcalc.SetPedestalUpdate(kFALSE);
     1077    //pedcalc.SetPedestalUpdate(kFALSE);
    10771078
    10781079    MPedCalcFromLoGain pedlogain;
     
    11321133        tlist.AddToList(&fillpul);
    11331134    }
     1135
     1136    // produce pedestal subtracted raw-data
     1137    MPedestalSubtract pedsub;
     1138    if (fExtractor && fExtractionType!=kFundamental)
     1139        pedsub.SetPedestalCam(&fPedestalCamIn);
     1140    else
     1141        pedsub.SetNamePedestalCam(""); // Only copy hi- and lo-gain together!
     1142    tlist.AddToList(&pedsub);
    11341143
    11351144    // ----------------------------------------------------------------------
     
    11861195    if (fExtractor)
    11871196    {
    1188       fExtractor->SetPedestals(&fPedestalCamIn);
    1189 
    1190       if (fExtractionType!=kFundamental)
     1197        fExtractor->SetPedestals(&fPedestalCamIn);
     1198
     1199        if (fExtractionType!=kFundamental)
    11911200        {
    1192           pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
    1193           pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
    1194          
    1195           pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);
    1196           pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);
     1201            pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
     1202            pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm);
     1203
     1204            pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);
     1205            pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);
    11971206        }
    1198      
    1199       if (fExtractor->InheritsFrom("MExtractTimeAndCharge"))
     1207        else
    12001208        {
    1201 
    1202           const Float_t f = 0.1+fExtractor->GetHiGainFirst();
    1203           const Int_t win = ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain();
    1204           pedcalc.SetExtractWindow((Int_t)f, win);
    1205           pedlogain.SetExtractWindow((Int_t)(15+f), win);
    1206 
     1209            // The window size of the extractor is not yet initialized,
     1210            // so we have to stick to the extraction range
     1211            const Int_t f = fExtractor->GetHiGainFirst();
     1212            const Int_t l = fExtractor->GetHiGainLast();
     1213            const Int_t w = (l-f+1)&~1;
     1214
     1215            // Setup to use the hi-gain extraction window in the lo-gain
     1216            // range (the start of the lo-gain range is added automatically
     1217            // by MPedCalcFromLoGain)
     1218            pedcalc.SetExtractWindow(f, w);
     1219            pedlogain.SetExtractWindow(f, w);
    12071220        }
    1208       else
     1221
     1222        if (!fExtractor->InheritsFrom("MExtractTimeAndCharge") && fExtractionType!=kFundamental)
    12091223        {
    1210           const Float_t f = 0.1+fExtractor->GetHiGainFirst();
    1211           const Float_t n = 0.1+fExtractor->GetNumHiGainSamples();
    1212           pedcalc.SetExtractWindow((Int_t)f, (Int_t)n);
    1213           pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)n);
    1214 
    1215           if (fExtractionType!=kFundamental)
    1216             {
    1217               *fLog << inf;
    1218               *fLog << "Signal extractor doesn't inherit from MExtractTimeAndCharge..." << endl;
    1219               *fLog << " --> falling back to fundamental pedestal extraction." << endl;
    1220               fExtractionType=kFundamental;
    1221             }
     1224            *fLog << inf;
     1225            *fLog << "Signal extractor doesn't inherit from MExtractTimeAndCharge..." << endl;
     1226            *fLog << " --> falling back to fundamental pedestal extraction." << endl;
     1227            fExtractionType=kFundamental;
    12221228        }
    12231229    }
Note: See TracChangeset for help on using the changeset viewer.