Minor corrections on the display (adc counts readable, ...).
[u/mrichter/AliRoot.git] / STEER / AliRunDigitizer.h
CommitLineData
9ce40367 1#ifndef ALIRUNDIGITIZER_H
2#define ALIRUNDIGITIZER_H
3/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8////////////////////////////////////////////////////////////////////////
9//
10// Manager Class for Merging/Digitization
11//
12// Author: Jiri Chudoba (CERN)
13//
14////////////////////////////////////////////////////////////////////////
15
16// --- ROOT system ---
17#include "TNamed.h"
18#include "TObjString.h"
19#include "TArrayI.h"
20#include "TClonesArray.h"
21#include "TTree.h"
22#include "TParticle.h"
8d5e6345 23#include "TTask.h"
9ce40367 24
9ae76683 25const Int_t kMaxStreamsToMerge = 4;
9ce40367 26
27// --- AliRoot header files ---
28
29class AliDigitizer;
a90ecf3c 30class AliMergeCombi;
9ce40367 31
8d5e6345 32class AliRunDigitizer: public TTask {
9ce40367 33
34public:
314558d7 35 AliRunDigitizer();
36 AliRunDigitizer(Int_t nInputStreams, Int_t sperb=1);
9ce40367 37 virtual ~AliRunDigitizer();
38 void AddDigitizer(AliDigitizer *digitizer);
8d5e6345 39 void SetOutputFile(TString fn);
9ae76683 40 TString GetOutputFile() const {return fOutputFileName;}
9ce40367 41 void SetOutputDir(TString dn) {fOutputDirName = dn;}
9ae76683 42 TString GetOutputDir() const {return fOutputDirName;}
3466e07f 43 void SetInputStream(Int_t stream, const char *inputName);
9ce40367 44 void SetFirstOutputEventNr(Int_t i) {fEvent = i;}
45 void SetNrOfEventsToWrite(Int_t i) {fNrOfEventsToWrite = i;}
46 void SetCopyTreesFromInput(Int_t i) {fCopyTreesFromInput = i;}
47 Int_t GetCopyTreesFromInput() {return fCopyTreesFromInput;}
9ae76683 48 Int_t GetOutputEventNr() const {return fEvent;}
9ce40367 49 void SetCombinationFileName(TString fn) {fCombinationFileName = fn;}
9ae76683 50 TString GetCombinationFileName() const {return fCombinationFileName;}
9ce40367 51 Int_t GetNinputs() const {return fNinputs;}
52 Int_t GetMask(Int_t i) const {return fkMASK[i];}
53 TTree* GetInputTreeS(Int_t i) const {return fArrayTreeS[i];}
54 TTree* GetInputTreeH(Int_t i) const {return fArrayTreeH[i];}
f042097d 55 void SetInputTreeTPCSBaseName(char * name) {
56 fTreeTPCSBaseName = name;}
9ce40367 57 TTree* GetInputTreeTPCS(Int_t i) const {return fArrayTreeTPCS[i];}
f34e67f9 58 TTree* GetInputTreeTRDS(Int_t i) const {return fArrayTreeTRDS[i];}
9ce40367 59 TTree* GetTreeD() const {return fTreeD;}
f042097d 60 void SetTreeDTPCBaseName(char * name) {
61 fTreeDTPCBaseName = name;}
f34e67f9 62 TTree* GetTreeDTPC() const {return fTreeDTPC;}
63 TTree* GetTreeDTRD() const {return fTreeDTRD;}
a08ddb28 64 TTree* GetTreeR() const {return fTreeR;}
8d5e6345 65 void Digitize(Option_t* option = 0);
f042097d 66 void Exec(Option_t *option) {this->Digitize(option);}
8d5e6345 67 void ExecuteTask(Option_t* option = 0);
9ce40367 68
8d5e6345 69
9ce40367 70// Nr of particles in all input files for a given event
71// (as numbered in the output file)
9ae76683 72 Int_t GetNParticles(Int_t event) const;
9ce40367 73
74// Nr of particles in input file input for a given event
75// (as numbered in this input file)
9ae76683 76 Int_t GetNParticles(Int_t event, Int_t input) const;
9ce40367 77
78// return pointer to an int array with input event numbers which were
79// merged in the output event event
9ae76683 80 Int_t* GetInputEventNumbers(Int_t event) const;
9ce40367 81
82// return an event number of an eventInput from input file input
83// which was merged to create output event event
9ae76683 84 Int_t GetInputEventNumber(Int_t event, Int_t input) const;
9ce40367 85
86// return pointer to particle with index i (index with mask)
9ae76683 87 TParticle* GetParticle(Int_t i, Int_t event) const;
9ce40367 88
89// return pointer to particle with index i in the input file input
90// (index without mask)
9ae76683 91 TParticle* GetParticle(Int_t i, Int_t input, Int_t event) const;
9ce40367 92
2e3dd5e5 93// return TString with input file name
94 TString GetInputFileName(const Int_t input, const Int_t order) const;
9ce40367 95
96 Int_t GetDebug() const {return fDebug;}
97 void SetDebug(Int_t level) {fDebug = level;}
98
99private:
9ae76683 100 Int_t fkMASK[kMaxStreamsToMerge]; //! masks for track ids from
9ce40367 101 // different source files
102 Int_t fkMASKSTEP; // step to increase MASK for
103 // each input file
104 TString fOutputFileName; // output file name
105 TString fOutputDirName; // output dir name
106 TFile * fOutput; //! pointer to the output file
107 Int_t fEvent; // output event nr.
108 Int_t fNrOfEventsToWrite; // Nr of events to write
109 Int_t fNrOfEventsWritten; // Nr of events written
110 Int_t fCopyTreesFromInput; // from which input file the trees
111 // should be copied, -1 for no copies
112 TTree * fTreeD; //! output TreeD
f34e67f9 113 TTree * fTreeDTPC; //! output TreeD for TPC
114 TTree * fTreeDTRD; //! output TreeD for TRD
a08ddb28 115 TTree * fTreeR; //! output TreeR for ITS fast points
a90ecf3c 116 Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension
117 Int_t fNinputsGiven; // nr of input streams given by user
118 TClonesArray * fInputStreams; // input streams
9ae76683 119 TFile * fInputFiles[kMaxStreamsToMerge]; //! p. to current input files
120 TTree * fArrayTreeS[kMaxStreamsToMerge]; //! array with p. to TreeS
121 TTree * fArrayTreeTPCS[kMaxStreamsToMerge]; //! array with p. to TreeD_75x40_100x60_x (TPC Sdigits)
122 TTree * fArrayTreeTRDS[kMaxStreamsToMerge]; //! array with p. to TreeSx_TRD (TRD Sdigits)
123 TTree * fArrayTreeH[kMaxStreamsToMerge]; //! array with p. to TreeH
f042097d 124 char * fTreeDTPCBaseName; //! basename of output TreeD for TPC
125 char * fTreeTPCSBaseName; //! basename of output TreeS for TPC
a90ecf3c 126 AliMergeCombi * fCombi; // pointer to the combination object
9ce40367 127 TArrayI fCombination; //! combination of events from
9ce40367 128 TString fCombinationFileName; // fn with combinations (used
129 // with type 2 of comb.)
a90ecf3c 130 Bool_t ConnectInputTrees();
9ce40367 131 Bool_t InitGlobal();
132 Bool_t InitOutputGlobal();
a90ecf3c 133 void InitEvent();
134 void FinishEvent();
9ce40367 135 void FinishGlobal();
136 Int_t fDebug; //! specifies debug level, 0 is min
137
f042097d 138 ClassDef(AliRunDigitizer,4)
9ce40367 139};
140
141#endif // ALIRUNDIGITIZER_H