Changeset 1665 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
11/22/02 00:04:19 (22 years ago)
Author:
bigongia
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1664 r1665  
    11                                                               -*-*- END -*-*-
    22
     3 2002/11/22: Abelardo Moralejo
     4
     5   * macros/threshold.C:
     6     - Added 2nd argument to write an output file containing the
     7       energy spectrum histogram.
    38
    49 2002/11/21: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/threshold.C

    r1543 r1665  
    2424
    2525
    26 void threshold(char* filename="data/camera.root")
     26void threshold(char* filename="data/camera.root", char* outname="")
    2727{
    2828    //
     
    104104    while ((obj=Next()))
    105105        obj->DrawClone();
     106
     107    // 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      }
    106118}
Note: See TracChangeset for help on using the changeset viewer.