Changeset 6569 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/17/05 17:09:00 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6565 r6569  
    3535
    3636
     37
    3738 2005/02/17 Thomas Bretz
    3839
    3940   * mjobs/MJStar.cc:
    4041     - fixed some missing containers in case of MC files
     42
     43   * callisto.cc:
     44     - removed obsolete second check for kModeC
     45
     46   * mars.rc:
     47     - added a lot of option to be able to use a
     48       different signal extractor looking into uncalibrated
     49       data
     50
     51   * manalysis/MCameraData.[h,cc]:
     52     - added Print() member function
     53
     54   * manalysis/MCerPhotAnal2.[h,cc]:
     55     - switched off writing into MCerPhotEvt
     56
     57   * mdata/MDataChain.[h,cc]:
     58     - added code to handle priorities of operators correctly
     59
     60   * mhist/MHEvent.cc:
     61     - fixed display for MPedestalRMS
     62
     63   * mjobs/MJCalib.cc:
     64     - fixed treatment of PixelCheck resource
     65
     66   * mjobs/MJCalibrateSignal.cc:
     67     - added some comments about Monte Carlo
     68
     69   * mjobs/MJPedestal.cc:
     70     - do not allow 'UseData' for Monte Carlos. Reason is given as
     71       comment in the code
     72
     73   * mmain/MEventDisplay.[h,cc]:
     74     - changed such, that mars.cc allows to set the used extractor
     75     - removed the obsolete cam.root, ped.root option
     76
     77   * mmain/MCameraDisplay.cc:
     78     - adapted to change in MEventDisplay
     79
    4180
    4281
  • trunk/MagicSoft/Mars/callisto.cc

    r6558 r6569  
    385385        }
    386386
    387         if (kModeC)
    388         {
    389             //
    390             // Do calibration
    391             //
    392             MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence()));
    393             job3.SetSequence(seq);
    394             job3.SetEnv(&env);
    395             job3.SetEnvDebug(kDebugEnv);
    396             job3.SetDisplay(d);
    397             job3.SetOverwrite(kOverwrite);
    398             job3.SetPathOut(kOutpathC);
    399             job3.SetPathData(kInpathD);
    400             job3.SetDataType(kDataType);
    401             // job2.SetPathIn(kInpathC); // not yet needed
    402 
    403             job3.SetBadPixels(job2.GetBadPixels());
    404             job3.SetExtractor(job2.GetExtractor());
    405             job3.SetExtractorCam(job2.GetPedestalCam());
    406 
    407             if (!job3.ProcessFile(job1.GetPedestalCam()))
    408             {
    409                 gLog << err << "Calculation of calibration failed." << endl << endl;
    410                 return -1;
    411             }
    412 
    413             if (kDebugEnv>0)
    414                 env.PrintUntouched();
    415 
    416             if (!job3.GetDisplay())
    417             {
    418                 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
    419                 return 1;
    420             }
     387        //
     388        // Do calibration
     389        //
     390        MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence()));
     391        job3.SetSequence(seq);
     392        job3.SetEnv(&env);
     393        job3.SetEnvDebug(kDebugEnv);
     394        job3.SetDisplay(d);
     395        job3.SetOverwrite(kOverwrite);
     396        job3.SetPathOut(kOutpathC);
     397        job3.SetPathData(kInpathD);
     398        job3.SetDataType(kDataType);
     399        // job2.SetPathIn(kInpathC); // not yet needed
     400
     401        job3.SetBadPixels(job2.GetBadPixels());
     402        job3.SetExtractor(job2.GetExtractor());
     403        job3.SetExtractorCam(job2.GetPedestalCam());
     404
     405        if (!job3.ProcessFile(job1.GetPedestalCam()))
     406        {
     407            gLog << err << "Calculation of calibration failed." << endl << endl;
     408            return -1;
     409        }
     410
     411        if (kDebugEnv>0)
     412            env.PrintUntouched();
     413
     414        if (!job3.GetDisplay())
     415        {
     416            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
     417            return 1;
    421418        }
    422419
  • trunk/MagicSoft/Mars/manalysis/MCameraData.cc

    r4838 r6569  
    420420    *fLog << warn << "MCameraData::DrawPixelContent - not available." << endl;
    421421}
     422
     423void MCameraData::Print(Option_t *o) const
     424{
     425    MParContainer::Print(o);
     426    *fLog << "Size = " << fData.GetSize() << endl;
     427    for (int i=0; i<fData.GetSize(); i++)
     428        cout << i << ": " << fData[i] << endl;
     429}
  • trunk/MagicSoft/Mars/manalysis/MCameraData.h

    r4838 r6569  
    5252    Double_t operator[](int i) { return fData[i]; }
    5353
     54    void Print(Option_t *o="") const;
     55
    5456    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    5557    void DrawPixelContent(Int_t num) const;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc

    r3538 r6569  
    3131//
    3232//  Input Containers:
    33 //   MRawEvtData, MPedPhotCam
     33//   MRawEvtData, MPedestalCam
    3434//
    3535//  Output Containers:
     
    4848#include "MRawEvtData.h"       // MRawEvtData::GetNumPixels
    4949#include "MCerPhotEvt.h"
    50 #include "MPedPhotPix.h"
    51 #include "MPedPhotCam.h"
     50#include "MPedestalPix.h"
     51#include "MPedestalCam.h"
    5252#include "MRawEvtPixelIter.h"
    5353
     
    7878//  - MRawRunHeader
    7979//  - MRawEvtData
    80 //  - MPedPhotCam
     80//  - MPestalCam
    8181//
    8282// The following output containers are also searched and created if
     
    124124    }
    125125
    126     fPedestals = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam");
     126    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    127127    if (runheader && !fPedestals)
    128128        return kFALSE;
     
    263263
    264264        Int_t idx = pixel.GetPixelId();
    265         fCerPhotEvt->AddPixel(idx, s, sigs);
     265//        fCerPhotEvt->AddPixel(idx, s, sigs);
    266266
    267267        // Preliminary: Do not overwrite pedestals calculated by
     
    271271    }
    272272
    273     fCerPhotEvt->FixSize();
    274     fCerPhotEvt->SetReadyToSave();
     273//    fCerPhotEvt->FixSize();
     274//    fCerPhotEvt->SetReadyToSave();
    275275
    276276    if (fPedestals)
  • trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.h

    r3389 r6569  
    1616
    1717class MRawEvtData;
    18 class MPedPhotCam;
     18class MPedestalCam;
    1919class MCerPhotEvt;
    2020class MRawRunHeader;
     
    2323{
    2424private:
    25     MPedPhotCam   *fPedestals;  // Pedestals of all pixels in the camera
     25    MPedestalCam  *fPedestals;  // Pedestals of all pixels in the camera
    2626    MRawEvtData   *fRawEvt;     // raw event data (time slices)
    2727    MCerPhotEvt   *fCerPhotEvt; // Cerenkov Photon Event used for calculation
  • trunk/MagicSoft/Mars/mars.rc

    r6338 r6569  
    2020
    2121# -------------------------------------------------------------------------
     22# Define here which signal extractor you are going to use for the
     23# whole calibration chain
     24# -------------------------------------------------------------------------
     25ExtractSignal: MExtractTimeAndChargeDigitalFilter
     26# -------------------------------------------------------------------------
     27# Define here an extractor which can be used for the December 04 data.
     28# -------------------------------------------------------------------------
     29#ExtractSignal: MExtractTimeAndChargeSpline, MExtractTimeAndChargeDigitalFilterPeakSearch, MExtractTimeAndChargeSlidingWindow
     30# -------------------------------------------------------------------------
     31# Define here parameters valid for all extractors above
     32# -------------------------------------------------------------------------
     33#ExtractSignal.HiGainFirst:         0
     34#ExtractSignal.HiGainLast:         15
     35#ExtractSignal.LoGainFirst:         3
     36#ExtractSignal.LoGainLast:         14
     37#ExtractSignal.SaturationLimit:   250
     38#ExtractSignal.OffsetLoGain:     1.51
     39#ExtractSignal.OffsetLoGain:        0
     40#ExtractSignal.LoGainSwitch:      150
     41#ExtractSignal.LoGainStartShift: -2.8
     42#ExtractSignal.LoGainStartShift: -2.8
     43# -------------------------------------------------------------------------
     44# Define here parameters valid for the spline:
     45# -------------------------------------------------------------------------
     46#ExtractSignal.Resolution:        0.05
     47#ExtractSignal.RiseTimeHiGain:    0.5
     48#ExtractSignal.FallTimeHiGain:    1.5
     49#ExtractSignal.LoGainStretch:     1.5
     50#ExtractSignal.ExtractionType: Integral <default>
     51#ExtractSignal.ExtractionType: Amplitude
     52# -------------------------------------------------------------------------
     53# Define here parameters valid for the sliding window:
     54# -------------------------------------------------------------------------
     55#ExtractSignal.HiGainWindowSize:     6
     56#ExtractSignal.LoGainWindowSize:     6
     57# -------------------------------------------------------------------------
     58# Define here parameters valid for the digital filter with peak search:
     59# -------------------------------------------------------------------------
     60#ExtractSignal.OffsetLeftFromPeak:   3
     61#ExtractSignal.OffsetRightFromPeak:  3
     62#ExtractSignal.PeakSearchWindowSize: 2
     63#ExtractSignal.HiGainFailureLimit:  10
     64#ExtractSignal.LoGainFailureLimit:  25
     65
     66# -------------------------------------------------------------------------
     67# In the case of the Digital filter you have to overwrite the default
     68# weights file depending on what you are extracting
     69# -------------------------------------------------------------------------
     70#ExtractSignal.WeightsFile: msignal/cosmics_weights.dat
     71
     72# -------------------------------------------------------------------------
     73# Setup level for determining of bad pixels
     74# -------------------------------------------------------------------------
     75#MBadPixelsCalc.PedestalLevel:         3.0
     76#MBadPixelsCalc.PedestalLevelVariance: 3.0
     77#MBadPixelsTreat.NumMinNeighbors:      3
     78#MBadPixelsTreat.UseInterpolation:     yes
     79#MBadPixelsTreat.ProcessPedestalEvt:   yes
     80#MBadPixelsTreat.ProcessPedestalRun:   no
     81#MBadPixelsTreat.ProcessTimes:         yes
     82#MBadPixelsTreat.UseCentralPixel:      no
     83#MBadPixelsTreat.HardTreatment:        no
     84
     85# -------------------------------------------------------------------------
    2286# This is how you can setup the Image cleaning used in the Camera Display
    2387# -------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r6515 r6569  
    5252// ---------
    5353//
    54 // The allowed operations are: +, -, *, /, %, ^
     54// The allowed operations are: +, -, *, /, %, ^ and ** for ^
    5555//
    5656// While a%b returns the floating point reminder of a/b.
    5757// While a^b returns a to the power of b
    5858//
    59 // Warning: There is no priority rule build in. So better use parantheses
    60 //   to get correct results. The rule is parsed/evaluated from the left
    61 //   to the right, which means:
    62 //
    63 //   "MHillas.fWidth + MHillas.fLength / HillasSource.fDist"
    64 //
    65 //    is parses as
    66 //
    67 //   "(MHillas.fWidth + MHillas.fLength) / HillasSource.fDist"
     59// Priority
     60// --------
     61//
     62//  The priority of the operators is build in as:
     63//    ^ (highest),  %, *, /, +, -
     64//
     65//  Priorities are evaluated before parsing the rule by inserting
     66//  artificial paranthesis. If you find ANY problem with this please
     67//  report it immediatly! It is highly recommended to check the result!
    6868//
    6969// You can also use mathmatical operators, eg:
     
    168168#include <stdlib.h>       // strtod, ...
    169169
     170#include <TRegexp.h>
    170171#include <TRandom.h>
    171172#include <TMethodCall.h>
     
    371372}
    372373
     374// --------------------------------------------------------------------------
     375//
     376// Remove all whitespaces
     377// Replace all kind of double +/- by a single + or -
     378//
    373379void MDataChain::SimplifyString(TString &txt) const
    374380{
     381    txt.ReplaceAll(" ",  "");
     382    txt.ReplaceAll("**", "^");
     383
    375384    while (txt.First("--")>=0 || txt.First("++")>=0 ||
    376385           txt.First("+-")>=0 || txt.First("-+")>=0)
     
    385394// --------------------------------------------------------------------------
    386395//
     396// Add Parenthesis depending on the priority of the operators. The
     397// priorities are defined by the default of the second argument.
     398//
     399void MDataChain::AddParenthesis(TString &test, const TString op) const
     400{
     401    const TString low = op(1, op.Length());
     402    if (low.Length()==0)
     403        return;
     404
     405    //cout << "--- " << Form("[%c]", op[0]) << " ---" << endl;
     406
     407    int offset = 0;
     408    while (1)
     409    {
     410        const TString check = test(offset, test.Length());
     411        if (check.IsNull())
     412            break;
     413
     414        const Ssiz_t pos = check.First(op[0]);
     415        if (pos<0)
     416            break;
     417
     418        int cnt=0;
     419
     420        int i;
     421        for (i=pos-1; i>=0; i--)
     422        {
     423            if (check[i]==')')
     424                cnt++;
     425            if (check[i]=='(')
     426                cnt--;
     427            if (cnt>0 || low.First(check[i])<0)
     428                continue;
     429            break;
     430        }
     431
     432        cnt=0;
     433        int j;
     434        for (j=pos; j<check.Length(); j++)
     435        {
     436            if (check[j]=='(')
     437                cnt++;
     438            if (check[j]==')')
     439                cnt--;
     440            if (cnt>0 || low.First(check[j])<0)
     441                continue;
     442            break;
     443        }
     444
     445        const TString sub = test(offset+i+1, j-i-1);
     446
     447        // Check if it contains operators,
     448        // otherwise we can simply skip it
     449        static const TRegexp regexp("[%/*^+-]");
     450        if (sub.Index(regexp)>0)
     451        {
     452            test.Insert(offset+j,   ")");
     453            test.Insert(offset+i+1, "(");
     454            offset += 2;
     455        }
     456        offset += j+1;
     457    }
     458
     459    AddParenthesis(test, low);
     460}
     461
     462// --------------------------------------------------------------------------
     463//
    387464// Core of the data chain. Here the chain is constructed out of the rule.
    388465//
     
    390467{
    391468    if (level==0)
     469    {
    392470        SimplifyString(txt);
     471        AddParenthesis(txt);
     472    }
    393473
    394474    MData *member0=NULL;
     
    828908    return kTRUE;
    829909}
     910/*
     911void MDataChain::ReconstructElements()
     912{
     913    if (!fMember)
     914        return;
     915
     916    if (fMember->InheritsFrom(MDataElement::Class()))
     917    {
     918        MData *data = ((MDataElement*)fMember)->CloneColumn();
     919        delete fMember;
     920        fMember = data;
     921    }
     922
     923    fMember->ReconstructElements();
     924}
     925*/
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r5956 r6569  
    4545
    4646    void   SimplifyString(TString &txt) const;
     47    void   AddParenthesis(TString &test, const TString op="^%*/+-") const;
    4748    MData *ParseString(TString txt, Int_t level);
    4849    MData *ParseDataMember(TString txt);
     
    6263    TString GetRule() const;
    6364    TString GetDataMember() const;
     65    //void    ReconstructElements() { if (fMember) fMember->ReconstructElements(); }
    6466
    6567    // MParContainer
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r5807 r6569  
    215215        break;
    216216    case kEvtPedestalRMS:
    217         fHist->SetCamContent(*event, 1);
     217        fHist->SetCamContent(*event, 2);
    218218        break;
    219219    case kEvtPedPhot:
  • trunk/MagicSoft/Mars/mjobs/MJCalib.cc

    r6475 r6569  
    3737
    3838const Int_t MJCalib::fgCheckedPixId = 100;
     39
    3940// --------------------------------------------------------------------------
    4041//
     
    5455Bool_t MJCalib::CheckEnvLocal()
    5556{
    56 
    5757    if (HasEnv("PixelCheck"))
    58       SetPixelCheck();
     58        SetPixelCheck(GetEnv("PixelCheck", fPixelCheck));
    5959
    6060    if (HasEnv("CheckedPixId"))
    61       SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId));
     61        SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId));
    6262
    6363    if (!HasEnv("DataType"))
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6505 r6569  
    464464    taskenv3.SetDefault(extractor3);
    465465
    466     MCalibrateData         calib;
    467466    //
    468467    // This is new calibration to eff. photo-electrons, hard-coded as decided
     
    470469    //
    471470#warning Default calibration now in equiv. photo-electrons!
     471    MCalibrateData calib;
    472472    calib.SetSignalType(MCalibrateData::kPhe);
    473 
     473    //----- WORKAROUND: Currently MC has no lo-gain switch ------
    474474    if (IsUseMC()) // MC file
    475475    {
     
    488488        calib.SetPedestalFlag(MCalibrateData::kEvent);
    489489    }
     490    //----------------------------------------------------------
    490491
    491492    MExtractPINDiode        pinext;
     
    621622    tlist2.AddToList(&apply);
    622623    tlist2.AddToList(&merge);
     624    //----- WORKAROUND: Currently MC has no lo-gain switch ------
    623625    if (IsUseMC())
    624626        tlist2.AddToList(&pcopy);
     
    629631        tlist2.AddToList(&pedlo3);
    630632    }
     633    //-----------------------------------------------------------
    631634    if (fIsInterlaced)
    632       {
     635    {
    633636        pinext.SetFilter(&fcalib);
    634637        bldext.SetFilter(&fcalib);
     
    655658        if (fIsRelTimesUpdate)
    656659          tlist2.AddToList(&recalc);
    657       }
     660    }
    658661
    659662    tlist2.AddToList(&conttp);
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6553 r6569  
    791791   
    792792    if (HasEnv("UseData"))
    793       fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
     793        fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
     794
     795    if (IsUseMC() && fExtractType==kUseData)
     796    {
     797        // The reason is, that the standard data files contains empty
     798        // (untriggered) events. If we would loop over the default 500
     799        // first events of the data file you would calculate the
     800        // pedestal from only some single events...
     801        *fLog << inf;
     802        *fLog << "Sorry, you cannot extract the starting pedestal from the first" << endl;
     803        *fLog << "events in your data files... using pedestal file instead.  The" << endl;
     804        *fLog << "result should not differ..." << endl;
     805        fExtractType = kUsePedRun;
     806    }
     807
    794808
    795809    if (HasEnv("UseHists"))
     
    10021016   
    10031017    if (fIsUseHists)
    1004       {
     1018    {
    10051019        pedcalc.SetIntermediateStorage();
    10061020        pedlogain.SetIntermediateStorage();
     
    10091023        //        plist.AddToList(&fPedestalHist);
    10101024        tlist.AddToList(&fillped);
    1011       }
     1025    }
    10121026
    10131027    pedcalc.SetPedestalsIn(&fPedestalCamIn);
    10141028    pedlogain.SetPedestalsIn(&fPedestalCamIn);
     1029
    10151030    pedcalc.SetPedestalsInter(&pedinter);
    10161031    pedlogain.SetPedestalsInter(&pedinter);
     
    11351150        DisplayResult(plist);
    11361151
    1137     if (fExtractionType!=kFundamental)
    1138       fExtractor->SetFilter(0);
    1139 
    11401152    if (!WriteResult())
    11411153        return kFALSE;
  • trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc

    r3503 r6569  
    9090        {
    9191        case kButDisplay:
    92             new MEventDisplay(fInputFile, "ped.root", "cal.root");
     92            new MEventDisplay(fInputFile);
    9393            return kTRUE;
    9494        }
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r6339 r6569  
    7070#include "MMcPedestalNSBAdd.h"    // MMcPedestalNSBAdd
    7171
    72 #include "MCerPhotAnal2.h"        // MCerPhotAnal2
     72#include "MCerPhotAnal2.h"        // MPedestalCalc
     73#include "MTaskEnv.h"             // MTaskEnv
     74#include "MExtractTimeAndChargeDigitalFilter.h"
    7375#include "MImgCleanStd.h"         // MImgCleanStd
    7476#include "MHillasCalc.h"          // MHillasCalc
    75 //#include "MHillasSrcCalc.h"       // MHillasSrcCalc
    76 //#include "MBlindPixelCalc.h"      // MBlindPixelCalc
    77 #include "MArrivalTimeCalc.h"     // MArrivalTimeCalc
     77#include "MCalibrationRelTimeCalc.h" // MHillasSrcCalc
     78#include "MPrint.h"               //
     79#include "MBadPixelsCalc.h"       // MBadPixelsCalc
     80#include "MBadPixelsTreat.h"      // MBadPixelsTreat
    7881#include "MFillH.h"               // MFillH
    7982#include "MExtractSignal.h"       // MExtractsignal
     
    107110//  Constructor.
    108111//
    109 MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay(), fEvtLoop(0)
     112MEventDisplay::MEventDisplay(const char *fname) : MStatusDisplay(), fEvtLoop(0)
    110113{
    111114    //
    112115    // Setup Task list for hillas calculation
    113116    //
    114     SetupTaskList("Events", fname, pname, cname);
     117    SetupTaskList("Events", fname);
    115118
    116119    //
     
    170173//  preprocess tasks and read in first event (process)
    171174//
    172 void MEventDisplay::SetupTaskList(const char *tname, const char *fname,
    173                                   const char *pname, const char *cname)
    174 {
    175     MCalibrationChargeCam *ccam=0;
    176     MPedPhotCam           *pcam=0;
     175void MEventDisplay::SetupTaskList(const char *tname, const char *fname)
     176{
     177//    MCalibrationChargeCam *ccam=0;
     178//    MPedPhotCam           *pcam=0;
    177179
    178180    MBadPixelsCam *badpix = new MBadPixelsCam;
     
    187189    }
    188190
    189     if (type==2)
    190     {
    191         TFile file(pname, "READ");
    192         if (!file.IsZombie())
    193             pcam = new MPedPhotCam;
    194         if (pcam)
    195         {
    196             if (pcam->Read()<=0)
    197             {
    198                 delete pcam;
    199                 pcam = NULL;
    200             }
    201 
    202             if (file.FindKey("MBadPixelsCam"))
    203             {
    204                 MBadPixelsCam bad;
    205                 if (bad.Read()>0)
    206                     badpix->Merge(bad);
    207             }
    208         }
    209         file.Close();
    210         file.Open(cname, "READ");
    211         if (!file.IsZombie())
    212             ccam = new MCalibrationChargeCam;
    213         if (ccam)
    214         {
    215             if (ccam->Read()<=0)
    216             {
    217                 delete ccam;
    218                 ccam = NULL;
    219             }
    220 
    221             if (file.FindKey("MBadPixelsCam"))
    222             {
    223                 MBadPixelsCam bad;
    224                 if (bad.Read()>0)
    225                     badpix->Merge(bad);
    226             }
    227         }
    228         file.Close();
    229     }
    230 
    231191    //
    232192    // Setup an empty job, with a reader task only.
     
    248208    plist->AddToList(tlist);
    249209    plist->AddToList(badpix);
    250     if (pcam)
    251         plist->AddToList(pcam);
    252     if (ccam)
    253         plist->AddToList(ccam);
    254210
    255211    //MArrivalTime *atime = new MArrivalTime;
     
    290246    plist->AddToList(evt10);
    291247
     248    MExtractTimeAndChargeDigitalFilter *digf = new MExtractTimeAndChargeDigitalFilter;
     249    digf->ReadWeightsFile("msignal/MC_weights.dat");
     250
     251    MTaskEnv *taskenv1=new MTaskEnv("ExtractSignal");
     252    taskenv1->SetDefault(digf);
     253    taskenv1->SetOwner();
     254
    292255    MCerPhotAnal2      *nanal  = new MCerPhotAnal2;
    293256    MFillH             *fill01 = new MFillH(evt01, "MCerPhotEvt", "MFillH01");
    294257    MImgCleanStd       *clean  = new MImgCleanStd;
    295258    MFillH             *fill02 = new MFillH(evt02, "MCerPhotEvt", "MFillH02");
    296     MFillH             *fill03 = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPedPhotCam", "MFillH03");
    297     MFillH             *fill04 = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPedPhotCam", "MFillH04");
     259    MFillH             *fill03 = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPedestalCam",      "MFillH03");
     260    MFillH             *fill04 = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPedestalCam", "MFillH04");
    298261    MFillH             *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06a");
    299262    MFillH             *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06b");
    300     //MBlindPixelCalc   *blind = new MBlindPixelCalc;
    301263    MHillasCalc        *hcalc  = new MHillasCalc;
    302264    MMcTriggerLvl2Calc *trcal  = new MMcTriggerLvl2Calc;
     
    304266    MFillH             *fill10 = new MFillH(evt10, "MCerPhotEvt",    "MFillH10");
    305267
     268    MBadPixelsCalc     *bcalc  = new MBadPixelsCalc;
     269    MBadPixelsTreat    *btreat = new MBadPixelsTreat;
     270    btreat->SetProcessTimes(kFALSE);
    306271    if (type==1)
     272    {
     273        bcalc->SetNamePedPhotCam("MPedPhotFromExtractor");
     274        btreat->AddNamePedPhotCam("MPedPhotFromExtractorRndm");
    307275        clean->SetNamePedPhotCam("MPedPhotFromExtractorRndm");
     276    }
    308277
    309278    // If no pedestal or no calibration file is availble
    310279    if (type==2)
    311280    {
    312         if (!pcam || !ccam)
    313         {
    314             MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
    315             MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
    316             f1->SetName("MFMonteCarlo");
    317             f2->SetName("MFRealData");
    318 
    319             MMcPedestalCopy   *pcopy = new MMcPedestalCopy;
    320             MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
    321 
    322             MExtractSignal* extra = new MExtractSignal();
    323             extra->SetRange(0, 14, 0, 14);
    324             extra->SetSaturationLimit(240);
    325 
    326             MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate;
    327             mcupd->SetOuterPixelsGainScaling(kFALSE);
    328 
    329             MCalibrateData* mccal = new MCalibrateData;
    330             mccal->SetCalibrationMode(MCalibrateData::kFfactor);
    331 
    332             // MC
    333             extra->SetFilter(f1);
    334             mcupd->SetFilter(f1);
    335             mccal->SetFilter(f1);
    336             trcal->SetFilter(f1);
    337             //fill09->SetFilter(f1);
    338 
    339             // Data
    340             nanal->SetFilter(f2);
    341 
    342             // TaskList
    343             tlist->AddToList(f1);
    344             tlist->AddToList(f2);
    345             tlist->AddToList(pcopy);
    346             tlist->AddToList(pdnsb);
    347 
    348             tlist->AddToList(extra);
    349             tlist->AddToList(mcupd);
    350             tlist->AddToList(mccal);
    351 
    352 
    353             tlist->AddToList(nanal);
    354         }
    355         else
    356         {
    357             MCalibrateData* calib = new MCalibrateData;
    358             tlist->AddToList(calib);
    359         }
     281        MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
     282        f1->SetName("MFMonteCarlo");
     283
     284        MMcPedestalCopy   *pcopy = new MMcPedestalCopy;
     285        MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
     286
     287        MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate;
     288        mcupd->SetOuterPixelsGainScaling(kFALSE);
     289
     290        MCalibrateData* calib = new MCalibrateData;
     291        calib->SetCalibrationMode(MCalibrateData::kFlatCharge);
     292        calib->SetPedestalFlag(MCalibrateData::kEvent);
     293
     294        //MCalibrationRelTimeCalc *tcalc = new MCalibrationRelTimeCalc;
     295
     296        // MC
     297        mcupd->SetFilter(f1);
     298        trcal->SetFilter(f1);
     299
     300        // TaskList
     301        tlist->AddToList(f1);
     302        tlist->AddToList(pcopy);
     303        tlist->AddToList(pdnsb);
     304
     305        tlist->AddToList(nanal);    // Calculated MPedPhotCam
     306        tlist->AddToList(taskenv1); // Calculates MExtractedSignalCam, MArrivalTimeCam
     307        tlist->AddToList(mcupd);
     308        tlist->AddToList(calib);    // MExtractedSignalCam --> MCerPhotEvt
     309
     310        tlist->AddToList(bcalc);    // Produce MBadPixelsCam
     311        tlist->AddToList(btreat);   // Treat MBadPixelsCam
    360312    }
    361313
     
    367319    tlist->AddToList(fill06a);
    368320    tlist->AddToList(fill06b);
    369     //tlist->AddToList(blind);
    370321    tlist->AddToList(fill10);
    371     tlist->AddToList(hcalc);
    372     if ((!pcam || !ccam) && type==2)
    373     {
    374         MArrivalTimeCalc  *tcalc = new MArrivalTimeCalc;
    375         MFillH            *fill07 = new MFillH(evt07, "MRawEvtData",     "MFillH7");
    376         MFillH            *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8");
    377         tlist->AddToList(tcalc);
     322    if (type==2)
     323    {
     324        MFillH *fill07 = new MFillH(evt07, "MRawEvtData",     "MFillH7");
     325        MFillH *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8");
    378326        tlist->AddToList(fill07);
    379327        tlist->AddToList(fill08);
     
    387335        tlist->AddToList(fill08);
    388336    }
     337    tlist->AddToList(hcalc);
    389338
    390339    //
     
    570519        }
    571520
    572         if (!tlist->Process())
     521        const Int_t rc = tlist->Process();
     522        if (rc==kFALSE || rc==kERROR)
    573523            return;
    574524
     
    609559void MEventDisplay::ReadFirstEvent()
    610560{
    611     if (!fEvtLoop->PreProcess())
     561    const Int_t rc = fEvtLoop->PreProcess();
     562    if (rc==kFALSE || rc==kERROR)
    612563        return;
    613564
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.h

    r4714 r6569  
    3838
    3939    void UpdateDisplay();
    40     void SetupTaskList(const char *tname, const char *fname,
    41                        const char *pname=0, const char *cname=0);
     40    void SetupTaskList(const char *tname, const char *fname);
    4241
    4342    void ReadFirstEvent();
     
    4948
    5049public:
    51     MEventDisplay(const char *fname, const char *pname=0, const char *cname=0);
     50    MEventDisplay(const char *fname);
    5251    ~MEventDisplay();
    5352
Note: See TracChangeset for help on using the changeset viewer.