Changeset 13388 for trunk/Mars/mhist
- Timestamp:
- 04/19/12 09:54:54 (13 years ago)
- Location:
- trunk/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mhist/MHCamera.cc
r13001 r13388 644 644 // ------------------------------------------------------------------------ 645 645 // 646 // This is TObject::DrawClone but completely ignores647 // gROOT->GetSelectedPad(). tbretz had trouble with this in the past.648 // If this makes trouble please write a bug report.649 //650 TObject *MHCamera::DrawClone(Option_t *option) const651 {652 return TObject::Clone();653 654 // Draw a clone of this object in the current pad655 656 //TVirtualPad *pad = gROOT->GetSelectedPad();657 TVirtualPad *padsav = gPad;658 //if (pad) pad->cd();659 660 TObject *newobj = Clone();661 662 if (!newobj)663 return 0;664 665 /*666 if (pad) {667 if (strlen(option)) pad->GetListOfPrimitives()->Add(newobj,option);668 else pad->GetListOfPrimitives()->Add(newobj,GetDrawOption());669 pad->Modified(kTRUE);670 pad->Update();671 if (padsav) padsav->cd();672 return newobj;673 }674 */675 676 TString opt(option);677 opt.ToLower();678 679 newobj->Draw(opt.IsNull() ? GetDrawOption() : option);680 681 if (padsav)682 padsav->cd();683 684 return newobj;685 }686 687 // ------------------------------------------------------------------------688 //689 646 // Creates a TH1D which contains the projection of the contents of the 690 647 // MHCamera onto the y-axis. The maximum and minimum are calculated … … 1427 1384 // ------------------------------------------------------------------------ 1428 1385 // 1429 void MHCamera::AddCamDifference(const MCamEvent &event1, const MCamEvent &event2, Int_t type )1386 void MHCamera::AddCamDifference(const MCamEvent &event1, const MCamEvent &event2, Int_t type, Stat_t weight) 1430 1387 { 1431 1388 if (fNcells<=1 || IsFreezed()) … … 1444 1401 1445 1402 SetUsed(idx); 1446 Fill(idx, val1-val2); // FIXME: Slow! 1403 Fill(idx, (val1-val2)*weight); // FIXME: Slow! 1404 } 1405 fEntries++; 1406 } 1407 1408 // ------------------------------------------------------------------------ 1409 // 1410 void MHCamera::AddCamRatio(const MCamEvent &event1, const MCamEvent &event2, Int_t type, Stat_t weight) 1411 { 1412 if (fNcells<=1 || IsFreezed()) 1413 return; 1414 1415 // FIXME: Security check missing! 1416 for (Int_t idx=0; idx<fNcells-2; idx++) 1417 { 1418 Double_t val1=0; 1419 if (!event1.GetPixelContent(val1, idx, *fGeomCam, type)) 1420 continue; 1421 1422 Double_t val2=0; 1423 if (!event2.GetPixelContent(val2, idx, *fGeomCam, type)) 1424 continue; 1425 1426 if (val2==0) 1427 continue; 1428 1429 SetUsed(idx); 1430 Fill(idx, weight*val1/val2); // FIXME: Slow! 1447 1431 } 1448 1432 fEntries++; … … 2234 2218 return fGeomCam ? fGeomCam->GetNumPixels() : 0; 2235 2219 } 2236 2237 TH1 *MHCamera::DrawCopy() const2238 {2239 gPad=NULL;2240 return TH1D::DrawCopy(fName+";cpy");2241 }2242 2220 2243 2221 // -------------------------------------------------------------------------- -
trunk/Mars/mhist/MHCamera.h
r13295 r13388 163 163 164 164 virtual Double_t GetPixContent(Int_t idx) const { return GetBinContent(idx+1); } 165 virtual void AddCamDifference(const MCamEvent &evt, const MCamEvent &evt2, Int_t type=0); 165 virtual void AddCamDifference(const MCamEvent &evt, const MCamEvent &evt2, Int_t type=0, Stat_t weight=1); 166 virtual void AddCamRatio(const MCamEvent &evt, const MCamEvent &evt2, Int_t type=0, Stat_t weight=1); 166 167 virtual void AddCamContent(const MCamEvent &evt, Int_t type=0, Stat_t weight=1); 167 168 virtual void AddCamContent(const MHCamera &evt, Int_t type=0); … … 226 227 void Reset(Option_t *); 227 228 void Reset() { Reset(""); } // *MENU* 228 TH1 *DrawCopy() const/* { gPad=NULL; return TH1D::DrawCopy(); }*/; // *MENU*229 TH1 *DrawCopy(Option_t *o) const { return TH1D::DrawCopy(o); }230 229 231 230 void Print(Option_t *) const; 232 231 void Paint(Option_t *option=""); 233 232 void Draw(Option_t *option=""); 234 TObject *DrawClone(Option_t *option="") const;235 233 void DrawProjection (Int_t fit=0) const; 236 234 void DrawRadialProfile() const;
Note:
See TracChangeset
for help on using the changeset viewer.