Using the recommended way of forward declarations for TVector and TMatrix (see v5...
[u/mrichter/AliRoot.git] / STEER / AliSimulation.h
CommitLineData
85a5290f 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
af7ba10c 8//
9// class for running generation, simulation and digitization
10// Hits, sdigits and digits are created for all detectors by typing:
af7ba10c 11// AliSimulation sim;
12// sim.Run();
13//
14
85a5290f 15#include <TNamed.h>
16#include <TString.h>
3c166bf6 17#include <TObjArray.h>
85a5290f 18
e8d02863 19class AliCDBId;
20class AliCDBParam;
85a5290f 21class AliRunLoader;
22
23
24class AliSimulation: public TNamed {
25public:
95601147 26 AliSimulation(const char* configFileName = "Config.C",
27 const char* name = "AliSimulation",
85a5290f 28 const char* title = "generation, simulation and digitization");
29 AliSimulation(const AliSimulation& sim);
30 AliSimulation& operator = (const AliSimulation& sim);
31 virtual ~AliSimulation();
32
33 void SetNumberOfEvents(Int_t nEvents);
34 void SetConfigFile(const char* fileName);
0421c3d1 35 void SetGAliceFile(const char* fileName);
18b43626 36 void SetEventsPerFile(const char* detector, const char* type,
37 Int_t nEvents);
85a5290f 38
39 void SetRunGeneration(Bool_t run) {fRunGeneration = run;};
40 void SetRunSimulation(Bool_t run) {fRunSimulation = run;};
41 void SetMakeSDigits(const char* detectors)
42 {fMakeSDigits = detectors;};
05526d44 43 void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
04bae0a0 44 void SetUseBkgrdVertex(Bool_t useBkgrdVertex)
45 {fUseBkgrdVertex = useBkgrdVertex;};
4df28b43 46 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
85a5290f 47 void SetMakeDigits(const char* detectors)
48 {fMakeDigits = detectors;};
a5a091ce 49 void SetMakeTrigger(const char* descriptors)
50 {fMakeTrigger = descriptors;};
85a5290f 51 void SetMakeDigitsFromHits(const char* detectors)
52 {fMakeDigitsFromHits = detectors;};
06c7e392 53 void SetWriteRawData(const char* detectors,
54 const char* fileName = NULL,
55 Bool_t deleteIntermediateFiles = kFALSE)
56 {fWriteRawData = detectors; fRawDataFileName = fileName;
57 fDeleteIntermediateFiles = deleteIntermediateFiles;};
e8d02863 58
8c30cb69 59 static Bool_t ApplyDisplacements(const char* fileName,
b9bc0f82 60 const char* ClArrayName);
8c30cb69 61 static Bool_t ApplyDisplacements(TClonesArray* AlObjArray);
62 static Bool_t ApplyDisplacements(AliCDBParam* param,
b9bc0f82 63 AliCDBId& Id);
8c30cb69 64 static Bool_t ApplyDisplacements(const char* uri, const char* path,
b9bc0f82 65 Int_t runnum, Int_t version,
66 Int_t sversion);
85a5290f 67
68 virtual Bool_t Run(Int_t nEvents = 0);
69
95601147 70 virtual Bool_t RunSimulation(Int_t nEvents = 0);
71 virtual Bool_t RunSDigitization(const char* detectors = "ALL");
a5a091ce 72 virtual Bool_t RunTrigger(const char* descriptors ="" );
95601147 73 virtual Bool_t RunDigitization(const char* detectors = "ALL",
74 const char* excludeDetectors = "");
75 virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
06c7e392 76 virtual Bool_t WriteRawData(const char* detectors = "ALL",
77 const char* fileName = NULL,
78 Bool_t deleteIntermediateFiles = kFALSE);
79 virtual Bool_t WriteRawFiles(const char* detectors = "ALL");
80 virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date");
81 virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
82 const char* rootFileName = "raw.root");
8e4a4643 83
95601147 84private:
06c7e392 85 AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
05526d44 86 Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
85a5290f 87 Bool_t IsSelected(TString detName, TString& detectors) const;
88
85a5290f 89 Bool_t fRunGeneration; // generate prim. particles or not
90 Bool_t fRunSimulation; // simulate detectors (hits) or not
91 TString fMakeSDigits; // create sdigits for these detectors
92 TString fMakeDigits; // create digits for these detectors
a5a091ce 93 TString fMakeTrigger; // run trigger for these descriptors
85a5290f 94 TString fMakeDigitsFromHits; // create digits from hits for these detectors
0421c3d1 95 TString fWriteRawData; // write raw data for these detectors
06c7e392 96 TString fRawDataFileName; // file name for the raw data file
97 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
85a5290f 98 Bool_t fStopOnError; // stop or continue on errors
99
100 Int_t fNEvents; // number of events
101 TString fConfigFileName; // name of the config file
102 TString fGAliceFileName; // name of the galice file
18b43626 103 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
104
85a5290f 105 TObjArray* fBkgrdFileNames; // names of background files for merging
04bae0a0 106 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
4df28b43 107 Bool_t fRegionOfInterest; // digitization in region of interest
85a5290f 108
06c7e392 109 ClassDef(AliSimulation, 2) // class for running generation, simulation and digitization
85a5290f 110};
111
112#endif