Ignore:
Timestamp:
10/27/11 17:10:47 (13 years ago)
Author:
kraehenb
Message:
Save spectra of gainanalysis to the file gainspectra.root.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/gainanalysis.C

    r12299 r12303  
    66#include <TF1.h>
    77#include <TGraph.h>
     8#include <TFile.h>
    89
    910#include <stdint.h>
     
    2930
    3031        gROOT->SetStyle("Plain");
    31        
     32        TFile outfile("gainspectra.root","RECREATE");   
    3233//-------------------------------------------
    3334//Define the data variables
     
    8081                std::sprintf(title_spect,"Spectrum of Px %i (data: %s, DRS: %s)",i,name,drsname);
    8182                std::sprintf(name_spect,"spect%i",i);
    82                 spectrum[i] = new TH1F(name_spect,title_spect,300,0,600);
     83                spectrum[i] = new TH1F(name_spect,title_spect,350,-100,600);
    8384                spectrum[i]->GetXaxis()->SetTitle("Pulse size (a.u.)");
    8485                spectrum[i]->GetYaxis()->SetTitle("Counts");
     
    281282                std::cin >> plotspect_nr;
    282283        }
    283        
     284        outfile.Write();
     285        outfile.Close();
    284286        return 0;
    285287}
Note: See TracChangeset for help on using the changeset viewer.