- 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=dynamic_cast<TBranch*>(next()))) {
- branch->SetFile(outFile);
- }
- delete outFile;
-
- cwd->cd();
-
- if (GetDebug()>1)
- printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file);
- }
- const 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(),"TreeTrackReferences",5)) {
- folder = "RunMC/Event/Data/TrackReferences";
- folderName = "TrackReferences" ;
- }
-
- 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());
- }