]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliSimulation.h
More inline functions available to the user (B.Hippolyte)
[u/mrichter/AliRoot.git] / STEER / AliSimulation.h
1 #ifndef ALISIMULATION_H
2 #define ALISIMULATION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //
9 // class for running generation, simulation and digitization
10 // Hits, sdigits and digits are created for all detectors by typing:
11 //   AliSimulation sim;
12 //   sim.Run();
13 //
14
15 #include <TNamed.h>
16 #include <TString.h>
17 #include <TObjArray.h>
18
19 class AliRunLoader;
20
21
22 class AliSimulation: public TNamed {
23 public:
24   AliSimulation(const char* configFileName = "Config.C",
25                 const char* name = "AliSimulation", 
26                 const char* title = "generation, simulation and digitization");
27   AliSimulation(const AliSimulation& sim);
28   AliSimulation& operator = (const AliSimulation& sim);
29   virtual ~AliSimulation();
30
31   void           SetNumberOfEvents(Int_t nEvents);
32   void           SetConfigFile(const char* fileName);
33   void           SetGAliceFile(const char* fileName);
34   void           SetEventsPerFile(const char* detector, const char* type, 
35                                   Int_t nEvents);
36
37   void           SetRunGeneration(Bool_t run) {fRunGeneration = run;};
38   void           SetRunSimulation(Bool_t run) {fRunSimulation = run;};
39   void           SetMakeSDigits(const char* detectors) 
40                    {fMakeSDigits = detectors;};
41   void           MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
42   void           SetUseBkgrdVertex(Bool_t useBkgrdVertex)
43                    {fUseBkgrdVertex = useBkgrdVertex;};
44   void           SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
45   void           SetMakeDigits(const char* detectors)
46                    {fMakeDigits = detectors;};
47   void           SetMakeDigitsFromHits(const char* detectors)
48                    {fMakeDigitsFromHits = detectors;};
49   void           SetWriteRawData(const char* detectors, 
50                                  const char* fileName = NULL,
51                                  Bool_t deleteIntermediateFiles = kFALSE)
52                    {fWriteRawData = detectors; fRawDataFileName = fileName;
53                    fDeleteIntermediateFiles = deleteIntermediateFiles;};
54
55   virtual Bool_t Run(Int_t nEvents = 0);
56
57   virtual Bool_t RunSimulation(Int_t nEvents = 0);
58   virtual Bool_t RunSDigitization(const char* detectors = "ALL");
59   virtual Bool_t RunDigitization(const char* detectors = "ALL",
60                                  const char* excludeDetectors = "");
61   virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
62   virtual Bool_t WriteRawData(const char* detectors = "ALL",
63                               const char* fileName = NULL,
64                               Bool_t deleteIntermediateFiles = kFALSE);
65   virtual Bool_t WriteRawFiles(const char* detectors = "ALL");
66   virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date");
67   virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
68                                    const char* rootFileName = "raw.root");
69
70 private:
71   AliRunLoader*  LoadRun(const char* mode = "UPDATE") const;
72   Int_t          GetNSignalPerBkgrd(Int_t nEvents = 0) const;
73   Bool_t         IsSelected(TString detName, TString& detectors) const;
74
75   Bool_t         fRunGeneration;      // generate prim. particles or not
76   Bool_t         fRunSimulation;      // simulate detectors (hits) or not
77   TString        fMakeSDigits;        // create sdigits for these detectors
78   TString        fMakeDigits;         // create digits for these detectors
79   TString        fMakeDigitsFromHits; // create digits from hits for these detectors
80   TString        fWriteRawData;       // write raw data for these detectors
81   TString        fRawDataFileName;    // file name for the raw data file
82   Bool_t         fDeleteIntermediateFiles; // delete intermediate raw data files
83   Bool_t         fStopOnError;        // stop or continue on errors
84
85   Int_t          fNEvents;            // number of events
86   TString        fConfigFileName;     // name of the config file
87   TString        fGAliceFileName;     // name of the galice file
88   TObjArray      fEventsPerFile;      // number of events per file for given detectors and data types
89
90   TObjArray*     fBkgrdFileNames;     // names of background files for merging
91   Bool_t         fUseBkgrdVertex;     // use vertex from background in case of merging
92   Bool_t         fRegionOfInterest;   // digitization in region of interest
93
94   ClassDef(AliSimulation, 2)  // class for running generation, simulation and digitization
95 };
96
97 #endif