Datareader home        Runlist        Pilot File        Outputs        Stage6        Template

 

The spectral analysis is performed with the GrISep package This section will not describe all the GrISep possibility but just the way to produce spectrum from datareader.

We will use 2 programs of the GrISep packages:

GrISep/vg_get_data which creates 4 data files (in "root" format) from the energy output files of
GrISU/Datareader/datareader,
GrISU/Datareader/spectrum_info,
GrISU/Simulation/Detector/grisudet
These 4 files are:
List of the reconstructed energy of the "ON" events (from experimental data, produced by datareader).
List of the reconstructed energy of the "OFF" events (from experimental data, produced by datareader).
List of the simulated and reconstructed energy of "ON" events (from Monte Carlo data, produced by spectrum_info).
List of the simulated energy of all the events simulated (from Monte Carlo data, produced by grisudet).
GrISep/vg_spectrum which unfolds the spectrum of source using the above mentioned data files in ".root" format.

The 2 GrISep programs are controlled by a pilot file using the same convention as GrISU.
The default pilot files are spectrum.pilot and get_data.pilot.

To compile these program, launch "make" in the GrIsep directory:
GrISep> make

Producing Energy Files

  • Producing energy files of experimental data from datareader
  • In the datareader pilot file, you need to add a * to the following line to produce the ON and OFF energy files:
    * ENGFI 1 ./Crab
    After you run datareader, it will produce 2 files named Crab_ON.els and Crab_OFF.els, which are the reconstructed energy of the ON and OFF events.

  • Producing energy files of simulation from grisudet
  • The energy file of all the simulated events is produced at time of simulation using grisudet. It is a ".eng" file.
  • Producing energy files of simulation from spectrum_info
  • To compile spectrum_info:
  • GrISU/Datareader> make spectrum

  • Runlist
  • You need a runlist containing the path and names of the simulation files, similar to the runlist of datareader except you do not need the RA/dec and time cut information (or the program will not execute successfully).

  • Pilot
  • You may use the same datareader pilot file you used to run Datareader. You can edit the ENGFI line to change the name of your simulation file

    The command line to run spectrum_info:
    GrISU> Datareader/spectrum_info -d datareader.pilot < simulation-runlist
    When it's finished it'll print out on the screen where the simulation energy files is saved to, for example, Crab_simu.rcs

    Converting energy files into root format

    In GrISep directory, edit get_data.pilot with your favorite text editor.
    Inside the get_data.pilot:

  • * NUMBTEL 4
    This indicates the number of telescopes in your data. If you have 3 and 4 telescopes data in your dataset, you must treat them separately.

  • * GETDA filein utahfile ../Crab_on.els gamma
    This indicates the input file, in this case it's the reconstructed energies of ON events from your data. Make sure the path name is correct.

  • * GETDA fileout rcstree ./Crab_on.root gamma
    This is the output root file.

  • Don't worry about the rest
  • To run in command line:
    ./vg_get_data

    Repeat for the other 3 files.

    For the OFF file, simply replace "ON" with "OFF" in the pilot file

    For the simulation reconstructed energy file from spectrum_info

  • * GETDA filein utahsimfile ../Crab_simu.rcs gamma
    Notice the change in file type to utahsimfile.

  • * GETDA fileout rcstree ./Crab_simu.root gamma

  • For the simulation energy file from grisudet

  • * GETDA filein engfile ../Crab.eng eng
    Notice the change in file type to engfile, and from gamma to eng.

  • * GETDA fileout engtree ./Crab_eng.root eng
    Notice the change in tree type to engtree, and from gamma to eng.

  • Producing a spectrum from the root files

    In spectrum.pilot:

  • * NUMBTEL 4
  • specfies number of telescopes

  • * MAKESPEC filein rcstree ./Crab_simu.root gamma
  • specifies the location of the reconstructed energy file of the simulation.

  • * MAKESPEC fileengin engtree ./Crab_eng.root eng
  • specifies the location of the simulation energy file.

  • * MAKESPEC filedataon rcstree ./Crab_on.root gamma
  • specifies the location of the reconstructed energy file of ON events.

  • * MAKESPEC filedataoff rcstree ./Crab_off.root gamma
  • specifies the location of the reconstructed energy file of OFF events.

  • * MAKESPEC multoff 0.142857
  • specifies the constant beta.
    For reflected regions analysis (7 reflected off regions), it's 1/7, which is 0.142857.
    For ring background analysis, you can extract this constant in the summary file produced by datareader. On the line where it says OFF count, beta is the number ON background divided by OFF count.
    For example: OFF count : 537 (ON background = 76.71)
    beta is 76.71/537 = 0.142849.

  • * MAKESPEC mcarlo 450.0 2.5
  • how the photons were simulated.

  • * MAKESPEC data 54
  • specifies the observing duration in minutes, deadtime needs to be taken into accout (~10% for 4 telescopes).

  • * CFSPEC logebins -.85 0.3 8
  • specifies the range and binning of the spectrum.

    To run in command line:
    ./vg_spectrum

    The last plot flux is the spectrum.

    A text file named flux_spectrum.tbl will also be created in GrISep. It contains the data points in the spectrum in the this format: Energy(TeV),Flux, Flux error bar.

    Datareader home        Runlist        Pilot File        Outputs        Stage6        Template