Changeset 1844
- Timestamp:
- 03/19/03 16:59:38 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1841 r1844 37 37 * mtools/Makefile, mtools/ToolsLinkDef.h: 38 38 - added MChisqEval 39 40 * manalysis/MEnergyEstParam.[h,cc]: 41 - slight changes 39 42 40 43 -
trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.cc
r1525 r1844 52 52 void MEnergyEstParam::InitCoefficients() 53 53 { 54 fA[0] = 39.667402; // [cm] 55 fA[1] = 143.081912; // [cm] 56 fA[2] = -395.501677; // [cm] 57 fA[3] = 0.006193; 58 59 fB[0] = 45.037867; // [GeV] 60 fB[1] = 0.087222; // [GeV] 61 fB[2] = -0.208065; // [GeV/cm] 62 fB[3] = 78.164942; // [GeV] 63 fB[4] = -159.361283; // [GeV] 64 fB[5] = -0.130455; // [GeV/cm] 65 fB[6] = 0.051139; 54 fA.Set(5); 55 fA[0] = -2539; // [cm] 56 fA[1] = 900; // [cm] 57 fA[2] = 17.5; // [cm] 58 fA[3] = 0.006; 59 fA[4] = 58.3; 60 /* 61 fA[0] = 39.667402; // [cm] 62 fA[1] = 143.081912; // [cm] 63 fA[2] = -395.501677; // [cm] 64 fA[3] = 0.006193; 65 fA[4] = 0; 66 */ 67 68 fB.Set(7); 69 fB[0] = -8.69; // [GeV] 70 fB[1] = -0.069; // [GeV] 71 fB[2] = 0.000655; // [GeV] 72 fB[3] = 0.0326; // [GeV] 73 fB[4] = 0.000225; // [GeV] 74 fB[5] = 4.13e-8; // [GeV] 75 fB[6] = 0.05; 76 /* 77 fB[0] = 45.037867; // [GeV] 78 fB[1] = 0.087222; // [GeV] 79 fB[2] = -0.208065; // [GeV/cm] 80 fB[3] = 78.164942; // [GeV] 81 fB[4] = -159.361283; // [GeV] 82 fB[5] = -0.130455; // [GeV/cm] 83 fB[6] = 0.051139; 84 */ 66 85 } 67 86 … … 73 92 // 74 93 MEnergyEstParam::MEnergyEstParam(const char *hillas, const char *name, const char *title) 75 : fMatrix(NULL) , fA(4), fB(7)94 : fMatrix(NULL) 76 95 { 77 96 fName = name ? name : "MEnergyEstParam"; … … 88 107 InitCoefficients(); 89 108 90 AddToBranchList("MMcEvt.fT heta");91 AddToBranchList(fHillasName+" fSize");92 AddToBranchList(fHillasName+" fWidth");93 AddToBranchList(fHillasName+" fLength");109 AddToBranchList("MMcEvt.fTelescopeTheta"); 110 AddToBranchList(fHillasName+".fSize"); 111 AddToBranchList(fHillasName+".fWidth"); 112 AddToBranchList(fHillasName+".fLength"); 94 113 } 95 114 … … 159 178 // 160 179 // Set the four coefficients for the estimation of the impact parameter. 161 // Argument must ba a TArrayD of size 4.162 // 163 void MEnergyEstParam::SetCoeffA( TArrayDarr)180 // Argument must ba a TArrayD of size 5. 181 // 182 void MEnergyEstParam::SetCoeffA(const TArrayD &arr) 164 183 { 165 184 if (arr.GetSize() != fA.GetSize()) … … 177 196 // Argument must ba a TArrayD of size 7. 178 197 // 179 void MEnergyEstParam::SetCoeffB( TArrayDarr)198 void MEnergyEstParam::SetCoeffB(const TArrayD &arr) 180 199 { 181 200 if (arr.GetSize() != fB.GetSize()) … … 186 205 187 206 fB = arr; 207 } 208 209 // -------------------------------------------------------------------------- 210 // 211 // Set the four coefficients for the estimation of impact and energy. 212 // Argument must ba a TArrayD of size 12. 213 // 214 void MEnergyEstParam::SetCoeff(const TArrayD &arr) 215 { 216 if (arr.GetSize() != fA.GetSize()+fB.GetSize()) 217 { 218 *fLog << err << dbginf << "Error - Wrong number of coefficients!" << endl; 219 return; 220 } 221 222 fA = TArrayD(fA.GetSize(), arr.GetArray()); 223 fB = TArrayD(fB.GetSize(), arr.GetArray() + fA.GetSize()); 188 224 } 189 225 … … 213 249 fMatrix = mat; 214 250 215 fMap[0] = fMatrix->AddColumn("MMcEvt.fT heta");251 fMap[0] = fMatrix->AddColumn("MMcEvt.fTelescopeTheta"); 216 252 fMap[1] = fMatrix->AddColumn(fHillasName+".fWidth"); 217 253 fMap[2] = fMatrix->AddColumn(fHillasName+".fLength"); … … 245 281 Bool_t MEnergyEstParam::Process() 246 282 { 247 const Double_t theta = fMatrix ? GetVal(0) : fMc->GetT heta();283 const Double_t theta = fMatrix ? GetVal(0) : fMc->GetTelescopeTheta(); 248 284 const Double_t width = fMatrix ? GetVal(1) : fHillas->GetWidth(); 249 285 const Double_t length = fMatrix ? GetVal(2) : fHillas->GetLength(); 250 286 const Double_t size = fMatrix ? GetVal(3) : fHillas->GetSize(); 251 287 252 const Double_t k = 1 /cos(theta);288 const Double_t k = 1./cos(theta); 253 289 const Double_t k2 = k*k; 254 290 255 const Double_t i0 = k * ( 1+fA[3]*k)/(1+fA[3]);291 const Double_t i0 = k * (fA[3]*k+1)/(fA[3]+1); 256 292 const Double_t i1 = fA[0] + fA[2]*width; 257 293 258 const Double_t e0 = k2 * (1+fB[6]*k2)/(1+fB[6]); 259 const Double_t e1 = fB[0] + fB[1]*size + fB[3]*length + fB[4]*size*length; 260 const Double_t e2 = fB[2] + fB[5]*length; 294 const Double_t e0 = k2 * (fB[6]*k2+1)/(fB[6]+1); 295 296 /* MY PARAM */ 297 const Double_t e1 = fB[0] + fB[1]*size + fB[3]*length + fB[4]*size*width; 298 const Double_t e2 = fB[2] + fB[5]*size*width; 299 300 /* MARCOS */ 301 //const Double_t e1 = fB[0] + fB[1]*size + fB[3]*length + fB[4]*size*length; 302 //const Double_t e2 = fB[2] + fB[5]*length; 261 303 262 304 TIter NextH(fHillasSrc); … … 273 315 const Double_t dist = fMatrix ? GetVal(col++) : ((MHillasSrc*)NextH())->GetDist(); 274 316 275 const Double_t ir = i0 * (i1 + fA[1]*dist); // [cm] 276 const Double_t er = -e0 * (e1 + e2*ir); // [GeV] 317 318 /* MARCOS */ 319 //const Double_t ir = i0 * (i1 + fA[1]*dist); // [cm] 320 /*const*/// Double_t er = e0 * (e1 + e2*ir); // [GeV] 321 322 /* MY PARAM */ 323 // if (width==0) return kCONTINUE; 324 const Double_t ir = i0 * (i1 + dist*(fA[1]/width + fA[4]/log10(size))); // [cm] 325 Double_t er = e0 * (e1 + e2*ir); // [GeV] 326 327 /* MKA */ 328 //Double_t er = e0 * (fB[0] + fB[1]*size/width + fB[2]*ir /*+ d*leakage*/); 329 330 if (width==0) 331 return kCONTINUE; 332 333 if (TMath::IsNaN(ir)) 334 *fLog << all << theta << " " << width << " " << length << " " << size << " " << dist << endl; 335 if (TMath::IsNaN(er)) 336 { 337 *fLog << all << theta << " " << width << " " << length << " " << size << " " << dist << endl; 338 er = 0; 339 } 277 340 278 341 est->SetEnergy(er); 279 342 est->SetImpact(ir); 343 est->SetReadyToSave(); 280 344 } 281 345 -
trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.h
r1525 r1844 41 41 42 42 public: 43 MEnergyEstParam(const char *hil=" MHillas", const char *name=NULL, const char *title=NULL);43 MEnergyEstParam(const char *hil="Hillas", const char *name=NULL, const char *title=NULL); 44 44 ~MEnergyEstParam(); 45 45 … … 47 47 Bool_t Process(); 48 48 49 void Add(const TString hillas, const TString energy );49 void Add(const TString hillas, const TString energy="MEnergyEst"); 50 50 51 51 void InitMapping(MHMatrix *mat); 52 52 53 void SetCoeffA(TArrayD arr); 54 void SetCoeffB(TArrayD arr); 53 Int_t GetNumCoeff() const { return fA.GetSize()+fB.GetSize(); } 54 55 void SetCoeff(const TArrayD &arr); 56 void SetCoeffA(const TArrayD &arr); 57 void SetCoeffB(const TArrayD &arr); 55 58 56 59 ClassDef(MEnergyEstParam, 0) // Task to estimate the energy
Note:
See TracChangeset
for help on using the changeset viewer.