Changeset 2414
- Timestamp:
- 10/20/03 18:33:11 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MFillH.cc
r2206 r2414 324 324 const Ssiz_t length = last-first-1; 325 325 326 // 327 // Make a copy before stripping leading and trailing White Spaces. 328 // 326 329 TString strip = fHName(first+1, length); 327 330 return strip.Strip(TString::kBoth); … … 340 343 return kTRUE; 341 344 342 if (!fH->OverwritesDraw())343 return kTRUE;344 345 345 if (TestBit(kDoNotDisplay)) 346 346 return kTRUE; 347 347 348 const Bool_t dr = fH->OverwritesDraw(); 349 const Bool_t ts = fH->OverwritesDraw(NULL, "TS"); 350 if (!dr && !ts) 351 return kTRUE; 352 353 if (!ts) 354 { 355 *fLog << warn << "You overwrote " << fH->ClassName() << "::"; 356 *fLog << "Draw instead of " << fH->ClassName() << "::DrawTS" << endl; 357 *fLog << "This is not thread safe and might result in trouble using" << endl; 358 *fLog << "multithreaded programs like MONA." << endl; 359 *fLog << "" << endl; 360 return kTRUE; 361 } 362 348 363 fCanvas = &fDisplay->AddTab(fH->GetName()); 349 fH->Draw(); 364 fH->DrawTS(fCanvas); 365 366 return kTRUE; 367 } 368 369 // -------------------------------------------------------------------------- 370 // 371 // 372 Bool_t MFillH::DrawCloneToDisplay() 373 { 374 fH->DrawCloneTS(fCanvas); 375 fCanvas->Modified(); 376 fCanvas->Update(); 350 377 351 378 return kTRUE; … … 506 533 // 507 534 if (fDisplay && fDisplay->HasCanvas(fCanvas)) 508 { 509 fCanvas->cd(); 510 fH->DrawClone("nonew"); 511 fCanvas->Modified(); 512 fCanvas->Update(); 513 } 535 DrawCloneToDisplay(); 514 536 515 537 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MFillH.h
r2206 r2414 44 44 45 45 Bool_t DrawToDisplay(); 46 Bool_t DrawCloneToDisplay(); 46 47 47 48 public: … … 63 64 Int_t PostProcess(); 64 65 66 MH *GetH() { return fH; } 67 TCanvas *GetCanvas() { return fCanvas; } 68 65 69 ClassDef(MFillH, 2) // Task to fill a histogram with data from a parameter container 66 70 }; -
trunk/MagicSoft/Mars/mhist/MHHadronness.cc
r2307 r2414 503 503 gPad->SetBorderMode(0); 504 504 //gStyle->SetOptStat(10); 505 MH::Draw (*fGhness, *fPhness, "Hadronness"); // Displ both stat boxes505 MH::DrawSame(*fGhness, *fPhness, "Hadronness"); // Displ both stat boxes 506 506 507 507 pad->cd(2); -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
r2377 r2414 171 171 } 172 172 173 void MHTriggerLvl0::Draw (Option_t *)173 void MHTriggerLvl0::DrawTS(TVirtualPad *p=NULL, Option_t * ="") 174 174 { 175 TVirtualPad *pad = gPad ? gPad: MakeDefCanvas(this);175 TVirtualPad *pad = p ? p : MakeDefCanvas(this); 176 176 pad->SetBorderMode(0); 177 177 178 //----------------------------- 178 179 pad->Divide(1,2); 179 180 180 pad->cd(1); 181 gPad->SetBorderMode(0); 182 gPad->Divide(1,1); 183 gPad->cd(1); 184 gPad->SetBorderMode(0); 185 fSum->Draw(); 181 p = pad->GetPad(1); 182 p->SetBorderMode(0); 183 p->Divide(1,1); 184 p->cd(1); 185 p->SetBorderMode(0); 186 // fSum does not derive from MParContainer 187 MParContainer::DrawTS(fSum, p); 186 188 187 pad->cd(2); 188 gPad->SetBorderMode(0); 189 fSum->Draw("EPhist"); 189 p = pad->GetPad(2); 190 p->SetBorderMode(0); 191 // fSum does not derive from MParContainer 192 MParContainer::DrawTS(fSum, p, "EPhist"); 193 //----------------------------- 194 195 //MParContainer::DrawTS(fSum, p); 190 196 } -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h
r2298 r2414 34 34 TH1 *GetHistByName(const TString name=""); 35 35 36 void Draw(Option_t * =""); 36 //void Draw(Option_t * =""); 37 void DrawTS(TVirtualPad *pad=NULL, Option_t * =""); 37 38 38 39 void PrintOutlayers(Float_t s) const; -
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r2320 r2414 278 278 gStyle->SetPalette(50, c); 279 279 } 280 280 /* 281 281 // -------------------------------------------------------------------------- 282 282 // … … 323 323 pad->Update(); 324 324 } 325 */ 326 327 // -------------------------------------------------------------------------- 328 // 329 // Creates a new canvas and draws the four histograms into it. 330 // Be careful: The histograms belongs to this object and won't get deleted 331 // together with the canvas. 332 // 333 void MHHillas::DrawTS(TVirtualPad *p, Option_t *) 334 { 335 TVirtualPad *pad = p ? p : MakeDefCanvas(this); 336 pad->SetBorderMode(0); 337 338 MParContainer::DrawTS(pad); 339 340 pad->Divide(2,3); 341 342 p = pad->GetPad(1); 343 p->SetBorderMode(0); 344 MH::DrawSame(*fWidth, *fLength, "Width'n'Length", p); 345 346 p = pad->GetPad(2); 347 p->SetBorderMode(0); 348 MParContainer::DrawTS(fDistC, p); 349 350 p = pad->GetPad(3); 351 p->SetBorderMode(0); 352 p->SetLogx(); 353 MParContainer::DrawTS(fSize, p); 354 355 p = pad->GetPad(4); 356 p->SetBorderMode(0); 357 p->SetPad(0.51, 0.01, 0.99, 0.65); 358 SetColors(); 359 MParContainer::DrawTS(fCenter, p, "colz"); 360 361 p = pad->GetPad(5); 362 p->SetBorderMode(0); 363 MParContainer::DrawTS(fDelta, p); 364 365 delete pad->GetPad(6); 366 367 pad->Modified(); 368 pad->Update(); 369 } 370 325 371 326 372 TH1 *MHHillas::GetHistByName(const TString name) -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r2043 r2414 51 51 TH2F *GetHistCenter() { return fCenter; } 52 52 53 void Draw(Option_t *opt=NULL); 53 //void Draw(Option_t *opt=NULL); 54 void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL); 54 55 55 56 //Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; } -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r2320 r2414 242 242 pad->cd(1); 243 243 gPad->SetBorderMode(0); 244 MH::Draw (fHM3Long, fHM3Trans, "3^{rd} Moments");244 MH::DrawSame(fHM3Long, fHM3Trans, "3^{rd} Moments"); 245 245 246 246 pad->cd(2); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r2320 r2414 198 198 // together with the canvas. 199 199 // 200 void MHHillasSrc::Draw (Option_t *)201 { 202 TVirtualPad *pad = gPad ? gPad: MakeDefCanvas(this);200 void MHHillasSrc::DrawTS(TVirtualPad *p, Option_t *) 201 { 202 TVirtualPad *pad = p ? p : MakeDefCanvas(this); 203 203 pad->SetBorderMode(0); 204 204 205 AppendPad(""); 205 // 206 // Add this object to the given pad 207 // 208 MParContainer::DrawTS(pad); 206 209 207 210 // FIXME: Display Source position 208 211 212 // 213 // Fill the pad with histograms 214 // 209 215 pad->Divide(2, 2); 210 216 211 pad->cd(1); 212 gPad->SetBorderMode(0); 213 fAlpha->Draw(); 214 215 pad->cd(2); 216 gPad->SetBorderMode(0); 217 fDist->Draw(); 218 219 pad->cd(4); 220 gPad->SetBorderMode(0); 221 //gPad->SetLogy(); 222 fCosDA->Draw(); 217 p = pad->GetPad(1); 218 p->SetBorderMode(0); 219 MParContainer::DrawTS(fAlpha, p); 220 221 p = pad->GetPad(2); 222 p->SetBorderMode(0); 223 MParContainer::DrawTS(fDist, p); 224 225 delete pad->GetPad(3); 226 227 p = pad->GetPad(4); 228 p->SetBorderMode(0); 229 MParContainer::DrawTS(fCosDA, p); 223 230 224 231 pad->Modified(); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.h
r2100 r2414 35 35 TH1F *GetHistCosDeltaAlpha() { return fCosDA; } 36 36 37 void Draw(Option_t *opt=NULL); 37 //void Draw(Option_t *opt=NULL); 38 void DrawTS(TVirtualPad *pad=NULL, Option_t *opt=NULL); 38 39 void Paint(Option_t *opt); 39 40 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r2320 r2414 191 191 TAxis &x = *fHistLeakage1.GetXaxis(); 192 192 x.SetRangeUser(0.0, x.GetXmax()); 193 MH::Draw (fHistLeakage1, fHistLeakage2, "Leakage1 and Leakage2");193 MH::DrawSame(fHistLeakage1, fHistLeakage2, "Leakage1 and Leakage2"); 194 194 195 195 pad->cd(2); 196 196 gPad->SetBorderMode(0); 197 MH::Draw (fHistCorePix, fHistUsedPix, "Number of core/used Pixels");197 MH::DrawSame(fHistCorePix, fHistUsedPix, "Number of core/used Pixels"); 198 198 199 199 pad->cd(3); 200 200 gPad->SetBorderMode(0); 201 MH::Draw (fHistConc1, fHistConc, "Concentrations");201 MH::DrawSame(fHistConc1, fHistConc, "Concentrations"); 202 202 203 203 pad->cd(4); -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2372 r2414 215 215 // <index> The pixel with the given index is drawn 216 216 // 217 void MRawEvtData::Draw(Option_t *opt) 217 // Rem: DrawTS is the thread-safe version of Draw. In most cases 218 // you can use Draw instead 219 // 220 void MRawEvtData::DrawTS(TVirtualPad *pad=NULL, Option_t *opt="") 218 221 { 219 222 if (GetNumPixels()==0) 220 223 { 221 224 *fLog << warn << "Sorry, no pixel to draw!" << endl; 225 return; 226 } 227 if (!pad) 228 { 229 *fLog << warn << "MRawEvtData::DrawTS - No pad available..." << endl; 222 230 return; 223 231 } … … 238 246 if (!pix.Jump(id)) 239 247 { 240 *fLog << warn << "Pixel Idx #" << id << " doesn't exist!" << endl;248 *fLog << warn << "Pixel Idx #" << dec << id << " doesn't exist!" << endl; 241 249 return; 242 250 } … … 255 263 if (str.BeginsWith("graph")) 256 264 { 257 *fLog << inf << "Drawing Graph: Pixel Idx #" << pix.GetPixelId();265 *fLog << inf << "Drawing Graph: Pixel Idx #" << dec << pix.GetPixelId(); 258 266 *fLog << " of " << (int)GetNumPixels() << "Pixels" << endl; 259 267 … … 267 275 268 276 graphhi->SetBit(kCanDelete); 269 graphhi->Draw(same ? "C*" : "AC*");277 MParContainer::DrawTS(graphhi, pad, same ? "C*" : "AC*"); 270 278 271 279 TH1F *histhi = graphhi->GetHistogram(); … … 286 294 287 295 graphlo->SetBit(kCanDelete); 288 graphlo->Draw("C*");296 MParContainer::DrawTS(graphlo, pad, "C*"); 289 297 290 298 TH1F *histlo = graphlo->GetHistogram(); … … 300 308 { 301 309 // FIXME: Add Legend 302 *fLog << inf << "Drawing Histogram of Pixel with Idx #" << pix.GetPixelId() << endl; 310 *fLog << inf << "Drawing Histogram of Pixel with Idx #"; 311 *fLog << dec << pix.GetPixelId() << endl; 303 312 304 313 TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5); … … 309 318 histh->Fill(i, higains[i]); 310 319 histh->SetBit(kCanDelete); 311 histh->Draw(same ? "same" : "");320 MParContainer::DrawTS(histh, pad, same ? "same" : ""); 312 321 313 322 if (nl>0) … … 319 328 histl->Fill(i, logains[i]); 320 329 histl->SetBit(kCanDelete); 321 histl->Draw("same");330 MParContainer::DrawTS(histl, pad, "same"); 322 331 } 323 332 return; … … 516 525 return kTRUE; 517 526 } 527 528 void MRawEvtData::Copy(TObject &named) 529 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 530 const 531 #endif 532 { 533 MRawEvtData &evt = (MRawEvtData &)named; 534 535 *evt.fHiGainPixId = *fHiGainPixId; 536 *evt.fLoGainPixId = *fLoGainPixId; 537 538 *evt.fHiGainFadcSamples = *fHiGainFadcSamples; 539 *evt.fLoGainFadcSamples = *fLoGainFadcSamples; 540 541 evt.fPosInArray = fPosInArray; 542 evt.fConnectedPixels = fConnectedPixels; 543 evt.fArraySize = fArraySize; 544 } 545 -
trunk/MagicSoft/Mars/mraw/MRawEvtData.h
r2207 r2414 24 24 // FIXME: COMMENT ABOUT ORDERING 25 25 26 MArrayS *fHiGainPixId; // list of pixel IDs of hi gain channel27 MArrayB *fHiGainFadcSamples; // list of hi gain samples of all pixels (ordering: see fHiGainPixId)26 MArrayS *fHiGainPixId; //-> list of pixel IDs of hi gain channel 27 MArrayB *fHiGainFadcSamples; //-> list of hi gain samples of all pixels (ordering: see fHiGainPixId) 28 28 29 MArrayS *fLoGainPixId; // list of pixel IDs of lo gain channel30 MArrayB *fLoGainFadcSamples; // list of lo gain samples of all pixels (ordering: see fLoGainPixId)29 MArrayS *fLoGainPixId; //-> list of pixel IDs of lo gain channel 30 MArrayB *fLoGainFadcSamples; //-> list of lo gain samples of all pixels (ordering: see fLoGainPixId) 31 31 32 32 Int_t fPosInArray; //! … … 52 52 void Clear(Option_t * = NULL); 53 53 void Print(Option_t * = NULL) const; 54 void Draw (Option_t * = NULL); 54 void DrawTS(TVirtualPad *pad=NULL, Option_t *option=""); 55 void Copy(TObject &named) 56 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 57 const 58 #endif 59 ; 55 60 56 61 void DeletePixels(Bool_t flag=kFALSE); … … 65 70 66 71 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 67 void DrawPixelContent(Int_t num ) const72 void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const 68 73 { 69 74 TString s("HIST"); 70 75 s += num; 71 const_cast<MRawEvtData*>(this)->Draw(s); 76 const_cast<MRawEvtData*>(this)->DrawTS(pad, s); 77 //const_cast<MRawEvtData*>(this)->Draw(s); 72 78 } 73 79
Note:
See TracChangeset
for help on using the changeset viewer.