wiki:IngredientsSpectrum

Version 3 (modified by Daniela Dorner, 6 years ago) ( diff )

--

Amit asked me to write down the basic notes of the tutorial on creating a spectrum which I gave him few days ago. As I thought it might be useful for other people as well, I decided to put it in the trac. However please keep in mind that this is far from being complete, might contain information that is valid only now and that it has not been checked for mistakes.

remark: this tutorial is referring to Mars from June 2018 (rev 19018)

Ingredients

  • energy-estimator
  • ganymed-output for data
  • ganymed-output for MC
  • macro to calculate spectrum

Basic Steps and Rules

  1. Prepare ingredients
  2. MAKE SURE to
    • use star files produced the same way for data and MC
    • use the same cuts for data and MC
    • use the same disp parametrization for data and MC
    • use the same energy estimator for data and MC
  3. optimize energy parametrization
  4. run ganymed for data and MC
  5. run macro for spectrum

Energy Estimator

To estimate the energy there are different methods. E.g. you can use neutral nets or random forrest. Here I will refer to the very basic approach of an energy parametrization.

Once you have an energy estimator, you implement it in ganymed e.g. like this: https://trac.fact-project.org/browser/trunk/Mars/fact/analysis/mc/ganymed.C?rev=17733#L169

Get Energy Parametrization

To get an energy parametrization, you may plot image parameters vs MC-energy and use https://trac.fact-project.org/browser/trunk/Mars/macros/optim/optimenergy.C to optimize the coefficients.

The macro in the svn contains a very basic example using only the image parameter Size in the parametrization.

Start with this and then add more image parameters.

more image parameters

To find out which other parameters to use and which formula to use, plot the residual (Emc - Eest) versus an image parameter of your choice.

For example you can plot the image parameters like this: http://www.astro.uni-wuerzburg.de/wikineu/index.php/How_to_plot_image_parameters

To get an idea which other image parameters are available, you may look at the classes MHillas.cc MHillasExt MHillasSrc MImagePar MNewImagePar MNewImagePar2 in https://trac.fact-project.org/browser/trunk/Mars/mimage Not all of them might be relevant for FACT, but for most of them you can find a description in the class.

Parameters relevant for the energy estimation: Size, Zd, Leakage, Dist and maybe some others.

An example for plots and energy parametrization here: https://www.fact-project.org/logbook/showthread.php?tid=4695

optimenergy.C

As input you need a MC ganymed file.

The parametrization is defined in

char *r = "[0]*M[0]";  

With

opt.AddParameter("MHillas.fSize");

further image parameters are added.

You can also change the slope and add cuts.

More examples can be found at ISDC in /home/isdc/dorner/e_est/optimenergy.C

Spectrum

A macro to get a spectrum can be found at /home/isdc/dorner/get_spectrum/spectrum.C

remark: so far it does not yet calculate errors.

Input: ganymed files from data and MC

Consistent Processing of MC and data

[tbc]

Note: See TracWiki for help on using the wiki.