Changeset 5620 for trunk/MagicSoft/Mars/mhvstime
- Timestamp:
- 12/17/04 13:27:08 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
r4891 r5620 83 83 // 84 84 MHVsTime::MHVsTime(const char *rule, const char *error) 85 : fGraph(NULL), fData(NULL), fError( 0), fScale(1), fMaxPts(-1),85 : fGraph(NULL), fData(NULL), fError(NULL), fScale(1), fMaxPts(-1), 86 86 fNumEvents(1), fUseEventNumber(0) 87 87 { … … 114 114 if (fData) 115 115 delete fData; 116 117 if (fError) 118 delete fError; 116 119 } 117 120 … … 169 172 { 170 173 fGraph->SetName(name); 171 M ParContainer::SetName(name);174 MH::SetName(name); 172 175 } 173 176 … … 179 182 { 180 183 fGraph->SetTitle(title); 181 M ParContainer::SetTitle(title);184 MH::SetTitle(title); 182 185 } 183 186 … … 247 250 void MHVsTime::Paint(Option_t *opt) 248 251 { 252 /* 253 *fLog << all << fGraph << " " << gPad->GetName() << " ----> Paint " << opt << endl; 254 TListIter Next(gPad->GetListOfPrimitives()); TObject *obj; 255 while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << endl; 256 */ 257 258 if (!fGraph) 259 return; 260 261 // *fLog << all << fGraph->GetN() << " " << opt << endl; 262 263 if (fGraph->GetN()==0) 264 return; 265 266 TString str(opt); 267 if (!str.Contains("A")) 268 str += "A"; 269 if (!str.Contains("P")) 270 str += "P"; 271 if (str.Contains("same", TString::kIgnoreCase)) 272 { 273 str.ReplaceAll("same", ""); 274 str.ReplaceAll("A", ""); 275 } 276 249 277 // SetPoint deletes the histogram! 250 278 if (fUseEventNumber) … … 264 292 // Otherwise MStatusDisplay::Update hangs. 265 293 gPad->GetListOfPrimitives()->Remove(fGraph); 266 gPad->GetListOfPrimitives()->Add(fGraph, fGraph->GetN()<2 ? "A" : opt); 294 fGraph->Draw(fGraph->GetN()<2 ? "A" : str); 295 //gPad->GetListOfPrimitives()->Add(fGraph, fGraph->GetN()<2 ? "A" : opt); 296 // AppendPad(str); 297 // fGraph->Draw(str); 298 267 299 } 268 300 … … 275 307 void MHVsTime::Draw(Option_t *opt) 276 308 { 277 if (!fGraph)278 return;279 280 if (fGraph->GetN()==0)281 return;282 283 309 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fGraph); 284 310 pad->SetBorderMode(0); 285 286 TString str(opt); 287 288 if (!str.Contains("A")) 289 str += "A"; 290 if (!str.Contains("P")) 291 str += "P"; 292 293 if (str.Contains("same", TString::kIgnoreCase)) 294 { 295 str.ReplaceAll("same", ""); 296 str.ReplaceAll("A", ""); 297 } 298 299 AppendPad(str); 300 fGraph->Draw(str); 311 AppendPad(opt); 301 312 } 302 313
Note:
See TracChangeset
for help on using the changeset viewer.