]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRunDigitizer.h
Wrong versiion was committed before, this is the correct one
[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
1bb2a43c 11// This handles Merging and Digitisation of AliRoot events
9ce40367 12// Author: Jiri Chudoba (CERN)
13//
14////////////////////////////////////////////////////////////////////////
15
16// --- ROOT system ---
e2afb3b6 17
9ce40367 18#include "TArrayI.h"
8d5e6345 19#include "TTask.h"
88cb7938 20#include "TClonesArray.h"
e2afb3b6 21class TFile;
22class TParticle;
23class TTree;
9ce40367 24
25// --- AliRoot header files ---
26
88cb7938 27#include "AliStream.h"
9ce40367 28class AliDigitizer;
a90ecf3c 29class AliMergeCombi;
88cb7938 30class AliRunLoader;
9ce40367 31
af7ba10c 32#define MAXSTREAMSTOMERGE 4
e2afb3b6 33
8d5e6345 34class AliRunDigitizer: public TTask {
9ce40367 35
36public:
314558d7 37 AliRunDigitizer();
38 AliRunDigitizer(Int_t nInputStreams, Int_t sperb=1);
246e4424 39
9ce40367 40 virtual ~AliRunDigitizer();
88cb7938 41
42 void ExecuteTask(Option_t* option = 0);
43 void Exec(Option_t *option) {this->Digitize(option);}
44 void Digitize(Option_t* option = 0);
9ce40367 45 void AddDigitizer(AliDigitizer *digitizer);
88cb7938 46
8d5e6345 47 void SetOutputFile(TString fn);
9ae76683 48 TString GetOutputFile() const {return fOutputFileName;}
88cb7938 49
9ce40367 50 void SetOutputDir(TString dn) {fOutputDirName = dn;}
9ae76683 51 TString GetOutputDir() const {return fOutputDirName;}
88cb7938 52
53 void SetInputStream(Int_t stream, const char *inputName, TString foldername = "");
54
9ce40367 55 void SetFirstOutputEventNr(Int_t i) {fEvent = i;}
56 void SetNrOfEventsToWrite(Int_t i) {fNrOfEventsToWrite = i;}
57 void SetCopyTreesFromInput(Int_t i) {fCopyTreesFromInput = i;}
116cbefd 58 Int_t GetCopyTreesFromInput() const {return fCopyTreesFromInput;}
9ae76683 59 Int_t GetOutputEventNr() const {return fEvent;}
9ce40367 60 void SetCombinationFileName(TString fn) {fCombinationFileName = fn;}
9ae76683 61 TString GetCombinationFileName() const {return fCombinationFileName;}
9ce40367 62 Int_t GetMask(Int_t i) const {return fkMASK[i];}
9ce40367 63
88cb7938 64
65 Int_t GetNinputs() const {return fNinputs;}
66 const TString& GetInputFolderName(Int_t i) const;
67 const char* GetOutputFolderName();
68
69
70
9ce40367 71// Nr of particles in all input files for a given event
72// (as numbered in the output file)
9ae76683 73 Int_t GetNParticles(Int_t event) const;
9ce40367 74
75// Nr of particles in input file input for a given event
76// (as numbered in this input file)
9ae76683 77 Int_t GetNParticles(Int_t event, Int_t input) const;
9ce40367 78
79// return pointer to an int array with input event numbers which were
80// merged in the output event event
9ae76683 81 Int_t* GetInputEventNumbers(Int_t event) const;
9ce40367 82
83// return an event number of an eventInput from input file input
84// which was merged to create output event event
9ae76683 85 Int_t GetInputEventNumber(Int_t event, Int_t input) const;
9ce40367 86
d0f1ee3b 87 AliStream * GetInputStream(Int_t index) const { return dynamic_cast<AliStream *>(fInputStreams->At(index)) ; }
9ce40367 88// return pointer to particle with index i (index with mask)
9ae76683 89 TParticle* GetParticle(Int_t i, Int_t event) const;
9ce40367 90
91// return pointer to particle with index i in the input file input
92// (index without mask)
9ae76683 93 TParticle* GetParticle(Int_t i, Int_t input, Int_t event) const;
9ce40367 94
2e3dd5e5 95// return TString with input file name
d0f1ee3b 96 TString GetInputFileName(Int_t input, Int_t order) const;
9ce40367 97
9ce40367 98private:
246e4424 99 AliRunDigitizer(const AliRunDigitizer& dig); // not implemented
100 AliRunDigitizer& operator=(const AliRunDigitizer& dig); // not implemented
6c4904c2 101 void Copy(TObject& dig) const;
e2afb3b6 102 Bool_t ConnectInputTrees();
103 Bool_t InitGlobal();
104 Bool_t InitOutputGlobal();
105 void InitEvent();
106 void FinishEvent();
107 void FinishGlobal();
108
af7ba10c 109 Int_t fkMASK[MAXSTREAMSTOMERGE]; //! masks for track ids from
9ce40367 110 // different source files
111 Int_t fkMASKSTEP; // step to increase MASK for
112 // each input file
113 TString fOutputFileName; // output file name
114 TString fOutputDirName; // output dir name
88cb7938 115
9ce40367 116 Int_t fEvent; // output event nr.
117 Int_t fNrOfEventsToWrite; // Nr of events to write
118 Int_t fNrOfEventsWritten; // Nr of events written
119 Int_t fCopyTreesFromInput; // from which input file the trees
120 // should be copied, -1 for no copies
a90ecf3c 121 Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension
122 Int_t fNinputsGiven; // nr of input streams given by user
88cb7938 123 TClonesArray * fInputStreams; // input signal streams
124
125// AliStream* fOutputStream;
126 AliRunLoader* fOutRunLoader; //!
127 Bool_t fOutputInitialized; //indicates if outout was initialized
128 //
a90ecf3c 129 AliMergeCombi * fCombi; // pointer to the combination object
9ce40367 130 TArrayI fCombination; //! combination of events from
9ce40367 131 TString fCombinationFileName; // fn with combinations (used
132 // with type 2 of comb.)
88cb7938 133
134 AliRunLoader* GetOutRunLoader();
9ce40367 135
88cb7938 136 static const TString fgkDefOutFolderName;//default name for output foler
137 static const TString fgkBaseInFolderName;//default name for input foler
594d8990 138 ClassDef(AliRunDigitizer,6)
9ce40367 139};
140
141#endif // ALIRUNDIGITIZER_H