- if (classname) {
- branch = tree->Branch(name,classname,address,size,splitlevel);
- } else {
- branch = tree->Branch(name,address,size);
- }
-
- if (file) {
- char * outFile = new char[strlen(gAlice->GetBaseFile())+strlen(file)+2];
- sprintf(outFile,"%s/%s",gAlice->GetBaseFile(),file);
- branch->SetFile(outFile);
- TIter next( branch->GetListOfBranches());
- while ((branch=(TBranch*)next())) {
- branch->SetFile(outFile);
- }
- delete outFile;
-
- cwd->cd();
-
- if (GetDebug()>1)
- printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file);
- }
- char *folder = 0;
- TString folderName(name);
-
- if (!strncmp(tree->GetName(),"TreeE",5)) folder = "RunMC/Event/Data";
- if (!strncmp(tree->GetName(),"TreeK",5)) folder = "RunMC/Event/Data";
- if (!strncmp(tree->GetName(),"TreeH",5)) {
- folder = "RunMC/Event/Data/Hits";
- folderName = "Hits" ;
- }
- if (!strncmp(tree->GetName(),"TreeD",5)) {
- folder = "Run/Event/Data";
- folderName = "Digits" ;
- }
- if (!strncmp(tree->GetName(),"TreeS",5)) {
- folder = "RunMC/Event/Data/SDigits";
- folderName = "SDigits" ;
- }
- if (!strncmp(tree->GetName(),"TreeR",5)) folder = "Run/Event/RecData";
-
- if (folder) {
- if (GetDebug())
- printf("%15s: Publishing %s to %s\n",ClassName(),name,folder);
- Publish(folder,address, folderName.Data());
- }
+ AliDebug(2,Form("Making Branch %s",name));
+ if (tree == 0x0)
+ {
+ AliError(Form("Making Branch %s Tree is NULL",name));
+ return 0x0;
+ }
+ TBranch *branch = tree->GetBranch(name);
+ if (branch)
+ {
+ AliDebug(2,Form("Branch %s is already in tree.",name));