ROOT logo
AliRoot » STEER » STEER » AliDigitizationInput

class AliDigitizationInput: public TNamed


 AliDigitizationInput.cxx
 RS: Created from former AliDigitizationInput. It does not anymore manage digitization:
 (now it is steared by the AliSimulation) but just provides input info for
 AliDetector::SDigits2Ditits.

 Manager object for merging/digitization

 Instance of this class manages the digitization and/or merging of
 Sdigits into Digits.

 Only one instance of this class is created in the macro:
   AliDigitizationInput * manager =
      new AliDigitizationInput(nInputStreams,SPERB);
 where nInputStreams is number of input streams and SPERB is
 signals per background variable, which determines how combinations
 of signal and background events are generated.
 Then instances of specific detector digitizers are created:
   AliMUONDigitizer *dMUON  = new AliMUONDigitizer(manager)
 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
 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),
 merge all inputs, digitize it, and save it in the TreeD
 obtained by manager->GetTreeD(). Output events are stored with
 numbers from 0, this default can be changed by
 manager->SetFirstOutputEventNr(Int_t) method. The particle numbers
 in the output are shifted by MASK, which is taken from manager.

 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.
 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.

 Access to the some data is via gAlice for now (supposing the
 same geometry in all input files), gAlice is taken from the first
 input file on the first stream.

 Example with MUON digitizer, no merging, just digitization

  AliDigitizationInput * manager = new AliDigitizationInput(1,1);
  manager->SetInputStream(0,"galice.root");
  AliMUONDigitizer *dMUON  = new AliMUONDigitizer(manager);
  manager->Exec("");

 Example with MUON digitizer, merge all events from
   galice.root (signal) file with events from bgr.root
   (background) file. Number of merged events is
   min(number of events in galice.root, number of events in bgr.root)

  AliDigitizationInput * manager = new AliDigitizationInput(2,1);
  manager->SetInputStream(0,"galice.root");
  manager->SetInputStream(1,"bgr.root");
  AliMUONDigitizer *dMUON  = new AliMUONDigitizer(manager);
  manager->Exec("");

 Example with MUON digitizer, save digits in a new file digits.root,
   process only 1 event

  AliDigitizationInput * manager = new AliDigitizationInput(2,1);
  manager->SetInputStream(0,"galice.root");
  manager->SetInputStream(1,"bgr.root");
  manager->SetOutputFile("digits.root");
  AliMUONDigitizer *dMUON  = new AliMUONDigitizer(manager);
  manager->SetNrOfEventsToWrite(1);
  manager->Exec("");


Function Members (Methods)

