Ignore:
Timestamp:
11/21/02 10:28:46 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1653 r1660  
    2424
    2525
    26 void collarea(char *filename = "data/camera.root", char *outname = "")
     26void collarea(TString filename="camera.root", TString outname="")
    2727{
    2828    //
     
    6868
    6969
    70     // Write histogram to a file in case an output filename has been supplied:
     70    //
     71    // Write histogram to a file in case an output
     72    // filename has been supplied
     73    //
     74    if (outname.IsNull())
     75        return;
    7176
    72     if (strlen(outname) > 0)
    73       {
    74         TFile* f = new TFile(outname,"recreate");
    75         if (f)
    76           {
    77             TH1D* hc = ((MHMcCollectionArea*)parlist.FindObject("MHMcCollectionArea"))->GetHist();
    78             hc->Write();
    79             f.Close();
    80           }
    81       }
     77    TFile f(outname, "recreate");
     78    if (!f)
     79        return;
     80
     81    parlist.FindObject("MHMcCollectionArea")->Write();
    8282}
Note: See TracChangeset for help on using the changeset viewer.