Ignore:
Timestamp:
11/05/03 14:47:52 (21 years ago)
Author:
marcos
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r2449 r2474  
    2323\* ======================================================================== */
    2424
     25
    2526//////////////////////////////////////////////////////////////////////////////
    2627//                                                                          //
     
    3132//////////////////////////////////////////////////////////////////////////////
    3233
     34
     35// --------------------------------------------------------------------------
     36//
     37//
     38Double_t myfunction(Double_t *x, Double_t *par)
     39{
     40  Double_t xx = x[0];
     41
     42  return pow(xx,-2)*exp(-xx/20); 
     43}
     44
     45
     46
     47// --------------------------------------------------------------------------
     48//
     49//
    3350void weights(TString filename="/up1/data/Magic-MC/CameraAll/Gammas/zbin0/Gamma_zbin0_0_7_1000to1009_w0-4:4:2.root")
    3451{
     
    6380    reader.EnableBranch("fImpact");
    6481
    65     // ------------------
     82
     83    // -------------------------------------------------------------
    6684    //
    6785    // Option 1. Just change the slope of the MC power law spectrum
    6886    //
    69     //MMcWeightEnergySpecCalc wcalc(-2.0);
     87    //MMcWeightEnergySpecCalc wcalc(-2.0);                //<-- Uncomment me
     88
    7089    //
    71     // Option 2. A completely differente specturm
     90    // Option 2. A completely differente specturm pass as a TF1 function
    7291    //           e.g. spectrum with exponential cutoff
    7392    //
    74     TF1* spec = new TF1("spectrum","pow(x,[0])*exp(-x/[1])");
    75     spec->SetParameter(0,-2.0); // Spectral index
    76     spec->SetParameter(1,50); // Spectral index
    77     MMcWeightEnergySpecCalc wcalc(spec);
     93    //TF1 spec("spectrum","pow(x,[0])*exp(-x/[1])");      //<-- Uncomment me
     94    //spec->SetParameter(0,-2.0);                         //<-- Uncomment me
     95    //spec->SetParameter(1,50);                           //<-- Uncomment me
     96    //MMcWeightEnergySpecCalc wcalc(spec);                //<-- Uncomment me
     97 
     98    //
     99    // Option 3. A completely differente specturm pass as a cahr*
     100    //           
     101    //char* func = "pow(x,-2)";                           //<-- Uncomment me
     102    //MMcWeightEnergySpecCalc wcalc(func);                //<-- Uncomment me
     103
     104    //
     105    // Option 4. A completely differente specturm pass as a c++ function
     106    //     
     107    MMcWeightEnergySpecCalc wcalc((void*)myfunction);   //<-- Uncomment me
     108    //
     109    //-------------------------------------------------------------
     110
    78111
    79112    MFillH hfill(&h1,"MMcEvt");
    80113    MFillH hfill2(&h2,"MMcEvt");
    81114    hfill2.SetWeight("MWeight");
    82     //
    83     //------------------
    84115
    85116    tasklist.AddToList(&reader);
     
    115146    hist1->DrawClone();
    116147    hist2->DrawClone("same");   
     148
    117149}
    118150
Note: See TracChangeset for help on using the changeset viewer.