]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRun.h
Make use of new method AliRawReader::GetNumberOfEvents() - goinf to the last event...
[u/mrichter/AliRoot.git] / STEER / AliRun.h
index 76135cb873bb4837b490ffa43be407abb995b32c..c5d3543ba4b91e645255d509ca4541a6f0dfe869 100644 (file)
@@ -5,9 +5,14 @@
 
 /* $Id$ */
 
-#include <TMCProcess.h>
-#include <TStopwatch.h>
+//
+// General configuration class for Simulation and Reconstruction
+// Basic driver for AliRoot runs
+// Containing pointers to data elements for AliRoot
+//
+
 #include <TError.h>
+#include <TSystem.h>
 
 class TGeometry;
 class TParticle;
@@ -25,9 +30,9 @@ class AliMC;
 class AliMagF;
 class AliStack;
 
-enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
 
 class AliRun : public TNamed {
+
 public:
    // Creators - distructors
    AliRun();
@@ -48,12 +53,10 @@ public:
    void           AddModule(AliModule* mod);
    Int_t          GetEvNumber() const;
    Int_t          GetRunNumber() const {return fRun;}
-   void           SetRunNumber(Int_t run) {fRun=run;}
    void           SetEventNrInRun(Int_t event) {fEventNrInRun=event;}
    Int_t          GetEventNrInRun() const {return fEventNrInRun;}
    Int_t          GetEventsPerRun() const {return fEventsPerRun;}
    Int_t          GetNdets() const {return fNdets;}
-   Int_t          GetDebug() const {return fDebug;}
    AliModule     *GetModule(const char *name) const;
    AliDetector   *GetDetector(const char *name) const;
    Int_t          GetModuleID(const char *name) const;
@@ -75,7 +78,17 @@ public:
    virtual  void  Init(const char *setup="Config.C") {InitMC(setup);}
    Bool_t         IsFolder() const {return kTRUE;}
    virtual AliLego* Lego() const {return fLego;}
-
+   Bool_t         IsRootGeometry() const {return fIsRootGeometry;}
+   void           SetRootGeometry(Bool_t flag=kTRUE);
+   const char*    GetGeometryFileName() const {return fGeometryFileName.Data();}
+   void           SetGeometryFromFile(const char *filename) {
+     SetRootGeometry();
+     fGeometryFileName = filename;
+   }
+   void           SetGeometryFromCDB();
+   Bool_t         IsGeomFromCDB() const {return fGeometryFromCDB;}
+   const char*    GetTriggerDescriptor() const {return fTriggerDescriptor.Data();}
+   void           SetTriggerDescriptor(const char *name) {fTriggerDescriptor = name;}
    virtual  void  ResetDigits();
    virtual  void  ResetSDigits();
    virtual  void  ResetPoints();
@@ -84,12 +97,11 @@ public:
    virtual  void  Run(Int_t nevent=1, const char *setup="Config.C") {RunMC(nevent,setup);}
    virtual  void  RunLego(const char *setup="Config.C",Int_t nc1=60,Float_t c1min=2,Float_t c1max=178,
                           Int_t nc2=60,Float_t c2min=0,Float_t c2max=360,Float_t rmin=0,
-                          Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL);
+                          Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL, Int_t nev = -1);
    virtual  Bool_t IsLegoRun() const {return (fLego!=0);}
    virtual  void  RunReco(const char *detector=0, Int_t first = 0, Int_t last = 0);
-   virtual  void  SetDebug(const Int_t level=0) {fDebug = level;}
    virtual  void  SetDisplay(AliDisplay *display) {fDisplay = display;}
-   virtual  void  SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, char*filename="$(ALICE_ROOT)/data/field01.dat");
+   virtual  void  SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, const char* filename="$(ALICE_ROOT)/data/field01.dat");
    virtual  void  SetField(AliMagF* magField);
    virtual  TDatabasePDG* PDGDB() const {return fPDGDB;}
    
@@ -98,7 +110,10 @@ public:
    // Delegations
    virtual  void  ResetHits();
    virtual  AliGenerator* Generator() const;
