First prototype of the trigger classes (E. Lopez Torres)
[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;};
a5a091ce 53 void SetMakeTrigger(const char* descriptors)
54 {fMakeTrigger = descriptors;};
85a5290f 55 void SetMakeDigitsFromHits(const char* detectors)
56 {fMakeDigitsFromHits = detectors;};
06c7e392 57 void SetWriteRawData(const char* detectors,
58 const char* fileName = NULL,
59 Bool_t deleteIntermediateFiles = kFALSE)
60 {fWriteRawData = detectors; fRawDataFileName = fileName;
61 fDeleteIntermediateFiles = deleteIntermediateFiles;};
8c30cb69 62 static Bool_t ApplyDisplacements(const char* fileName,
b9bc0f82 63 const char* ClArrayName);
8c30cb69 64 static Bool_t ApplyDisplacements(TClonesArray* AlObjArray);
65 static Bool_t ApplyDisplacements(AliCDBParam* param,
b9bc0f82 66 AliCDBId& Id);
8c30cb69 67 static Bool_t ApplyDisplacements(const char* uri, const char* path,
b9bc0f82 68 Int_t runnum, Int_t version,
69 Int_t sversion);
85a5290f 70
71 virtual Bool_t Run(Int_t nEvents = 0);
72
95601147 73 virtual Bool_t RunSimulation(Int_t nEvents = 0);
74 virtual Bool_t RunSDigitization(const char* detectors = "ALL");
a5a091ce 75 virtual Bool_t RunTrigger(const char* descriptors ="" );
95601147 76 virtual Bool_t RunDigitization(const char* detectors = "ALL",
77 const char* excludeDetectors = "");
78 virtual Bool_t RunHitsDigitization(const char* detectors = "ALL");
06c7e392 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");
8e4a4643 86
95601147 87private:
06c7e392 88 AliRunLoader* LoadRun(const char* mode = "UPDATE") const;
05526d44 89 Int_t GetNSignalPerBkgrd(Int_t nEvents = 0) const;
85a5290f 90 Bool_t IsSelected(TString detName, TString& detectors) const;
91
85a5290f 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
a5a091ce 96 TString fMakeTrigger; // run trigger for these descriptors
85a5290f 97 TString fMakeDigitsFromHits; // create digits from hits for these detectors
0421c3d1 98 TString fWriteRawData; // write raw data for these detectors
06c7e392 99 TString fRawDataFileName; // file name for the raw data file
100 Bool_t fDeleteIntermediateFiles; // delete intermediate raw data files
85a5290f 101 Bool_t fStopOnError; // stop or continue on errors
102
103 Int_t fNEvents; // number of events
104 TString fConfigFileName; // name of the config file
105 TString fGAliceFileName; // name of the galice file
18b43626 106 TObjArray fEventsPerFile; // number of events per file for given detectors and data types
107
85a5290f 108 TObjArray* fBkgrdFileNames; // names of background files for merging
04bae0a0 109 Bool_t fUseBkgrdVertex; // use vertex from background in case of merging
4df28b43 110 Bool_t fRegionOfInterest; // digitization in region of interest
85a5290f 111
06c7e392 112 ClassDef(AliSimulation, 2) // class for running generation, simulation and digitization
85a5290f 113};
114
115#endif