Changeset 2015
- Timestamp:
- 04/28/03 09:52:57 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/NEWS
r1992 r2015 45 45 46 46 - made compatible with the latest PRO version of root (3.04/02) 47 (this means, that it is compiling, but not yet fully tested) 47 48 48 49 - added a new status display which can show the present status -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r1966 r2015 185 185 nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0; 186 186 perr[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot() : 0; 187 188 nphot[i] *= fGeomCam->GetPixRatio(id); 189 // FIXME: perr[i] ??? 190 187 191 for (int j=0; j<n; j++) 188 192 { … … 195 199 if (evtpix) 196 200 { 197 nphot[i] += evtpix->GetNumPhotons() ;201 nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nid); 198 202 perr[i] += evtpix->GetErrorPhot(); 203 // FIXME: perr[i] ??? 199 204 } 200 205 num++; 201 206 } 202 207 203 nphot[i] /= num ;204 perr[i] /= num ;208 nphot[i] /= num*fGeomCam->GetPixRatio(id); 209 perr[i] /= num/*FIXME:???*/; 205 210 } 206 211 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2009 r2015 251 251 // Check System time (don't loose too much time by updates) 252 252 // 253 static TTime t0 = gSystem->Now(); 254 255 const TTime t1 = gSystem->Now(); 256 if (t1-t0 < (TTime)20) 253 254 // FIXME: Not thread safe 255 static Int_t start = num; 256 static TTime t1 = gSystem->Now(); 257 static TTime t2 = t1; 258 259 // 260 // No update < 20ms 261 // 262 const TTime t0 = gSystem->Now(); 263 if (t0-t1 < (TTime)20) 257 264 return rc; 258 259 t0 = t1; 265 t1 = t0; 266 267 // 268 // Update current speed each second 269 // 270 if (t0-t2 > (TTime)1000) 271 { 272 const Int_t speed = 1000*(num-start)/(long int)(t0-t2); 273 TString txt = "Processing..."; 274 if (speed>0) 275 { 276 txt += " ("; 277 txt += speed; 278 txt += "Evts/s)"; 279 } 280 fDisplay->SetStatusLine1(txt); 281 start = num; 282 t2 = t1; 283 } 260 284 261 285 // -
trunk/MagicSoft/Mars/mbase/MGGroupFrame.h
r1664 r2015 37 37 virtual Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2); 38 38 39 ClassDef(MGGroupFrame, 0) // A interface to widgets in a group frame (makes live easier)39 ClassDef(MGGroupFrame, 0) // An interface to widgets in a group frame (makes live easier) 40 40 }; 41 41 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1936 r2015 69 69 70 70 #include <fstream.h> 71 #include <TBaseClass.h> 71 72 72 73 #include "MLog.h" … … 317 318 out << " " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl; 318 319 } 320 321 // -------------------------------------------------------------------------- 322 // 323 // Check whether the class given in the argument overwrites MTask::Process. 324 // This function calls itself recursively. If you want to call it, 325 // leave out the argument. 326 // 327 Bool_t MTask::OverwritesProcess(TClass *cls) const 328 { 329 if (!cls) 330 cls = IsA(); 331 332 // 333 // Check whether we reached the base class MTask 334 // 335 if (TString(cls->GetName())=="MTask") 336 return kFALSE; 337 338 // 339 // Check whether the class cls overwrites Process 340 // 341 if (cls->GetMethodAny("Process")) 342 return kTRUE; 343 344 // 345 // If the class itself doesn't overload it check all it's base classes 346 // 347 TBaseClass *base=NULL; 348 TIter NextBase(cls->GetListOfBases()); 349 while ((base=(TBaseClass*)NextBase())) 350 { 351 if (OverwritesProcess(base->GetClassPointer())) 352 return kTRUE; 353 } 354 355 return kFALSE; 356 } -
trunk/MagicSoft/Mars/mbase/MTask.h
r1661 r2015 80 80 const TList *GetListOfBranches() const { return fListOfBranches; } 81 81 82 Bool_t OverwritesProcess(TClass *cls=NULL) const; 83 82 84 void SavePrimitive(ofstream &out, Option_t *o=""); 83 85 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1965 r2015 60 60 61 61 #include <TClass.h> 62 #include <TBaseClass.h>63 62 #include <TOrdCollection.h> 64 63 … … 322 321 // -------------------------------------------------------------------------- 323 322 // 324 // Check whether this task (or one of it's base classes) overloads325 // MTask::Process. Only if this function is overloaded this task is326 // added to the fTaskProcess-List. This makes the execution of the327 // tasklist a little bit (only a little bit) faster, bacause tasks328 // doing no Processing are not Processed.329 //330 Bool_t MTaskList::CheckClassForProcess(TClass *cls)331 {332 //333 // Check whether the class itself overloads the Process function334 //335 if (cls->GetName()=="MTask")336 return kFALSE;337 338 if (cls->GetMethodAny("Process"))339 return kTRUE;340 341 //342 // If the class itself doesn't overload it check all it's base classes343 //344 TBaseClass *base=NULL;345 TIter NextBase(cls->GetListOfBases());346 while ((base=(TBaseClass*)NextBase()))347 {348 if (CheckClassForProcess(base->GetClassPointer()))349 return kTRUE;350 }351 352 return kFALSE;353 }354 355 // --------------------------------------------------------------------------356 //357 323 // do pre processing (before eventloop) of all tasks in the task-list 324 // Only if a task overwrites the Process function the task is 325 // added to the fTaskProcess-List. This makes the execution of the 326 // tasklist a little bit (only a little bit) faster, bacause tasks 327 // doing no Processing are not Processed. 358 328 // 359 329 Bool_t MTaskList::PreProcess(MParList *pList) … … 410 380 // 411 381 while ((task=(MTask*)Next())) 412 if ( CheckClassForProcess(task->IsA()))382 if (task->OverwritesProcess()) 413 383 fTasksProcess.Add(task); 414 384 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1965 r2015 31 31 32 32 void Remove(MTask *task); 33 Bool_t CheckClassForProcess(TClass *cls); 34 35 void StreamPrimitive(ofstream &out) const; 36 33 void StreamPrimitive(ofstream &out) const; 37 34 Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const; 38 35 -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1994 r2015 326 326 } 327 327 328 // -------------------------------------------------------------------------- 329 // 330 // Creates a new tab in a status display with the name of the MH class, 331 // if fDisplay is set and the MH-class overwrites the Draw function 332 // 328 333 Bool_t MFillH::DrawToDisplay() 329 334 { 335 fCanvas = NULL; 336 330 337 if (!fDisplay) 338 return kTRUE; 339 340 if (!fH->OverwritesDraw()) 331 341 return kTRUE; 332 342 … … 485 495 fH->SetReadyToSave(); 486 496 487 if (fDisplay) 497 // 498 // Check whether fDisplay has previously been used (fCanvas) 499 // and fDisplay is still open. 500 // 501 if (fCanvas && fDisplay) 488 502 { 489 503 fCanvas->cd(); -
trunk/MagicSoft/Mars/mhist/MH.cc
r2010 r2015 59 59 #include <TLegend.h> 60 60 #include <TPaveStats.h> 61 #include <TBaseClass.h> 61 62 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 62 63 #include <THLimitsFinder.h> … … 589 590 590 591 // FIXME: Also align max/min with set Maximum/Minimum 591 const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin())); 592 const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin())); 593 h1->SetMaximum(max); 594 h1->SetMinimum(min); 592 const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin()); 593 const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin()); 594 const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin()); 595 const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin()); 596 597 const Double_t max = TMath::Max(maxbin1, maxbin2); 598 const Double_t min = TMath::Min(minbin1, minbin2); 599 600 h1->SetMaximum(max>0?max*1.05:max*0.95); 601 h1->SetMinimum(max>0?min*0.95:min*1.05); 595 602 596 603 TPaveText *t = (TPaveText*)gPad->FindObject("title"); … … 658 665 gPad->Update(); 659 666 660 // FIXME: Also align max/min with set Maximum/Minimum661 667 /* 662 const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin())); 663 const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin())); 664 hist1.SetMaximum(max); 665 hist1.SetMinimum(min); 668 const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin()); 669 const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin()); 670 const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin()); 671 const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin()); 672 673 const Double_t max = TMath::Max(maxbin1, maxbin2); 674 const Double_t min = TMath::Min(minbin1, minbin2); 675 676 hist1.SetMaximum(max>0?max*1.05:max*0.95); 677 hist1.SetMinimum(max>0?min*0.95:min*1.05); 666 678 */ 667 679 … … 751 763 return o; 752 764 } 765 766 // -------------------------------------------------------------------------- 767 // 768 // Check whether a class inheriting from MH overwrites the Draw function 769 // 770 Bool_t MH::OverwritesDraw(TClass *cls) const 771 { 772 if (!cls) 773 cls = IsA(); 774 775 // 776 // Check whether we reached the base class MTask 777 // 778 if (TString(cls->GetName())=="MH") 779 return kFALSE; 780 781 // 782 // Check whether the class cls overwrites Draw 783 // 784 if (cls->GetMethodAny("Draw")) 785 { 786 *fLog << all << "FOUND: " << cls->GetName() << " " << (cls->GetName()=="MH") << endl; 787 return kTRUE; 788 } 789 790 // 791 // If the class itself doesn't overload it check all it's base classes 792 // 793 TBaseClass *base=NULL; 794 TIter NextBase(cls->GetListOfBases()); 795 while ((base=(TBaseClass*)NextBase())) 796 { 797 if (OverwritesDraw(base->GetClassPointer())) 798 return kTRUE; 799 } 800 801 return kFALSE; 802 } -
trunk/MagicSoft/Mars/mhist/MH.h
r2003 r2015 21 21 MH(const char *name=NULL, const char *title=NULL); 22 22 23 Bool_t OverwritesDraw(TClass *cls=NULL) const; 24 23 25 virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; } 24 26 virtual Bool_t Fill(const MParContainer *par, Double_t weight=1); … … 30 32 31 33 static TCanvas *MakeDefCanvas(TString name="", const char *title="", 32 const UInt_t w= 580, const UInt_t h=435);34 const UInt_t w=625, const UInt_t h=440); 33 35 static TCanvas *MakeDefCanvas(const TObject *obj, 34 const UInt_t w= 580, const UInt_t h=435);36 const UInt_t w=625, const UInt_t h=440); 35 37 36 38 static void SetBinning(TH1 *h, const MBinning *binsx); … … 63 65 TObject *DrawClone(Option_t *opt="") const 64 66 { 65 return MH::DrawClone(opt, 580, 435);67 return MH::DrawClone(opt, 625, 440); 66 68 } 67 69 -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc
r1992 r2015 126 126 void MHAlphaEnergyTheta::Draw(Option_t *opt) 127 127 { 128 if (!gPad)129 MakeDefCanvas("AlphaEnergyTheta", fTitle);128 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 129 pad->SetBorderMode(0); 130 130 131 gPad->Divide(2,2); 131 AppendPad(""); 132 133 pad->Divide(2,2); 132 134 133 135 TH1 *h; 134 136 135 gPad->cd(1); 137 pad->cd(1); 138 gPad->SetBorderMode(0); 136 139 h = fHist.Project3D("expro"); 137 138 140 h->SetTitle("Distribution of \\alpha [\\circ]"); 139 141 h->SetXTitle("\\alpha [\\circ]"); 140 142 h->SetYTitle("Counts"); 141 142 143 h->Draw(opt); 143 144 h->SetBit(kCanDelete); 144 145 145 gPad->cd(2); 146 pad->cd(2); 147 gPad->SetBorderMode(0); 148 gPad->SetLogx(); 146 149 h = fHist.Project3D("eypro"); 147 148 150 h->SetTitle("Distribution of E-est [GeV]"); 149 151 h->SetXTitle("E_{est} [GeV]"); 150 152 h->SetYTitle("Counts"); 151 152 153 h->Draw(opt); 153 154 h->SetBit(kCanDelete); 154 gPad->SetLogx();155 155 156 gPad->cd(3); 156 pad->cd(3); 157 gPad->SetBorderMode(0); 157 158 h = fHist.Project3D("ezpro"); 158 159 159 h->SetTitle("Distribution of \\Theta [\\circ]"); 160 160 h->SetXTitle("\\Theta [\\circ]"); 161 161 h->SetYTitle("Counts"); 162 163 162 h->Draw(opt); 164 163 h->SetBit(kCanDelete); 165 164 166 gPad->cd(4); 165 pad->cd(4); 166 gPad->SetBorderMode(0); 167 167 fHist.Draw(opt); 168 168 169 gPad->Modified();170 gPad->Update();169 pad->Modified(); 170 pad->Update(); 171 171 } 172 173 // --------------------------------------------------------------------------174 //175 // Draw copies of the histogram176 //177 TObject *MHAlphaEnergyTheta::DrawClone(Option_t *opt) const178 {179 TCanvas &c = *MakeDefCanvas("AlphaEnergyTheta", fTitle);180 c.Divide(2, 2);181 182 gROOT->SetSelectedPad(NULL);183 184 TH1 *h;185 186 c.cd(1);187 h = ((TH3*)(&fHist))->Project3D(fName+"_expro");188 189 h->SetTitle("Distribution of \\alpha [\\circ]");190 h->SetXTitle("\\alpha [\\circ]");191 h->SetYTitle("Counts");192 193 h->Draw(opt);194 h->SetBit(kCanDelete);195 196 c.cd(2);197 h = ((TH3*)(&fHist))->Project3D(fName+"_eypro");198 199 h->SetTitle("Distribution of E-est [GeV]");200 h->SetXTitle("E_{est} [GeV]");201 h->SetYTitle("Counts");202 203 h->Draw(opt);204 h->SetBit(kCanDelete);205 gPad->SetLogx();206 207 c.cd(3);208 h = ((TH3*)(&fHist))->Project3D(fName+"_ezpro");209 210 h->SetTitle("Distribution of \\Theta [\\circ]");211 h->SetXTitle("\\Theta [\\circ]");212 h->SetYTitle("Counts");213 214 h->Draw(opt);215 h->SetBit(kCanDelete);216 217 c.cd(4);218 ((TH3&)fHist).DrawCopy(opt);219 220 c.Modified();221 c.Update();222 223 return &c;224 }225 -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h
r1992 r2015 42 42 43 43 void Draw(Option_t *option=""); 44 TObject *DrawClone(Option_t *option="") const;45 44 46 45 ClassDef(MHAlphaEnergyTheta, 0) //3D-histogram in alpha, Energy and theta -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc
r1992 r2015 126 126 void MHAlphaEnergyTime::Draw(Option_t *opt) 127 127 { 128 if (!gPad)129 MakeDefCanvas("AlphaEnergyTime", fTitle);130 131 gPad->Divide(2,2);128 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 129 pad->SetBorderMode(0); 130 131 pad->Divide(2,2); 132 132 133 133 TH1 *h; 134 134 135 gPad->cd(1); 135 pad->cd(1); 136 gPad->SetBorderMode(0); 136 137 h = fHist.Project3D("ex"); 137 138 138 h->SetTitle("Distribution of \\alpha [\\circ]"); 139 139 h->SetXTitle("\\alpha [\\circ]"); 140 140 h->SetYTitle("Counts"); 141 142 141 h->Draw(opt); 143 142 h->SetBit(kCanDelete); 144 143 145 gPad->cd(2); 144 pad->cd(2); 145 gPad->SetBorderMode(0); 146 gPad->SetLogx(); 146 147 h = fHist.Project3D("ey"); 147 148 148 h->SetTitle("Distribution of E-est [GeV]"); 149 149 h->SetXTitle("E-est [GeV] "); 150 150 h->SetYTitle("Counts"); 151 152 151 h->Draw(opt); 153 152 h->SetBit(kCanDelete); 154 gPad->SetLogx(); 155 156 gPad-> cd(3);153 154 pad->cd(3); 155 gPad->SetBorderMode(0); 157 156 h = fHist.Project3D("ez"); 158 159 157 h->SetTitle("Distribution of time [s]"); 160 158 h->SetXTitle("time [s]"); 161 159 h->SetYTitle("Counts"); 162 163 160 h->Draw(opt); 164 161 h->SetBit(kCanDelete); 165 162 166 gPad->cd(4); 163 pad->cd(4); 164 gPad->SetBorderMode(0); 167 165 fHist.Draw(opt); 168 166 169 gPad->Modified(); 170 gPad->Update(); 171 172 } 173 174 // -------------------------------------------------------------------------- 175 // 176 // Draw copies of the histogram 177 // 178 TObject *MHAlphaEnergyTime::DrawClone(Option_t *opt) const 179 { 180 TCanvas &c = *MakeDefCanvas("AlphaEnergyTime", fTitle); 181 182 c.Divide(2, 2); 183 184 gROOT->SetSelectedPad(NULL); 185 186 TH1 *h; 187 188 c.cd(1); 189 h = ((TH3D*)(&fHist))->Project3D("ex"); 190 191 h->SetTitle("Distribution of \\alpha [\\circ]"); 192 h->SetXTitle("\\alpha [\\circ]"); 193 h->SetYTitle("Counts"); 194 195 h->Draw(opt); 196 h->SetBit(kCanDelete); 197 198 c.cd(2); 199 h = ((TH3D*)(&fHist))->Project3D("ey"); 200 201 h->SetTitle("Distribution of E-est [GeV]"); 202 h->SetXTitle("E-est [GeV] "); 203 h->SetYTitle("Counts"); 204 205 h->Draw(opt); 206 h->SetBit(kCanDelete); 207 gPad->SetLogx(); 208 209 c.cd(3); 210 h = ((TH3D*)(&fHist))->Project3D("ez"); 211 212 h->SetTitle("Distribution of time [s]"); 213 h->SetXTitle("time [s]"); 214 h->SetYTitle("Counts"); 215 216 h->Draw(opt); 217 h->SetBit(kCanDelete); 218 219 c.cd(4); 220 ((TH3D&)fHist).DrawCopy(opt); 221 222 c.Modified(); 223 c.Update(); 224 225 return &c; 226 } 227 167 pad->Modified(); 168 pad->Update(); 169 170 } 228 171 229 172 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h
r1992 r2015 41 41 42 42 void Draw(Option_t *option=""); 43 TObject *DrawClone(Option_t *option="") const;44 43 45 44 TH2D *IntegrateTime (const char *title, Bool_t Draw); -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
r2002 r2015 152 152 // -------------------------------------------------------------------------- 153 153 // 154 // Draw clone155 //156 TObject *MHCerPhotEvt::DrawClone(Option_t *opt) const157 {158 return MH::DrawClone(opt, 750, 600);159 }160 161 // --------------------------------------------------------------------------162 //163 154 // Draw the present 'fill status' 164 155 // -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h
r1989 r2015 37 37 const MCerPhotEvt &GetSum() const { return fSum; } 38 38 39 TObject *DrawClone(Option_t *opt) const; 40 void Draw(Option_t *); 39 void Draw(Option_t *opt=""); 41 40 void Paint(Option_t *option=""); 42 41 -
trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc
r1992 r2015 361 361 // ------------------------------------------------------------------------- 362 362 // 363 // Draw a copy of the histogram364 //365 TObject *MHEffOnTime::DrawClone(Option_t *opt) const366 {367 TCanvas &c = *MakeDefCanvas(TString("EffOnTime")+fVarname,368 TString("Results from on time fit vs. ")+fVarname);369 c.Divide(2, 2);370 371 gROOT->SetSelectedPad(NULL);372 373 c.cd(1);374 ((TH2*)&fHEffOn)->DrawCopy(opt);375 376 c.cd(2);377 ((TH2*)&fHProb)->DrawCopy(opt);378 379 c.cd(3);380 ((TH2*)&fHLambda)->DrawCopy(opt);381 382 c.cd(4);383 ((TH2*)&fHRdead)->DrawCopy(opt);384 385 c.Modified();386 c.Update();387 388 return &c;389 }390 391 // -------------------------------------------------------------------------392 //393 363 // Draw the histogram 394 364 // 395 365 void MHEffOnTime::Draw(Option_t *opt) 396 366 { 397 if (!gPad)398 MakeDefCanvas(TString("EffOnTime")+fVarname,399 TString("Results from on time fit vs. ")+fVarname); 400 401 gPad->Divide(2,2); 402 403 gPad-> cd(1);367 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 368 pad->SetBorderMode(0); 369 370 pad->Divide(2,2); 371 372 pad->cd(1); 373 gPad->SetBorderMode(0); 404 374 fHEffOn.Draw(opt); 405 375 406 gPad->cd(2); 376 pad->cd(2); 377 gPad->SetBorderMode(0); 407 378 fHProb.Draw(opt); 408 379 409 gPad->cd(3); 380 pad->cd(3); 381 gPad->SetBorderMode(0); 410 382 fHLambda.Draw(opt); 411 383 412 gPad->cd(4); 384 pad->cd(4); 385 gPad->SetBorderMode(0); 413 386 fHRdead.Draw(opt); 414 387 415 gPad->Modified();416 gPad->Update();388 pad->Modified(); 389 pad->Update(); 417 390 } 418 391 -
trunk/MagicSoft/Mars/mhist/MHEffOnTime.h
r1992 r2015 41 41 42 42 void Draw(Option_t *option=""); 43 TObject *DrawClone(Option_t *option="") const;44 43 45 44 ClassDef(MHEffOnTime, 0) //1D-plot of Delta t vs. Var -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc
r1992 r2015 257 257 // ------------------------------------------------------------------------- 258 258 // 259 // Draw a copy of the histogram260 //261 TObject *MHEffOnTimeTheta::DrawClone(Option_t *opt) const262 {263 TCanvas &c = *MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta");264 265 c.Divide(2, 2);266 267 gROOT->SetSelectedPad(NULL);268 269 c.cd(1);270 ((TH2*)&fHEffOn)->DrawCopy(opt);271 272 c.cd(2);273 ((TH2*)&fHChi2)->DrawCopy(opt);274 275 c.cd(3);276 ((TH2*)&fHLambda)->DrawCopy(opt);277 278 c.cd(4);279 ((TH2*)&fHN0del)->DrawCopy(opt);280 281 c.Modified();282 c.Update();283 284 return &c;285 }286 287 // -------------------------------------------------------------------------288 //289 259 // Draw the histogram 290 260 // 291 261 void MHEffOnTimeTheta::Draw(Option_t *opt) 292 262 { 293 if (!gPad) 294 MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta"); 295 296 gPad->Divide(2,2); 297 298 gPad->cd(1); 263 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 264 pad->SetBorderMode(0); 265 266 pad->Divide(2,2); 267 268 pad->cd(1); 269 gPad->SetBorderMode(0); 299 270 fHEffOn.Draw(opt); 300 271 301 gPad->cd(2); 272 pad->cd(2); 273 gPad->SetBorderMode(0); 302 274 fHChi2.Draw(opt); 303 275 304 gPad->cd(3); 276 pad->cd(3); 277 gPad->SetBorderMode(0); 305 278 fHLambda.Draw(opt); 306 279 307 gPad->cd(4); 280 pad->cd(4); 281 gPad->SetBorderMode(0); 308 282 fHN0del.Draw(opt); 309 283 310 gPad->Modified();311 gPad->Update();312 } 284 pad->Modified(); 285 pad->Update(); 286 } -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.h
r1992 r2015 32 32 33 33 void Draw(Option_t *option=""); 34 TObject *DrawClone(Option_t *option="") const;35 34 36 35 ClassDef(MHEffOnTimeTheta, 0) //1D-plot of Delta t vs. Theta -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc
r1992 r2015 264 264 // ------------------------------------------------------------------------- 265 265 // 266 // Draw a copy of the histogram267 //268 TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const269 {270 TCanvas &c = *MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time");271 c.Divide(2, 2);272 273 gROOT->SetSelectedPad(NULL);274 275 c.cd(1);276 ((TH2*)&fHEffOn)->DrawCopy(opt);277 278 c.cd(2);279 ((TH2*)&fHChi2)->DrawCopy(opt);280 281 c.cd(3);282 ((TH2*)&fHLambda)->DrawCopy(opt);283 284 c.cd(4);285 ((TH2*)&fHN0del)->DrawCopy(opt);286 287 c.Modified();288 c.Update();289 290 return &c;291 }292 293 // -------------------------------------------------------------------------294 //295 266 // Draw the histogram 296 267 // 297 268 void MHEffOnTimeTime::Draw(Option_t *opt) 298 269 { 299 if (!gPad) 300 MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time"); 301 302 gPad->Divide(2,2); 303 304 gPad->cd(1); 270 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 271 pad->SetBorderMode(0); 272 273 pad->Divide(2,2); 274 275 pad->cd(1); 276 gPad->SetBorderMode(0); 305 277 fHEffOn.Draw(opt); 306 278 307 gPad->cd(2); 279 pad->cd(2); 280 gPad->SetBorderMode(0); 308 281 fHChi2.Draw(opt); 309 282 310 gPad->cd(3); 283 pad->cd(3); 284 gPad->SetBorderMode(0); 311 285 fHLambda.Draw(opt); 312 286 313 gPad->cd(4); 287 pad->cd(4); 288 gPad->SetBorderMode(0); 314 289 fHN0del.Draw(opt); 315 290 316 gPad->Modified();317 gPad->Update();318 } 319 320 321 322 323 291 pad->Modified(); 292 pad->Update(); 293 } 294 295 296 297 298 -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.h
r1992 r2015 32 32 33 33 void Draw(Option_t *option=""); 34 TObject *DrawClone(Option_t *option="") const;35 34 36 35 ClassDef(MHEffOnTimeTime, 0) //1D-plot of Delta t vs. time -
trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc
r1992 r2015 89 89 // -------------------------------------------------------------------------- 90 90 // 91 // Delete the three histograms92 //93 MHEnergyTheta::~MHEnergyTheta()94 {95 }96 97 // --------------------------------------------------------------------------98 //99 91 // Fill data into the histogram which contains all showers 100 92 // … … 114 106 void MHEnergyTheta::Draw(Option_t* option) 115 107 { 116 if (!gPad) 117 MakeDefCanvas(&fHist); 108 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 109 pad->SetBorderMode(0); 110 pad->SetLogy(); 118 111 119 fHist.DrawCopy(option); 120 gPad->SetLogy(); 112 fHist.Draw(option); 121 113 122 gPad->Modified(); 123 gPad->Update(); 124 } 125 126 // -------------------------------------------------------------------------- 127 // 128 // Creates a new canvas and draws the histogram into it. 129 // Be careful: The histogram belongs to this object and won't get deleted 130 // together with the canvas. 131 // 132 TObject *MHEnergyTheta::DrawClone(Option_t* option) const 133 { 134 TCanvas *c = MakeDefCanvas(&fHist); 135 136 // 137 // This is necessary to get the expected bahviour of DrawClone 138 // 139 gROOT->SetSelectedPad(NULL); 140 141 ((TH2D&)fHist).DrawCopy(option); 142 gPad->SetLogy(); 143 144 c->Modified(); 145 c->Update(); 146 147 return c; 114 pad->Modified(); 115 pad->Update(); 148 116 } 149 117 -
trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h
r1992 r2015 18 18 19 19 public: 20 21 20 MHEnergyTheta(const char *name=NULL, const char *title=NULL); 22 ~MHEnergyTheta();23 21 24 22 Bool_t Fill(const MParContainer *cont, Double_t w=1); 25 23 26 24 void Draw(Option_t *option=""); 27 TObject *DrawClone(Option_t *option="") const;28 25 29 26 Bool_t SetupFill(const MParList *plist); -
trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc
r1330 r2015 62 62 // we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins 63 63 64 65 64 fName = name ? name : "MHEnergyTime"; 66 65 fTitle = title ? title : "Data to Calculate Collection Area"; … … 97 96 // -------------------------------------------------------------------------- 98 97 // 99 // Delete the three histograms100 //101 MHEnergyTime::~MHEnergyTime()102 {103 }104 105 // --------------------------------------------------------------------------106 //107 98 // Fill data into the histogram which contains all showers 108 99 // … … 122 113 void MHEnergyTime::Draw(Option_t* option) 123 114 { 124 if (!gPad)125 MakeDefCanvas(&fHist);115 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 116 pad->SetBorderMode(0); 126 117 118 AppendPad(""); 119 120 pad->SetLogy(); 127 121 fHist.DrawCopy(option); 128 gPad->SetLogy();129 122 130 gPad->Modified(); 131 gPad->Update(); 132 } 133 134 // -------------------------------------------------------------------------- 135 // 136 // Creates a new canvas and draws the histogram into it. 137 // Be careful: The histogram belongs to this object and won't get deleted 138 // together with the canvas. 139 // 140 TObject *MHEnergyTime::DrawClone(Option_t* option) const 141 { 142 TCanvas *c = MakeDefCanvas(&fHist); 143 144 // 145 // This is necessary to get the expected bahviour of DrawClone 146 // 147 gROOT->SetSelectedPad(NULL); 148 149 ((TH2D&)fHist).DrawCopy(option); 150 gPad->SetLogy(); 151 152 c->Modified(); 153 c->Update(); 154 155 return c; 123 pad->Modified(); 124 pad->Update(); 156 125 } 157 126 -
trunk/MagicSoft/Mars/mhist/MHEnergyTime.h
r1663 r2015 19 19 20 20 public: 21 22 21 MHEnergyTime(const char *name=NULL, const char *title=NULL); 23 ~MHEnergyTime();24 22 25 23 Bool_t Fill(const MParContainer *cont); 26 24 27 25 void Draw(Option_t *option=""); 28 TObject *DrawClone(Option_t *option="") const;29 26 30 27 Bool_t SetupFill(const MParList *plist); -
trunk/MagicSoft/Mars/mhist/MHFlux.cc
r1992 r2015 503 503 // ------------------------------------------------------------------------- 504 504 // 505 // Draw copies of the histograms506 //507 TObject *MHFlux::DrawClone(Option_t *opt) const508 {509 TCanvas &c = *MakeDefCanvas("flux", "Orig - Unfold - Flux plots");510 c.Divide(2, 2);511 512 gROOT->SetSelectedPad(NULL);513 514 c.cd(1);515 ((TH2*)&fHOrig)->DrawCopy("");516 gPad->SetLogx();517 518 c.cd(2);519 ((TH2*)&fHUnfold)->DrawCopy("");520 gPad->SetLogx();521 522 c.cd(3);523 ((TH2*)&fHFlux)->DrawCopy("");524 gPad->SetLogx();525 526 c.Modified();527 c.Update();528 529 return &c;530 }531 532 // -------------------------------------------------------------------------533 //534 505 // Draw the histograms 535 506 // 536 507 void MHFlux::Draw(Option_t *opt) 537 508 { 538 if (!gPad) 539 MakeDefCanvas("flux", "orig-unfold-flux plots"); 540 541 gPad->Divide(2,2); 542 543 gPad->cd(1); 509 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 510 pad->SetBorderMode(0); 511 512 AppendPad(""); 513 514 pad->Divide(2,2); 515 516 pad->cd(1); 517 gPad->SetBorderMode(0); 544 518 fHOrig.Draw(opt); 545 519 546 gPad->cd(2); 520 pad->cd(2); 521 gPad->SetBorderMode(0); 547 522 fHUnfold.Draw(opt); 548 523 549 gPad->cd(3); 524 pad->cd(3); 525 gPad->SetBorderMode(0); 550 526 fHFlux.Draw(opt); 551 527 552 gPad->Modified();553 gPad->Update();528 pad->Modified(); 529 pad->Update(); 554 530 } 555 531 -
trunk/MagicSoft/Mars/mhist/MHFlux.h
r1992 r2015 59 59 60 60 void Draw(Option_t *option=""); 61 TObject *DrawClone(Option_t *option="") const; 61 62 62 void DrawFluxProjectionX(Option_t *opt="") const; 63 63 void DrawOrigProjectionX(Option_t *opt="") const; -
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r1992 r2015 880 880 DrawDefRefInfo(hth, hthd, thsh, refcolumn); 881 881 882 if (!rest) 883 return kTRUE; 884 885 CopyCrop(*rest, mrest, evtcount2); 882 if (rest) 883 CopyCrop(*rest, mrest, evtcount2); 886 884 887 885 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
r1992 r2015 180 180 { 181 181 Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg; 182 Double_t my Sig = fSigmabar->Calc(*fCam, *fPed, *fEvt);183 184 fSigmaTheta.Fill(theta, my Sig);182 Double_t mysig = fSigmabar->Calc(*fCam, *fPed, *fEvt); 183 184 fSigmaTheta.Fill(theta, mysig); 185 185 186 186 const UInt_t npix = fEvt->GetNumPixels(); … … 188 188 for (UInt_t i=0; i<npix; i++) 189 189 { 190 MCerPhotPix cerpix = (*fEvt)[i]; 191 if (!cerpix.IsPixelUsed()) 192 continue; 193 194 const Int_t id = cerpix.GetPixId(); 195 const MPedestalPix &pix = (*fPed)[id]; 196 197 const Double_t sigma = pix.GetMeanRms(); 198 const Double_t area = fCam->GetPixRatio(id); 199 200 201 fSigmaPixTheta.Fill(theta, (Double_t)id, sigma); 202 203 const Double_t diff = sigma*sigma/area - mySig*mySig; 204 fDiffPixTheta.Fill(theta, (Double_t)id, diff); 190 MCerPhotPix cerpix = (*fEvt)[i]; 191 if (!cerpix.IsPixelUsed()) 192 continue; 193 194 const Int_t id = cerpix.GetPixId(); 195 const MPedestalPix &pix = (*fPed)[id]; 196 197 const Double_t sigma = pix.GetMeanRms(); 198 const Double_t area = fCam->GetPixRatio(id); 199 200 fSigmaPixTheta.Fill(theta, (Double_t)id, sigma); 201 202 const Double_t diff = sigma*sigma/area - mysig*mysig; 203 fDiffPixTheta.Fill(theta, (Double_t)id, diff); 205 204 } 206 205 207 206 return kTRUE; 208 }209 210 // --------------------------------------------------------------------------211 //212 // Draw a copy of the histogram213 //214 TObject *MHSigmaTheta::DrawClone(Option_t *opt)215 {216 return MH::DrawClone(opt, 900, 900);217 207 } 218 208 -
trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
r1992 r2015 32 32 MMcEvt *fMcEvt; //! 33 33 34 TH1D fNpix; // 1D-distribution no.of pixels in MCerPhotEvt;35 TH1D fBlindId; // 1D-distribution Id of blind pixel;36 34 TH2D fSigmaTheta; // 2D-distribution sigmabar versus Theta; 37 35 // sigmabar is the average pedestasl sigma in an event … … 48 46 const TH2D *GetSigmaTheta() { return &fSigmaTheta; } 49 47 const TH2D *GetSigmaTheta() const { return &fSigmaTheta; } 50 TH2D *GetSigmaThetaByName(const TString name) { return &fSigmaTheta; }51 48 52 49 const TH3D *GetSigmaPixTheta() { return &fSigmaPixTheta; } 53 50 const TH3D *GetSigmaPixTheta() const { return &fSigmaPixTheta; } 54 TH3D *GetSigmaPixThetaByName(const TString name) { return &fSigmaPixTheta; }55 51 56 52 const TH3D *GetDiffPixTheta() { return &fDiffPixTheta; } 57 53 const TH3D *GetDiffPixTheta() const { return &fDiffPixTheta; } 58 TH3D *GetDiffPixThetaByName(const TString name) { return &fDiffPixTheta; }59 54 60 55 void Draw(Option_t *option=""); 61 TObject *DrawClone(Option_t *option="");62 56 63 57 ClassDef(MHSigmaTheta, 0) //2D-histogram sigmabar vs. Theta -
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
r1974 r2015 160 160 } 161 161 162 // --------------------------------------------------------------------------163 //164 // Creates a new canvas and draws the histogram into it.165 // Be careful: The histogram belongs to this object and won't get deleted166 // together with the canvas.167 //168 TObject *MHMcCollectionArea::DrawClone(Option_t* opt) const169 {170 return MH::DrawClone(opt);171 /*172 TCanvas *c = MH::MakeDefCanvas(fHistCol);173 174 //175 // This is necessary to get the expected bahviour of DrawClone176 //177 gROOT->SetSelectedPad(NULL);178 179 fHistCol->DrawCopy(option);180 181 gPad->SetLogx();182 183 c->Modified();184 c->Update();185 186 return c;*/187 }188 189 162 void MHMcCollectionArea::Draw(Option_t* option) 190 163 { 191 164 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 192 165 pad->SetBorderMode(0); 193 // if (!gPad)194 // MH::MakeDefCanvas(fHistCol);195 166 196 167 fHistCol->Draw(option); -
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
r1974 r2015 36 36 37 37 void Draw(Option_t *option=""); 38 TObject *DrawClone(Option_t *option="") const;39 38 40 39 void CalcEfficiency(); -
trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc
r1974 r2015 82 82 } 83 83 84 //-------------------------------------------------------------------------85 //86 // Defualt Destructor87 //88 MHMcDifRate::~MHMcDifRate()89 {90 }91 92 84 // ------------------------------------------------------------------------ 93 85 // … … 96 88 void MHMcDifRate::Draw(Option_t *option) 97 89 { 98 if (!gPad)99 MH::MakeDefCanvas(&fHist);90 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 91 pad->SetBorderMode(0); 100 92 101 gPad->SetLogx(); 93 AppendPad(""); 94 95 pad->SetLogx(); 102 96 103 97 fHist.Draw(option); 104 98 105 gPad->Modified(); 106 gPad->Update(); 107 } 108 109 TObject *MHMcDifRate::DrawClone(Option_t *option) const 110 { 111 TCanvas *c = MH::MakeDefCanvas(&fHist); 112 113 c->SetLogx(); 114 115 // 116 // This is necessary to get the expected bahviour of DrawClone 117 // 118 gROOT->SetSelectedPad(NULL); 119 120 ((TH1D&)fHist).DrawCopy(option); 121 122 c->Modified(); 123 c->Update(); 124 125 return c; 99 pad->Modified(); 100 pad->Update(); 126 101 } 127 102 /* -
trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.h
r1974 r2015 23 23 public: 24 24 MHMcDifRate(const char *name=NULL, const char *title=NULL); 25 ~MHMcDifRate();26 25 27 26 void SetName(const char *name); … … 34 33 35 34 void Draw(Option_t* option = ""); 36 TObject *DrawClone(Option_t* option = "") const;37 35 38 36 // void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc
r1974 r2015 91 91 } 92 92 93 //-------------------------------------------------------------------------94 //95 // Defualt Destructor96 //97 MHMcEfficiency::~MHMcEfficiency()98 {99 }100 101 93 // ------------------------------------------------------------------------ 102 94 // … … 105 97 void MHMcEfficiency::Draw(Option_t *option) 106 98 { 107 if (!gPad)108 MH::MakeDefCanvas(&fHist);99 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 100 pad->SetBorderMode(0); 109 101 110 gPad->SetLogx(); 102 AppendPad(""); 103 104 pad->SetLogx(); 111 105 112 106 fHist.Draw(option); 113 107 114 gPad->Modified(); 115 gPad->Update(); 116 } 117 118 TObject *MHMcEfficiency::DrawClone(Option_t *option) const 119 { 120 TCanvas *c = MH::MakeDefCanvas(&fHist); 121 122 c->SetLogx(); 123 124 // 125 // This is necessary to get the expected bahviour of DrawClone 126 // 127 gROOT->SetSelectedPad(NULL); 128 129 ((TH2D&)fHist).DrawCopy(option); 130 131 c->Modified(); 132 c->Update(); 133 134 return c; 108 pad->Modified(); 109 pad->Update(); 135 110 } 136 111 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiency(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiency();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc
r1974 r2015 86 86 } 87 87 88 //-------------------------------------------------------------------------89 //90 // Defualt Destructor91 //92 MHMcEfficiencyEnergy::~MHMcEfficiencyEnergy()93 {94 }95 96 88 // ------------------------------------------------------------------------ 97 89 // … … 100 92 void MHMcEfficiencyEnergy::Draw(Option_t *option) 101 93 { 102 if (!gPad)103 MH::MakeDefCanvas(&fHist);94 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 95 pad->SetBorderMode(0); 104 96 105 gPad->SetLogx(); 97 AppendPad(""); 98 99 pad->SetLogx(); 106 100 107 101 fHist.Draw(option); 108 102 109 gPad->Modified(); 110 gPad->Update(); 111 } 112 113 TObject *MHMcEfficiencyEnergy::DrawClone(Option_t *option) const 114 { 115 TCanvas *c = MH::MakeDefCanvas(&fHist); 116 117 c->SetLogx(); 118 119 // 120 // This is necessary to get the expected bahviour of DrawClone 121 // 122 gROOT->SetSelectedPad(NULL); 123 124 ((TH1D&)fHist).DrawCopy(option); 125 126 c->Modified(); 127 c->Update(); 128 129 return c; 103 pad->Modified(); 104 pad->Update(); 130 105 } 131 106 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiencyEnergy(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiencyEnergy();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc
r1974 r2015 86 86 } 87 87 88 //-------------------------------------------------------------------------89 //90 // Defualt Destructor91 //92 MHMcEfficiencyImpact::~MHMcEfficiencyImpact()93 {94 }95 96 88 // ------------------------------------------------------------------------ 97 89 // … … 100 92 void MHMcEfficiencyImpact::Draw(Option_t *option) 101 93 { 102 if (!gPad)103 MH::MakeDefCanvas(&fHist);94 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 95 pad->SetBorderMode(0); 104 96 105 gPad->SetLogx(); 97 AppendPad(""); 98 99 pad->SetLogx(); 106 100 107 101 fHist.Draw(option); 108 102 109 gPad->Modified();110 gPad->Update();103 pad->Modified(); 104 pad->Update(); 111 105 } 112 106 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiencyImpact(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiencyImpact();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc
r1974 r2015 170 170 void MHMcEnergy::Draw(Option_t *option) 171 171 { 172 if (!gPad) 173 MH::MakeDefCanvas(fHist); 172 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 173 pad->SetBorderMode(0); 174 175 AppendPad(""); 174 176 175 177 fHist->Draw(option); … … 177 179 DrawLegend(); 178 180 179 gPad->Modified(); 180 gPad->Update(); 181 } 182 183 TObject *MHMcEnergy::DrawClone(Option_t *option) const 184 { 185 TCanvas *c = MH::MakeDefCanvas(fHist); 186 187 // 188 // This is necessary to get the expected bahviour of DrawClone 189 // 190 gROOT->SetSelectedPad(NULL); 191 192 fHist->DrawClone(option); 193 194 DrawLegend(); 195 196 c->Modified(); 197 c->Update(); 198 199 return c; 181 pad->Modified(); 182 pad->Update(); 200 183 } 201 184 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h
r1974 r2015 49 49 50 50 void Draw(Option_t* option = ""); 51 TObject *DrawClone(Option_t* option = "") const;52 51 53 52 void Print(Option_t* option = NULL) const; -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc
r1992 r2015 93 93 } 94 94 95 //-------------------------------------------------------------------------96 //97 // Defualt Destructor98 //99 MHMcEnergyImpact::~MHMcEnergyImpact()100 {101 }102 103 104 95 Bool_t MHMcEnergyImpact::SetupFill(const MParList *pList) 105 96 { … … 137 128 void MHMcEnergyImpact::Draw(Option_t *option) 138 129 { 139 if (!gPad)140 MH::MakeDefCanvas(&fHist);130 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 131 pad->SetBorderMode(0); 141 132 142 gPad->SetLogx(); 133 AppendPad(""); 134 135 pad->SetLogx(); 143 136 144 137 fHist.Draw(option); 145 138 146 gPad->Modified();147 gPad->Update();139 pad->Modified(); 140 pad->Update(); 148 141 } 149 150 TObject *MHMcEnergyImpact::DrawClone(Option_t *option) const151 {152 TCanvas *c = MH::MakeDefCanvas(&fHist);153 154 c->SetLogx();155 156 //157 // This is necessary to get the expected bahviour of DrawClone158 //159 gROOT->SetSelectedPad(NULL);160 161 ((TH2D&)fHist).DrawCopy(option);162 163 c->Modified();164 c->Update();165 166 return c;167 }168 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h
r1992 r2015 18 18 public: 19 19 MHMcEnergyImpact(const char *name=NULL, const char *title=NULL); 20 ~MHMcEnergyImpact();21 20 22 21 void SetName(const char *name); … … 32 31 33 32 void Draw(Option_t* option = ""); 34 TObject *DrawClone(Option_t* option = "") const;35 33 36 34 ClassDef(MHMcEnergyImpact, 1) // Histogram container for 2D histogram in Energy and Impact -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc
r1992 r2015 107 107 // -------------------------------------------------------------------------- 108 108 // 109 // Draw a copy of the histogram110 //111 TObject *MHMcEnergyMigration::DrawClone(Option_t *opt) const112 {113 TCanvas &c = *MakeDefCanvas("EnergyMigration", "E-est vs. E-true");114 115 c.Divide(2, 2);116 117 gROOT->SetSelectedPad(NULL);118 119 TH1 *h;120 121 c.cd(1);122 h = ((TH3*)(&fHist))->Project3D("expro");123 124 h->SetTitle("Distribution of E-true");125 h->SetXTitle("E_{true} [GeV]");126 h->SetYTitle("Counts");127 128 h->Draw(opt);129 h->SetBit(kCanDelete);130 gPad->SetLogx();131 132 133 c.cd(2);134 h = ((TH3*)(&fHist))->Project3D("eypro");135 136 h->SetTitle("Distribution of E-est");137 h->SetXTitle("E_{est} [GeV]");138 h->SetYTitle("Counts");139 140 h->Draw(opt);141 h->SetBit(kCanDelete);142 gPad->SetLogx();143 144 c.cd(3);145 h = ((TH3*)(&fHist))->Project3D("ezpro");146 147 h->SetTitle("Distribution of Theta");148 h->SetXTitle("\\Theta [\\circ]");149 h->SetYTitle("Counts");150 151 h->Draw(opt);152 h->SetBit(kCanDelete);153 154 155 c.cd(4);156 ((TH3*)(&fHist))->DrawCopy(opt);157 158 c.Modified();159 c.Update();160 161 return &c;162 }163 164 // --------------------------------------------------------------------------165 //166 109 // Draw the histogram 167 110 // 168 111 void MHMcEnergyMigration::Draw(Option_t *opt) 169 112 { 170 if (!gPad)171 MakeDefCanvas("EnergyMigration", "E-est vs. E-true");113 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 114 pad->SetBorderMode(0); 172 115 173 gPad->Divide(2,2); 116 AppendPad(""); 117 118 pad->Divide(2,2); 174 119 175 120 TH1 *h; 176 121 177 gPad->cd(1); 122 pad->cd(1); 123 gPad->SetBorderMode(0); 124 gPad->SetLogx(); 178 125 h = fHist.Project3D("ex_pro"); 179 180 h->SetTitle("Distribution of E-true"); 126 h->SetTitle("Distribution of E_{true}"); 181 127 h->SetXTitle("E_{true} [GeV]"); 182 183 128 h->Draw(opt); 184 129 h->SetBit(kCanDelete); 130 131 pad->cd(2); 132 gPad->SetBorderMode(0); 185 133 gPad->SetLogx(); 186 187 188 gPad->cd(2);189 134 h = fHist.Project3D("ey_pro"); 190 191 h->SetTitle("Distribution of E-est"); 135 h->SetTitle("Distribution of E_{est}"); 192 136 h->SetXTitle("E_{est} [GeV]"); 193 137 h->Draw(opt); 194 138 h->SetBit(kCanDelete); 195 gPad->SetLogx();196 139 197 gPad->cd(3); 140 pad->cd(3); 141 gPad->SetBorderMode(0); 198 142 h = fHist.Project3D("ez_pro"); 199 200 h->SetTitle("Distribution of Theta"); 143 h->SetTitle("Distribution of \\Theta"); 201 144 h->SetXTitle("\\Theta [\\circ]"); 202 145 h->Draw(opt); 203 146 h->SetBit(kCanDelete); 204 147 148 pad->cd(4); 149 gPad->SetBorderMode(0); 150 fHist.Draw(opt); 205 151 206 gPad->cd(4); 207 fHist.DrawCopy(opt); 208 209 gPad->Modified(); 210 gPad->Update(); 152 pad->Modified(); 153 pad->Update(); 211 154 } 212 155 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h
r2010 r2015 34 34 35 35 void Draw(Option_t *option=""); 36 TObject *DrawClone(Option_t *option="") const;37 36 38 37 ClassDef(MHMcEnergyMigration, 1) //3D-histogram E-true E-est Theta -
trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc
r1974 r2015 20 20 ! Author(s): Abelardo Moralejo 2/2003 21 21 ! 22 ! Explanations on the rate calculation can be found in23 ! chapter 7 of the following diploma thesis:24 ! http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)25 !26 22 ! Copyright: MAGIC Software Development, 2000-2001 27 23 ! 28 24 ! 29 25 \* ======================================================================== */ 26 27 ///////////////////////////////////////////////////////////////////////////// 28 // 29 // Explanations on the rate calculation can be found in 30 // chapter 7 of the following diploma thesis: 31 // http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian) 32 // 33 //////////////////////////////////////////////////////////////////////////// 30 34 31 35 #include "MHMcRate.h" … … 251 255 } 252 256 253 TObject *MHMcRate::DrawClone(Option_t *) const 254 { 255 *fLog << all << dbginf << " - MHMcRate::DrawClone: To be iplemented" << endl; 256 return NULL; 257 } 257 q -
trunk/MagicSoft/Mars/mhistmc/MHMcRate.h
r1974 r2015 12 12 UShort_t fPartId; // Type of particle 13 13 14 Float_t fEnergyMax; // Maximum Energy in TeV15 Float_t fEnergyMin; // Minimum Energy in TeV14 Float_t fEnergyMax; // Maximum Energy [TeV] 15 Float_t fEnergyMin; // Minimum Energy [TeV] 16 16 17 Float_t fThetaMax; // Maximum theta angle of run 18 Float_t fThetaMin; // Minimum theta angle of run 19 Float_t fPhiMax; // Maximum phi angle of run 20 Float_t fPhiMin; // Minimum phi angle of run 17 Float_t fThetaMax; // Maximum theta angle of run [?] 18 Float_t fThetaMin; // Minimum theta angle of run [?] 19 Float_t fPhiMax; // Maximum phi angle of run [?] 20 Float_t fPhiMin; // Minimum phi angle of run [?] 21 21 22 Float_t fSolidAngle; // Solid angle within which incident directions 23 // are distributed (sr) 22 Float_t fSolidAngle; // Solid angle within which incident directions are distributed [sr] 24 23 25 Float_t fImpactMax; // Maximum impact parameter (cm)26 Float_t fImpactMin; // Minimum impact parameter (cm)24 Float_t fImpactMax; //[cm] Maximum impact parameter [cm] 25 Float_t fImpactMin; //[cm] Minimum impact parameter [cm] 27 26 28 27 Float_t fBackTrig; // Number of triggers from background … … 38 37 Float_t fTriggerRateError; // Estimated error for the trigger rate in Hz 39 38 40 Float_t fMeanThreshold; // Mean discriminator threshold (mV) of trigger 41 // pixels. 39 Float_t fMeanThreshold; // Mean discriminator threshold of trigger pixels [mV] 42 40 43 41 Short_t fMultiplicity; // L1 trigger multiplicity. 44 42 45 Short_t fTriggerCondNum; // Trigger condition number, for the case of 46 // running over camra files containing several. 43 Short_t fTriggerCondNum; // Trigger condition number, for the case of running over camra files containing several. 47 44 48 45 void Init(const char *name, const char *title); … … 93 90 94 91 void Draw(Option_t *o=NULL); 95 TObject *DrawClone(Option_t *o=NULL) const;96 92 97 93 ClassDef(MHMcRate, 1) // Data Container to calculate trigger rate -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r1976 r2015 226 226 // To disable redirction call SetLogStream(NULL) 227 227 // 228 void MStatusDisplay::SetLogStream(MLog *log) 228 // if enable==kFALSE the stdout is disabled/enabled. Otherwise stdout 229 // is ignored. 230 // 231 void MStatusDisplay::SetLogStream(MLog *log, Bool_t enable) 229 232 { 230 233 if (log && fLogBox==NULL) … … 256 259 257 260 log->SetOutputGui(fLogBox, kTRUE); 258 log->DisableOutputDevice(MLog::eStdout);259 261 log->EnableOutputDevice(MLog::eGui); 262 if (!enable) 263 log->DisableOutputDevice(MLog::eStdout); 260 264 261 265 fLogTimer.Start(); … … 266 270 267 271 fLog->DisableOutputDevice(MLog::eGui); 268 fLog->EnableOutputDevice(MLog::eStdout);269 272 fLog->SetOutputGui(NULL); 273 if (!enable) 274 fLog->EnableOutputDevice(MLog::eStdout); 270 275 271 276 fLog = &gLog; … … 1134 1139 if (num<0) 1135 1140 *fLog << inf << " - "; 1136 *fLog << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") ";1141 *fLog << inf << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") "; 1137 1142 if (num>0) 1138 1143 *fLog << "to " << name; -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r1965 r2015 105 105 virtual ~MStatusDisplay(); 106 106 107 void SetLogStream(MLog *log );107 void SetLogStream(MLog *log, Bool_t enable=kFALSE); 108 108 109 109 void StartUpdate(Int_t millisec=-1);
Note:
See TracChangeset
for help on using the changeset viewer.