Ignore:
Timestamp:
03/04/05 16:41:53 (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/MJPedestal.cc

    r6730 r6751  
    228228
    229229    return o ? (MExtractor*)o->Clone("ExtractSignal") : NULL;
     230}
     231
     232Bool_t MJPedestal::WriteExtractor() const
     233{
     234
     235  const TString name  = Form("pedy%08d.root",fSequence.GetSequence());
     236  const TString fname = Form("%s/%s",fPathIn.Data(),name.Data());
     237
     238  *fLog << inf << "Updating extractor in file: " << fname << endl;
     239
     240  TFile file(fname, "UPDATE");
     241  if (!file.IsOpen())
     242    {
     243      *fLog << err << dbginf << "ERROR - Could not open file " << fname << endl;
     244      return kFALSE;
     245    }
     246
     247  TObjArray cont;
     248  cont.Add(fExtractor);
     249
     250  return WriteContainer(cont,name, fOverwrite?"RECREATE":"NEW");
    230251}
    231252
     
    859880    cont.Add(&fBadPixels);
    860881
    861     return WriteContainer(cont, GetOutputFileName(), fOverwrite?"RECREATE":"NEW");
     882    return WriteContainer(cont, GetOutputFileName(),fOverwrite?"RECREATE":"NEW");
    862883}
    863884
     
    12151236              ? (Int_t)(meanpulsetime-1.5*rmspulsetime)
    12161237              : (Int_t)(meanpulsetime-3.);
    1217             const Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
    1218               ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain()
     1238            Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
     1239              ?  ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain()
    12191240              : 6;
     1241            if (wshigain > 6)
     1242              wshigain = 6;
    12201243            const Int_t wslogain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
    12211244              ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain()
     
    12431266              }
    12441267            fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples());
     1268            if (!WriteExtractor())
     1269              {
     1270                *fLog << err << "Could not write the changes to disk, abort... " << endl;
     1271                return kFALSE;
     1272              }
    12451273          }
    12461274        else
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r6699 r6751  
    8383
    8484    void ReadReferenceFile();
     85
     86    Bool_t WriteExtractor() const;
    8587   
    8688public:
Note: See TracChangeset for help on using the changeset viewer.