]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliSimulation.h
New files belonging to the PPD version of the JETAN code
[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>
b9bc0f82 18#include <TGeoManager.h>
19#include <TGeoPhysicalNode.h>
20#include "AliCDBManager.h"
21#include "AliCDBStorage.h"
22#include "AliCDBEntry.h"
23#include "AliCDBId.h"
85a5290f 24
25class AliRunLoader;
26
27
28class AliSimulation: public TNamed {
29public:
95601147 30 AliSimulation(const char* configFileName = "Config.C",
31 const char* name = "AliSimulation",
85a5290f 32 const char* title = "generation, simulation and digitization");
33 AliSimulation(const AliSimulation& sim);
34 AliSimulation& operator = (const AliSimulation& sim);
35 virtual ~AliSimulation();
36
37 void SetNumberOfEvents(Int_t nEvents);
38 void SetConfigFile(const char* fileName);
0421c3d1 39 void SetGAliceFile(const char* fileName);
18b43626 40 void SetEventsPerFile(const char* detector, const char* type,
41 Int_t nEvents);
85a5290f 42
43 void SetRunGeneration(Bool_t run) {fRunGeneration = run;};
44 void SetRunSimulation(Bool_t run) {fRunSimulation = run;};
45 void SetMakeSDigits(const char* detectors)
46 {fMakeSDigits = detectors;};
05526d44 47 void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
04bae0a0 48 void SetUseBkgrdVertex(Bool_t useBkgrdVertex)
49 {fUseBkgrdVertex = useBkgrdVertex;};
4df28b43 50 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
85a5290f 51 void SetMakeDigits(const char* detectors)
52 {fMakeDigits = detectors;};
53 void SetMakeDigitsFromHits(const char* detectors)
54 {fMakeDigitsFromHits = detectors;};
06c7e392 55 void SetWriteRawData(const char* detectors,
56 const char* fileName = NULL,
57 Bool_t deleteIntermediateFiles = kFALSE)
58 {fWriteRawData = detectors; fRawDataFileName = fileName;
59 fDeleteIntermediateFiles = deleteIntermediateFiles;};
8c30cb69 60 static Bool_t ApplyDisplacements(const char* fileName,
b9bc0f82 61 const char* ClArrayName);
8c30cb69 62 static Bool_t ApplyDisplacements(TClonesArray* AlObjArray);
63 static Bool_t ApplyDisplacements(AliCDBParam* param,
b9bc0f82 64 AliCDBId& Id);
8c30cb69 65 static Bool_t ApplyDisplacements(const char* uri, const char* path,
b9bc0f82 66 Int_t runnum, Int_t version,
67 Int_t sversion);
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");
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
93 TString fMakeDigitsFromHits; // create digits from hits for these detectors
0421c3d1 94 TString fWriteRawData; // write raw data for these detectors
06c7e392 95 TString fRawDataFileName; // file name for the raw data file
96 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
85a5290f 97 Bool_t fStopOnError; // stop or continue on errors
98
99 Int_t fNEvents; // number of events
100 TString fConfigFileName; // name of the config file
101 TString fGAliceFileName; // name of the galice file
18b43626 102 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
103
85a5290f 104 TObjArray* fBkgrdFileNames; // names of background files for merging
04bae0a0 105 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
4df28b43 106 Bool_t fRegionOfInterest; // digitization in region of interest
85a5290f 107
06c7e392 108 ClassDef(AliSimulation, 2) // class for running generation, simulation and digitization
85a5290f 109};
110
111#endif