]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPainterDataSourceFrame.cxx
Create the magnetic field map in the reconstruction macros (Yuri)
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterDataSourceFrame.cxx
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  *
14 **************************************************************************/
15
16 // $Id$
17
18 #include <cstdlib>
19 #include "AliMUONPainterDataSourceFrame.h"
20
21
22 #include "AliLog.h"
23 #include "AliMUONPainterDataSourceItem.h"
24 #include "AliMUONPainterEnv.h"
25 #include "AliMUONPainterHelper.h"
26 #include "AliMUONPainterRegistry.h"
27 #include "AliMUONTrackerCalibratedDataMaker.h"
28 #include "AliMUONTrackerOCDBDataMaker.h"
29 #include "AliMUONTrackerRawDataMaker.h"
30 #include "AliRawReader.h"
31 #include <TGButton.h>
32 #include <TGComboBox.h>
33 #include <TGFileDialog.h>
34 #include <TGNumberEntry.h>
35 #include <TGTextEntry.h>
36 #include <TGrid.h>
37 #include <TObjArray.h>
38 #include <TObjString.h>
39 #include <TRegexp.h>
40 #include <TString.h>
41 #include <TSystem.h>
42
43 ///\class AliMUONPainterDataSourceFrame
44 ///
45 /// A complete frame to select and display various data sources to 
46 /// be displayed : either raw data or OCDB data. 
47 /// Later on we might add digits and clusters for instance.
48 ///
49 ///\author Laurent Aphecetche, Subatech
50
51 const char* AliMUONPainterDataSourceFrame::fgkNumberOfDataSourcesKey = "NumberOfDataSources";
52 const char* AliMUONPainterDataSourceFrame::fgkDataSourceURIKey = "DataSourceURI.%d";
53
54 ///\cond CLASSIMP
55 ClassImp(AliMUONPainterDataSourceFrame)
56 ///\endcond
57
58 //_____________________________________________________________________________
59 AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p, UInt_t w, UInt_t h)
60 : TGCompositeFrame(p,w,h,kVerticalFrame),
61   fRecentSourceSelector(new TGGroupFrame(this,"Recent sources",kHorizontalFrame)),
62   fRawSelector(new TGGroupFrame(this,"Raw file URI",kHorizontalFrame)),
63   fRawSelector2(new TGCompositeFrame(fRawSelector,w,h,kVerticalFrame)),
64   fRawSelector21(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
65   fRawSelector22(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
66   fRawSelector23(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
67   fCalibrateNoGain(new TGCheckButton(fRawSelector22,"Ped subraction")),
68   fCalibrateGainConstantCapa(new TGCheckButton(fRawSelector22,"Ped subraction + gain (capa cste)")),
69   fCalibrateGain(new TGCheckButton(fRawSelector22,"Full calib (Ped subraction + gain with capa)")),
70   fHistogramButton(new TGCheckButton(fRawSelector23,"Histogram")),
71   fHistoMin(new TGNumberEntry(fRawSelector23,0)),
72   fHistoMax(new TGNumberEntry(fRawSelector23,4096)),
73   fRawOCDBPath(new TGTextEntry(fRawSelector22,"")),
74   fOCDBSelector(new TGGroupFrame(this,"OCDB Path",kHorizontalFrame)),
75   fDataReaders(new TGGroupFrame(this,"Data sources")),
76   fFilePath(new TGTextEntry(fRawSelector21,"")),
77   fOCDBPath(new TGTextEntry(fOCDBSelector,"")),
78   fRunSelector(new TGNumberEntry(fOCDBSelector,0)),
79   fOCDBTypes(new TGComboBox(fOCDBSelector)),
80   fRecentSources(new TGComboBox(fRecentSourceSelector)),
81   fItems(new TObjArray)
82 {
83   /// Ctor
84   
85     AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
86     
87     reg->Connect("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",
88                  "AliMUONPainterDataSourceFrame",
89                  this,
90                  "DataMakerWasRegistered(AliMUONVTrackerDataMaker*)");
91     
92     reg->Connect("DataMakerWasUnregistered(AliMUONVTrackerDataMaker*)",
93                  "AliMUONPainterDataSourceFrame",
94                  this,
95                  "DataMakerWasUnregistered(AliMUONVTrackerDataMaker*)");
96     
97     fItems->SetOwner(kFALSE);
98     
99     /// Recent source selection
100     
101     AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
102     
103     Int_t nsources = env->Integer(fgkNumberOfDataSourcesKey);
104     
105     for ( Int_t i = 0; i < nsources; ++i )
106     {
107       AddRecentSource(env->String(Form(fgkDataSourceURIKey,i)));
108     }
109
110     fRecentSources->Resize(100,20);
111     
112     TGButton* createRecentButton = new TGTextButton(fRecentSourceSelector,"Create data source");
113     createRecentButton->Connect("Clicked()",
114                                 "AliMUONPainterDataSourceFrame",
115                                 this,
116                                 "OpenRecentSource()");
117     
118     fRecentSourceSelector->AddFrame(fRecentSources,new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
119     fRecentSourceSelector->AddFrame(createRecentButton,new TGLayoutHints(kLHintsTop,5,5,5,5));
120                                     
121     /// Raw file selection
122     
123     TGButton* openButton = new TGPictureButton(fRawSelector21,
124                                            gClient->GetPicture("fileopen.xpm"));
125     openButton->SetToolTipText("Click to open file dialog");
126                                         
127     fRawSelector2->AddFrame(fRawSelector21, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
128     fRawSelector2->AddFrame(fRawSelector22, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
129     fRawSelector2->AddFrame(fRawSelector23, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
130
131     fRawSelector21->AddFrame(openButton,new TGLayoutHints(kLHintsTop,5,5,5,5));
132     fRawSelector21->AddFrame(fFilePath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
133
134     fRawSelector22->AddFrame(fCalibrateNoGain, new TGLayoutHints(kLHintsTop,5,5,5,5));
135     fRawSelector22->AddFrame(fCalibrateGainConstantCapa, new TGLayoutHints(kLHintsTop,5,5,5,5));
136     fRawSelector22->AddFrame(fCalibrateGain, new TGLayoutHints(kLHintsTop,5,5,5,5));
137     fRawSelector22->AddFrame(fRawOCDBPath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
138     fRawOCDBPath->SetEnabled(kFALSE);
139     
140     fRawSelector23->AddFrame(fHistogramButton,new TGLayoutHints(kLHintsTop,5,5,5,5));
141     
142     fHistogramButton->Connect("Clicked()","AliMUONPainterDataSourceFrame",this,"HistogramButtonClicked()");
143     
144     fHistoMin->SetState(kFALSE);
145     fHistoMax->SetState(kFALSE);
146     
147     fRawSelector23->AddFrame(fHistoMin,new TGLayoutHints(kLHintsTop,5,5,5,5));
148     fRawSelector23->AddFrame(fHistoMax,new TGLayoutHints(kLHintsTop,5,5,5,5));
149     
150     TGButton* createRawButton = new TGTextButton(fRawSelector,"Create data source");
151     
152     fRawSelector->AddFrame(fRawSelector2, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
153     fRawSelector->AddFrame(createRawButton, new TGLayoutHints(kLHintsCenterY,5,5,5,5));
154         
155     fCalibrateNoGain->Connect("Clicked()","AliMUONPainterDataSourceFrame",this,"CalibrateButtonClicked()");
156     fCalibrateGainConstantCapa->Connect("Clicked()","AliMUONPainterDataSourceFrame",this,"CalibrateButtonClicked()");
157     fCalibrateGain->Connect("Clicked()","AliMUONPainterDataSourceFrame",this,"CalibrateButtonClicked()");
158
159     openButton->Connect("Clicked()",
160                         "AliMUONPainterDataSourceFrame",
161                         this,
162                         "OpenFileDialog()");
163
164     createRawButton->Connect("Clicked()",
165                         "AliMUONPainterDataSourceFrame",
166                         this,
167                         "CreateRawDataSource()");
168     
169     /// OCDB selection
170     
171     fOCDBTypes->AddEntry("Pedestals",0);
172     fOCDBTypes->AddEntry("Gains",1);
173     fOCDBTypes->AddEntry("Capacitances",2);
174     fOCDBTypes->Select(0);
175     fOCDBTypes->Resize(100,20);
176     
177     TGButton* createOCDBButton = new TGTextButton(fOCDBSelector,"Create data source");
178     createOCDBButton->Connect("Clicked()",
179                              "AliMUONPainterDataSourceFrame",
180                              this,
181                              "CreateOCDBDataSource()");
182     
183     
184     fOCDBSelector->AddFrame(fOCDBPath,new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));    
185     fOCDBSelector->AddFrame(fRunSelector,new TGLayoutHints(kLHintsTop,5,5,5,5));
186     fOCDBSelector->AddFrame(fOCDBTypes,new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
187     fOCDBSelector->AddFrame(createOCDBButton,new TGLayoutHints(kLHintsTop,5,5,5,5));
188
189     AddFrame(fRecentSourceSelector,new TGLayoutHints(kLHintsExpandX,10,10,10,10));
190
191     AddFrame(fRawSelector,new TGLayoutHints(kLHintsExpandX,10,10,10,10));
192
193     AddFrame(fOCDBSelector,new TGLayoutHints(kLHintsExpandX,10,10,10,10));
194
195     AddFrame(fDataReaders, new TGLayoutHints(kLHintsExpandX,10,10,10,10));
196     
197 }
198
199 //_____________________________________________________________________________
200 AliMUONPainterDataSourceFrame::~AliMUONPainterDataSourceFrame()
201 {
202   /// dtor
203   
204   delete fItems;
205 }
206
207 //_____________________________________________________________________________
208 void
209 AliMUONPainterDataSourceFrame::AddRecentSource(const char* name)
210 {  
211   /// Add a source to the list of recently used sources
212   
213   TGListBox* lb = fRecentSources->GetListBox();
214   
215   for ( Int_t i = 0; i < lb->GetNumberOfEntries(); ++i ) 
216   {
217     TGTextLBEntry* t = (TGTextLBEntry*)lb->GetEntry(i);
218     TString s(t->GetText()->GetString());
219     if ( s == name ) 
220     {
221       return;
222     }
223   }
224   
225   fRecentSources->AddEntry(name,lb->GetNumberOfEntries());
226   fRecentSources->MapSubwindows();
227   fRecentSources->Layout();
228 }
229
230 //_____________________________________________________________________________
231 void
232 AliMUONPainterDataSourceFrame::CalibrateButtonClicked()
233 {
234   /// Calibrate button was clicked.
235   
236   if ( fCalibrateNoGain->IsOn() ||
237        fCalibrateGainConstantCapa->IsOn() ||
238        fCalibrateGain->IsOn() ) 
239   {
240     fRawOCDBPath->SetEnabled(kTRUE);
241     fRawOCDBPath->SetFocus();
242   }
243   else
244   {
245     fRawOCDBPath->SetEnabled(kFALSE);
246   }
247 }
248
249 //_____________________________________________________________________________
250 void
251 AliMUONPainterDataSourceFrame::HistogramButtonClicked()
252 {
253   /// Histogram button was clicked.
254   
255   if ( fHistogramButton->IsOn() )
256   {
257     fHistoMin->SetState(kTRUE);
258     fHistoMax->SetState(kTRUE);
259   }
260   else
261   {
262     fHistoMin->SetState(kFALSE);
263     fHistoMax->SetState(kFALSE);
264   }
265 }
266
267 //_____________________________________________________________________________
268 void
269 AliMUONPainterDataSourceFrame::CreateOCDBDataSource()
270 {
271   /// Create an OCDB data source (using information from the widgets)
272   
273   TString cdbPath = fOCDBPath->GetText();
274   Int_t runNumber = fRunSelector->GetIntNumber();
275   TGTextLBEntry* t = static_cast<TGTextLBEntry*>(fOCDBTypes->GetSelectedEntry());
276   TString type = t->GetText()->GetString();
277   
278   CreateOCDBDataSource(cdbPath,runNumber,type);
279   
280   fOCDBPath->SetText("");
281   fRunSelector->SetNumber(0);  
282 }
283
284 //_____________________________________________________________________________
285 void
286 AliMUONPainterDataSourceFrame::CreateOCDBDataSource(const TString& uri)
287 {
288   /// Create an OCDB data source, given it's URI
289   
290   TObjArray* a = uri.Tokenize(";");
291   TString cdbPath = static_cast<TObjString*>(a->At(1))->String();
292   TString srun = static_cast<TObjString*>(a->At(2))->String();
293   TString type = static_cast<TObjString*>(a->At(3))->String();
294   
295   CreateOCDBDataSource(cdbPath,atoi(srun.Data()),type);
296   
297   delete a;
298 }
299
300 //_____________________________________________________________________________
301 void
302 AliMUONPainterDataSourceFrame::CreateOCDBDataSource(const TString& cdbPath,
303                                                     Int_t runNumber,
304                                                     const TString& type)
305 {
306   /// Create an OCDB data source for a given (path,runnumber,type) triplet
307   
308   AliMUONVTrackerDataMaker* reader = new AliMUONTrackerOCDBDataMaker(cdbPath.Data(),
309                                                                        runNumber,
310                                                                        type.Data());
311   
312   if ( reader->IsValid() ) 
313   {
314     AliMUONPainterRegistry::Instance()->Register(reader);
315     
316     AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
317     
318     Int_t n = env->Integer(fgkNumberOfDataSourcesKey);
319     
320     env->Set(fgkNumberOfDataSourcesKey,n+1);
321     
322     TString ds(Form("OCDB;%s;%d;%s",cdbPath.Data(),runNumber,type.Data()));
323     
324     env->Set(Form(fgkDataSourceURIKey,n),ds.Data());
325     
326     env->Save();
327     
328     AddRecentSource(ds.Data());
329   }
330 }
331
332 //_____________________________________________________________________________
333 void 
334 AliMUONPainterDataSourceFrame::CreateRawDataSource()
335 {
336   /// Create a new raw data source (using info from the widgets)
337   
338   TString uri(gSystem->ExpandPathName(fFilePath->GetText()));
339   
340   if ( gSystem->AccessPathName(uri.Data()) )
341   {
342     AliError(Form("File %s does not exist",uri.Data()));
343     fFilePath->SetText("");
344     return;
345   }
346
347   TString calibMode("");
348   TString name("RAW");
349   
350   if ( fCalibrateGain->IsOn() ) 
351   {
352     calibMode = "GAIN";
353     name = "CALC";
354   }
355   
356   if ( fCalibrateGainConstantCapa->IsOn() ) 
357   {
358     calibMode = "GAINCONSTANTCAPA";
359     name = "CALG";
360   }
361   
362   if ( fCalibrateNoGain->IsOn() ) 
363   {
364     calibMode = "NOGAIN";
365     name = "CALZ";
366   }
367   
368   uri = Form("%s%s;%s;%s;%s;%s;%s",
369              ( fHistogramButton->IsOn() ? "H":""),
370              name.Data(),uri.Data(),
371              ( strlen(fRawOCDBPath->GetText()) > 0 ? fRawOCDBPath->GetText() : " "),
372              ( calibMode.Length() > 0 ? calibMode.Data() : " "),
373              Form("%e",fHistoMin->GetNumber()),
374              Form("%e",fHistoMax->GetNumber()));
375   
376   if ( CreateRawDataSource(uri) )
377   {
378     fFilePath->SetText("");
379     fRawOCDBPath->SetText("");
380   }
381 }
382
383 //_____________________________________________________________________________
384 Bool_t 
385 AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri)
386 {
387   /// Create a new raw data source, given its URI
388   
389   TString filename;
390   TString ocdbPath;
391   TString calibMode;
392   TString sxmin("0.0");
393   TString sxmax("4096.0");
394   
395   TObjArray* a = uri.Tokenize(";");
396   
397   filename = static_cast<TObjString*>(a->At(1))->String();
398   
399   if ( a->GetLast() > 1 ) 
400   {
401     ocdbPath = static_cast<TObjString*>(a->At(2))->String();
402     if ( ocdbPath == " " ) ocdbPath = "";
403   }
404
405   if ( a->GetLast() > 2 ) 
406   {
407     calibMode = static_cast<TObjString*>(a->At(3))->String();
408     if ( calibMode == " " ) calibMode = "";
409   }
410
411   if ( a->GetLast() > 3 ) 
412   {
413     sxmin = static_cast<TObjString*>(a->At(4))->String();
414   }
415
416   if ( a->GetLast() > 4 ) 
417   {
418     sxmax = static_cast<TObjString*>(a->At(5))->String();
419   }
420   
421   AliRawReader* rawReader = 0x0;
422
423   if ( filename.Contains(TRegexp("^alien")) )
424   {
425     // insure we've initialized the grid...
426     if (!gGrid)
427     {
428       TGrid::Connect("alien://");
429     }
430   }
431   
432   rawReader = AliRawReader::Create(filename.Data());
433
434   if (!rawReader)
435   {
436     AliError(Form("Could not open file %s",filename.Data()));
437     fFilePath->SetText("");
438     return kFALSE;
439   }
440   
441   /// Basic test to see if the file is correct
442   Bool_t ok = rawReader->NextEvent();
443   if (!ok)
444   {
445     AliError(Form("File %s does not seem to be a raw data file",filename.Data()));
446     fFilePath->SetText("");
447     return kFALSE;
448   }
449   
450   rawReader->RewindEvents();
451   
452   AliMUONVTrackerDataMaker* reader(0x0);
453   Bool_t histogram(kFALSE);
454   
455   if ( uri.Contains(TRegexp("^H")) ) histogram = kTRUE;
456
457   if ( ocdbPath.Length() > 0 ) 
458   {
459     reader = new AliMUONTrackerCalibratedDataMaker(rawReader,ocdbPath.Data(),
460                                                    calibMode.Data(),
461                                                    histogram,
462                                                    sxmin.Atof(),
463                                                    sxmax.Atof());
464   }
465   else
466   {
467     reader = new AliMUONTrackerRawDataMaker(rawReader,histogram);
468   }
469   
470   reader->SetSource(filename.Data());
471   
472   AliMUONPainterRegistry::Instance()->Register(reader);
473   
474   AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
475   
476   Int_t n = env->Integer(fgkNumberOfDataSourcesKey);
477   
478   env->Set(fgkNumberOfDataSourcesKey,n+1);
479   
480   env->Set(Form(fgkDataSourceURIKey,n),uri.Data());
481   
482   AddRecentSource(uri.Data());
483   
484   env->Save();
485
486   return kTRUE;
487 }
488
489 //_____________________________________________________________________________
490 void 
491 AliMUONPainterDataSourceFrame::DataMakerWasRegistered(AliMUONVTrackerDataMaker* reader)
492 {
493   /// Update ourselves as a new data reader was created
494   
495   AliMUONPainterDataSourceItem* item = new AliMUONPainterDataSourceItem(fDataReaders,100,20,reader);
496       
497   item->Connect("StartRunning()",
498                 "AliMUONPainterDataSourceFrame",
499                 this,
500                 Form("StartRunning(=(AliMUONPainterDataSourceItem*)(0x%x))",item));
501
502   item->Connect("StopRunning()",
503                 "AliMUONPainterDataSourceFrame",
504                 this,
505                 Form("StopRunning(=(AliMUONPainterDataSourceItem*)(0x%x))",item));
506   
507   fDataReaders->AddFrame(item);
508   
509   fItems->Add(item);
510
511   fDataReaders->MapSubwindows();
512   fDataReaders->Resize();
513 }
514
515 //_____________________________________________________________________________
516 void 
517 AliMUONPainterDataSourceFrame::DataMakerWasUnregistered(AliMUONVTrackerDataMaker* maker)
518 {
519   /// Update ourselves as a data reader was deleted
520   
521   AliMUONPainterDataSourceItem* theItem(0x0);
522   
523   TIter next(fItems);
524   AliMUONPainterDataSourceItem* item;
525   
526   while ( ( item = static_cast<AliMUONPainterDataSourceItem*>(next()) ) && !theItem )
527   {
528     if ( item->DataMaker() == maker ) 
529     {
530       theItem = item;
531     }
532   }
533   
534   if  (!theItem) return;
535   
536   fDataReaders->RemoveFrame(theItem);
537   fItems->Remove(theItem);
538   theItem->DestroyWindow();
539   delete theItem;
540   
541   fDataReaders->MapSubwindows();
542   fDataReaders->Resize();
543
544 }
545
546 //_____________________________________________________________________________
547 void
548 AliMUONPainterDataSourceFrame::OpenFileDialog()
549 {
550   /// Open a file dialog to select a file to be read
551   
552   TGFileInfo fileInfo;
553   
554   const char* fileTypes[] = { 
555     "ROOT files","*.root",
556     "DATE files","*.raw",
557     "All files","*",
558     0,0 };
559   
560   fileInfo.fFileTypes = fileTypes;
561   delete[] fileInfo.fIniDir;
562
563   AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
564   
565   fileInfo.fIniDir = StrDup(env->String("LastOpenDir","."));
566   
567   new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
568                    kFDOpen,&fileInfo);
569   
570   fFilePath->SetText(gSystem->ExpandPathName(Form("%s",fileInfo.fFilename)));
571   
572   env->Set("LastOpenDir",fileInfo.fIniDir);
573   env->Save();  
574 }
575
576
577 //_____________________________________________________________________________
578 void
579 AliMUONPainterDataSourceFrame::OpenRecentSource()
580 {
581   /// Open one source from the recently used ones
582   
583   TGTextLBEntry* t = (TGTextLBEntry*)fRecentSources->GetSelectedEntry();
584
585   TString uri(t->GetText()->GetString());
586   
587   if ( uri.Contains(TRegexp("^RAW")) || uri.Contains(TRegexp("^HRAW")) || 
588        uri.Contains(TRegexp("^CAL")) || uri.Contains(TRegexp("^HCAL")) )
589   {
590     CreateRawDataSource(uri);
591   }
592   else if ( uri.Contains(TRegexp("^OCDB")) )
593   {
594     CreateOCDBDataSource(uri);
595   }
596   
597   fRecentSources->Select(-1);
598 }
599
600 //_____________________________________________________________________________
601 void
602 AliMUONPainterDataSourceFrame::StartRunning(AliMUONPainterDataSourceItem* item)
603 {
604   /// One data source starts running. Disable the Run button of the other ones
605   TIter next(fItems);
606   AliMUONPainterDataSourceItem* o;
607   while ( ( o = static_cast<AliMUONPainterDataSourceItem*>(next()) ) )
608   {
609     if ( o != item ) 
610     {
611       o->DisableRun();
612     }
613   }
614 }  
615
616 //_____________________________________________________________________________
617 void
618 AliMUONPainterDataSourceFrame::StopRunning(AliMUONPainterDataSourceItem* /*item*/)
619 {
620   /// One data source stops running. Enable the Run button of all items
621   TIter next(fItems);
622   AliMUONPainterDataSourceItem* o;
623   while ( ( o = static_cast<AliMUONPainterDataSourceItem*>(next()) ) )
624   {
625     o->EnableRun();
626   }
627 }
628