Changeset 7365 for trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc
- Timestamp:
- 09/26/05 19:17:18 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc
r7225 r7365 127 127 fHistWidth.UseCurrentStyle(); 128 128 129 fHistTime.SetName("HistTime"); 130 fHistTime.SetTitle("HistTime"); 131 fHistTime.SetXTitle("timing difference"); 132 fHistTime.SetYTitle("number of pixels"); 133 fHistTime.SetDirectory(NULL); 134 fHistTime.SetFillStyle(4000); 135 fHistTime.UseCurrentStyle(); 136 129 137 MBinning bins; 130 138 bins.SetEdges(20, -180, 180); … … 133 141 bins.SetEdges(28, 0.3, 1.7); 134 142 bins.Apply(fHistWidth); 143 144 bins.SetEdges(100, -10, 10); 145 bins.Apply(fHistTime); 135 146 } 136 147 … … 169 180 ApplyBinning(*plist, "ArcPhi", &fHistPhi); 170 181 ApplyBinning(*plist, "MuonWidth", &fHistWidth); 182 ApplyBinning(*plist, "MuonTime", &fHistTime); 171 183 172 184 return kTRUE; … … 182 194 fHistPhi.Reset(); 183 195 fHistWidth.Reset(); 196 fHistTime.Reset(); 184 197 185 198 const Int_t entries = fSignalCam->GetNumPixels(); … … 202 215 if (dist < fMuonSearchPar->GetRadius() + fMargin && 203 216 dist > fMuonSearchPar->GetRadius() - fMargin) 204 fHistPhi.Fill(TMath::ATan2(dx, dy)*TMath::RadToDeg(), pix.GetNumPhotons()); 205 217 { 218 fHistTime.Fill(pix.GetArrivalTime()-fMuonSearchPar->GetTime()); 219 } 206 220 // use only the inner pixles. FIXME: This is geometry dependent 207 221 if(i>397) … … 210 224 fHistWidth.Fill(dist*fGeomCam->GetConvMm2Deg(), pix.GetNumPhotons()); 211 225 } 212 226 // Setup the function and perform the fit 227 TF1 g1("g1", "gaus", -10, 10); 228 229 // Choose starting values as accurate as possible 230 g1.SetParameter(0, fHistTime.GetMaximum()); 231 g1.SetParameter(1, 0); 232 g1.SetParameter(2, 0.3); 233 g1.SetParLimits(1, -0.5, 0.5); 234 g1.SetParLimits(2, 0, 1); 235 // options : N do not store the function, do not draw 236 // I use integral of function in bin rather than value at bin center 237 // R use the range specified in the function range 238 // Q quiet mode 239 fHistTime.Fit(&g1, "QNRB"); 240 241 // Double_t err; 242 Double_t mean, meanerr, sig, sigerr; 243 gMinuit->GetParameter(2, sig, sigerr); // get the sigma value 244 gMinuit->GetParameter(1, mean, meanerr); // get the sigma value 245 246 for (Int_t i=0; i<entries; i++) 247 { 248 const MSignalPix &pix = (*fSignalCam)[i]; 249 const MGeomPix &gpix = (*fGeomCam)[i]; 250 251 const Float_t dx = gpix.GetX() - cenx; 252 const Float_t dy = gpix.GetY() - ceny; 253 254 const Float_t dist = TMath::Hypot(dx, dy); 255 256 // if the signal is not near the estimated circle, it is ignored. 257 if (dist < fMuonSearchPar->GetRadius() + fMargin && 258 dist > fMuonSearchPar->GetRadius() - fMargin) 259 { 260 if(TMath::Abs(pix.GetArrivalTime()-(fMuonSearchPar->GetTime()+mean))<2*sig) 261 fHistPhi.Fill(TMath::ATan2(dx, dy)*TMath::RadToDeg(), pix.GetNumPhotons()); 262 } 263 } 213 264 // error estimation (temporaly) 214 265 // The error is estimated from the signal. In order to do so, we have to … … 244 295 // below the threshold is found, kFALSE is returned. 245 296 // 246 Bool_t MHSingleMuon::FindRangeAboveThreshold(const T H1&h, Float_t thres, Int_t &first, Int_t &last) const297 Bool_t MHSingleMuon::FindRangeAboveThreshold(const TProfile &h, Float_t thres, Int_t &first, Int_t &last) const 247 298 { 248 299 const Int_t n = h.GetNbinsX(); … … 362 413 // R use the range specified in the function range 363 414 // Q quiet mode 364 fHistWidth.Fit(&f1, "QR0"); 415 // fHistWidth.Fit(&f1, "QRO"); 416 fHistWidth.Fit(&f1, "QRN"); 365 417 366 418 chi = f1.GetChisquare()/f1.GetNDF(); … … 477 529 gPad->SetBorderMode(0); 478 530 fHistWidth.Draw(); 479 480 } 531 }
Note:
See TracChangeset
for help on using the changeset viewer.