]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRunDigitizer.h
Updated version of the non-recursive Makefiles. See doc/README.FlatMakefile and build...
[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
25#define MAXDETECTORS 20
a90ecf3c 26#define MAXSTREAMSTOMERGE 4
9ce40367 27
28// --- AliRoot header files ---
29
30class AliDigitizer;
a90ecf3c 31class AliMergeCombi;
9ce40367 32
8d5e6345 33class AliRunDigitizer: public TTask {
9ce40367 34
35public:
8d5e6345 36 AliRunDigitizer(Int_t nInputStream=1, Int_t sperb=1);
9ce40367 37 virtual ~AliRunDigitizer();
38 void AddDigitizer(AliDigitizer *digitizer);
8d5e6345 39 void SetOutputFile(TString fn);
9ce40367 40 TString GetOutputFile() {return fOutputFileName;}
41 void SetOutputDir(TString dn) {fOutputDirName = dn;}
42 TString GetOutputDir() {return fOutputDirName;}
a90ecf3c 43 void SetInputStream(Int_t stream, 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;}
48 Int_t GetOutputEventNr() {return fEvent;}
9ce40367 49 void SetCombinationFileName(TString fn) {fCombinationFileName = fn;}
50 TString GetCombinationFileName() {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];}
55 TTree* GetInputTreeTPCS(Int_t i) const {return fArrayTreeTPCS[i];}
9ce40367 56 TTree* GetTreeD() const {return fTreeD;}
8d5e6345 57 void Digitize(Option_t* option = 0);
58 void Exec(Option_t *option) {this->Digitize();}
59 void ExecuteTask(Option_t* option = 0);
9ce40367 60
8d5e6345 61
9ce40367 62// Nr of particles in all input files for a given event
63// (as numbered in the output file)
64 Int_t GetNParticles(Int_t event);
65
66// Nr of particles in input file input for a given event
67// (as numbered in this input file)
68 Int_t GetNParticles(Int_t event, Int_t input);
69
70// return pointer to an int array with input event numbers which were
71// merged in the output event event
72 Int_t* GetInputEventNumbers(Int_t event);
73
74// return an event number of an eventInput from input file input
75// which was merged to create output event event
76 Int_t GetInputEventNumber(Int_t event, Int_t input);
77
78// return pointer to particle with index i (index with mask)
79 TParticle* GetParticle(Int_t i, Int_t event);
80
81// return pointer to particle with index i in the input file input
82// (index without mask)
83 TParticle* GetParticle(Int_t i, Int_t input, Int_t event);
84
85
86 Int_t GetDebug() const {return fDebug;}
87 void SetDebug(Int_t level) {fDebug = level;}
88
89private:
a90ecf3c 90 Int_t fkMASK[MAXSTREAMSTOMERGE]; //! masks for track ids from
9ce40367 91 // different source files
92 Int_t fkMASKSTEP; // step to increase MASK for
93 // each input file
94 TString fOutputFileName; // output file name
95 TString fOutputDirName; // output dir name
96 TFile * fOutput; //! pointer to the output file
97 Int_t fEvent; // output event nr.
98 Int_t fNrOfEventsToWrite; // Nr of events to write
99 Int_t fNrOfEventsWritten; // Nr of events written
100 Int_t fCopyTreesFromInput; // from which input file the trees
101 // should be copied, -1 for no copies
102 TTree * fTreeD; //! output TreeD
a90ecf3c 103 Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension
104 Int_t fNinputsGiven; // nr of input streams given by user
105 TClonesArray * fInputStreams; // input streams
8d5e6345 106 TFile * fInputFiles[MAXSTREAMSTOMERGE]; //! p. to current input files
a90ecf3c 107 TTree * fArrayTreeS[MAXSTREAMSTOMERGE]; //! array with p. to TreeS
108 TTree * fArrayTreeTPCS[MAXSTREAMSTOMERGE]; //! array with p. to TreeD_75x40_100x60_x (TPC Sdigits)
109 TTree * fArrayTreeH[MAXSTREAMSTOMERGE]; //! array with p. to TreeH
110 AliMergeCombi * fCombi; // pointer to the combination object
9ce40367 111 TArrayI fCombination; //! combination of events from
9ce40367 112 TString fCombinationFileName; // fn with combinations (used
113 // with type 2 of comb.)
a90ecf3c 114 Bool_t ConnectInputTrees();
9ce40367 115 Bool_t InitGlobal();
116 Bool_t InitOutputGlobal();
a90ecf3c 117 void InitEvent();
118 void FinishEvent();
9ce40367 119 void FinishGlobal();
120 Int_t fDebug; //! specifies debug level, 0 is min
121
8d5e6345 122 ClassDef(AliRunDigitizer,2)
9ce40367 123};
124
125#endif // ALIRUNDIGITIZER_H