Changeset 1463 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 07/31/02 18:03:51 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/MagicHillas.C
r1443 r1463 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz et al, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2002 21 21 ! 22 22 ! … … 24 24 25 25 26 void MagicHillas(const char *filename="~/data/ gamma*.root")26 void MagicHillas(const char *filename="~/data/Gamma*.root") 27 27 { 28 28 // 29 29 // This is a demonstration program which calculates the Hillas 30 // parameter out of a Magic root file. 30 // parameter out of a Magic root file (raw data file). 31 // 31 32 32 33 // … … 43 44 // of MHillas 44 45 // 45 //MHillasExt hext; 46 //plist.AddToList(&hext); 46 /* 47 MHillasExt hext; 48 plist.AddToList(&hext); 49 */ 47 50 48 51 // … … 54 57 55 58 // 56 // Setup binning for your histograms. 59 // Use this if you want to change the binning of one of 60 // the histograms 57 61 // 58 MBinning binswidth("BinningWidth"); 59 binswidth.SetEdges(100, 0, 1); // 100 bins from 0 to 1 deg 62 /* 63 MBinning binswidth("BinningWidth"); 64 binswidth.SetEdges(100, 0, 0.1); // 100 bins from 0 to 1 deg 65 plist.AddToList(&binswidth); 60 66 61 MBinning binslength("BinningLength"); 62 binslength.SetEdges(100, 0, 1); // 100 bins from 0 to 1 deg 67 MBinning binslength("BinningLength"); 68 binslength.SetEdges(100, 0, 1); // 100 bins from 0 to 1 deg 69 plist.AddToList(&binslength); 63 70 64 MBinning binsalpha("BinningAlpha"); 65 binsalpha.SetEdges(90, 0, 90); // 90 bins from 0 to 90 deg 71 MBinning binsdist("BinningDist"); 72 binsdist.SetEdges(100, 0, 1.5); // 100 bins from 0 to 1 deg 73 plist.AddToList(&binsdist); 66 74 67 MBinning binsdist("BinningDist"); 68 binsdist.SetEdges(100, 0, 2); // 100 bins from 0 to 2 deg 75 MBinning binsht("BinningHeadTail"); 76 binsht.SetEdges(100, -1.5, 1.5); // 100 bins from 0 to 1 deg 77 plist.AddToList(&binsht); 69 78 70 plist.AddToList(&binswidth); 71 plist.AddToList(&binslength); 72 plist.AddToList(&binsalpha); 73 plist.AddToList(&binsdist); 79 MBinning binsalpha("BinningAlpha"); 80 binsalpha.SetEdges(90, 0, 90); // 90 bins from 0 to 90 deg 81 plist.AddToList(&binsalpha); 82 83 MBinning binscam("BinningCamera"); 84 binscam.SetEdges(50, -1.5, 1.5); // 20 bins from -2 to 2 deg 85 plist.AddToList(&binscam); 86 */ 74 87 75 88 // … … 101 114 MMcPedestalCopy pcopy; 102 115 MMcPedestalNSBAdd pnsb; 116 103 117 MCerPhotCalc ncalc; 104 105 // Alternative photon calculation: 106 // MCerPhotCalc2 ncalc; 107 // Example: use only 2nd to 6th FADC slices for photon calculation: 108 // const Float_t x[15]={0., 1., 1., 1., 1., 1., 0.,0.,0.,0.,0.,0.,0.,0.,0.}; 109 // TArrayF w(15,x); 110 // ncalc.SetWeights(w); 118 // 119 // Alternative photon calculation: 120 // Example: use only 2nd to 6th FADC slices for photon calculation: 121 // 122 // MCerPhotCalc2 ncalc; 123 // const Float_t x[15]={0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 124 // TArrayF w(15,x); 125 // ncalc.SetWeights(w); 126 // 111 127 112 128 MImgCleanStd clean; … … 121 137 MFillH hfill2a("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc"); 122 138 139 MWriteRootFile write("hillas.root"); 140 write.AddContainer("MHillas", "Hillas"); 141 write.AddContainer("HillasSource", "Hillas"); 142 write.AddContainer("HillasAntiSrc", "Hillas"); 143 write.AddContainer("MHStarMap"); 144 write.AddContainer("MMcEvt","Hillas"); 145 123 146 /* 124 MWriteRootFile write("hillas.root");125 write.AddContainer("MHillas", "Hillas");126 write.AddContainer("HillasSource", "Hillas");127 write.AddContainer("HillasAntiSrc", "Hillas");128 write.AddContainer("MMcEvt", "Hillas");129 write.AddContainer("MHStarMap");130 131 147 MWriteAsciiFile write("hillas.txt"); 132 148 write.AddColumn("MHillas.fLength*MGeomCam.fConvMm2Deg"); … … 143 159 tlist.AddToList(&hcalc); 144 160 tlist.AddToList(&csrc1); 161 145 162 tlist.AddToList(&csrc2); 146 163 tlist.AddToList(&hfill); … … 148 165 tlist.AddToList(&hfill2s); 149 166 tlist.AddToList(&hfill2a); 167 tlist.AddToList(&write); 150 168 151 169 // … … 165 183 // 166 184 // After the analysis is finished we can display the histograms 167 185 // 186 plist.FindObject("HistSource")->DrawClone(); 168 187 plist.FindObject("MHHillas")->DrawClone(); 169 plist.FindObject("HistSource")->DrawClone();170 188 plist.FindObject("HistAntiSrc")->DrawClone(); 171 189 plist.FindObject("MHStarMap")->DrawClone(); 172 190 } 191
Note:
See TracChangeset
for help on using the changeset viewer.