/*
$Log$
+Revision 1.9 2001/11/15 09:00:11 jchudoba
+Add special treatment for TPC and TRD, they use different trees than other detectors
+
Revision 1.8 2001/10/21 18:38:43 hristov
Several pointers were set to zero in the default constructors to avoid memory management problems
// and the I/O configured (you have to specify input files
// and an output file). The manager connects appropriate trees from
// the input files according a combination returned by AliMergeCombi
-// classcreates. It creates TreeD in the output and runs once per
+// class. It creates TreeD in the output and runs once per
// event Digitize method of all existing AliDetDigitizers
// (without any option). AliDetDigitizers ask manager
// for a TTree with input (manager->GetInputTreeS(Int_t i),
// The default output is to the signal file (stream 0). This can be
// changed with the SetOutputFile(TString fn) method.
//
-// Single input file is permitted. Maximum MAXSTREAMSTOMERGE can be merged.
+// Single input file is permitted. Maximum kMaxStreamsToMerge can be merged.
// Input from the memory (on-the-fly merging) is not yet
// supported, as well as access to the input data by invoking methods
// on the output data.
fNinputs = nInputStreams;
fOutputFileName = "";
fOutputDirName = ".";
- fCombination.Set(MAXSTREAMSTOMERGE);
- for (i=0;i<MAXSTREAMSTOMERGE;i++) {
+ fCombination.Set(kMaxStreamsToMerge);
+ for (i=0;i<kMaxStreamsToMerge;i++) {
fArrayTreeS[i]=fArrayTreeH[i]=fArrayTreeTPCS[i]=NULL;
fCombination[i]=-1;
}
fkMASKSTEP = 10000000;
fkMASK[0] = 0;
- for (i=1;i<MAXSTREAMSTOMERGE;i++) {
+ for (i=1;i<kMaxStreamsToMerge;i++) {
fkMASK[i] = fkMASK[i-1] + fkMASKSTEP;
}
fInputStreams = new TClonesArray("AliStream",nInputStreams);
fCopyTreesFromInput = -1;
fCombi = new AliMergeCombi(nInputStreams,sperb);
fDebug = 0;
- if (GetDebug()>2)
- cerr<<"AliRunDigitizer::AliRunDigitizer() called"<<endl;
- //PH
fTreeD = 0;
- for (i=0; i<MAXSTREAMSTOMERGE; i++) fInputFiles[i]=0;
+ fTreeDTPC = 0;
+ fTreeDTRD = 0;
+
+ for (i=0; i<kMaxStreamsToMerge; i++) fInputFiles[i]=0;
}
////////////////////////////////////////////////////////////////////////
TTree *tree;
char treeName[50];
Int_t serialNr;
- Int_t eventNr[MAXSTREAMSTOMERGE], delta[MAXSTREAMSTOMERGE];
+ Int_t eventNr[kMaxStreamsToMerge], delta[kMaxStreamsToMerge];
fCombi->Combination(eventNr, delta);
for (Int_t i=0;i<fNinputs;i++) {
if (delta[i] == 1) {
////////////////////////////////////////////////////////////////////////
-Int_t AliRunDigitizer::GetNParticles(Int_t event)
+Int_t AliRunDigitizer::GetNParticles(Int_t event) const
{
// return number of particles in all input files for a given
// event (as numbered in the output file)
}
////////////////////////////////////////////////////////////////////////
-Int_t AliRunDigitizer::GetNParticles(Int_t event, Int_t input)
+Int_t AliRunDigitizer::GetNParticles(Int_t event, Int_t input) const
{
// return number of particles in input file input for a given
// event (as numbered in this input file)
}
////////////////////////////////////////////////////////////////////////
-Int_t* AliRunDigitizer::GetInputEventNumbers(Int_t event)
+Int_t* AliRunDigitizer::GetInputEventNumbers(Int_t event) const
{
// return pointer to an int array with input event numbers which were
// merged in the output event event
// simplified for now, implement later
- Int_t * a = new Int_t[MAXSTREAMSTOMERGE];
+ Int_t * a = new Int_t[kMaxStreamsToMerge];
for (Int_t i = 0; i < fNinputs; i++) {
a[i] = event;
}
return a;
}
////////////////////////////////////////////////////////////////////////
-Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t input)
+Int_t AliRunDigitizer::GetInputEventNumber(Int_t event, Int_t input) const
{
// return an event number of an eventInput from input file input
// which was merged to create output event event
return event;
}
////////////////////////////////////////////////////////////////////////
-TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t event)
+TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t event) const
{
// return pointer to particle with index i (index with mask)
}
////////////////////////////////////////////////////////////////////////
-TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t input, Int_t event)
+TParticle* AliRunDigitizer::GetParticle(Int_t i, Int_t input, Int_t event) const
{
// return pointer to particle with index i in the input file input
// (index without mask)
#include "TParticle.h"
#include "TTask.h"
-#define MAXDETECTORS 20
-#define MAXSTREAMSTOMERGE 4
+const Int_t kMaxStreamsToMerge = 4;
// --- AliRoot header files ---
virtual ~AliRunDigitizer();
void AddDigitizer(AliDigitizer *digitizer);
void SetOutputFile(TString fn);
- TString GetOutputFile() {return fOutputFileName;}
+ TString GetOutputFile() const {return fOutputFileName;}
void SetOutputDir(TString dn) {fOutputDirName = dn;}
- TString GetOutputDir() {return fOutputDirName;}
+ TString GetOutputDir() const {return fOutputDirName;}
void SetInputStream(Int_t stream, char *inputName);
void SetFirstOutputEventNr(Int_t i) {fEvent = i;}
void SetNrOfEventsToWrite(Int_t i) {fNrOfEventsToWrite = i;}
void SetCopyTreesFromInput(Int_t i) {fCopyTreesFromInput = i;}
Int_t GetCopyTreesFromInput() {return fCopyTreesFromInput;}
- Int_t GetOutputEventNr() {return fEvent;}
+ Int_t GetOutputEventNr() const {return fEvent;}
void SetCombinationFileName(TString fn) {fCombinationFileName = fn;}
- TString GetCombinationFileName() {return fCombinationFileName;}
+ TString GetCombinationFileName() const {return fCombinationFileName;}
Int_t GetNinputs() const {return fNinputs;}
Int_t GetMask(Int_t i) const {return fkMASK[i];}
TTree* GetInputTreeS(Int_t i) const {return fArrayTreeS[i];}
// Nr of particles in all input files for a given event
// (as numbered in the output file)
- Int_t GetNParticles(Int_t event);
+ Int_t GetNParticles(Int_t event) const;
// Nr of particles in input file input for a given event
// (as numbered in this input file)
- Int_t GetNParticles(Int_t event, Int_t input);
+ Int_t GetNParticles(Int_t event, Int_t input) const;
// return pointer to an int array with input event numbers which were
// merged in the output event event
- Int_t* GetInputEventNumbers(Int_t event);
+ Int_t* GetInputEventNumbers(Int_t event) const;
// return an event number of an eventInput from input file input
// which was merged to create output event event
- Int_t GetInputEventNumber(Int_t event, Int_t input);
+ Int_t GetInputEventNumber(Int_t event, Int_t input) const;
// return pointer to particle with index i (index with mask)
- TParticle* GetParticle(Int_t i, Int_t event);
+ TParticle* GetParticle(Int_t i, Int_t event) const;
// return pointer to particle with index i in the input file input
// (index without mask)
- TParticle* GetParticle(Int_t i, Int_t input, Int_t event);
+ TParticle* GetParticle(Int_t i, Int_t input, Int_t event) const;
Int_t GetDebug() const {return fDebug;}
void SetDebug(Int_t level) {fDebug = level;}
private:
- Int_t fkMASK[MAXSTREAMSTOMERGE]; //! masks for track ids from
+ Int_t fkMASK[kMaxStreamsToMerge]; //! masks for track ids from
// different source files
Int_t fkMASKSTEP; // step to increase MASK for
// each input file
Int_t fNinputs; // nr of input streams - can be taken from the TClonesArray dimension
Int_t fNinputsGiven; // nr of input streams given by user
TClonesArray * fInputStreams; // input streams
- TFile * fInputFiles[MAXSTREAMSTOMERGE]; //! p. to current input files
- TTree * fArrayTreeS[MAXSTREAMSTOMERGE]; //! array with p. to TreeS
- TTree * fArrayTreeTPCS[MAXSTREAMSTOMERGE]; //! array with p. to TreeD_75x40_100x60_x (TPC Sdigits)
- TTree * fArrayTreeTRDS[MAXSTREAMSTOMERGE]; //! array with p. to TreeSx_TRD (TRD Sdigits)
- TTree * fArrayTreeH[MAXSTREAMSTOMERGE]; //! array with p. to TreeH
+ TFile * fInputFiles[kMaxStreamsToMerge]; //! p. to current input files
+ TTree * fArrayTreeS[kMaxStreamsToMerge]; //! array with p. to TreeS
+ TTree * fArrayTreeTPCS[kMaxStreamsToMerge]; //! array with p. to TreeD_75x40_100x60_x (TPC Sdigits)
+ TTree * fArrayTreeTRDS[kMaxStreamsToMerge]; //! array with p. to TreeSx_TRD (TRD Sdigits)
+ TTree * fArrayTreeH[kMaxStreamsToMerge]; //! array with p. to TreeH
AliMergeCombi * fCombi; // pointer to the combination object
TArrayI fCombination; //! combination of events from
TString fCombinationFileName; // fn with combinations (used