]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliRun.cxx
35edc45084ac98ba132c915db257ee57c5139afa
[u/mrichter/AliRoot.git] / STEER / AliRun.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 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Control class for Alice C++                                              //
21 //  Only one single instance of this class exists.                           //
22 //  The object is created in main program aliroot                            //
23 //  and is pointed by the global gAlice.                                     //
24 //                                                                           //
25 //   -Supports the list of all Alice Detectors (fModules).                 //
26 //   -Supports the list of particles (fParticles).                           //
27 //   -Supports the Trees.                                                    //
28 //   -Supports the geometry.                                                 //
29 //   -Supports the event display.                                            //
30 //Begin_Html
31 /*
32 <img src="picts/AliRunClass.gif">
33 */
34 //End_Html
35 //Begin_Html
36 /*
37 <img src="picts/alirun.gif">
38 */
39 //End_Html
40 //                                                                           //
41 ///////////////////////////////////////////////////////////////////////////////
42
43 #include <TBRIK.h> 
44 #include <TCint.h> 
45 #include <TGeometry.h>
46 #include <TROOT.h>
47 #include <TRandom3.h>
48 #include <TSystem.h>
49 #include <TVirtualMC.h>
50 #include <TGeoManager.h>
51 // 
52 #include "AliLog.h"
53 #include "AliDetector.h"
54 #include "AliHeader.h"
55 #include "AliLego.h"
56 #include "AliLegoGenerator.h"
57 #include "AliMC.h"
58 #include "AliMagFC.h"
59 #include "AliMagFCM.h"
60 #include "AliMagFDM.h"
61 #include "AliPDG.h"
62 #include "AliRun.h"
63 #include "AliStack.h"
64 #include "AliCDBManager.h"
65 #include "AliAlignObj.h"
66
67 AliRun *gAlice;
68
69 ClassImp(AliRun)
70
71 //_______________________________________________________________________
72 AliRun::AliRun():
73   fRun(-1),
74   fEvent(0),
75   fEventNrInRun(0),
76   fModules(0),
77   fMCApp(0),
78   fField(0),
79   fNdets(0),
80   fLego(0),
81   fConfigFunction(""),
82   fRandom(0),
83   fBaseFileName(""),
84   fIsRootGeometry(kFALSE),
85   fGeometryFromCDB(kFALSE),
86   fGeometryFileName(""),
87   fTriggerDescriptor(""),
88   fRunLoader(0x0)
89 {
90   //
91   // Default constructor for AliRun
92   //
93   AliConfig::Instance();//skowron 29 Feb 2002
94                         //ensures that the folder structure is build
95
96 }
97
98 //_____________________________________________________________________________
99 AliRun::AliRun(const char *name, const char *title):
100   TNamed(name,title),
101   fRun(-1),
102   fEvent(0),
103   fEventNrInRun(0),
104   fModules(new TObjArray(77)), // Support list for the Detectors
105   fMCApp(0),
106   fField(0),
107   fNdets(0),
108   fLego(0),
109   fConfigFunction("Config();"),
110   fRandom(new TRandom3()),
111   fBaseFileName(""),
112   fIsRootGeometry(kFALSE),
113   fGeometryFromCDB(kFALSE),
114   fGeometryFileName(""),
115   fTriggerDescriptor(""),
116   fRunLoader(0x0)
117 {
118   //
119   //  Constructor for the main processor.
120   //  Creates the geometry
121   //  Creates the list of Detectors.
122   //  Creates the list of particles.
123   //
124
125   gAlice     = this;
126
127   // Set random number generator
128   gRandom = fRandom;
129
130   if (gSystem->Getenv("CONFIG_SEED")) {
131      gRandom->SetSeed(static_cast<UInt_t>(atoi(gSystem->Getenv("CONFIG_SEED"))));
132   }
133
134   // Add to list of browsable  
135   gROOT->GetListOfBrowsables()->Add(this,name);
136   
137   // Create default mag field
138   SetField();
139
140 }
141
142
143 //_______________________________________________________________________
144 AliRun::~AliRun()
145 {
146   //
147   // Default AliRun destructor
148   //
149   gROOT->GetListOfBrowsables()->Remove(this);
150
151   if (fRunLoader)
152    {
153     TFolder* evfold = fRunLoader->GetEventFolder();
154     TFolder* modfold = dynamic_cast<TFolder*>(evfold->FindObjectAny(AliConfig::GetModulesFolderName()));
155     TIter next(fModules);
156     AliModule *mod;
157     while((mod = (AliModule*)next()))
158      { 
159        modfold->Remove(mod);
160      }
161    }
162   
163   
164   delete fField;
165   delete fMCApp;
166   delete gMC; gMC=0;
167   delete fLego;
168   if (fModules) {
169     fModules->Delete();
170     delete fModules;
171   }
172   
173 }
174
175 //_______________________________________________________________________
176 void AliRun::ResetHits() 
177 {
178   fMCApp->ResetHits();
179 }
180
181 //_______________________________________________________________________
182 AliGenerator* AliRun::Generator() const 
183 {
184   return fMCApp->Generator();
185 }
186
187 //_______________________________________________________________________
188 void  AliRun::SetField(AliMagF* magField)
189 {
190   //
191   // Set Magnetic Field Map
192   //
193   fField = magField;
194   fField->ReadField();
195 }
196
197 //_______________________________________________________________________
198 void AliRun::SetRootGeometry(Bool_t flag)
199 {
200 // Instruct application that the geometry is to be retreived from a root file.
201    fIsRootGeometry = flag;
202    if (flag && gMC) gMC->SetRootGeometry();
203 }
204
205 //_______________________________________________________________________
206 void AliRun::SetGeometryFromCDB()
207 {
208   // Set the loading of geometry from cdb instead of creating it
209   // A default CDB storage needs to be set before this method is called
210   if(AliCDBManager::Instance()->IsDefaultStorageSet() &&
211         AliCDBManager::Instance()->GetRun() >= 0){
212     SetRootGeometry();
213     fGeometryFromCDB = kTRUE;
214   }else{
215     AliError("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
216     AliError("Loading of geometry from CDB ignored. First set a default CDB storage!");
217     AliError("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
218   }
219 }
220
221 //_______________________________________________________________________
222 void AliRun::SetField(Int_t type, Int_t version, Float_t scale,
223                       Float_t maxField, const char* filename)
224 {
225   //
226   //  Set magnetic field parameters
227   //  type      Magnetic field transport flag 0=no field, 2=helix, 3=Runge Kutta
228   //  version   Magnetic field map version (only 1 active now)
229   //  scale     Scale factor for the magnetic field
230   //  maxField  Maximum value for the magnetic field
231
232   //
233   // --- Sanity check on mag field flags
234   if(fField) delete fField;
235   if(version==1) {
236     fField = new AliMagFC("Map1"," ",type,scale,maxField);
237   } else if(version<=2) {
238     fField = new AliMagFCM("Map2-3",filename,type,scale,maxField);
239     fField->ReadField();
240   } else if(version==3) {
241     fField = new AliMagFDM("Map4",filename,type,scale,maxField);
242     fField->ReadField();
243   } else {
244     AliWarning(Form("Invalid map %d",version));
245   }
246 }
247
248 //_____________________________________________________________________________
249
250 void AliRun::InitLoaders()
251 {
252   //creates list of getters
253   AliDebug(1, "");
254   TIter next(fModules);
255   AliModule *mod;
256   while((mod = (AliModule*)next()))
257    { 
258      mod->SetRunLoader(fRunLoader);
259      AliDetector *det = dynamic_cast<AliDetector*>(mod);
260      if (det) 
261       {
262         AliDebug(2, Form("Adding %s", det->GetName()));
263         fRunLoader->AddLoader(det);
264       }
265    }
266   AliDebug(1, "Done");
267 }
268 //_____________________________________________________________________________
269
270 void AliRun::FinishRun()
271 {
272   //
273   // Called at the end of the run.
274   //
275
276   if(fLego) 
277    {
278     AliDebug(1, "Finish Lego");
279     AliRunLoader::GetRunLoader()->CdGAFile();
280     fLego->FinishRun();
281    }
282   
283   // Clean detector information
284   TIter next(fModules);
285   AliModule *detector;
286   while((detector = dynamic_cast<AliModule*>(next()))) {
287     AliDebug(2, Form("%s->FinishRun()", detector->GetName()));
288     detector->FinishRun();
289   }
290   
291   AliDebug(1, "AliRunLoader::GetRunLoader()->WriteHeader(OVERWRITE)");
292   AliRunLoader::GetRunLoader()->WriteHeader("OVERWRITE");
293
294   // Write AliRun info and all detectors parameters
295   AliRunLoader::GetRunLoader()->CdGAFile();
296   Write(0,TObject::kOverwrite);//write AliRun
297   AliRunLoader::GetRunLoader()->Write(0,TObject::kOverwrite);//write RunLoader itself
298   
299   if(fMCApp) fMCApp->FinishRun();  
300   AliRunLoader::GetRunLoader()->Synchronize();
301 }
302
303 //_______________________________________________________________________
304 void AliRun::Announce() const
305 {
306   //
307   // Announce the current version of AliRoot
308   //
309   printf("%70s",
310          "****************************************************************\n");
311   printf("%6s","*");printf("%64s","*\n");
312
313   printf("%6s","*");
314   printf("    You are running AliRoot version NewIO\n");
315
316   printf("%6s","*");
317   printf("    The SVN version for the current program is $Id$\n");
318
319   printf("%6s","*");printf("%64s","*\n");
320   printf("%70s",
321          "****************************************************************\n");
322 }
323
324 //_______________________________________________________________________
325 AliModule *AliRun::GetModule(const char *name) const
326 {
327   //
328   // Return pointer to detector from name
329   //
330   return dynamic_cast<AliModule*>(fModules->FindObject(name));
331 }
332  
333 //_______________________________________________________________________
334 AliDetector *AliRun::GetDetector(const char *name) const
335 {
336   //
337   // Return pointer to detector from name
338   //
339   return dynamic_cast<AliDetector*>(fModules->FindObject(name));
340 }
341  
342 //_______________________________________________________________________
343 Int_t AliRun::GetModuleID(const char *name) const
344 {
345   //
346   // Return galice internal detector identifier from name
347   //
348   Int_t i=-1;
349   TObject *mod=fModules->FindObject(name);
350   if(mod) i=fModules->IndexOf(mod);
351   return i;
352 }
353  
354 //_______________________________________________________________________
355 Int_t AliRun::GetEvent(Int_t event)
356 {
357 //
358 // Reloads data containers in folders # event
359 // Set branch addresses
360 //
361   if (fRunLoader == 0x0)
362    {
363      AliError("RunLoader is not set. Can not load data.");
364      return -1;
365    }
366 /*****************************************/ 
367 /****   P R E    R E L O A D I N G    ****/
368 /*****************************************/ 
369 // Reset existing structures
370   fMCApp->ResetHits();
371   fMCApp->ResetTrackReferences();
372   ResetDigits();
373   ResetSDigits();
374
375 /*****************************************/ 
376 /****       R  E  L  O  A  D          ****/
377 /*****************************************/
378
379   AliRunLoader::GetRunLoader()->GetEvent(event);
380
381 /*****************************************/ 
382 /****  P O S T    R E L O A D I N G   ****/
383 /*****************************************/ 
384
385   // Set Trees branch addresses
386   TIter next(fModules);
387   AliDetector *detector;
388   while((detector = dynamic_cast<AliDetector*>(next()))) 
389    {
390      detector->SetTreeAddress();
391    }
392  
393   return AliRunLoader::GetRunLoader()->GetHeader()->GetNtrack();
394 }
395
396 //_______________________________________________________________________
397 void AliRun::SetBaseFile(const char *filename)
398 {
399   fBaseFileName = filename;
400 }
401
402 //_______________________________________________________________________
403 void AliRun::ResetDigits()
404 {
405   //
406   //  Reset all Detectors digits
407   //
408   TIter next(fModules);
409   AliModule *detector;
410   while((detector = dynamic_cast<AliModule*>(next()))) {
411      detector->ResetDigits();
412   }
413 }
414
415 //_______________________________________________________________________
416 void AliRun::ResetSDigits()
417 {
418   //
419   //  Reset all Detectors digits
420   //
421   TIter next(fModules);
422   AliModule *detector;
423   while((detector = dynamic_cast<AliModule*>(next()))) {
424      detector->ResetSDigits();
425   }
426 }
427
428
429 //_______________________________________________________________________
430 void AliRun::InitMC(const char *setup)
431 {
432   //
433   // Initialize ALICE Simulation run
434   //
435
436   static Bool_t initDone=kFALSE;
437
438   Announce();
439
440   if(initDone) {
441     AliError("AliRun already initialised! Check your logic!");
442     return;
443   } else initDone=kTRUE;
444     
445   if (!fMCApp)  
446     fMCApp=new AliMC(GetName(),GetTitle());
447     
448   gROOT->LoadMacro(setup);
449   gInterpreter->ProcessLine(fConfigFunction.Data());
450
451   if(AliCDBManager::Instance()->GetRun() >= 0) { 
452         SetRunNumber(AliCDBManager::Instance()->GetRun());
453   } else {
454         AliWarning("Run number not initialized!!");
455   }
456   
457    AliRunLoader::GetRunLoader()->CdGAFile();
458     
459    AliPDG::AddParticlesToPdgDataBase();  
460
461    fMCApp->Init();
462    
463    //Must be here because some MCs (G4) adds detectors here and not in Config.C
464    InitLoaders();
465    AliRunLoader::GetRunLoader()->MakeTree("E");
466    if (fLego == 0x0)
467     {
468       AliRunLoader::GetRunLoader()->LoadKinematics("RECREATE");
469       AliRunLoader::GetRunLoader()->LoadTrackRefs("RECREATE");
470       AliRunLoader::GetRunLoader()->LoadHits("all","RECREATE");
471     }
472    //
473    // Save stuff at the beginning of the file to avoid file corruption
474    AliRunLoader::GetRunLoader()->CdGAFile();
475    Write();
476    fEventNrInRun = -1; //important - we start Begin event from increasing current number in run
477 }
478
479 //_______________________________________________________________________
480 void AliRun::Hits2Digits(const char *selected)
481 {
482
483    // Convert Hits to sumable digits
484    // 
485    for (Int_t nevent=0; nevent<AliRunLoader::GetRunLoader()->TreeE()->GetEntries(); nevent++) {
486      GetEvent(nevent);
487      Hits2SDigits(selected);
488      SDigits2Digits(selected);
489    }  
490 }
491
492
493 //_______________________________________________________________________
494
495 void AliRun::Tree2Tree(Option_t *option, const char *selected)
496 {
497   //
498   // Function to transform the content of
499   //  
500   // - TreeH to TreeS (option "S")
501   // - TreeS to TreeD (option "D")
502   // - TreeD to TreeR (option "R")
503   // 
504   // If multiple options are specified ("SDR"), transformation will be done in sequence for
505   // selected detector and for all detectors if none is selected (detector string 
506   // can contain blank separated list of detector names). 
507
508
509    const char *oS = strstr(option,"S");
510    const char *oD = strstr(option,"D");
511    const char *oR = strstr(option,"R");
512    
513    TObjArray *detectors = Detectors();
514
515    TIter next(detectors);
516
517    AliDetector *detector = 0;
518
519    while((detector = dynamic_cast<AliDetector*>(next()))) {
520      if (selected) 
521        if (strcmp(detector->GetName(),selected)) continue;
522      if (detector->IsActive())
523       { 
524        
525        AliLoader* loader = detector->GetLoader();
526        if (loader == 0x0) continue;
527        
528        if (oS) 
529         {
530           AliDebug(1, Form("Processing Hits2SDigits for %s ...", detector->GetName()));
531           loader->LoadHits("read");
532           if (loader->TreeS() == 0x0) loader->MakeTree("S");
533           detector->MakeBranch(option);
534           detector->SetTreeAddress();
535           detector->Hits2SDigits();
536           loader->UnloadHits();
537           loader->UnloadSDigits();
538         }  
539        if (oD) 
540         {
541           AliDebug(1, Form("Processing SDigits2Digits for %s ...", detector->GetName()));
542           loader->LoadSDigits("read");
543           if (loader->TreeD() == 0x0) loader->MakeTree("D");
544           detector->MakeBranch(option);
545           detector->SetTreeAddress();
546           detector->SDigits2Digits();
547           loader->UnloadSDigits();
548           loader->UnloadDigits();
549         } 
550        if (oR) 
551         {
552           AliDebug(1, Form("Processing Digits2Reco for %s ...", detector->GetName()));
553           loader->LoadDigits("read");
554           if (loader->TreeR() == 0x0) loader->MakeTree("R");
555           detector->MakeBranch(option);
556           detector->SetTreeAddress();
557           detector->Digits2Reco(); 
558           loader->UnloadDigits();
559           loader->UnloadRecPoints();
560
561         }
562      }   
563    }
564 }
565
566 //_______________________________________________________________________
567 void AliRun::RunLego(const char *setup, Int_t nc1, Float_t c1min,
568                      Float_t c1max,Int_t nc2,Float_t c2min,Float_t c2max,
569                      Float_t rmin,Float_t rmax,Float_t zmax, AliLegoGenerator* gener, Int_t nev)
570 {
571   //
572   // Generates lego plots of:
573   //    - radiation length map phi vs theta
574   //    - radiation length map phi vs eta
575   //    - interaction length map
576   //    - g/cm2 length map
577   //
578   //  ntheta    bins in theta, eta
579   //  themin    minimum angle in theta (degrees)
580   //  themax    maximum angle in theta (degrees)
581   //  nphi      bins in phi
582   //  phimin    minimum angle in phi (degrees)
583   //  phimax    maximum angle in phi (degrees)
584   //  rmin      minimum radius
585   //  rmax      maximum radius
586   //  
587   //
588   //  The number of events generated = ntheta*nphi
589   //  run input parameters in macro setup (default="Config.C")
590   //
591   //  Use macro "lego.C" to visualize the 3 lego plots in spherical coordinates
592   //Begin_Html
593   /*
594     <img src="picts/AliRunLego1.gif">
595   */
596   //End_Html
597   //Begin_Html
598   /*
599     <img src="picts/AliRunLego2.gif">
600   */
601   //End_Html
602   //Begin_Html
603   /*
604     <img src="picts/AliRunLego3.gif">
605   */
606   //End_Html
607   //
608   // Number of events 
609     if (nev == -1) nev  = nc1 * nc2;
610     
611   // check if initialisation has been done
612   // If runloader has been initialized, set the number of events per file to nc1 * nc2
613     
614   // Set new generator
615   if (!gener) gener  = new AliLegoGenerator();
616   //
617   // Configure Generator
618   
619   gener->SetRadiusRange(rmin, rmax);
620   gener->SetZMax(zmax);
621   gener->SetCoor1Range(nc1, c1min, c1max);
622   gener->SetCoor2Range(nc2, c2min, c2max);
623   
624   
625   //Create Lego object  
626   fLego = new AliLego("lego",gener);
627
628   InitMC(setup);
629   //Save current generator
630   
631   AliGenerator *gen=fMCApp->Generator();
632   fMCApp->ResetGenerator(gener);
633   //Prepare MC for Lego Run
634   gMC->InitLego();
635   
636   //Run Lego Object
637
638
639   if (fRunLoader) fRunLoader->SetNumberOfEventsPerFile(nev);
640   gMC->ProcessRun(nev);
641   
642   // End of this run, close files
643   FinishRun();
644   // Restore current generator
645   fMCApp->ResetGenerator(gen);
646   // Delete Lego Object
647   delete fLego; fLego=0;
648 }
649
650 //_______________________________________________________________________
651 void AliRun::SetConfigFunction(const char * config) 
652 {
653   //
654   // Set the signature of the function contained in Config.C to configure
655   // the run
656   //
657   fConfigFunction=config;
658 }
659
660 // 
661 // MC Application
662 // 
663
664 //_______________________________________________________________________
665 void AliRun::Field(const Double_t* x, Double_t *b) const
666 {
667   //
668   // Return the value of the magnetic field
669   //
670     
671   Float_t xfloat[3];
672   for (Int_t i=0; i<3; i++) xfloat[i] = x[i]; 
673   
674   if (Field()) {
675
676     Float_t bfloat[3];
677     Field()->Field(xfloat,bfloat);
678     for (Int_t j=0; j<3; j++) b[j] = bfloat[j]; 
679   } 
680   else {
681     AliError("No mag field defined!");
682     b[0]=b[1]=b[2]=0.;
683   }
684
685   
686 }      
687
688 // 
689 // End of MC Application
690 // 
691
692 //_______________________________________________________________________
693 void AliRun::Streamer(TBuffer &R__b)
694 {
695   // Stream an object of class AliRun.
696
697   if (R__b.IsReading()) {
698     if (!gAlice) gAlice = this;
699     AliRun::Class()->ReadBuffer(R__b, this);
700     gROOT->GetListOfBrowsables()->Add(this,"Run");
701
702     gRandom = fRandom;
703   } else {
704     AliRun::Class()->WriteBuffer(R__b, this);
705   }
706 }
707 //_______________________________________________________________________
708
709 void AliRun::SetGenEventHeader(AliGenEventHeader* header)
710 {
711   AliRunLoader::GetRunLoader()->GetHeader()->SetGenEventHeader(header);
712 }
713
714
715 //_______________________________________________________________________
716
717 Int_t AliRun::GetEvNumber() const
718
719 //Returns number of current event  
720   if (fRunLoader == 0x0)
721    {
722      AliError("RunLoader is not set. Can not load data.");
723      return -1;
724    }
725
726   return fRunLoader->GetEventNumber();
727 }
728 //_______________________________________________________________________
729
730 void AliRun::SetRunLoader(AliRunLoader* rloader)
731 {
732   //
733   // Set the loader of the run
734   //
735   fRunLoader = rloader;
736   if (fRunLoader == 0x0) return;
737   
738   TString evfoldname;
739   TFolder* evfold = fRunLoader->GetEventFolder();
740   if (evfold) evfoldname = evfold->GetName();
741   else AliWarning("Did not get Event Folder from Run Loader");
742   
743   if ( fRunLoader->GetAliRun() )
744    {//if alrun already exists in folder
745     if (fRunLoader->GetAliRun() != this )
746      {//and is different than this - crash
747        AliFatal("AliRun is already in Folder and it is not this object");
748        return;//pro forma
749      }//else do nothing
750    }
751   else
752    {
753      evfold->Add(this);//Post this AliRun to Folder
754    }
755   
756   TIter next(fModules);
757   AliModule *module;
758   while((module = (AliModule*)next())) 
759    {
760      if (evfold) AliConfig::Instance()->Add(module,evfoldname);
761      module->SetRunLoader(fRunLoader);
762      AliDetector* detector = dynamic_cast<AliDetector*>(module);
763      if (detector)
764       {
765         AliLoader* loader = fRunLoader->GetLoader(detector);
766         if (loader == 0x0)
767          {
768            AliError(Form("Can not get loader for detector %s", detector->GetName()));
769          }
770         else
771          {
772            AliDebug(1, Form("Setting loader for detector %s", detector->GetName()));
773            detector->SetLoader(loader);
774          }
775       }
776    }
777 }
778
779 void AliRun::AddModule(AliModule* mod)
780 {
781   //
782   // Add a module to the module list
783   //
784   if (mod == 0x0) return;
785   if (strlen(mod->GetName()) == 0) return;
786   if (GetModuleID(mod->GetName()) >= 0) return;
787   
788   AliDebug(1, mod->GetName());
789   if (fRunLoader == 0x0) AliConfig::Instance()->Add(mod);
790   else AliConfig::Instance()->Add(mod,fRunLoader->GetEventFolder()->GetName());
791
792   Modules()->Add(mod);
793   
794   fNdets++;
795 }
796
797 //_____________________________________________________________________________
798 /*inline*/ Bool_t AliRun::IsFileAccessible(const char* fnam, EAccessMode mode)
799 { return !gSystem->AccessPathName(fnam,mode);}
800
801 //______________________________________________________
802 /*inline*/ Bool_t AliRun::IsFileAccessible(Char_t* name,EAccessMode mode)
803 {
804   TString str = name; gSystem->ExpandPathName(str);
805   return !gSystem->AccessPathName(str.Data(),mode);
806 }