Ignore:
Timestamp:
11/22/02 09:23:54 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/threshold.C

    r1665 r1666  
    2424
    2525
    26 void threshold(char* filename="data/camera.root", char* outname="")
     26void threshold(TString filename="data/camera.root", TString outname="")
    2727{
    2828    //
     
    106106
    107107    // Write histogram to a file in case an output filename has been supplied:
    108     if (strlen(outname) > 0)
    109       {
    110         TFile* f = new TFile(outname,"recreate");
    111         if (f)
    112           {
    113             TH1F* hc = ((MHMcEnergy*)parlist.FindObject("MHMcEnergy"))->GetHistByName("MHMcEnergy");
    114             hc->Write();
    115             f.Close();
    116           }
    117       }
     108    if (outname.IsNull())
     109        return;
     110
     111    TFile f(outname, "recreate");
     112    if (!f)
     113        return;
     114
     115    parlist.FindObject("MHMcEnergy")->Write();
    118116}
Note: See TracChangeset for help on using the changeset viewer.