]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEER/AliDigitizationInput.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / STEER / AliDigitizationInput.h
CommitLineData
f21fc003 1#ifndef ALIDIGITIZATIONINPUT_H
2#define ALIDIGITIZATIONINPUT_H
9ce40367 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"
f21fc003 19#include "TNamed.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
f21fc003 34class AliDigitizationInput: public TNamed {
9ce40367 35
36public:
f21fc003 37 AliDigitizationInput();
38 AliDigitizationInput(Int_t nInputStreams, Int_t sperb=1);
246e4424 39
f21fc003 40 virtual ~AliDigitizationInput();
88cb7938 41
8d5e6345 42 void SetOutputFile(TString fn);
9ae76683 43 TString GetOutputFile() const {return fOutputFileName;}
88cb7938 44
9ce40367 45 void SetOutputDir(TString dn) {fOutputDirName = dn;}
9ae76683 46 TString GetOutputDir() const {return fOutputDirName;}
88cb7938 47
48 void SetInputStream(Int_t stream, const char *inputName, TString foldername = "");
49
9ce40367 50 void SetFirstOutputEventNr(Int_t i) {fEvent = i;}
51 void SetNrOfEventsToWrite(Int_t i) {fNrOfEventsToWrite = i;}
52 void SetCopyTreesFromInput(Int_t i) {fCopyTreesFromInput = i;}
116cbefd 53 Int_t GetCopyTreesFromInput() const {return fCopyTreesFromInput;}
9ae76683 54 Int_t GetOutputEventNr() const {return fEvent;}
9ce40367 55 void SetCombinationFileName(TString fn) {fCombinationFileName = fn;}
9ae76683 56 TString GetCombinationFileName() const {return fCombinationFileName;}
9ce40367 57 Int_t GetMask(Int_t i) const {return fkMASK[i];}
f21fc003 58 void SetRegionOfInterest(Bool_t flag) {fRegionOfInterest = flag;};
59 Bool_t GetRegionOfInterest() const {return fRegionOfInterest;};
88cb7938 60 Int_t GetNinputs() const {return fNinputs;}
61 const TString& GetInputFolderName(Int_t i) const;
62 const char* GetOutputFolderName();
63
64
65
9ce40367 66// Nr of particles in all input files for a given event
67// (as numbered in the output file)
9ae76683 68 Int_t GetNParticles(Int_t event) const;
9ce40367 69
70// Nr of particles in input file input for a given event
71// (as numbered in this input file)
9ae76683 72 Int_t GetNParticles(Int_t event, Int_t input) const;
9ce40367 73
74// return pointer to an int array with input event numbers which were
75// merged in the output event event
9ae76683 76 Int_t* GetInputEventNumbers(Int_t event) const;
9ce40367 77
78// return an event number of an eventInput from input file input
79// which was merged to create output event event
9ae76683 80 Int_t GetInputEventNumber(Int_t event, Int_t input) const;
9ce40367 81
d0f1ee3b 82 AliStream * GetInputStream(Int_t index) const { return dynamic_cast<AliStream *>(fInputStreams->At(index)) ; }
9ce40367 83// return pointer to particle with index i (index with mask)
9ae76683 84 TParticle* GetParticle(Int_t i, Int_t event) const;
9ce40367 85
86// return pointer to particle with index i in the input file input
87// (index without mask)
9ae76683 88 TParticle* GetParticle(Int_t i, Int_t input, Int_t event) const;
9ce40367 89
2e3dd5e5 90// return TString with input file name
d0f1ee3b 91 TString GetInputFileName(Int_t input, Int_t order) const;
f21fc003 92 AliRunLoader* GetOutRunLoader();
93 //
e2afb3b6 94 Bool_t ConnectInputTrees();
e2afb3b6 95 Bool_t InitOutputGlobal();
96 void InitEvent();
97 void FinishEvent();
98 void FinishGlobal();
f21fc003 99
100private:
101 AliDigitizationInput(const AliDigitizationInput& dig); // not implemented
102 AliDigitizationInput& operator=(const AliDigitizationInput& dig); // not implemented
103 void Copy(TObject& dig) const;
e2afb3b6 104
af7ba10c 105 Int_t fkMASK[MAXSTREAMSTOMERGE]; //! masks for track ids from
9ce40367 106 // different source files
107 Int_t fkMASKSTEP; // step to increase MASK for
108 // each input file
109 TString fOutputFileName; // output file name
110 TString fOutputDirName; // output dir name
88cb7938 111
9ce40367 112 Int_t fEvent; // output event nr.
113 Int_t fNrOfEventsToWrite; // Nr of events to write
114 Int_t fNrOfEventsWritten; // Nr of events written
115 Int_t fCopyTreesFromInput; // from which input file the trees
116 // should be copied, -1 for no copies
a90ecf3c 117 Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension
118 Int_t fNinputsGiven; // nr of input streams given by user
f21fc003 119 Bool_t fRegionOfInterest; // digitization in region of interest
88cb7938 120 TClonesArray * fInputStreams; // input signal streams
121
122// AliStream* fOutputStream;
123 AliRunLoader* fOutRunLoader; //!
124 Bool_t fOutputInitialized; //indicates if outout was initialized
125 //
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
f21fc003 129 // with type 2 of comb.)
88cb7938 130 static const TString fgkDefOutFolderName;//default name for output foler
131 static const TString fgkBaseInFolderName;//default name for input foler
f21fc003 132 ClassDef(AliDigitizationInput,2)
9ce40367 133};
134
135#endif // ALIRUNDIGITIZER_H