Changeset 2124
- Timestamp:
- 05/20/03 11:08:23 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/estfit.C
r1842 r2124 33 33 34 34 // -------------------------------------------------------------------------- 35 36 void estfit(Bool_t evalenergy=kFALSE) 35 // 36 // 0: fit impact parameter only 37 // 1: fit energy only 38 // 2: fit all parameters with respect to the energy resolution 39 // 40 void estfit(Int_t evalenergy=0) 37 41 { 38 42 // … … 48 52 eest.InitMapping(&matrix); 49 53 50 MReadTree read("Events", " ~/ct1/MC_ON2.root");54 MReadTree read("Events", "MC_ON2_short.root"); 51 55 read.DisableAutoScheme(); 52 56 … … 92 96 // 93 97 TArrayD fA(5); 94 fA[0] = -3907.74; //4916.4; //-2414.75;95 fA[1] = 1162.3; //149.549; // 1134.28;96 fA[2] = 199.351; //-558.209; // 132.932;97 fA[3] = 0.403192; //0.270725; //0.292845;98 fA[4] = 121.921; //107.001; // 107.001;99 100 98 TArrayD fB(7); 101 fB[0] = -100; 102 fB[1] = 10; 103 fB[2] = 0.1; 104 fB[3] = 10; 105 fB[4] = -1; 106 fB[5] = -0.1; 107 fB[6] = -0.1; 108 99 fA[0] = 392957; 100 fA[1] = 135; 101 fA[2] = -37449; 102 fA[3] = 0.3464; 103 fA[4] = 1; 104 fB[0] = 1; 105 fB[1] = 1; 106 fB[2] = 1; 107 fB[3] = 1; 108 fB[4] = 1; 109 fB[5] = 1; 110 fB[6] = 1; 111 /* 112 fA[0] = 6122.97; 113 fA[1] = 144.889; 114 fA[2] = -601.256; 115 fA[3] = 0.00171985; 116 fA[4] = 116.451; 117 fB[0] = -2368.21; 118 fB[1] = 1186.26; 119 fB[2] = 0.147235; 120 fB[3] = 144.49; 121 fB[4] = 42.7681; 122 fB[5] = -0.757817; 123 fB[6] = 0.182482; 124 */ 125 /* 126 TArrayD fA(5); 127 fA[0] = 6122.97; 128 fA[1] = 144.889; 129 fA[2] = -601.256; 130 fA[3] = 0.00171985; 131 fA[4] = 116.451; 132 133 TArrayD fB(7); 134 fB[0] = -10445.5; 135 fB[1] = 2172.05; 136 fB[2] = 0.69; 137 fB[3] = 491.2; 138 fB[4] = 4.71444; 139 fB[5] = -0.0331926; 140 fB[6] = -0.014833; 141 */ 109 142 // Set starting values and step sizes for parameters 110 143 for (Int_t i=0; i<fA.GetSize(); i++) … … 120 153 121 154 Bool_t rc = minuit.DefineParameter(i, name, vinit, step, limlo, limup); 122 if (evalenergy) 155 if (evalenergy==1) 156 { 123 157 minuit.FixParameter(i); 158 cout << "Fixed Parameter #" << i << endl; 159 } 124 160 125 161 if (!rc) … … 142 178 143 179 Bool_t rc = minuit.DefineParameter(i+fA.GetSize(), name, vinit, step, limlo, limup); 144 if (!evalenergy) 180 if (evalenergy==0) 181 { 145 182 minuit.FixParameter(i+fA.GetSize()); 183 cout << "Fixed Parameter #" << i+fA.GetSize() << endl; 184 } 146 185 147 186 if (!rc) … … 156 195 // 157 196 minuit.SetObjectFit(&evtloop); 197 198 cout << endl << "Fitting procedure running..." << endl; 158 199 159 200 TStopwatch clock; … … 164 205 Bool_t rc = minuit.Migrad(); 165 206 gLog.SetNullOutput(kFALSE); 166 167 207 if (rc) 168 208 { … … 176 216 cout << endl; 177 217 178 for (Int_t i=(evalenergy?fA.GetSize():0); i<(evalenergy?fA.GetSize()+fB.GetSize():fA.GetSize()); i++) 218 for (Int_t i=(evalenergy==1?fA.GetSize():0); i<(evalenergy>0?fA.GetSize()+fB.GetSize():fA.GetSize()); i++) 219 //for (Int_t i=0; i<fA.GetSize()+fB.GetSize(); i++) 179 220 { 180 221 Double_t val; … … 182 223 183 224 if (!minuit.GetParameter(i, val, er)) 184 {185 225 cout << "Error getting parameter #" << i << endl; 186 return;187 }188 226 189 227 cout << i << ": " << val << " +- " << er << endl; -
trunk/MagicSoft/Mars/macros/multidimdist2.C
r1629 r2124 66 66 // Here you give the trainings sample(s) for 67 67 // the gammas 68 // If you have only _one_ single Theta 69 // remove MMcEvt.fTheta! 68 70 // --------------------------------------------- 69 MReadMarsFile readg("Events", "star_gammas .root");71 MReadMarsFile readg("Events", "star_gammas0.root"); 70 72 readg.DisableAutoScheme(); 71 73 tlistg.AddToList(&readg); … … 95 97 // --- Create and set up the eventloop (gammas) --- 96 98 // 97 MEvtLoop evtloop ;98 evtloop .SetParList(&plist);99 MEvtLoop evtloop1; 100 evtloop1.SetParList(&plist); 99 101 100 102 // 101 103 // --- Execute matrix buildup (gammas) --- 102 104 // 103 if (!evtloop .Eventloop())105 if (!evtloop1.Eventloop()) 104 106 return; 105 107 … … 119 121 // the hadrons 120 122 // --------------------------------------------- 121 MReadMarsFile readh("Events", "star_protons .root");123 MReadMarsFile readh("Events", "star_protons0.root"); 122 124 readh.DisableAutoScheme(); 123 125 tlisth.AddToList(&readh); … … 135 137 // Create and set up the eventloop (protons) 136 138 // 137 MEvtLoop evtloop ;138 evtloop .SetParList(&plist);139 MEvtLoop evtloop2; 140 evtloop2.SetParList(&plist); 139 141 140 142 // 141 143 // Execute matrix buildup (hadrons) 142 144 // 143 if (!evtloop .Eventloop())145 if (!evtloop2.Eventloop()) 144 146 return; 145 147 146 148 // sum up in log 147 tlist g.PrintStatistics();149 tlisth.PrintStatistics(); 148 150 149 151 matrix.Print("size"); … … 165 167 // and one gamma file available 166 168 // ---------------------------------------------------- 167 MReadMarsFile read2("Events", "star_ protons.root");168 read2.AddFile("star_ gammas.root");169 MReadMarsFile read2("Events", "star_gammas0.root"); 170 read2.AddFile("star_protons0.root"); 169 171 read2.DisableAutoScheme(); 170 172 tlist2.AddToList(&read2); … … 190 192 // 191 193 MProgressBar bar; 192 MEvtLoop evtloop ;193 evtloop .SetProgressBar(&bar);194 evtloop .SetParList(&plist);195 196 if (!evtloop .Eventloop())194 MEvtLoop evtloop3; 195 evtloop3.SetProgressBar(&bar); 196 evtloop3.SetParList(&plist); 197 198 if (!evtloop3.Eventloop()) 197 199 return; 198 200 -
trunk/MagicSoft/Mars/macros/star.C
r2026 r2124 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 18 ! Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 220 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! … … 66 66 67 67 // ------------- user change ----------------- 68 read.AddFile("data/Gamma_z*.root"); 69 //read.AddFile("Gam*.root"); 68 read.AddFile("magictest/test/Gamma_z*.root"); 70 69 71 70 MMcPedestalCopy pcopy; … … 76 75 blind.SetUseInterpolation(); 77 76 77 MSigmabarCalc sgcal; 78 78 MImgCleanStd clean; 79 79 MHillasCalc hcalc; … … 81 81 82 82 // ------------- user change ----------------- 83 MWriteRootFile write("data/star_protons.root"); 83 MWriteRootFile write("starfile.root"); 84 write.AddContainer("MMcEvt", "Events"); 85 write.AddContainer("MSigmabar", "Events"); 84 86 write.AddContainer("MHillas", "Events"); 85 87 write.AddContainer("MHillasExt", "Events"); 88 write.AddContainer("MHillasSrc", "Events"); 86 89 write.AddContainer("MNewImagePar", "Events"); 87 write.AddContainer("MMcEvt", "Events");88 write.AddContainer("MHillasSrc", "Events");89 90 write.AddContainer("MRawRunHeader", "RunHeaders"); 90 91 write.AddContainer("MMcRunHeader", "RunHeaders"); … … 96 97 tlist.AddToList(&ncalc); 97 98 tlist.AddToList(&blind); 99 tlist.AddToList(&sgcal); 98 100 tlist.AddToList(&clean); 99 101 tlist.AddToList(&hcalc); -
trunk/MagicSoft/Mars/macros/status.C
r2065 r2124 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 18 ! Author(s): Thomas Bretz, 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2003 … … 61 61 plist.AddToList(&src); 62 62 63 // Use MHillasExt instead of MHillas64 MHillasExt hext;65 plist.AddToList(&hext);66 67 63 // 68 64 // The geometry container must be created by yourself to make sure … … 80 76 81 77 // ------------- user change ----------------- 82 read.AddFile("data/Pro*.root"); 83 read.AddFile("data/Gam*.root"); 78 read.AddFile("magictest/test/Gamma_z*.root"); 84 79 85 80 MMcPedestalCopy pcopy; … … 90 85 blind.SetUseInterpolation(); 91 86 87 MSigmabarCalc sgcal; 92 88 MImgCleanStd clean; 93 89 MHillasCalc hcalc; … … 97 93 // ------------------------------------------- 98 94 MFillH hfill1("MHHillas", "MHillas"); 99 MFillH hfill2("MHHillasExt [MHHillasExt]");100 MFillH hfill3("MHHillasExtSrc [MHHillasExt]" );95 MFillH hfill2("MHHillasExt"); 96 MFillH hfill3("MHHillasExtSrc [MHHillasExt]", "MHillasSrc"); 101 97 MFillH hfill4("MHHillasSrc","MHillasSrc"); 102 98 MFillH hfill4("MHNewImagePar","MNewImagePar"); … … 104 100 MFillH hfill6("MHCerPhotEvt", "MCerPhotEvt"); 105 101 MFillH hfill7("MHHadronness", "MHadronness"); 102 MFillH hfill8("MHSigmaTheta"); 106 103 107 104 tlist.AddToList(&read); 108 105 tlist.AddToList(&pcopy); 109 106 tlist.AddToList(&pnsb); 110 111 107 tlist.AddToList(&ncalc); 112 108 tlist.AddToList(&blind); 109 tlist.AddToList(&sgcal); 113 110 tlist.AddToList(&clean); 114 111 tlist.AddToList(&hcalc); 115 112 tlist.AddToList(&scalc); 116 113 tlist.AddToList(&calc1); 117 tlist.AddToList(&hfill7);118 114 tlist.AddToList(&hfill1); 119 115 tlist.AddToList(&hfill2); … … 122 118 tlist.AddToList(&hfill5); 123 119 tlist.AddToList(&hfill6); 120 tlist.AddToList(&hfill7); 121 tlist.AddToList(&hfill8); 124 122 125 123 MEvtLoop evtloop; … … 142 140 { 143 141 // Save data in a postscriptfile (status.ps) 144 //d->SaveAsPS();142 d->SaveAsPS(); 145 143 /* 146 144 * ----------- Write status to a root file ------------ -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2071 r2124 49 49 50 50 #pragma link C++ class MCT1SupercutsCalc+; 51 #pragma link C++ class MFiltercutsCalc+; 51 52 52 53 #endif -
trunk/MagicSoft/Mars/manalysis/Makefile
r2071 r2124 22 22 # connect the include files defined in the config.mk file 23 23 # 24 INCLUDES = -I. -I../mbase -I../mmc -I../mraw -I../mgeom \24 INCLUDES = -I. -I../mbase -I../mmc -I../mraw -I../mgeom -I../mfilter \ 25 25 -I../mdata -I../mhist -I../mgui -I../mimage -I../mhistmc 26 26 … … 57 57 MMcTriggerLvl2.cc \ 58 58 MMcTriggerLvl2Calc.cc \ 59 MCT1SupercutsCalc.cc 59 MCT1SupercutsCalc.cc \ 60 MFiltercutsCalc.cc 60 61 61 62 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.