public:
AliDigitizationInput()
AliDigitizationInput(Int_t nInputStreams, Int_t sperb = 1)
virtual~AliDigitizationInput()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
Bool_tConnectInputTrees()
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
voidFinishEvent()
voidFinishGlobal()
TStringGetCombinationFileName() const
Int_tGetCopyTreesFromInput() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
Int_tGetInputEventNumber(Int_t event, Int_t input) const
Int_t*GetInputEventNumbers(Int_t event) const
TStringGetInputFileName(Int_t input, Int_t order) const
const TString&GetInputFolderName(Int_t i) const
AliStream*GetInputStream(Int_t index) const
Int_tGetMask(Int_t i) const
virtual const char*TNamed::GetName() const
Int_tGetNinputs() const
Int_tGetNParticles(Int_t event) const
Int_tGetNParticles(Int_t event, Int_t input) const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TStringGetOutputDir() const
Int_tGetOutputEventNr() const
TStringGetOutputFile() const
const char*GetOutputFolderName()
AliRunLoader*GetOutRunLoader()
TParticle*GetParticle(Int_t i, Int_t event) const
TParticle*GetParticle(Int_t i, Int_t input, Int_t event) const
Bool_tGetRegionOfInterest() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
voidInitEvent()
Bool_tInitOutputGlobal()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCombinationFileName(TString fn)
voidSetCopyTreesFromInput(Int_t i)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetFirstOutputEventNr(Int_t i)
voidSetInputStream(Int_t stream, const char* inputName, TString foldername = "")
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
voidSetNrOfEventsToWrite(Int_t i)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetOutputDir(TString dn)
voidSetOutputFile(TString fn)
voidSetRegionOfInterest(Bool_t flag)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
AliMergeCombi*fCombipointer to the combination object
TArrayIfCombination! combination of events from
TStringfCombinationFileNamefn with combinations (used
Int_tfCopyTreesFromInputfrom which input file the trees
Int_tfEventoutput event nr.
TClonesArray*fInputStreamsinput signal streams
Int_tfNinputsnr of input streams - can be taken from the TClonesArray dimension
Int_tfNinputsGivennr of input streams given by user
Int_tfNrOfEventsToWriteNr of events to write
Int_tfNrOfEventsWrittenNr of events written
AliRunLoader*fOutRunLoader!
TStringfOutputDirNameoutput dir name
TStringfOutputFileNameoutput file name
Bool_tfOutputInitializedindicates if outout was initialized
Bool_tfRegionOfInterestdigitization in region of interest
static const TStringfgkBaseInFolderNamedefault name for input foler
static const TStringfgkDefOutFolderNamedefault name for output foler
Int_tfkMASK[4]! masks for track ids from
Int_tfkMASKSTEPstep to increase MASK for

Class Charts

Inheritance Chart:
TNamed
AliDigitizationInput

Function documentation

AliDigitizationInput()
 root requires default ctor, where no new objects can be created
 do not use this ctor, it is supplied only for root needs
AliDigitizationInput(Int_t nInputStreams, Int_t sperb = 1)
 ctor which should be used to create
 a manager for merging/digitization

void Copy(TObject& dig) const
 Non implemented copy function

~AliDigitizationInput()
 dtor

void SetInputStream(Int_t stream, const char* inputName, TString foldername = "")
 Sets the name of the input file

Bool_t ConnectInputTrees()
 loads events

void SetOutputFile(TString fn)
 The output will be to separate file,
 not to the signal file here should be protection
to avoid setting the same file as any input

Bool_t InitOutputGlobal()
 Creates the output file, called by InitEvent()
 Needs to be called after all inputs are opened

void InitEvent()
 redirects output properly

void FinishEvent()
 called at the end of loop over digitizers

void FinishGlobal()
 called at the end of Exec
 save unique objects to the output file

Int_t GetNParticles(Int_t event) const
 return number of particles in all input files for a given
 event (as numbered in the output file)
 return -1 if some file cannot be accessed
Int_t 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)
 return -1 if some error
Int_t* GetInputEventNumbers(Int_t event) const
 return pointer to an int array with input event numbers which were
 merged in the output event event
Int_t 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
TParticle* GetParticle(Int_t i, Int_t event) const
 return pointer to particle with index i (index with mask)
TParticle* 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)
 event is the event number in the file input
 return 0 i fit does not exist
const TString& GetInputFolderName(Int_t i) const
 Get the input Folder Name

const char* GetOutputFolderName()
 Get output folder name

AliRunLoader* GetOutRunLoader()
 Returns Run Loader

TString GetInputFileName(Int_t input, Int_t order) const
 returns file name of the order-th file in the input stream input
 returns empty string if such file does not exist
 first input stream is 0
 first file in the input stream is 0
AliDigitizationInput()
TString GetOutputFile() const
{return fOutputFileName;}
void SetOutputDir(TString dn)
TString GetOutputDir() const
{return fOutputDirName;}
void SetFirstOutputEventNr(Int_t i)
{fEvent = i;}
void SetNrOfEventsToWrite(Int_t i)
void SetCopyTreesFromInput(Int_t i)
Int_t GetCopyTreesFromInput() const
Int_t GetOutputEventNr() const
{return fEvent;}
void SetCombinationFileName(TString fn)
TString GetCombinationFileName() const
Int_t GetMask(Int_t i) const
{return fkMASK[i];}
void SetRegionOfInterest(Bool_t flag)
Bool_t GetRegionOfInterest() const
Int_t GetNinputs() const
{return fNinputs;}
AliStream * GetInputStream(Int_t index) const
 return pointer to particle with index i (index with mask)
{ return dynamic_cast<AliStream *>(fInputStreams->At(index)) ; }
AliDigitizationInput& operator=(const AliDigitizationInput& dig)