Changeset 2124 for trunk/MagicSoft/Mars/macros/estfit.C
- Timestamp:
- 05/20/03 11:08:23 (21 years ago)
- File:
-
- 1 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;
Note:
See TracChangeset
for help on using the changeset viewer.