-
+   
+   Bool_t         IsFileAccessible(Char_t* name, EAccessMode mode = kFileExists);
+   static   Bool_t   IsFileAccessible(const char* fnam, EAccessMode mode = kFileExists);
+   
    //
    // End of MC Application
 
@@ -107,9 +122,9 @@ public:
    AliStack      *Stack() {return (fRunLoader)?fRunLoader->Stack():0x0;}
    AliHeader*     GetHeader() {return (fRunLoader)?fRunLoader->GetHeader():0x0;}
 
-   TTree         *TreeD() {MayNotUse("TreeD"); return 0x0;}
-   TTree         *TreeS() {MayNotUse("TreeS"); return 0x0;}
-   TTree         *TreeR() {MayNotUse("TreeR"); return 0x0;}
+   TTree         *TreeD() const {MayNotUse("TreeD"); return 0x0;}
+   TTree         *TreeS() const {MayNotUse("TreeS"); return 0x0;}
+   TTree         *TreeR() const {MayNotUse("TreeR"); return 0x0;}
 
    
    void SetRunLoader(AliRunLoader* rloader);
@@ -118,28 +133,25 @@ public:
   virtual  void Announce() const;
    
   virtual  void  InitLoaders(); //prepares run (i.e. creates getters)
-  static void Deprecated(TObject *obj, const char *method,
-                        const char *replacement) {
-    if (obj)
-      ::Warning(Form("%s::%s", obj->ClassName(), method),
-               "method is depricated\nPlease use: %s", replacement);
-    else
-      ::Warning(method, "method is depricated\nPlease use: %s", replacement);
-  }
+  static void Deprecated(TObject *obj, const char *method, const char *replace)
+    {// Indicates deprecated method
+      if (obj) ::Warning(Form("%s::%s", obj->ClassName(), method),
+                 "method is depricated\nPlease use: %s", replace);
+      else ::Warning(method, "method is depricated\nPlease use: %s", replace);
+    }
+
 protected:
+  void           SetRunNumber(Int_t run) {fRun=run;}
   virtual  void  Tree2Tree(Option_t *option, const char *detector=0);
   Int_t          fRun;               //! Current run number
   Int_t          fEvent;             //! Current event number (from 1)
   Int_t          fEventNrInRun;      //! Current unique event number in run
   Int_t          fEventsPerRun;      //  Number of events per run
-  Int_t          fDebug;             //  Debug flag
   TObjArray     *fModules;           //  List of Detectors
   TGeometry     *fGeometry;          //  Pointer to geometry
   AliMC         *fMCApp;             //  Pointer to virtual MC Application
   AliDisplay    *fDisplay;           //! Pointer to event display
-  TStopwatch     fTimer;             //  Timer object
   AliMagF       *fField;             //  Magnetic Field Map
-  TVirtualMC    *fMC;                //! Pointer to MonteCarlo object
   Int_t          fNdets;             //  Number of detectors
   Bool_t         fInitDone;          //! True when initialisation done
   AliLego       *fLego;              //! Pointer to aliLego object if it exists
@@ -147,14 +159,17 @@ protected:
   TString        fConfigFunction;    //  Configuration file to be executed
   TRandom       *fRandom;            //  Pointer to the random number generator
   TString        fBaseFileName;      //  Name of the base root file
-
+  Bool_t         fIsRootGeometry;    //! Flag telling if the geometry is loaded from file
+  Bool_t         fGeometryFromCDB;   //! Flag telling if the geometry is to be loaded from OCDB
+  TString        fGeometryFileName;  //! Name of the geometry file
+  TString        fTriggerDescriptor; //  Trigger descriptor identifier
   AliRunLoader  *fRunLoader;         //!run getter - written as a separate object
 private:
-  void Copy(AliRun &arun) const;
+  void Copy(TObject &arun) const;
 
-  ClassDef(AliRun,8)      //Supervisor class for all Alice detectors
+  ClassDef(AliRun,11)      //Supervisor class for all Alice detectors
 };
  
 R__EXTERN  AliRun *gAlice;
+  
 #endif