-//__________________________________________________________________
-void AliPHOSDigitizer::MixWith(TString alirunFileName, TString eventFolderName)
-{
- // Allows to produce digits by superimposing background and signal event.
- // It is assumed, that headers file with SIGNAL events is opened in
- // the constructor.
- // Sets the BACKGROUND event, with which the SIGNAL event is to be mixed
- // Thus we avoid writing (changing) huge and expensive
- // backgound files: all output will be writen into SIGNAL, i.e.
- // opened in constructor file.
- //
- // One can open as many files to mix with as one needs.
- // However only Sdigits with the same name (i.e. constructed with the same SDigitizer)
- // can be mixed.
-
- if( strcmp(fEventFolderName, "") == 0 )
- Init() ;
-
- if(fManager){
- Warning("MixWith", "Cannot use this method with AliRunDigitizer\n" ) ;
- return ;
- }
- // looking for file which contains AliRun
- if (gSystem->AccessPathName(alirunFileName)) {// file does not exist
- AliError(Form("File %s does not exist!", alirunFileName.Data())) ;
- return ;
- }
- // looking for the file which contains SDigits
- AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
- TString fileName( gime->GetSDigitsFileName() ) ;
- if ( eventFolderName != AliConfig::GetDefaultEventFolderName()) // only if not the default folder name
- fileName = fileName.ReplaceAll(".root", "") + "_" + eventFolderName + ".root" ;
- if ( (gSystem->AccessPathName(fileName)) ) {
- AliError(Form("The file %s does not exist!", fileName.Data())) ;
- return ;
- }
- // need to increase the arrays
- TString tempo = fInputFileNames[fInput-1] ;
- delete [] fInputFileNames ;
- fInputFileNames = new TString[fInput+1] ;
- fInputFileNames[fInput-1] = tempo ;
-
- tempo = fEventNames[fInput-1] ;
- delete [] fEventNames ;
- fEventNames = new TString[fInput+1] ;
- fEventNames[fInput-1] = tempo ;
-
- fInputFileNames[fInput] = alirunFileName ;
- fEventNames[fInput] = eventFolderName ;
- fInput++ ;
-}
-