Changeset 5210
- Timestamp:
- 10/08/04 10:48:10 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mmuon
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc
r5173 r5210 16 16 ! 17 17 ! 18 ! Author(s): Keiichi Mase 09/2004 <mailto:mase@mppmu.mpg.de>19 ! Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>18 ! Author(s): Keiichi Mase 10/2004 <mailto:mase@mppmu.mpg.de> 19 ! Markus Meyer 10/2004 <mailto:meyer@astro.uni-wuerzburg.de> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 72 72 fTitle = title ? title : "Muon calibration parameters"; 73 73 74 fHistPhi.SetName("HistPhi"); 75 fHistPhi.SetTitle("HistPhi"); 76 fHistPhi.SetXTitle("phi [deg.]"); 77 fHistPhi.SetYTitle("sum of ADC"); 78 fHistPhi.SetDirectory(NULL); 79 fHistPhi.SetFillStyle(4000); 80 fHistPhi.UseCurrentStyle(); 81 82 fHistWid.SetName("HistWid"); 83 fHistWid.SetTitle("HistWid"); 84 fHistWid.SetXTitle("distance from the ring center [deg.]"); 85 fHistWid.SetYTitle("sum of ADC"); 86 fHistWid.SetDirectory(NULL); 87 fHistWid.SetFillStyle(4000); 88 fHistWid.UseCurrentStyle(); 89 90 fKeepHist = kFALSE; // normally histgram is not kept 74 fHistPhi = new TH1F; 75 fHistWidth = new TH1F; 76 77 fHistPhi->SetName("HistPhi"); 78 fHistPhi->SetTitle("HistPhi"); 79 fHistPhi->SetXTitle("phi [deg.]"); 80 fHistPhi->SetYTitle("sum of ADC"); 81 fHistPhi->SetDirectory(NULL); 82 fHistPhi->SetFillStyle(4000); 83 fHistPhi->UseCurrentStyle(); 84 85 fHistWidth->SetName("HistWidth"); 86 fHistWidth->SetTitle("HistWidth"); 87 fHistWidth->SetXTitle("distance from the ring center [deg.]"); 88 fHistWidth->SetYTitle("sum of ADC"); 89 fHistWidth->SetDirectory(NULL); 90 fHistWidth->SetFillStyle(4000); 91 fHistWidth->UseCurrentStyle(); 92 91 93 fEnableImpactCalc = kFALSE; // By default the calculation of impact parameter is skipped. 92 94 fDisablePreCuts = kFALSE; // By default the pre cuts will be applied. 93 fUseCleanForWid = kFALSE;// By default all the pixels will be used for the histogram of arc width.95 fUseCleanForWidth = kFALSE; // By default all the pixels will be used for the histogram of arc width. 94 96 95 97 fMargin = 60.; // in mm 96 98 fArcPhiThres = 100.; 97 fArcWid Thres = 100.;99 fArcWidthThres = 100.; 98 100 fArcPhiBinNum = 20; 99 101 fArcPhiHistStartVal = -180.; // deg. 100 102 fArcPhiHistEndVal = 180.; // deg. 101 fArcWidBinNum = 28; 102 fArcWidHistStartVal = 0.3; // deg. 103 fArcWidHistEndVal = 1.7; // deg. 103 fArcWidthBinNum = 28; 104 fArcWidthHistStartVal = 0.3; // deg. 105 fArcWidthHistEndVal = 1.7; // deg. 106 } 107 108 // -------------------------------------------------------------------------- 109 // 110 MMuonCalibPar::~MMuonCalibPar() 111 { 112 delete fHistPhi; 113 delete fHistWidth; 104 114 } 105 115 … … 108 118 void MMuonCalibPar::Reset() 109 119 { 110 fArcLen 120 fArcLength = -1.; 111 121 fArcPhi = 0.; 112 fArcWid 122 fArcWidth = -1.; 113 123 fChiArcPhi = -1.; 114 fChiArcWid 124 fChiArcWidth = -1.; 115 125 fMuonSize = 0.; 116 126 fEstImpact = -1.; … … 122 132 // 123 133 // This function fill the histograms in order to get muon parameters. 124 // For the evaluation of the Arc Width, we use only the signals in the inner part.125 // You can use the image after the cleaning by using the function of UseCleanForWid().126 // See the manual of MMuonCalibParCalc.134 // For the evaluation of the Arc Width, we use only the signals in the inner 135 // part. You can use the image after the cleaning by using the function of 136 // UseCleanForWidth(). See the manual of MMuonCalibParCalc. 127 137 // 128 138 void MMuonCalibPar::FillHist … … 133 143 MBinning binsphi; 134 144 binsphi.SetEdges(fArcPhiBinNum, fArcPhiHistStartVal, fArcPhiHistEndVal); 135 binsphi.Apply( fHistPhi);145 binsphi.Apply(*fHistPhi); 136 146 137 147 MBinning binswid; 138 binswid.SetEdges(fArcWid BinNum, fArcWidHistStartVal, fArcWidHistEndVal);139 binswid.Apply( fHistWid);148 binswid.SetEdges(fArcWidthBinNum, fArcWidthHistStartVal, fArcWidthHistEndVal); 149 binswid.Apply(*fHistWidth); 140 150 141 151 const Int_t entries = evt.GetNumPixels(); 142 152 143 153 // the position of the center of a muon ring 144 const Float_t cenx = musearch.GetCen X();145 const Float_t ceny = musearch.GetCen Y();154 const Float_t cenx = musearch.GetCenterX(); 155 const Float_t ceny = musearch.GetCenterY(); 146 156 147 157 for (Int_t i=0; i<entries; i++ ) … … 161 171 162 172 // if the signal is not near the estimated circle, it is ignored. 163 if(dist < musearch.GetRad () + fMargin && dist > musearch.GetRad() - fMargin)173 if(dist < musearch.GetRadius() + fMargin && dist > musearch.GetRadius() - fMargin) 164 174 { 165 175 // check whether ummapped pixel is used or not. … … 170 180 continue; 171 181 } 172 fHistPhi .Fill(ang*kRad2Deg, pix.GetNumPhotons());182 fHistPhi->Fill(ang*kRad2Deg, pix.GetNumPhotons()); 173 183 fMuonSize += pix.GetNumPhotons(); 174 184 } … … 177 187 continue; // use only the inner pixles 178 188 179 if(fUseCleanForWid )189 if(fUseCleanForWidth) 180 190 { 181 191 if(!pix.IsPixelUsed()) … … 183 193 } 184 194 185 fHistWid .Fill(dist*geom.GetConvMm2Deg(), pix.GetNumPhotons());195 fHistWidth->Fill(dist*geom.GetConvMm2Deg(), pix.GetNumPhotons()); 186 196 } 187 197 … … 191 201 // once convert the signal from ADC to photo-electron. Then we can get 192 202 // the fluctuation such as F-factor*sqrt(phe). 193 // Up to now, the error of pedestal is not taken into accout. This is not of194 // course correct. We will include this soon.203 // Up to now, the error of pedestal is not taken into accout. This is not 204 // of course correct. We will include this soon. 195 205 Double_t ADC2PhEl = 0.14; 196 206 Double_t Ffactor = 1.4; 197 207 for(Int_t i=0; i<fArcPhiBinNum+1; i++) 198 208 { 199 Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistPhi .GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;200 { 201 fHistPhi .SetBinError(i, rougherr);209 Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistPhi->GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor; 210 { 211 fHistPhi->SetBinError(i, rougherr); 202 212 } 203 213 } 204 for(Int_t i=0; i<fArcWid BinNum+1; i++)214 for(Int_t i=0; i<fArcWidthBinNum+1; i++) 205 215 { 206 Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistWid .GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;207 { 208 fHistWid .SetBinError(i, rougherr);216 Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistWidth->GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor; 217 { 218 fHistWidth->SetBinError(i, rougherr); 209 219 } 210 220 } … … 226 236 Float_t maxval = 0.; 227 237 Int_t maxbin = 0; 228 maxval = fHistPhi .GetMaximum();229 maxbin = fHistPhi .GetMaximumBin();238 maxval = fHistPhi->GetMaximum(); 239 maxbin = fHistPhi->GetMaximumBin(); 230 240 fPeakPhi = 180.-(Float_t)(maxbin-1)*convbin2val; 231 241 TArrayD tmp; … … 233 243 for(Int_t i=1; i<fArcPhiBinNum+1; i++) 234 244 { 235 tmp[i] = fHistPhi .GetBinContent(i);245 tmp[i] = fHistPhi->GetBinContent(i); 236 246 } 237 247 for(Int_t i=1; i<fArcPhiBinNum+1; i++) … … 247 257 id+=(fArcPhiBinNum); 248 258 } 249 fHistPhi .SetBinContent(i,tmp[id]);259 fHistPhi->SetBinContent(i,tmp[id]); 250 260 } 251 261 maxbin = (Int_t)((Float_t)fArcPhiBinNum/2.)+1; … … 260 270 for(Int_t i=1; i<fArcPhiBinNum+1; i++) 261 271 { 262 Float_t content = fHistPhi .GetBinContent(i);263 Float_t content_pre = fHistPhi .GetBinContent(i-1);272 Float_t content = fHistPhi->GetBinContent(i); 273 Float_t content_pre = fHistPhi->GetBinContent(i-1); 264 274 265 275 if(content > fArcPhiThres && content_pre < fArcPhiThres) … … 281 291 282 292 fArcPhi = effbinnum*convbin2val; 283 fArcLen = fArcPhi*3.1415926/180.*musearch.GetRad()*geom.GetConvMm2Deg();293 fArcLength = fArcPhi*3.1415926/180.*musearch.GetRadius()*geom.GetConvMm2Deg(); 284 294 285 295 if(fEnableImpactCalc) … … 310 320 // impact parameter inside mirror radius (8.5m) 311 321 TString func1; 312 Float_t tmpval = musearch.GetRad ()*geom.GetConvMm2Deg()*3.1415926/180.;322 Float_t tmpval = musearch.GetRadius()*geom.GetConvMm2Deg()*3.1415926/180.; 313 323 tmpval = sin(2.*tmpval)*8.5; 314 324 func1 += "[0]*"; … … 321 331 f1.SetParLimits(2,-180.,180.); 322 332 323 if(fKeepHist) 324 { 325 fHistPhi.Fit("f1","RQEM"); 326 } 327 else 328 { 329 fHistPhi.Fit("f1","RQEM0"); 330 } 333 fHistPhi->Fit("f1","RQEM"); 331 334 332 335 Float_t chi1 = -1; … … 340 343 // impact parameter beyond mirror area (8.5m) 341 344 TString func2; 342 Float_t tmpval2 = musearch.GetRad ()*geom.GetConvMm2Deg()*3.1415926/180.;345 Float_t tmpval2 = musearch.GetRadius()*geom.GetConvMm2Deg()*3.1415926/180.; 343 346 tmpval2 = sin(2.*tmpval2)*8.5*2.; 344 347 func2 += "[0]*"; … … 351 354 f2.SetParLimits(2,-180.,180.); 352 355 353 if(fKeepHist) 354 { 355 fHistPhi.Fit("f2","RQEM+"); 356 } 357 else 358 { 359 fHistPhi.Fit("f2","RQEM0+"); 360 } 356 fHistPhi->Fit("f2","RQEM+"); 361 357 362 358 if(effbinnum>3) … … 388 384 // can represent to the PSF of our reflector. 389 385 // 390 Float_t MMuonCalibPar::CalcWid 386 Float_t MMuonCalibPar::CalcWidth 391 387 (const MGeomCam &geom, const MCerPhotEvt &evt, 392 388 const MMuonSearchPar &musearch) 393 389 { 394 Float_t convbin2val = (fArcWid HistEndVal - fArcWidHistStartVal)395 /(Float_t)fArcWid BinNum;390 Float_t convbin2val = (fArcWidthHistEndVal - fArcWidthHistStartVal) 391 /(Float_t)fArcWidthBinNum; 396 392 397 393 // determination of fitting region 398 Int_t maxbin = fHistWid .GetMaximumBin();394 Int_t maxbin = fHistWidth->GetMaximumBin(); 399 395 Float_t startfitval = 0.; 400 396 Float_t endfitval = 0.; 401 397 Bool_t IsInMaxim = kFALSE; 402 398 Int_t effbinnum = 0; 403 for(Int_t i=1; i<fArcWid BinNum+1; i++)399 for(Int_t i=1; i<fArcWidthBinNum+1; i++) 404 400 { 405 Float_t content = fHistWid .GetBinContent(i);406 Float_t content_pre = fHistWid .GetBinContent(i-1);407 408 if(content > fArcWid Thres)401 Float_t content = fHistWidth->GetBinContent(i); 402 Float_t content_pre = fHistWidth->GetBinContent(i-1); 403 404 if(content > fArcWidthThres) 409 405 effbinnum++; 410 406 411 if(content > fArcWid Thres && content_pre < fArcWidThres)407 if(content > fArcWidthThres && content_pre < fArcWidthThres) 412 408 { 413 startfitval = (Float_t)(i-4)*convbin2val + fArcWid HistStartVal;409 startfitval = (Float_t)(i-4)*convbin2val + fArcWidthHistStartVal; 414 410 if(startfitval<0.) startfitval = 0.; 415 411 } … … 417 413 IsInMaxim = kTRUE; 418 414 419 if(content < fArcWid Thres && IsInMaxim == kTRUE)415 if(content < fArcWidthThres && IsInMaxim == kTRUE) 420 416 { 421 endfitval = (Float_t)(i+2)*convbin2val + fArcWid HistStartVal;417 endfitval = (Float_t)(i+2)*convbin2val + fArcWidthHistStartVal; 422 418 if(endfitval>180.) endfitval = 180.; 423 419 break; 424 420 } 425 endfitval = fArcWid HistEndVal;421 endfitval = fArcWidthHistEndVal; 426 422 } 427 423 effbinnum = (Int_t)((endfitval-startfitval)/convbin2val); … … 429 425 TF1 f1("f1","gaus",startfitval,endfitval); 430 426 431 if(fKeepHist) 432 { 433 fHistWid.Fit("f1","QR","",startfitval,endfitval); 434 } 435 else 436 { 437 fHistWid.Fit("f1","QR0","",startfitval,endfitval); 438 } 427 fHistWidth->Fit("f1","QR","",startfitval,endfitval); 439 428 440 429 if(effbinnum>3) 441 fChiArcWid = f1.GetChisquare()/((Float_t)(effbinnum-3));430 fChiArcWidth = f1.GetChisquare()/((Float_t)(effbinnum-3)); 442 431 443 432 Double_t val,err; … … 453 442 Int_t MMuonCalibPar::Calc 454 443 (const MGeomCam &geom, const MCerPhotEvt &evt, 455 const MMuonSearchPar &musearch)444 MMuonSearchPar &musearch, const Float_t *cuts) 456 445 { 457 446 // sanity check … … 459 448 return kCONTINUE; 460 449 461 // if an event does not seem to be like muon, itwill be skipped.450 // If an event does not seem to be like muon, the calculation will be skipped. 462 451 if(musearch.IsNoMuon()) 463 452 return kCONTINUE; … … 466 455 if(!fDisablePreCuts) 467 456 { 468 if(musearch.GetRad() < 180. || musearch.GetRad() > 400.) 469 return kCONTINUE; 470 if(musearch.GetDev() > 50.) 471 return kCONTINUE; 457 if(musearch.GetRadius() < cuts[0] || musearch.GetRadius() > cuts[1]) 458 { 459 musearch.SetNoMuon(); 460 return kCONTINUE; 461 } 462 if(musearch.GetDeviation() > cuts[2]) 463 { 464 musearch.SetNoMuon(); 465 return kCONTINUE; 466 } 472 467 } 473 468 … … 481 476 if(!fDisablePreCuts) 482 477 { 483 if(fMuonSize < 2000. || fArcPhi < 150.) 484 return kCONTINUE; 485 } 486 487 fArcWid = CalcWid(geom,evt,musearch); 488 489 // Pre Cuts 3 490 if(!fDisablePreCuts) 491 { 492 if(fArcWid < 0.16) 493 return kCONTINUE; 494 } 495 478 if(fMuonSize < cuts[3] || fArcPhi < cuts[4]) 479 { 480 musearch.SetNoMuon(); 481 return kCONTINUE; 482 } 483 } 484 485 fArcWidth = CalcWidth(geom,evt,musearch); 486 496 487 SetReadyToSave(); 497 498 if(!fKeepHist){499 fHistPhi.Reset();500 fHistWid.Reset();501 }502 488 503 489 return kTRUE; … … 508 494 *fLog << all; 509 495 *fLog << "Muon Parameters (" << GetName() << ")" << endl; 510 *fLog << " - Arc Len . [deg.] = " << fArcLen<< endl;511 *fLog << " - Arc Phi [deg.] = " << fArcPhi << endl;512 *fLog << " - Arc Wid . [deg.] = " << fArcWid<< endl;513 *fLog << " - Chi Arc Phi [x2/ndf]= " << fChiArcPhi << endl;514 *fLog << " - Chi Arc Wid [x2/ndf]= " << fChiArcWid<< endl;515 *fLog << " - Est. I. P. [m] = " << fEstImpact << endl;516 *fLog << " - Size of muon = " << fMuonSize << endl;517 *fLog << " - Peak Phi [deg.] = " << fPeakPhi << endl;518 *fLog << " - UseUnmap = " << fUseUnmap << endl;519 } 520 521 522 523 496 *fLog << " - Arc Length [deg.] = " << fArcLength << endl; 497 *fLog << " - Arc Phi [deg.] = " << fArcPhi << endl; 498 *fLog << " - Arc Width [deg.] = " << fArcWidth << endl; 499 *fLog << " - Chi Arc Phi [x2/ndf]= " << fChiArcPhi << endl; 500 *fLog << " - Chi Arc Width [x2/ndf]= " << fChiArcWidth << endl; 501 *fLog << " - Est. I. P. [m] = " << fEstImpact << endl; 502 *fLog << " - Size of muon = " << fMuonSize << endl; 503 *fLog << " - Peak Phi [deg.] = " << fPeakPhi << endl; 504 *fLog << " - UseUnmap = " << fUseUnmap << endl; 505 } 506 507 508 509 -
trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.h
r5173 r5210 17 17 { 18 18 private: 19 Float_t fArcLen; // An arc length of a muon along the arc [deg.] 20 Float_t fArcPhi; // A opening angle of a muon arc [deg.] 21 Float_t fArcWid; // A width of a muon [deg.] (1 sigma of gaussian fit) 22 Float_t fChiArcPhi; // A chisquare value of the cosine fit for arc phi 23 Float_t fChiArcWid; // A chisquare value of the cosine fit for arc wid 24 Float_t fMuonSize; // A SIZE of muon which is defined as a SIZE around the estimated circle 25 Float_t fEstImpact; // An estimated impact parameter from the photon distribution along the arc image 26 Bool_t fKeepHist; // A flag to keep histgram 27 Float_t fMargin; // margin to evaluate muons [mm]. The defaut value is 60 mm, corresponding to 0.2 deg. This value can be changed by using the function of SetMargin 28 Bool_t fUseUnmap; // This is a flag to know the Unmapped pixels are used. Refer to the class of MImgCleanStd 29 Float_t fPeakPhi; // The angle which indicates the peak position in the estimated circle 30 Float_t fArcPhiThres; // The threshold value to define arc phi 31 Float_t fArcWidThres; // The threshold value to define arc width 32 Int_t fArcPhiBinNum; // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH. 33 Int_t fArcWidBinNum; // The bin number for the histogram of arc wid 34 Float_t fArcPhiHistStartVal; // The starting value for the histogram of arc phi 35 Float_t fArcPhiHistEndVal; // The end value for the histogram of arc phi 36 Float_t fArcWidHistStartVal; // The starting value for the histogram of arc width 37 Float_t fArcWidHistEndVal; // The end value for the histogram of arc width 38 Float_t fEnableImpactCalc; // If true, the impact calculation will be done, which will consume a lot of time. 39 Float_t fDisablePreCuts; // If true, the pre cuts to select muons for the calibration will be disabled. 40 Float_t fUseCleanForWid; // If true, the only signal after image cleaningwill be used for the histogram of arc width 19 Float_t fArcLength; // An arc length of a muon along the arc [deg.] 20 Float_t fArcPhi; // A opening angle of a muon arc [deg.] 21 Float_t fArcWidth; // A width of a muon [deg.] (1 sigma of gaussian fit) 22 Float_t fChiArcPhi; // A chisquare value of the cosine fit for arc phi 23 Float_t fChiArcWidth; // A chisquare value of the cosine fit for arc wid 24 Float_t fMuonSize; // A SIZE of muon which is defined as a SIZE around the estimated circle 25 Float_t fEstImpact; // An estimated impact parameter from the photon distribution along the arc image 26 Float_t fMargin; // margin to evaluate muons [mm]. The defaut value is 60 mm, corresponding to 0.2 deg. This value can be changed by using the function of SetMargin 27 Bool_t fUseUnmap; // This is a flag to know the Unmapped pixels are used. Refer to the class of MImgCleanStd 28 Float_t fPeakPhi; // The angle which indicates the peak position in the estimated circle 29 Float_t fArcPhiThres; // The threshold value to define arc phi 30 Float_t fArcWidthThres; // The threshold value to define arc width 31 Int_t fArcPhiBinNum; // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH. 32 Int_t fArcWidthBinNum; // The bin number for the histogram of arc wid 33 Float_t fArcPhiHistStartVal; // The starting value for the histogram of arc phi 34 Float_t fArcPhiHistEndVal; // The end value for the histogram of arc phi 35 Float_t fArcWidthHistStartVal; // The starting value for the histogram of arc width 36 Float_t fArcWidthHistEndVal; // The end value for the histogram of arc width 37 Bool_t fEnableImpactCalc; // If true, the impact calculation will be done, which will consume a lot of time. 38 Bool_t fDisablePreCuts; // If true, the pre cuts to select muons for the calibration will be disabled. 39 Bool_t fUseCleanForWidth; // If true, the only signal after image cleaningwill be used for the histogram of arc width 41 40 42 TH1F fHistPhi; // Histogram of photon distribution along the arc.43 TH1F fHistWid;// Histogram of radial photon distribution of the arc.41 TH1F *fHistPhi; // Histogram of photon distribution along the arc. 42 TH1F *fHistWidth; // Histogram of radial photon distribution of the arc. 44 43 45 44 public: 46 45 MMuonCalibPar(const char *name=NULL, const char *title=NULL); 46 ~MMuonCalibPar(); 47 47 48 48 void Reset(); 49 49 50 Float_t GetArcLen () const { return fArcLen; }51 Float_t GetArcPhi() const { return fArcPhi; }52 Float_t GetArcWid () const { return fArcWid; }53 Float_t GetChiArcPhi() const { return fChiArcPhi; }54 Float_t GetChiArcWid () const { return fChiArcWid; }55 Float_t GetMargin() const { return fMargin; }56 Float_t GetMuonSize() const { return fMuonSize; }57 Float_t GetEstImpact() const { return fEstImpact; }58 Bool_t IsUseUnmap() const { return fUseUnmap; }59 Float_t GetPeakPhi() const { return fPeakPhi; }60 Float_t GetArcPhiThres() const { return fArcPhiThres; }61 Float_t GetArcWid Thres() const { return fArcWidThres; }62 Float_t GetArcPhiBinNum() const { return fArcPhiBinNum; }63 Float_t GetArcWid BinNum() const { return fArcWidBinNum; }64 TH1F &GetHistPhi(){ return fHistPhi; }65 TH1F &GetHistWid() { return fHistWid; }50 Float_t GetArcLength() const { return fArcLength; } 51 Float_t GetArcPhi() const { return fArcPhi; } 52 Float_t GetArcWidth() const { return fArcWidth; } 53 Float_t GetChiArcPhi() const { return fChiArcPhi; } 54 Float_t GetChiArcWidth() const { return fChiArcWidth; } 55 Float_t GetMargin() const { return fMargin; } 56 Float_t GetMuonSize() const { return fMuonSize; } 57 Float_t GetEstImpact() const { return fEstImpact; } 58 Bool_t IsUseUnmap() const { return fUseUnmap; } 59 Float_t GetPeakPhi() const { return fPeakPhi; } 60 Float_t GetArcPhiThres() const { return fArcPhiThres; } 61 Float_t GetArcWidthThres() const { return fArcWidthThres; } 62 Float_t GetArcPhiBinNum() const { return fArcPhiBinNum; } 63 Float_t GetArcWidthBinNum() const { return fArcWidthBinNum; } 64 TH1F *GetHistPhi() { return fHistPhi; } 65 TH1F *GetHistWidth() { return fHistWidth; } 66 66 67 void SetMargin(Float_t margin) { fMargin = margin; } 68 void SetArcPhiThres(Float_t thres) { fArcPhiThres = thres; } 69 void SetArcWidThres(Float_t thres) { fArcWidThres = thres; } 70 void SetArcPhiBinNum(Int_t num) { fArcPhiBinNum = num; } 71 void SetArcWidBinNum(Int_t num) { fArcWidBinNum = num; } 72 73 void KeepHist() { fKeepHist = kTRUE; } 74 Bool_t IsKeepHist() { return fKeepHist; } 67 void SetMargin(Float_t margin) { fMargin = margin; } 68 void SetArcPhiThres(Float_t thres) { fArcPhiThres = thres; } 69 void SetArcWidthThres(Float_t thres) { fArcWidthThres = thres; } 70 void SetArcPhiBinNum(Int_t num) { fArcPhiBinNum = num; } 71 void SetArcWidthBinNum(Int_t num) { fArcWidthBinNum = num; } 75 72 76 73 void EnableImpactCalc() { fEnableImpactCalc = kTRUE; } … … 78 75 void DisablePreCuts() { fDisablePreCuts = kTRUE; } 79 76 Bool_t IsDisablePreCuts() { return fDisablePreCuts; } 80 void UseCleanForWid () { fUseCleanForWid= kTRUE; }81 Bool_t IsUseCleanForWid () { return fUseCleanForWid; }77 void UseCleanForWidth() { fUseCleanForWidth = kTRUE; } 78 Bool_t IsUseCleanForWidth() { return fUseCleanForWidth; } 82 79 83 80 void Print(Option_t *opt=NULL) const; … … 89 86 void CalcImpact(const MGeomCam &geom, const MMuonSearchPar &musearch, 90 87 Int_t effbinnum, Float_t startfitval, Float_t endfitval); 91 Float_t CalcWid (const MGeomCam &geom, const MCerPhotEvt &evt,88 Float_t CalcWidth(const MGeomCam &geom, const MCerPhotEvt &evt, 92 89 const MMuonSearchPar &musearch); 93 90 Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &evt, 94 const MMuonSearchPar &musearch);91 MMuonSearchPar &musearch, const Float_t *cuts); 95 92 96 ClassDef(MMuonCalibPar, 3) // Container to hold muon calibration parameters93 ClassDef(MMuonCalibPar, 1) // Container to hold muon calibration parameters 97 94 }; 98 95 -
trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc
r5173 r5210 16 16 ! 17 17 ! 18 ! Author(s): Keiichi Mase 09/2004 <mailto:mase@mppmu.mpg.de>19 ! Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>18 ! Author(s): Keiichi Mase 10/2004 <mailto:mase@mppmu.mpg.de> 19 ! Markus Meyer 10/2004 <mailto:meyer@astro.uni-wuerzburg.de> 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 105 105 void MMuonSearchPar::Reset() 106 106 { 107 fRad = -1.;108 fDev = -1.;109 fCen X = 0.;110 fCen Y = 0.;107 fRadius = -1.; 108 fDeviation = -1.; 109 fCenterX = 0.; 110 fCenterY = 0.; 111 111 fNoMuon = kFALSE; 112 112 } … … 123 123 Float_t tmp_r = 300.; // assume that the temporal cherenkov angle is 1 deg. (300 mm). 124 124 125 a = tan(hillas.GetDelta());126 127 dx = a/ sqrt(tmp_r+a*a)/3.;128 dy = -tmp_r/ sqrt(1+a*a)/3.;125 a = TMath::Tan(hillas.GetDelta()); 126 127 dx = a/TMath::Sqrt(tmp_r+a*a)/3.; 128 dy = -tmp_r/TMath::Sqrt(1+a*a)/3.; 129 129 130 130 *xtmp1 = hillas.GetMeanX() + dx; … … 180 180 // RMS of the fit, changing the center position of the circle. 181 181 // 182 void MMuonSearchPar::CalcMinimumDev 182 void MMuonSearchPar::CalcMinimumDeviation 183 183 ( const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x, Float_t y, 184 184 Float_t xcog, Float_t ycog, Float_t sigma, Float_t *opt_rad, … … 268 268 269 269 // find the best fit. 270 CalcMinimumDev (geom, evt, xtmp1,ytmp1,hillas.GetMeanX(),hillas.GetMeanY(),270 CalcMinimumDeviation(geom, evt, xtmp1,ytmp1,hillas.GetMeanX(),hillas.GetMeanY(), 271 271 dev, &opt_rad, &new_sigma, &newx, &newy); 272 272 273 fRad = opt_rad;274 fDev = new_sigma;275 276 fCen X = newx;277 fCen Y = newy;273 fRadius = opt_rad; 274 fDeviation = new_sigma; 275 276 fCenterX = newx; 277 fCenterY = newy; 278 278 279 279 SetReadyToSave(); … … 284 284 *fLog << all; 285 285 *fLog << "Muon Parameters (" << GetName() << ")" << endl; 286 *fLog << " - Est. Rad . [mm] = " << fRad<< endl;287 *fLog << " - Dev . [mm] = " << fDev<< endl;288 *fLog << " - Cen . Pos. X [mm] = " << fCenX << endl;289 *fLog << " - Cen . Pos. Y [mm] = " << fCenY << endl;286 *fLog << " - Est. Radius [mm] = " << fRadius << endl; 287 *fLog << " - Deviation [mm] = " << fDeviation << endl; 288 *fLog << " - Center Pos. X [mm] = " << fCenterX << endl; 289 *fLog << " - Center Pos. Y [mm] = " << fCenterY << endl; 290 290 } 291 291 … … 294 294 *fLog << all; 295 295 *fLog << "Muon Parameters (" << GetName() << ")" << endl; 296 *fLog << " - Est. Rad . [deg.] = " << fRad*geom.GetConvMm2Deg() << endl;297 *fLog << " - Dev . [deg.] = " << fDev*geom.GetConvMm2Deg() << endl;298 *fLog << " - Cen . Pos. X [deg.] = " << fCenX*geom.GetConvMm2Deg() << endl;299 *fLog << " - Cen . Pos. Y [deg.] = " << fCenY*geom.GetConvMm2Deg() << endl;300 } 301 302 303 296 *fLog << " - Est. Radius [deg.] = " << fRadius*geom.GetConvMm2Deg() << endl; 297 *fLog << " - Deviation [deg.] = " << fDeviation*geom.GetConvMm2Deg() << endl; 298 *fLog << " - Center Pos. X [deg.] = " << fCenterX*geom.GetConvMm2Deg() << endl; 299 *fLog << " - Center Pos. Y [deg.] = " << fCenterY*geom.GetConvMm2Deg() << endl; 300 } 301 302 303 -
trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h
r5173 r5210 21 21 { 22 22 private: 23 Float_t fRad ; // An estimated radius of the muon ring [mm]24 Float_t fDev ;// The standard deviation from the estimated ring [mm]25 Float_t fCen X; // An estimated center position in X of the muon ring [mm]26 Float_t fCen Y; // An estimated center position in Y of the muon ring [mm]27 Bool_t fNoMuon; // if the radius is estimated above 600 mm (2 deg.), assumed it's notmuon.23 Float_t fRadius; // An estimated radius of the muon ring [mm] 24 Float_t fDeviation; // The standard deviation from the estimated ring [mm] 25 Float_t fCenterX; // An estimated center position in X of the muon ring [mm] 26 Float_t fCenterY; // An estimated center position in Y of the muon ring [mm] 27 Bool_t fNoMuon; // if the radius is estimated above 600 mm (2 deg.), assumed it's not muon. Later on, at the stage of MMuonCalibParCalc, this flag will be changed if the task judge the event as no muon. 28 28 29 29 public: … … 32 32 void Reset(); 33 33 34 Float_t GetRad() const { return fRad; } 35 Float_t GetDev() const { return fDev; } 36 Float_t GetCenX() const { return fCenX; } 37 Float_t GetCenY() const { return fCenY; } 38 Bool_t IsNoMuon() const { return fNoMuon; } 34 Float_t GetRadius() const { return fRadius; } 35 Float_t GetDeviation() const { return fDeviation; } 36 Float_t GetCenterX() const { return fCenterX; } 37 Float_t GetCenterY() const { return fCenterY; } 38 Bool_t IsNoMuon() const { return fNoMuon; } 39 void SetNoMuon() { fNoMuon = kTRUE; } 39 40 40 41 void Print(Option_t *opt=NULL) const; … … 44 45 Bool_t CalcRadius(const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x, 45 46 Float_t y, Float_t *r, Float_t *sigma); 46 void CalcMinimumDev (const MGeomCam &geom, const MCerPhotEvt &evt,47 void CalcMinimumDeviation(const MGeomCam &geom, const MCerPhotEvt &evt, 47 48 Float_t x, Float_t y, Float_t xcog, 48 49 Float_t ycog, Float_t sigma, Float_t *opt_rad,
Note:
See TracChangeset
for help on using the changeset viewer.