]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliSimulation.h
Moving the alignment-related static methods from AliAlignObj to the new geometry...
[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",
024cf675 27 const char* cdbUri = "local://$ALICE_ROOT",
95601147 28 const char* name = "AliSimulation",
85a5290f 29 const char* title = "generation, simulation and digitization");
30 AliSimulation(const AliSimulation& sim);
31 AliSimulation& operator = (const AliSimulation& sim);
32 virtual ~AliSimulation();
33
34 void SetNumberOfEvents(Int_t nEvents);
35 void SetConfigFile(const char* fileName);
0421c3d1 36 void SetGAliceFile(const char* fileName);
18b43626 37 void SetEventsPerFile(const char* detector, const char* type,
38 Int_t nEvents);
85a5290f 39
40 void SetRunGeneration(Bool_t run) {fRunGeneration = run;};
41 void SetRunSimulation(Bool_t run) {fRunSimulation = run;};
024cf675 42 void SetLoadAlignFromCDB(Bool_t load) {fLoadAlignFromCDB = load;};
43 void SetLoadAlignData(const char* detectors)
25be1e5c 44 {fLoadAlObjsListOfDets = detectors;};
85a5290f 45 void SetMakeSDigits(const char* detectors)
46 {fMakeSDigits = detectors;};
05526d44 47 void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
ca30848f 48 void EmbedInto(const char* fileName, Int_t nSignalPerBkgrd = 0);
04bae0a0 49 void SetUseBkgrdVertex(Bool_t useBkgrdVertex)
50 {fUseBkgrdVertex = useBkgrdVertex;};
4df28b43 51 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
85a5290f 52 void SetMakeDigits(const char* detectors)
53 {fMakeDigits = detectors;};
a5a091ce 54 void SetMakeTrigger(const char* descriptors)
55 {fMakeTrigger = descriptors;};
85a5290f 56 void SetMakeDigitsFromHits(const char* detectors)
57 {fMakeDigitsFromHits = detectors;};
06c7e392 58 void SetWriteRawData(const char* detectors,
59 const char* fileName = NULL,
60 Bool_t deleteIntermediateFiles = kFALSE)
61 {fWriteRawData = detectors; fRawDataFileName = fileName;
62 fDeleteIntermediateFiles = deleteIntermediateFiles;};
024cf675 63 void SetAlignObjArray(TObjArray *array)
6bae477a 64 {fAlignObjArray = array;
65 fLoadAlignFromCDB = kFALSE;}
024cf675 66
6bae477a 67 Bool_t MisalignGeometry(AliRunLoader *runLoader = NULL);
68
69 Bool_t SetRunNumber();
024cf675 70
71 // CDB storage activation
ec92bee0 72 void InitCDBStorage();
73 void SetDefaultStorage(const char* uri);
c3a7b59a 74 void SetSpecificStorage(const char* calibType, const char* uri);
85a5290f 75
76 virtual Bool_t Run(Int_t nEvents = 0);
77
95601147 78 virtual Bool_t RunSimulation(Int_t nEvents = 0);
79 virtual Bool_t RunSDigitization(const char* detectors = "ALL");
a5a091ce 80 virtual Bool_t RunTrigger(const char* descriptors ="" );
007155cc 81 virtual Bool_t WriteTriggerRawData();
95601147 82 virtual Bool_t RunDigitization(const char* detectors = "ALL",
83 const char* excludeDetectors = "");
84 virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
06c7e392 85 virtual Bool_t WriteRawData(const char* detectors = "ALL",
86 const char* fileName = NULL,
87 Bool_t deleteIntermediateFiles = kFALSE);
88 virtual Bool_t WriteRawFiles(const char* detectors = "ALL");
89 virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date");
90 virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
91 const char* rootFileName = "raw.root");
ca30848f 92 virtual Bool_t ConvertRaw2SDigits(const char* rawDirectory, const char* esdFile = "");
93
95601147 94private:
06c7e392 95 AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
05526d44 96 Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
85a5290f 97 Bool_t IsSelected(TString detName, TString& detectors) const;
98
85a5290f 99 Bool_t fRunGeneration; // generate prim. particles or not
100 Bool_t fRunSimulation; // simulate detectors (hits) or not
024cf675 101 Bool_t fLoadAlignFromCDB; // Load alignment data from CDB and apply it to geometry or not
25be1e5c 102 TString fLoadAlObjsListOfDets; // Load alignment data from CDB for these detectors
85a5290f 103 TString fMakeSDigits; // create sdigits for these detectors
104 TString fMakeDigits; // create digits for these detectors
a5a091ce 105 TString fMakeTrigger; // run trigger for these descriptors
85a5290f 106 TString fMakeDigitsFromHits; // create digits from hits for these detectors
0421c3d1 107 TString fWriteRawData; // write raw data for these detectors
06c7e392 108 TString fRawDataFileName; // file name for the raw data file
109 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
85a5290f 110 Bool_t fStopOnError; // stop or continue on errors
111
112 Int_t fNEvents; // number of events
113 TString fConfigFileName; // name of the config file
114 TString fGAliceFileName; // name of the galice file
18b43626 115 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
116
85a5290f 117 TObjArray* fBkgrdFileNames; // names of background files for merging
024cf675 118 TObjArray* fAlignObjArray; // array with the alignment objects to be applied to the geometry
04bae0a0 119 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
4df28b43 120 Bool_t fRegionOfInterest; // digitization in region of interest
85a5290f 121
024cf675 122 TString fCDBUri; // Uri of the default CDB storage
ec92bee0 123 TObjArray fSpecCDBUri; // Array with detector specific CDB storages
ca30848f 124 Bool_t fEmbeddingFlag; // Flag for embedding
ec92bee0 125 ClassDef(AliSimulation, 3) // class for running generation, simulation and digitization
85a5290f 126};
127
128#endif