]>
Commit | Line | Data |
---|---|---|
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 | 19 | class AliCDBId; |
20 | class AliCDBParam; | |
85a5290f | 21 | class AliRunLoader; |
22 | ||
23 | ||
24 | class AliSimulation: public TNamed { | |
25 | public: | |
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, |
995ad051 | 60 | const char* clArrayName); |
8c30cb69 | 61 | static Bool_t ApplyDisplacements(AliCDBParam* param, |
b9bc0f82 | 62 | AliCDBId& Id); |
8c30cb69 | 63 | static Bool_t ApplyDisplacements(const char* uri, const char* path, |
b9bc0f82 | 64 | Int_t runnum, Int_t version, |
65 | Int_t sversion); | |
995ad051 | 66 | void SetAlignObjArray(TClonesArray *array) |
67 | {fAlignObjArray = array;} | |
85a5290f | 68 | |
69 | virtual Bool_t Run(Int_t nEvents = 0); | |
70 | ||
95601147 | 71 | virtual Bool_t RunSimulation(Int_t nEvents = 0); |
72 | virtual Bool_t RunSDigitization(const char* detectors = "ALL"); | |
a5a091ce | 73 | virtual Bool_t RunTrigger(const char* descriptors ="" ); |
95601147 | 74 | virtual Bool_t RunDigitization(const char* detectors = "ALL", |
75 | const char* excludeDetectors = ""); | |
76 | virtual Bool_t RunHitsDigitization(const char* detectors = "ALL"); | |
06c7e392 | 77 | virtual Bool_t WriteRawData(const char* detectors = "ALL", |
78 | const char* fileName = NULL, | |
79 | Bool_t deleteIntermediateFiles = kFALSE); | |
80 | virtual Bool_t WriteRawFiles(const char* detectors = "ALL"); | |
81 | virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date"); | |
82 | virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date", | |
83 | const char* rootFileName = "raw.root"); | |
8e4a4643 | 84 | |
95601147 | 85 | private: |
06c7e392 | 86 | AliRunLoader* LoadRun(const char* mode = "UPDATE") const; |
05526d44 | 87 | Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const; |
85a5290f | 88 | Bool_t IsSelected(TString detName, TString& detectors) const; |
89 | ||
85a5290f | 90 | Bool_t fRunGeneration; // generate prim. particles or not |
91 | Bool_t fRunSimulation; // simulate detectors (hits) or not | |
92 | TString fMakeSDigits; // create sdigits for these detectors | |
93 | TString fMakeDigits; // create digits for these detectors | |
a5a091ce | 94 | TString fMakeTrigger; // run trigger for these descriptors |
85a5290f | 95 | TString fMakeDigitsFromHits; // create digits from hits for these detectors |
0421c3d1 | 96 | TString fWriteRawData; // write raw data for these detectors |
06c7e392 | 97 | TString fRawDataFileName; // file name for the raw data file |
98 | Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files | |
85a5290f | 99 | Bool_t fStopOnError; // stop or continue on errors |
100 | ||
101 | Int_t fNEvents; // number of events | |
102 | TString fConfigFileName; // name of the config file | |
103 | TString fGAliceFileName; // name of the galice file | |
18b43626 | 104 | TObjArray fEventsPerFile; // number of events per file for given detectors and data types |
105 | ||
85a5290f | 106 | TObjArray* fBkgrdFileNames; // names of background files for merging |
995ad051 | 107 | TClonesArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry |
04bae0a0 | 108 | Bool_t fUseBkgrdVertex; // use vertex from background in case of merging |
4df28b43 | 109 | Bool_t fRegionOfInterest; // digitization in region of interest |
85a5290f | 110 | |
06c7e392 | 111 | ClassDef(AliSimulation, 2) // class for running generation, simulation and digitization |
85a5290f | 112 | }; |
113 | ||
114 | #endif |