Changeset 6987 for trunk/MagicSoft/Mars/mmuon
- Timestamp:
- 04/29/05 18:22:01 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc
r6986 r6987 221 221 { 222 222 const Float_t val = h.GetBinContent(i%n + 1); 223 if (val<thres && last<0) 223 if (val<thres) 224 { 224 225 last = i%n+1; 226 break; 227 } 225 228 } 226 229 … … 230 233 { 231 234 const Float_t val = h.GetBinContent(i%n + 1); 232 if (val<thres && first<0) 235 if (val<thres) 236 { 233 237 first = i%n+1; 238 break; 239 } 234 240 } 235 241 … … 245 251 Bool_t MHSingleMuon::CalcPhi(Double_t thres, Double_t &peakphi, Double_t &arcphi) const 246 252 { 253 if (fHistPhi.GetMaximum()<thres) 254 return kFALSE; 255 247 256 peakphi = 180.-fHistPhi.GetBinCenter(fHistPhi.GetMaximumBin()); 248 257 … … 250 259 Int_t first, last; 251 260 252 if (!FindRangeAboveThreshold(fHistPhi, thres, first, last)) 253 return kFALSE; 254 255 //cout << "P: " << first << " " << last << " " << last-first << endl; 261 FindRangeAboveThreshold(fHistPhi, thres, first, last); 262 263 const Int_t n = fHistPhi.GetNbinsX(); 264 const Int_t edge = fHistPhi.GetMaximumBin()+n/2; 265 if (first<0) 266 first = (edge-1)%n+1; 267 if (last<0) 268 last = edge%n+1;; 256 269 257 270 const Float_t startfitval = fHistPhi.GetBinLowEdge(first+1); 258 271 const Float_t endfitval = fHistPhi.GetBinLowEdge(last); 259 272 260 //Int_t effbinnum = TMath::Nint((endfitval-startfitval)/convbin2val); 261 262 arcphi = last<first ? 360+(endfitval-startfitval) : endfitval-startfitval; 273 arcphi = last-1<first ? 360+(endfitval-startfitval) : endfitval-startfitval; 263 274 264 275 //if (fEnableImpactCalc)
Note:
See TracChangeset
for help on using the changeset viewer.