Changeset 2474 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 11/05/03 14:47:52 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/weights.C
r2449 r2474 23 23 \* ======================================================================== */ 24 24 25 25 26 ////////////////////////////////////////////////////////////////////////////// 26 27 // // … … 31 32 ////////////////////////////////////////////////////////////////////////////// 32 33 34 35 // -------------------------------------------------------------------------- 36 // 37 // 38 Double_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 // 33 50 void weights(TString filename="/up1/data/Magic-MC/CameraAll/Gammas/zbin0/Gamma_zbin0_0_7_1000to1009_w0-4:4:2.root") 34 51 { … … 63 80 reader.EnableBranch("fImpact"); 64 81 65 // ------------------ 82 83 // ------------------------------------------------------------- 66 84 // 67 85 // Option 1. Just change the slope of the MC power law spectrum 68 86 // 69 //MMcWeightEnergySpecCalc wcalc(-2.0); 87 //MMcWeightEnergySpecCalc wcalc(-2.0); //<-- Uncomment me 88 70 89 // 71 // Option 2. A completely differente specturm 90 // Option 2. A completely differente specturm pass as a TF1 function 72 91 // e.g. spectrum with exponential cutoff 73 92 // 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 78 111 79 112 MFillH hfill(&h1,"MMcEvt"); 80 113 MFillH hfill2(&h2,"MMcEvt"); 81 114 hfill2.SetWeight("MWeight"); 82 //83 //------------------84 115 85 116 tasklist.AddToList(&reader); … … 115 146 hist1->DrawClone(); 116 147 hist2->DrawClone("same"); 148 117 149 } 118 150
Note:
See TracChangeset
for help on using the changeset viewer.