Ignore:
Timestamp:
10/20/04 16:21:23 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

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

    r5167 r5298  
    332332    MHCamEvent evt6(0, "Times",       "Arrival Time;;T [slice]");
    333333    evt0.EnableVariance();
     334    evt1.EnableVariance();
    334335    evt2.EnableVariance();
    335336    evt3.EnableVariance();
     337    evt4.EnableVariance();
    336338    evt6.EnableVariance();
    337339
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r5234 r5298  
    1717!
    1818!   Author(s): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
    19 !              Markus Gaug ,04/2004 <mailto:markus@ifae.es>
     19!   Author(s): Markus Gaug, 4/2004 <mailto:markus@ifae.es>
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2004
     
    8484const Float_t  MJPedestal::fgRefPedRmsExtraGalacticOuter = 3.35;
    8585const Float_t  MJPedestal::fgRefPedRmsGalacticOuter      = 4.2;
     86
    8687// --------------------------------------------------------------------------
    8788//
     
    99100      fDataCheck(kFALSE), fUseData(kFALSE)
    100101{
    101 
    102   fName  = name  ? name  : "MJPedestal";
    103   fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)";
    104  
    105   SetNormalStorage();
    106 
     102    fName  = name  ? name  : "MJPedestal";
     103    fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)";
     104
     105    SetNormalStorage();
    107106}
    108107
     
    128127Bool_t MJPedestal::ReadPedestalCam()
    129128{
    130 
    131   if (IsNoStorage())
    132     return kFALSE;
    133  
    134   const TString fname = GetOutputFile();
    135  
    136   if (gSystem->AccessPathName(fname, kFileExists))
    137     {
    138       *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl;
    139       return kFALSE;
    140     }
    141  
    142   *fLog << inf << "Reading from file: " << fname << endl;
    143  
    144   TFile file(fname, "READ");
    145   if (fPedestalCam.Read()<=0)
    146     {
    147       *fLog << err << "Unable to read MPedestalCam from " << fname << endl;
    148       return kFALSE;
    149     }
    150  
    151   if (file.FindKey("MBadPixelsCam"))
    152     {
    153       MBadPixelsCam bad;
     129    if (IsNoStorage())
     130        return kFALSE;
     131
     132    const TString fname = GetOutputFile();
     133
     134    if (gSystem->AccessPathName(fname, kFileExists))
     135    {
     136        *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl;
     137        return kFALSE;
     138    }
     139
     140    *fLog << inf << "Reading from file: " << fname << endl;
     141
     142    TFile file(fname, "READ");
     143    if (fPedestalCam.Read()<=0)
     144    {
     145        *fLog << err << "Unable to read MPedestalCam from " << fname << endl;
     146        return kFALSE;
     147    }
     148
     149    if (file.FindKey("MBadPixelsCam"))
     150    {
     151        MBadPixelsCam bad;
    154152        if (bad.Read()<=0)
    155           {
     153        {
    156154            *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
    157155            return kFALSE;
    158           }
     156        }
    159157        fBadPixels.Merge(bad);
    160158    }
    161159
    162   if (fDisplay && !fDisplay->GetCanvas("Pedestals"))
    163     fDisplay->Read();
    164  
    165   return kTRUE;
     160    if (fDisplay && !fDisplay->GetCanvas("Pedestals"))
     161        fDisplay->Read();
     162
     163    return kTRUE;
    166164}
    167165
     
    371369void  MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const
    372370{
    373 
    374371  Double_t x = cam->GetNbinsX();
    375372 
     
    441438void MJPedestal::FixDataCheckHist(TH1D *hist) const
    442439{
    443 
    444440    hist->SetDirectory(NULL);
    445441    hist->SetStats(0);
     
    459455    xaxe->SetLabelSize(0.05);
    460456    yaxe->SetLabelSize(0.05);   
    461 
    462 }
     457}
     458
    463459/*
    464460Bool_t MJPedestal::WriteEventloop(MEvtLoop &evtloop) const
     
    494490//   Prefix.DataCheck:        Yes, No
    495491//   Prefix.UseData:          Yes, No
     492//   Prefix.DisableOutput:    Yes, No
    496493//
    497494Bool_t MJPedestal::CheckEnvLocal()
     
    502499    SetDataCheck(GetEnv("DataCheck", fDataCheck));
    503500    SetUseData(GetEnv("UseData", fUseData));
     501    SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
    504502
    505503    return kTRUE;
     
    516514Bool_t MJPedestal::WriteResult()
    517515{
    518  
    519   if (IsNoStorage())
     516    if (IsNoStorage())
     517        return kTRUE;
     518
     519    if (fPathOut.IsNull())
     520        return kTRUE;
     521
     522    const TString oname(GetOutputFile());
     523
     524    *fLog << inf << "Writing to file: " << oname << endl;
     525
     526    TFile file(oname, "UPDATE", "File created by MJPedestal", 9);
     527    if (!file.IsOpen())
     528    {
     529        *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     530        return kFALSE;
     531    }
     532
     533    if (fDisplay && fDisplay->Write()<=0)
     534    {
     535        *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
     536        return kFALSE;
     537    }
     538
     539    if (fPedestalCam.Write()<=0)
     540    {
     541        *fLog << err << "Unable to write MPedestalCam to " << oname << endl;
     542        return kFALSE;
     543    }
     544
     545    if (fBadPixels.Write()<=0)
     546    {
     547        *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
     548        return kFALSE;
     549    }
     550
    520551    return kTRUE;
    521 
    522   if (fPathOut.IsNull())
    523     return kTRUE;
    524  
    525   const TString oname(GetOutputFile());
    526  
    527   *fLog << inf << "Writing to file: " << oname << endl;
    528 
    529   TFile file(oname, "UPDATE", "File created by MJPedestal", 9);
    530   if (!file.IsOpen())
    531     {
    532       *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
    533       return kFALSE;
    534     }
    535  
    536   if (fDisplay && fDisplay->Write()<=0)
    537     {
    538       *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
    539       return kFALSE;
    540     }
    541 
    542   if (fPedestalCam.Write()<=0)
    543     {
    544       *fLog << err << "Unable to write MPedestalCam to " << oname << endl;
    545       return kFALSE;
    546     }
    547 
    548   if (fBadPixels.Write()<=0)
    549     {
    550       *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
    551       return kFALSE;
    552     }
    553 
    554   return kTRUE;
    555552}
    556553
Note: See TracChangeset for help on using the changeset viewer.