Changeset 6821 for trunk/MagicSoft


Ignore:
Timestamp:
03/15/05 11:32:29 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6820 r6821  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23 2005/03/15 Thomas Bretz
     24
     25   * mjobs/MJCalibrateSignal.[h,cc]:
     26     - added the fExtractor data member
     27     - added a destructor deleting it
     28     - only read extractor from file if not set by user
     29     - user fExtractor as extractor1
     30     - do not delete extractor1 if set by user
     31     - added member function to set extractor
     32
     33   * mjobs/MJPedestal.cc:
     34     - removed MFEventSelector workaround again
     35     - do not write pedy file anymore
     36
     37   * callisto.cc:
     38     - MJCalibrateSignal now takes the signal extractor directly
     39       instead of taking the long way round a new file
     40
     41   * mpedestal/MExtractPedestal.cc:
     42     - ReInit extractor correctly. Now the workaround should be
     43       really obsolete
     44
     45
     46
    2347 2005/03/14 Thomas Bretz
    2448
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6820 r6821  
    126126//
    127127MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title)
    128     : fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE),
     128    : fExtractor(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE),
    129129      fIsModifiedExtractWin(kTRUE)
    130130{
     
    134134    SetPulsePosCheck();
    135135    //fCruns = NULL;
     136}
     137
     138MJCalibrateSignal::~MJCalibrateSignal()
     139{
     140    if (fExtractor)
     141        delete fExtractor;
     142}
     143
     144void MJCalibrateSignal::SetExtractor(const MExtractor &ext)
     145{
     146    if (fExtractor)
     147        delete fExtractor;
     148
     149    fExtractor = (MExtractor*)ext.Clone();
    136150}
    137151
     
    180194    }
    181195
    182     TObject *o = file.Get("ExtractSignal");
    183     if (o && !o->InheritsFrom(MExtractor::Class()))
    184     {
    185         *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
    186         return kFALSE;
    187     }
    188     ext1 = o ? (MExtractor*)o->Clone() : NULL;
    189 
    190     o = file.Get("ExtractTime");
     196    if (!ext1)
     197    {
     198        TObject *o = file.Get("ExtractSignal");
     199        if (o && !o->InheritsFrom(MExtractor::Class()))
     200        {
     201            *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
     202            return kFALSE;
     203        }
     204        ext1 = o ? (MExtractor*)o->Clone() : NULL;
     205    }
     206
     207    TObject *o = file.Get("ExtractTime");
    191208    if (o && !o->InheritsFrom(MExtractor::Class()))
    192209    {
     
    213230    return ReadContainer(cont);
    214231}
    215 
     232/*
    216233Bool_t MJCalibrateSignal::ReadExtractorCosmics(MExtractor* &ext1) const
    217234{
     
    245262  return kTRUE;
    246263}
    247 
     264*/
    248265// --------------------------------------------------------------------------
    249266//
     
    354371    }
    355372
    356     MExtractor *extractor1=0;
     373    MExtractor *extractor1=fExtractor;
    357374    MExtractor *extractor2=0;
    358375    MExtractor *extractor3=0;
     
    374391    else
    375392        *fLog << inf << "No Camera geometry found using default <MGeomCamMagic>" << endl;
    376 
    377     if (fIsModifiedExtractWin)
    378       if (!ReadExtractorCosmics(extractor1))
    379         *fLog << warn << "No extraction window update for signal extractor found" << endl;
    380393
    381394    if (extractor1)
     
    537550    // at the Wuerzburg software meeting 26.01.05
    538551    //
    539 #warning Default calibration now in equiv. photo-electrons!
    540552    MCalibrateData calib;
    541553    calib.SetSignalType(MCalibrateData::kPhe);
     
    800812
    801813    // make sure owned object are deleted
    802     if (extractor1)
     814    if (extractor1 && extractor1!=fExtractor)
    803815        delete extractor1;
    804816    if (extractor2)
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r6777 r6821  
    2020{
    2121private:
     22    MExtractor *fExtractor;
    2223
    2324  //    MRunIter *fCruns;                   // Calibration run iter
    24  
    2525    Bool_t fIsInterlaced;               // Distinguish interlaced from other calibration
    2626    Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
     
    4242
    4343    MJCalibrateSignal(const char *name=NULL, const char *title=NULL);
     44    ~MJCalibrateSignal();
    4445
    4546    Bool_t ProcessFile(MPedestalCam &camab, MPedestalCam &cam1, MPedestalCam &cam2);
     
    5051
    5152    //    void SetInputCal    ( MRunIter *iter       )  { fCruns = iter; }
    52  
     53
     54    void SetExtractor(const MExtractor &ext);
     55
    5356    ClassDef(MJCalibrateSignal, 0) // Tool to create a pedestal file (MPedestalCam)
    5457};
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6820 r6821  
    10461046    }
    10471047
    1048     MFEventSelector sel;
    1049     sel.SetNumSelectEvts(0);
    1050      
    1051     if (fExtractor)
    1052       {
    1053         fExtractor->SetFilter(&sel);
    1054         tlist.AddToList(&sel);
    1055         tlist.AddToList(fExtractor);
    1056       }
    1057 
    10581048    MFTriggerPattern fcalib("CalibFilter");
    10591049    fcalib.RequireCalibration();
     
    12241214
    12251215    tlist.PrintStatistics();
    1226 
    1227     fExtractor->SetFilter(0);
    12281216
    12291217    if (fIsPixelCheck)
     
    13021290            fExtractor->SetRange(newfirst,newlast+wshigain,
    13031291                                 newfirst>0?newfirst-1:newfirst,data->GetNumLoGainSamples()-1);
    1304             if (!WriteExtractor())
     1292            /*if (!WriteExtractor())
    13051293              {
    13061294                *fLog << err << "Could not write the changes to disk, abort... " << endl;
    13071295                return kFALSE;
    1308               }
     1296              }*/
    13091297          }
    13101298        else
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r6502 r6821  
    442442  if (fExtractor)
    443443  {
     444    if (!fExtractor->ReInit(pList))
     445        return kFALSE;
     446
    444447      if (!fExtractor->InitArrays())
    445448          return kFALSE;
Note: See TracChangeset for help on using the changeset viewer.