source: tags/Mars-V0.9.6/mtemp/mmpi/FluxCalcAndUnfold.C

Last change on this file was 6452, checked in by rwagner, 20 years ago
*** empty log message ***
File size: 1.4 KB
Line 
1void Flux6c()
2{
3
4 TString datafile = "files/AlphaEnergyTheta.LastKeichiRF.27MC.root";
5 TString areafile = "files/area.root";
6
7 TFile* file = new TFile(datafile);
8
9 MHAlphaEnergyTheta hAlpha;
10 hAlpha.Read("MHAlphaEnergyTheta");
11 hAlpha.DrawClone();
12
13 MHEffectiveOnTime hEffTime;
14 hEffTime.Read("MHEffectiveOnTime");
15 hEffTime.DrawClone();
16
17 TFile* file3 = new TFile(areafile);
18 MHMcCollectionArea area;
19 area.Read("MHMcCollectionArea");
20 area.DrawClone();
21
22 //
23 // Read Migration Matrix
24 //
25 TFile* file4 = new TFile("files/EnergyParams.Keichi.Resized.root");
26 MHMcEnergyMigration migm;
27 migm.Read("MHMcEnergyMigration");
28
29 // -----------------------------------------------------------------------
30 //
31 // Calculate # Excess events vs. Energy and Theta
32 //
33 MHExcessEnergyTheta *hex = new MHExcessEnergyTheta;
34 hex->Calc(&hAlpha);
35 hex->Draw();
36
37 MHFlux* hFluxNUnf = new MHFlux;
38 hFluxNUnf->Calc(hex, &area, &hEffTime);
39 TH1D* fluxNUnf = hFluxNUnf->GetAverageFlux();
40
41 // -----------------------------------------------------------------------
42 //
43 // Unfold # Excess events vs. Energy and Theta
44 //
45
46 TH2D* tobeunfolded = hex->GetHist();
47 TH2D* unfolded = new TH2D(*tobeunfolded);
48
49 MUnfoldSpectrum munfs;
50 munfs.SetDistToUnfold(tobeunfolded);
51 munfs.SetMigrationMatrix(migm->GetHist());
52 munfs.SetPriorConstant();
53 //munfs.SetPriorInput(hpr);
54 munfs.SetUnfoldingMethod(2);
55 munfs.Calc();
56 unfolded=munfs.GetUnfDist();
57
58}
59
Note: See TracBrowser for help on using the repository browser.