Ignore:
Timestamp:
05/16/07 14:48:37 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
8 edited

Legend:

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

    r8498 r8518  
    6262#include "MCalibrationRelTimeCam.h"
    6363#include "MCalibrationChargePINDiode.h"
    64 #include "MCalibrationPulseTimeCam.h"
    6564#include "MCalibrationPatternDecode.h"
    6665
     
    144143}
    145144
    146 Bool_t MJCalibrateSignal::WriteResult(TObjArray &cont)
     145Bool_t MJCalibrateSignal::WriteResult() const
    147146{
    148   if (IsNoStorage() || fIsMovieMode)
    149     return kTRUE;
    150 
    151   const TString name(Form("signal%08d.root", fSequence.GetSequence()));
    152   return WriteContainer(cont, name);
     147    if (IsNoStorage() || fIsMovieMode)
     148        return kTRUE;
     149
     150    // FIXME: This is not nice because it will update the signal
     151    // file always. Which might make the usage outside of
     152    // callisto difficult.
     153    const TString name(Form("signal%08d.root", fSequence.GetSequence()));
     154    return WriteDisplay(name, "UPDATE");
    153155}
    154156
     
    263265    MCalibrationRelTimeCam     tmcam;
    264266    //MCalibrationHiLoCam        hilcam;
    265     MCalibrationPulseTimeCam   pulcam;
     267    //MCalibrationPulseTimeCam   pulcam;
    266268
    267269    MBadPixelsCam              badpix;
     
    346348    plist.AddToList(&calibcont);       // Using AddToList(TObjArray *)
    347349    plist.AddToList(&interlacedcont);  // Using AddToList(TObjArray *)
    348     plist.AddToList(&pulcam);
     350    //plist.AddToList(&pulcam);
    349351
    350352    // Setup Tasklist
     
    872874        //    hilocam[fCheckedPixId].DrawClone("");
    873875      }
     876    interlacedcont.Add(&pulcam);
    874877    */
    875     interlacedcont.Add(&pulcam);
    876878
    877879    //if (fIsHiLoCalibration)
     
    884886    //    interlacedcont.Add(plist.FindObject("MHCalibrationHiLoCam"));
    885887
    886     if (!WriteResult(interlacedcont))
     888    if (!WriteResult())
    887889        return kFALSE;
    888890
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r8406 r8518  
    3030    void   DisplayResult(MParList &plist);
    3131
    32     Bool_t WriteResult(TObjArray &cont);
     32    Bool_t WriteResult() const;
    3333    Bool_t ReadCalibration(TObjArray &o, MBadPixelsCam &bpix,
    3434                           MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8504 r8518  
    20242024    }
    20252025
     2026    if (fDisplay)
     2027        cont.Add(fDisplay);
     2028
    20262029    return WriteContainer(cont, GetOutputFileName(), "UPDATE");
    20272030}
     
    20292032void MJCalibration::DisplayDoubleProject(MHCamera *cam, const char* whatsmall, const char* whatbig) const
    20302033{
    2031  
     2034
    20322035  TArrayI inner(1);
    20332036  inner[0] = 0;
    2034  
     2037
    20352038  TArrayI outer(1);
    20362039  outer[0] = 1;
    2037          
     2040
    20382041  TArrayI s1(3);
    20392042  s1[0] = 6;
    20402043  s1[1] = 1;
    20412044  s1[2] = 2;
    2042  
     2045
    20432046  TArrayI s2(3);
    20442047  s2[0] = 3;
    20452048  s2[1] = 4;
    20462049  s2[2] = 5;
    2047  
     2050
    20482051  TVirtualPad *pad = gPad;
    20492052  pad->Divide(2,1);
    2050  
     2053
    20512054  TH1D *inout[2];
    20522055
     
    20562059      gPad->SetBorderMode(0);
    20572060      gPad->SetTicks();
    2058      
     2061
    20592062      inout[i] = cam->ProjectionS(TArrayI(), TArrayI(1,&i), i==0 ? "Inner" : "Outer");
    20602063      FixDataCheckHist(inout[i]);
     
    20812084
    20822085      TLegend *leg2 = new TLegend(0.55,0.4,0.99,0.6);
    2083      
     2086
    20842087      //
    20852088      // Display the two half of the camera separately
     
    20882091      half[0] = cam->ProjectionS(s1, TArrayI(1,&i), "Sector 6-1-2");
    20892092      half[1] = cam->ProjectionS(s2, TArrayI(1,&i), "Sector 3-4-5");
    2090      
     2093
    20912094      for (int j=0; j<2; j++)
    20922095        {
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r8456 r8518  
    316316        }
    317317    }
     318
     319    if (fDisplay)
     320        arr.Add(fDisplay);
    318321
    319322    return WriteContainer(arr, fname, "UPDATE");
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r8504 r8518  
    201201// If Display type "kDataCheck" was chosen, also the reference lines are displayed.
    202202//
    203 void MJPedestal::DisplayResult(MParList &plist)
     203void MJPedestal::DisplayResult(const MParList &plist)
    204204{
    205205    if (!fDisplay)
     
    825825//---------------------------------------------------------------------------------
    826826//
    827 // Try to write the created MPedestalCam in the output file.
    828 // If possible, also an MBadPixelsCam and the corresponding display is written.
    829 //
    830 // In case of Storage type "kNoStorage" or if any of the containers
    831 // cannot be written, return kFALSE, otherwise kTRUE.
    832 //
    833 Bool_t MJPedestal::WriteResult()
     827Bool_t MJPedestal::WritePulsePos(TObject *obj) const
    834828{
    835829    if (IsNoStorage())
    836830        return kTRUE;
    837831
    838     TObjArray cont;
    839 
    840     cont.Add(&fPedestalCamOut);
    841     cont.Add(&fBadPixels);
    842 
    843     return WriteContainer(cont, GetOutputFileName(), fOverwrite?"RECREATE":"NEW");
     832    const TString name(Form("signal%08d.root", fSequence.GetSequence()));
     833
     834    TObjArray arr;
     835    arr.Add(obj);
     836    return WriteContainer(arr, name, fOverwrite?"RECREATE":"NEW");
    844837}
    845838
     
    869862    Float_t rmspulsetime   = 1.0;
    870863
     864    MCalibrationPulseTimeCam *cam = NULL;
    871865    if (!fSequence.IsMonteCarlo())
    872866    {
     
    887881        }
    888882
    889         MCalibrationPulseTimeCam *cam = (MCalibrationPulseTimeCam*)plist.FindObject("MCalibrationPulseTimeCam");
     883        cam = (MCalibrationPulseTimeCam*)plist.FindObject("MCalibrationPulseTimeCam");
    890884        if (!cam)
    891885        {
     
    897891        rmspulsetime  = cam->GetAverageArea(0).GetHiGainRms();
    898892    }
     893
     894    if (!WritePulsePos(cam))
     895        return kFALSE;
    899896
    900897    *fLog << all << "Mean pulse time (" << (fSequence.IsMonteCarlo()?"MC":"cosmics") << "): ";
     
    12741271        DisplayResult(plist);
    12751272
    1276     if (!WriteResult())
    1277         return kFALSE;
     1273    //    if (!WriteResult())
     1274    //        return kFALSE;
    12781275
    12791276    const Int_t rc = PulsePosCheck(plist);
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r7561 r8518  
    7676    MExtractor *ReadCalibration();
    7777    Bool_t ReadPedestalCam();
    78     Bool_t WriteResult();
     78    //Bool_t WriteResult();
     79    Bool_t WritePulsePos(TObject *obj) const;
    7980    //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
    8081
    81     void   DisplayResult(MParList &plist);
     82    void   DisplayResult(const MParList &plist);
    8283    void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
    8384    void   DisplayOutliers(TH1D *hist) const;
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r8245 r8518  
    302302    }
    303303
    304     if (fDisplay)
    305         cont.Add((TObject*)(fDisplay));
    306 
    307304    return WriteContainer(cont);
     305}
     306
     307Bool_t MJob::WriteDisplay(const char *name, const char *option, const int compr) const
     308{
     309    if (!fDisplay)
     310        return kTRUE;
     311
     312    TObjArray arr;
     313    arr.Add((TObject*)(fDisplay));
     314    return WriteContainer(arr, name, option, compr);
    308315}
    309316
  • trunk/MagicSoft/Mars/mjobs/MJob.h

    r8245 r8518  
    4949    Bool_t ReadContainer(TCollection &list) const;
    5050    Bool_t WriteContainer(TCollection &cont, const char *name, const char *option="RECREATE", const int compr=2) const;
     51    Bool_t WriteDisplay(const char *name, const char *option="RECREATE", const int comp=2) const;
    5152
    5253public:
Note: See TracChangeset for help on using the changeset viewer.