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 */
9 // class for running generation, simulation and digitization
10 // Hits, sdigits and digits are created for all detectors by typing:
17 #include <TObjArray.h>
18 #include <TGeoManager.h>
19 #include <TGeoPhysicalNode.h>
20 #include "AliCDBManager.h"
21 #include "AliCDBStorage.h"
22 #include "AliCDBEntry.h"
28 class AliSimulation: public TNamed {
30 AliSimulation(const char* configFileName = "Config.C",
31 const char* name = "AliSimulation",
32 const char* title = "generation, simulation and digitization");
33 AliSimulation(const AliSimulation& sim);
34 AliSimulation& operator = (const AliSimulation& sim);
35 virtual ~AliSimulation();
37 void SetNumberOfEvents(Int_t nEvents);
38 void SetConfigFile(const char* fileName);
39 void SetGAliceFile(const char* fileName);
40 void SetEventsPerFile(const char* detector, const char* type,
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;};
47 void MergeWith(const char* fileName, Int_t nSignalPerBkgrd = 0);
48 void SetUseBkgrdVertex(Bool_t useBkgrdVertex)
49 {fUseBkgrdVertex = useBkgrdVertex;};
50 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
51 void SetMakeDigits(const char* detectors)
52 {fMakeDigits = detectors;};
53 void SetMakeTrigger(const char* descriptors)
54 {fMakeTrigger = descriptors;};
55 void SetMakeDigitsFromHits(const char* detectors)
56 {fMakeDigitsFromHits = detectors;};
57 void SetWriteRawData(const char* detectors,
58 const char* fileName = NULL,
59 Bool_t deleteIntermediateFiles = kFALSE)
60 {fWriteRawData = detectors; fRawDataFileName = fileName;
61 fDeleteIntermediateFiles = deleteIntermediateFiles;};
62 static Bool_t ApplyDisplacements(const char* fileName,
63 const char* ClArrayName);
64 static Bool_t ApplyDisplacements(TClonesArray* AlObjArray);
65 static Bool_t ApplyDisplacements(AliCDBParam* param,
67 static Bool_t ApplyDisplacements(const char* uri, const char* path,
68 Int_t runnum, Int_t version,
71 virtual Bool_t Run(Int_t nEvents = 0);
73 virtual Bool_t RunSimulation(Int_t nEvents = 0);
74 virtual Bool_t RunSDigitization(const char* detectors = "ALL");
75 virtual Bool_t RunTrigger(const char* descriptors ="" );
76 virtual Bool_t RunDigitization(const char* detectors = "ALL",
77 const char* excludeDetectors = "");
78 virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
79 virtual Bool_t WriteRawData(const char* detectors = "ALL",
80 const char* fileName = NULL,
81 Bool_t deleteIntermediateFiles = kFALSE);
82 virtual Bool_t WriteRawFiles(const char* detectors = "ALL");
83 virtual Bool_t ConvertRawFilesToDate(const char* dateFileName = "raw.date");
84 virtual Bool_t ConvertDateToRoot(const char* dateFileName = "raw.date",
85 const char* rootFileName = "raw.root");
88 AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
89 Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
90 Bool_t IsSelected(TString detName, TString& detectors) const;
92 Bool_t fRunGeneration; // generate prim. particles or not
93 Bool_t fRunSimulation; // simulate detectors (hits) or not
94 TString fMakeSDigits; // create sdigits for these detectors
95 TString fMakeDigits; // create digits for these detectors
96 TString fMakeTrigger; // run trigger for these descriptors
97 TString fMakeDigitsFromHits; // create digits from hits for these detectors
98 TString fWriteRawData; // write raw data for these detectors
99 TString fRawDataFileName; // file name for the raw data file
100 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
101 Bool_t fStopOnError; // stop or continue on errors
103 Int_t fNEvents; // number of events
104 TString fConfigFileName; // name of the config file
105 TString fGAliceFileName; // name of the galice file
106 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
108 TObjArray* fBkgrdFileNames; // names of background files for merging
109 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
110 Bool_t fRegionOfInterest; // digitization in region of interest
112 ClassDef(AliSimulation, 2) // class for running generation, simulation and digitization