Ignore:
Timestamp:
03/04/05 16:59:58 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

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

    r6731 r6752  
    122122// - fIsRelTimesUpdate to kFALSE
    123123// - fIsHiLoCalibration to kFALSE
     124// - fIsModifiedExtractWin to kTRUE
    124125// - fPulsePosCheck to kTRUE
    125126//
    126127MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title)
    127     : fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE)
     128    : fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE),
     129      fIsHiLoCalibration(kFALSE), fIsModifiedExtractWin(kTRUE)
    128130{
    129131    fName  = name  ? name  : "MJCalibrateSignal";
     
    207209    cont.Add(&cam);
    208210    return ReadContainer(cont);
     211}
     212
     213Bool_t MJCalibrateSignal::ReadExtractorCosmics(MExtractor* &ext1) const
     214{
     215
     216  const TString fname = Form("pedy%08d.root",fSequence.GetSequence());
     217
     218  *fLog << inf << "Reading from file: " << fname << endl;
     219
     220  TFile file(fname, "READ");
     221  if (!file.IsOpen())
     222    {
     223      *fLog << warn << "Could not find or open file " << fname << endl;
     224      return kFALSE;
     225    }
     226
     227  TObject *o = file.Get("ExtractSignal");
     228  if (o && !o->InheritsFrom(MExtractor::Class()))
     229    {
     230      *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
     231      return kFALSE;
     232    }
     233  if (o)
     234    {
     235      delete ext1;
     236      ext1 = (MExtractor*)o->Clone();
     237    }
     238  else
     239    *fLog << warn << "No signal extractor found in " << fname << endl;
     240
     241  file.Close();
     242  return kTRUE;
    209243}
    210244
     
    222256    SetRelTimesUpdate(GetEnv("RelTimesUpdate", fIsRelTimesUpdate));
    223257    SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
     258    SetModifiedExtractWin(GetEnv("ModifiedExtractWin", fIsModifiedExtractWin));
    224259
    225260    return MJCalib::CheckEnvLocal();
     
    339374        *fLog << endl;
    340375        extractor3 = (MExtractor*)extractor1->Clone();
     376       
    341377    }
    342378    else
     
    356392    else
    357393        *fLog << inf << "No Camera geometry found using default <MGeomCamMagic>" << endl;
     394
     395    if (fIsModifiedExtractWin)
     396      if (!ReadExtractorCosmics(extractor1))
     397        *fLog << warn << "No extraction window update for signal extractor found" << endl;
    358398
    359399    // This is necessary for the case in which it is not in the files
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r6699 r6752  
    2626    Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
    2727    Bool_t fIsHiLoCalibration;          // Choose to calibrate the high-gain vs. low-gains
     28    Bool_t fIsModifiedExtractWin;       // Choose to use the modified extraction window from pulse position
    2829   
    2930    Bool_t CheckEnvLocal();
     
    3435    Bool_t ReadCalibration(TObjArray &o, MBadPixelsCam &bpix,
    3536                           MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
     37    Bool_t ReadExtractorCosmics(MExtractor* &ext1) const;
    3638
    3739    const char*  GetInputFileName() const;
     
    4749    void SetRelTimesUpdate ( const Bool_t b=kTRUE )  { fIsRelTimesUpdate  = b; }
    4850    void SetHiLoCalibration( const Bool_t b=kTRUE )  { fIsHiLoCalibration = b; }
     51    void SetModifiedExtractWin( const Bool_t b=kTRUE )  { fIsModifiedExtractWin = b; }
    4952
    5053    //    void SetInputCal    ( MRunIter *iter       )  { fCruns = iter; }
Note: See TracChangeset for help on using the changeset viewer.