Obsolete macros
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 31 Oct 2009 11:00:05 +0000 (11:00 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 31 Oct 2009 11:00:05 +0000 (11:00 +0000)
macros/ConvertToNewIO.C [deleted file]
macros/display.C [deleted file]
macros/grun.C [deleted file]

diff --git a/macros/ConvertToNewIO.C b/macros/ConvertToNewIO.C
deleted file mode 100644 (file)
index 70190c3..0000000
+++ /dev/null
@@ -1,801 +0,0 @@
-#ifndef __MAKECINT__
- #ifndef __CINT__
-  #include "alles.h"
-  #include "TInterpreter.h"
-  #include "TBranchClones.h"
-  #include "TBranchElement.h"  
-  #include "AliTPCTrackHits.h"
-  #include "AliTRDtrackHits.h"
- #endif
-#endif
-
-void ConvertToNewIO(const char* name)
-{
-//  AliLoader::SetDebug();
-  AliConfig* conf = AliConfig::Instance();
-  TClass* detclass = AliDetector::Class(); 
-  void* buff;
-  Bool_t skipit = kFALSE;
-  void * pbuf[100]; 
-  TBranch* branches[100];
-  Int_t nbranches = 0;
-  
-  AliRunLoader* rl = AliRunLoader::Open("galiceNewIO.root","Event","recreate");
-  rl->SetCompressionLevel(2);
-  rl->SetNumberOfEventsPerFile(100);
-  
-  AliRun* outAliRun;
-
-  if (gAlice == 0x0)
-   {
-     outAliRun = new AliRun("OutgAlice","Output gAlice");
-   }
-  else
-   {
-    outAliRun = gAlice;
-   } 
-  gAlice = 0x0;
-   
-  outAliRun->SetRunLoader(rl);
-  
-  TFile* infile = TFile::Open(name);
-  
-  if (infile == 0x0)
-   {
-     ::Error("ConvertToNewIO.C","Can not open input file %s",name);
-     return;
-   }
-  
-  AliRun* inAliRun = (AliRun*)infile->Get("gAlice");
-  
-  if(inAliRun == 0x0)
-   {
-     ::Error("ConvertToNewIO.C","Can not find gAlice in input file");
-     return;
-   }
-  gAlice = inAliRun;
-//  inAliRun->GetEvent(0);
-  
-  TObjArray* modules = inAliRun->Modules();
-  if (modules == 0x0)
-   {
-     ::Error("ConvertToNewIO.C","Can not get array with modules from AliRun");
-     return;
-   }
-  TIter next(modules);
-  AliModule* module;
-  TObject * object;
-  while ((object = next()))  
-   {
-     module = dynamic_cast<AliModule*>(object);
-     if (module == 0x0) {
-       ::Error("ConvertToNewIO.C","Can not cast module %#x ",object);
-       object->Dump();
-       continue;
-     }
-
-     outAliRun->AddModule(module);
-     
-     TClass* modclass = module->IsA();
-     AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-     if (det) 
-      {
-        ::Info("ConvertToNewIO.C"," Adding %s to RL.",det->GetName());
-        conf->Add(det,"Event");
-        rl->AddLoader(det);
-      }
-   }
-
-  TParticle* particleBuffer = new TParticle();
-  /***************************************************/
-  /****          Event to Event         **************/
-  /***************************************************/
-
-  TTree* treeE = (TTree*)infile->Get("TE");
-  if (treeE == 0x0)
-   {
-     ::Error("ConvertToNewIO.C","Can not get TreeE from AliRun");
-     return;
-   }
-  rl->MakeTree("E");
-    
-  AliHeader* inheader = new AliHeader();
-  treeE->SetBranchAddress("Header",&inheader);
-  
-  Int_t nevents = (Int_t)treeE->GetEntries();
-  for (Int_t i = 0; i<nevents; i++)
-   {
-     ::Info("ConvertToNewIO.C","Converting Event %d.",i);
-     rl->SetEventNumber(i);
-     treeE->GetEvent(i);
-     /*****************************************/
-     /*            H E A D E R                */
-     /*****************************************/
-     
-     ::Info("ConvertToNewIO.C","Copying Header");
-     AliHeader* outheader = rl->GetHeader();
-     
-     
-     outheader->SetEvent(inheader->GetEvent());
-     outheader->SetNvertex(inheader->GetNvertex());
-     outheader->SetNprimary(inheader->GetNprimary());
-     outheader->SetNtrack(inheader->GetNtrack());
-     outheader->SetRun(inheader->GetRun());
-     outheader->SetEventNrInRun(inheader->GetEventNrInRun());
-     outheader->SetStack(inheader->Stack());
-     outheader->SetGenEventHeader(inheader->GenEventHeader());
-     rl->TreeE()->Fill();
-
-     /*****************************************/
-     /*       K I N E M A T I C S             */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying Kinematics.");
-     TString treeKname("TreeK");
-     treeKname+=i;
-     TTree* treeK = (TTree*)infile->Get(treeKname);
-     if (treeK)
-      { 
-       if (treeK->GetEntries() > 0)
-       {   
-        //I do this gimnastics to set directory correctly, without changing NewIO code 
-        //only for this purpose
-        rl->LoadKinematics("update");
-        rl->MakeTree("K");
-        rl->GetEventFolder()->Remove(rl->TreeK());
-        delete rl->TreeK();
-        
-        treeK->SetBranchAddress("Particles",&particleBuffer);
-        ::Info("ConvertToNewIO.C","Cloning TreeK ...");
-        TTree* tk = treeK->CloneTree();
-        ::Info("ConvertToNewIO.C","Cloning TreeK ... Done");
-        tk->SetName(AliRunLoader::fgkKineContainerName);
-        rl->GetEventFolder()->Add(tk);
-        rl->WriteKinematics("OVERWRITE");
-        rl->UnloadKinematics();
-       }
-       else
-        {
-          Info("ConvertToNewIO.C","Kinematics Tree is Empty");
-        }
-      }
-     else
-      {
-        Error("ConvertToNewIO.C","Could not find Kinematics tree named %s",treeKname.Data());
-      }
-     delete treeK;
-     /*****************************************/
-     /*   T R A C K   R E F E R E N C E S     */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying Track Refs.");
-     TString treeTRname("TreeTR");
-     treeTRname+=i;
-     TTree* treeTR = (TTree*)infile->Get(treeTRname);
-     if (treeTR)
-      { 
-       if (treeTR->GetEntries() > 0)
-       {   
-        next.Reset();
-       TObject * object;
-        while ((object = next()))  
-         {
-          module = dynamic_cast<AliModule*>(object);
-          if (module == 0x0) {
-            ::Error("ConvertToNewIO.C","Can not cast module %#x ",object);
-            object->Dump();
-            continue;
-          }
-           TClass* modclass = module->IsA();
-           AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-           if (det) 
-            {
-              TClonesArray* trbuffer = new TClonesArray("AliTrackReference", 100);
-              treeTR->SetBranchAddress(det->GetName(),&trbuffer);
-            }
-         }
-        
-        //I do this gimnastics to set directory correctly, without changing NewIO code 
-        //only for this purpose
-        rl->LoadTrackRefs("update");
-        rl->MakeTrackRefsContainer();
-        rl->GetEventFolder()->Remove(rl->TreeTR());
-        delete rl->TreeTR();
-        
-        ::Info("ConvertToNewIO.C","Cloning TreeTR ...");
-        TTree* tr = treeTR->CloneTree();
-        ::Info("ConvertToNewIO.C","Cloning TreeTR ... Done");
-        
-        tr->SetName(AliRunLoader::fgkTrackRefsContainerName);
-        rl->GetEventFolder()->Add(tr);
-        rl->WriteTrackRefs("OVERWRITE");   
-        rl->UnloadTrackRefs();
-       }
-       else
-        {
-          Info("ConvertToNewIO.C","Track References Tree is Empty");
-        }
-      }
-     else
-      {
-        Error("ConvertToNewIO.C","Could not find Track Refs tree named %s",treeTRname.Data());
-      }
-     delete treeTR;
-      
-     /*****************************************/
-     /*          H I T S                      */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying Hits.");
-     TString treeHname("TreeH");
-     treeHname+=i;
-     TTree* treeH = (TTree*)infile->Get(treeHname);
-     
-     if (treeH)
-      { 
-       if (treeH->GetEntries() > 0)
-        {   
-         TObjArray* lob = treeH->GetListOfBranches();
-         TObjArray* loaders = new TObjArray();
-         TIter nextnewmodule(outAliRun->Modules());
-        
-         while ((module = (AliModule*)nextnewmodule()))
-          {
-            TClass* modclass = module->IsA();
-            AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-            TClonesArray* ca = 0;
-            if (det) 
-             {
-               AliLoader* loader = det->GetLoader();
-               if (loader == 0x0)
-                {
-                  ::Error("ConvertToNewIO.C","Can not find loader from %s.",det->GetName());
-                  continue;
-                }
-
-               TString mask(det->GetName());
-               
-               loader->LoadHits("update");
-               loader->MakeTree("H");
-               loaders->Add(loader);
-               for(Int_t b=0; b<lob->GetEntries();b++)
-                {
-                  TBranch* branch = (TBranch*)lob->At(b);
-                  TString bname(branch->GetName());//
-                  if ( bname.BeginsWith(det->GetName()) )
-                   {
-                     ::Info("ConvertToNewIO.C","Found branch %s.",branch->GetName());
-                     ::Info("ConvertToNewIO.C","Buffer Class Name %s.",branch->GetClassName());
-                     TString contname(branch->GetClassName());
-                  
-                     Int_t splitlvl = branch->GetSplitLevel();
-                    // if (splitlvl) splitlvl = 99;
-                 
-                     if( contname.CompareTo("TClonesArray") == 0)
-                      { 
-                        TBranchElement* belem = (TBranchElement*)branch;
-                        ::Info("ConvertToNewIO.C","Clones Class Name %s.",belem->GetClonesName());
-                    
-                        ca = new TClonesArray(belem->GetClonesName());
-                        pbuf[nbranches] = ca;
-           
-                        branch->SetAddress(&(pbuf[nbranches]));
-                        ::Info("ConvertToNewIO.C","Buffer addrss %#x",pbuf[nbranches]);
-                        ::Info("ConvertToNewIO.C","Creating branch for Clones SpliLvl = %d",splitlvl);
-                        branches[nbranches] = loader->TreeH()->Branch(branch->GetName(),&(pbuf[nbranches]),4000,splitlvl);
-                        nbranches++;
-                      }
-                     else
-                      {
-                        TClass* bcl = gROOT->GetClass(branch->GetClassName());
-                        if (bcl == 0x0)
-                         {
-                           ::Error("ConvertToNewIO.C","Can not get TClass object of class named %s",branch->GetClassName());
-                           continue;
-                         }
-                        pbuf[nbranches] = bcl->New();
-                        ::Info("ConvertToNewIO.C","Dumping buffer:");
-                        ((TObject*)pbuf[nbranches])->Dump();
-                        ::Info("ConvertToNewIO.C","Setting Adress:");
-                        branch->SetAddress(&(pbuf[nbranches]));
-                        ::Info("ConvertToNewIO.C","Creating branch SpliLvl = %d",splitlvl);
-                        branches[nbranches] =loader->TreeH()->Branch(branch->GetName(),branch->GetClassName(),&(pbuf[nbranches]),4000,splitlvl);
-                        nbranches++;
-                      }
-                   }
-                }//loop over branches
-             }//if module is detector
-          }//while loop over modules
-         Int_t nentr = (Int_t)treeH->GetEntries();
-         ::Info("ConvertToNewIO.C","Copying Hits . Number of entries %d  ... ",nentr);
-               
-//         ::Info("ConvertToNewIO.C","Getting event:");
-//         nentr = 100;
-         Int_t nl = loaders->GetEntries();
-         for (Int_t e = 0; e < nentr; e++)
-           {
-             printf("%d\r",e);
-             treeH->GetEntry(e);
-             
-             for (Int_t l = 0; l < nbranches; l++)
-              {
-//              printf("%s %#x \n", branches[l]->GetName(),pbuf[l]);
-                branches[l]->SetAddress(&(pbuf[l]));    
-              }
-     
-             for (Int_t l = 0; l < nl; l++)
-              {
-                AliLoader* loader = (AliLoader*)loaders->At(l);
-//              printf("Filling %s\n",loader->GetName());
-                loader->TreeH()->Fill();
-              }
-             #ifndef __MAKECINT__
-              #ifndef __CINT__
-               fflush(0);
-              #endif
-             #endif
-            }
-        printf("\n");
-               
-        ::Info("ConvertToNewIO.C","Copying Hits ...  Done");
-        for (Int_t l = 0; l < nl; l++)
-         {
-           AliLoader* loader = (AliLoader*)loaders->At(l);
-           loader->WriteHits("OVERWRITE");
-           loader->UnloadHits();
-         }
-        delete loaders;
-        for (Int_t l = 0; l < nbranches; l++)
-         {
-           delete (TObject*)pbuf[l];
-         }
-         nbranches = 0;            
-       }
-       else //tree has any entries
-        {
-          Info("ConvertToNewIO.C","Hits Tree is Empty");
-        }
-      }
-     else //treeH
-      {
-       ::Warning("ConvertToNewIO.C","Could not get TreeH from in AliRun.");
-      }
-     delete treeH; 
-
-     /*****************************************/
-     /*          S  D i g i t s               */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying S Digits.");
-     TString treeSname("TreeS");
-     treeSname+=i;
-     TTree* treeS = (TTree*)infile->Get(treeSname);
-     if (treeS)
-      { 
-       if (treeS->GetEntries() > 0)
-        {   
-         TObjArray* lob = treeS->GetListOfBranches();
-         TObjArray* loaders = new TObjArray();
-         TIter nextnewmodule(outAliRun->Modules());
-        
-         while ((module = (AliModule*)nextnewmodule()))
-          {
-           TClass* modclass = module->IsA();
-           AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-           TClonesArray* ca = 0;
-           if (det) 
-            {
-              AliLoader* loader = det->GetLoader();
-              if (loader == 0x0)
-               {
-                 ::Error("ConvertToNewIO.C","Can not find loader from %s.",det->GetName());
-                 continue;
-               }
-
-              TString mask(det->GetName());
-              
-              loader->LoadSDigits("update");
-              loader->MakeTree("S");
-              loaders->Add(loader);
-              for(Int_t b=0; b<lob->GetEntries();b++)
-               {
-                 TBranch* branch = (TBranch*)lob->At(b);
-                 TString bname(branch->GetName());//
-                 if ( bname.BeginsWith(det->GetName()) )
-                  {
-                    
-                    ::Info("ConvertToNewIO.C","Found branch %s.",branch->GetName());
-                    ::Info("ConvertToNewIO.C","Buffer Class Name %s.",branch->GetClassName());
-                    TString contname(branch->GetClassName());
-                 
-                    Int_t splitlvl = branch->GetSplitLevel();
-                   // if (splitlvl) splitlvl = 99;
-                 
-                    if ( contname.CompareTo("TClonesArray") == 0)
-                     {
-                       TBranchElement* belem = (TBranchElement*)branch;
-                       ::Info("ConvertToNewIO.C","Clones Class Name %s.",belem->GetClonesName());
-                   
-                       ca = new TClonesArray(belem->GetClonesName());
-                       pbuf[nbranches] = ca;
-          
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Buffer addrss %#x",pbuf[nbranches]);
-
-                       ::Info("ConvertToNewIO.C","Creating branch for Clones SpliLvl = %d",splitlvl);
-                       branches[nbranches] = loader->TreeS()->Branch(branch->GetName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                    else
-                     {
-                       TClass* bcl = gROOT->GetClass(branch->GetClassName());
-                        if (bcl == 0x0)
-                         {
-                           ::Error("ConvertToNewIO.C","Can not get TClass object of class named %s",branch->GetClassName());
-                           continue;
-                         }
-                       pbuf[nbranches] = bcl->New();
-                       ::Info("ConvertToNewIO.C","Dumping buffer:");
-                       ((TObject*)pbuf[nbranches])->Dump();
-                       ::Info("ConvertToNewIO.C","Setting Adress:");
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Creating branch SpliLvl = %d",splitlvl);
-                       branches[nbranches] =loader->TreeS()->Branch(branch->GetName(),branch->GetClassName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                  }
-               }//loop over branches
-            }//if module is detector
-         }//while loop over modules
-        Int_t nentr = (Int_t)treeS->GetEntries();
-        ::Info("ConvertToNewIO.C","Copying SDigits. Number of entries %d  ... ",nentr);
-              
-//        ::Info("ConvertToNewIO.C","Getting event:");
-//        nentr = 100;
-        Int_t nl = loaders->GetEntries();
-        for (Int_t e = 0; e < nentr; e++)
-          {
-            printf("%d\r",e);
-            treeS->GetEntry(e);
-            
-            for (Int_t l = 0; l < nbranches; l++)
-             {
-//             printf("%s %#x \n", branches[l]->GetName(),pbuf[l]);
-               branches[l]->SetAddress(&(pbuf[l]));    
-             }
-    
-            for (Int_t l = 0; l < nl; l++)
-             {
-               AliLoader* loader = (AliLoader*)loaders->At(l);
-//               printf("Filling %s\n",loader->GetName());
-               loader->TreeS()->Fill();
-             }
-            #ifndef __MAKECINT__
-             #ifndef __CINT__
-              fflush(0);
-             #endif
-            #endif
-           }
-        printf("\n");
-              
-        ::Info("ConvertToNewIO.C","Copying SDigits ...  Done");
-        for (Int_t l = 0; l < nl; l++)
-         {
-           AliLoader* loader = (AliLoader*)loaders->At(l);
-           loader->WriteSDigits("OVERWRITE");
-           loader->UnloadSDigits();
-         }
-        delete loaders;
-        for (Int_t l = 0; l < nbranches; l++)
-         {
-           delete (TObject*)pbuf[l];
-         }
-        nbranches = 0;             
-       }
-      else //tree has any entries
-       {
-         ::Info("ConvertToNewIO.C","S Digits Tree is Empty");
-       }
-      }
-     else //treeS
-      {
-        ::Warning("ConvertToNewIO.C","Could not get TreeS from AliRun.");
-      }
-     delete treeS; 
-
-     /*****************************************/
-     /*          D i g i t s                  */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying Digits.");
-     TString treeDname("TreeD");
-     treeDname+=i;
-     TTree* treeD = (TTree*)infile->Get(treeDname);
-     if (treeD)
-      { 
-       if (treeD->GetEntries() > 0)
-        {   
-       
-         TObjArray* lob = treeD->GetListOfBranches();
-         TObjArray* loaders = new TObjArray();
-         TIter nextnewmodule(outAliRun->Modules());
-         
-         while ((module = (AliModule*)nextnewmodule()))
-          {
-           TClass* modclass = module->IsA();
-           AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-           TClonesArray* ca = 0;
-           if (det) 
-            {
-              AliLoader* loader = det->GetLoader();
-              if (loader == 0x0)
-               {
-                 ::Error("ConvertToNewIO.C","Can not find loader from %s.",det->GetName());
-                 continue;
-               }
-
-              TString mask(det->GetName());
-              
-              loader->LoadDigits("update");
-              loader->MakeTree("D");
-              loaders->Add(loader);
-              for(Int_t b=0; b<lob->GetEntries();b++)
-               {
-                 TBranch* branch = (TBranch*)lob->At(b);
-                 TString bname(branch->GetName());//
-                 if ( bname.BeginsWith(det->GetName()) )
-                  {
-                    
-                    ::Info("ConvertToNewIO.C","Found branch %s.",branch->GetName());
-                    ::Info("ConvertToNewIO.C","Buffer Class Name %s.",branch->GetClassName());
-                    TString contname(branch->GetClassName());
-                 
-                    Int_t splitlvl = branch->GetSplitLevel();
-                   // if (splitlvl) splitlvl = 99;
-                 
-                    if ( contname.CompareTo("TClonesArray") == 0)
-                     {
-                       TBranchElement* belem = (TBranchElement*)branch;
-                       ::Info("ConvertToNewIO.C","Clones Class Name %s.",belem->GetClonesName());
-                   
-                       ca = new TClonesArray(belem->GetClonesName());
-                       pbuf[nbranches] = ca;
-          
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Buffer addrss %#x",pbuf[nbranches]);
-
-                       ::Info("ConvertToNewIO.C","Creating branch for Clones SpliLvl = %d",splitlvl);
-                       branches[nbranches] = loader->TreeD()->Branch(branch->GetName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                    else
-                     {
-                       TClass* bcl = gROOT->GetClass(branch->GetClassName());
-                       if (bcl == 0x0)
-                        {
-                          ::Error("ConvertToNewIO.C","Can not get TClass object of class named %s",branch->GetClassName());
-                          continue;
-                        }
-                       pbuf[nbranches] = bcl->New();
-                       ::Info("ConvertToNewIO.C","Dumping buffer:");
-                       ((TObject*)pbuf[nbranches])->Dump();
-                       ::Info("ConvertToNewIO.C","Setting Adress:");
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Creating branch SpliLvl = %d",splitlvl);
-                       branches[nbranches] =loader->TreeD()->Branch(branch->GetName(),branch->GetClassName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                  }
-               }//loop over branches
-            }//if module is detector
-         }//while loop over modules
-        Int_t nentr = (Int_t)treeD->GetEntries();
-        ::Info("ConvertToNewIO.C","Copying Digits. Number of entries %d  ... ",nentr);
-              
-//        ::Info("ConvertToNewIO.C","Getting event:");
-//        nentr = 100;
-        Int_t nl = loaders->GetEntries();
-        for (Int_t e = 0; e < nentr; e++)
-          {
-            printf("%d\r",e);
-            treeD->GetEntry(e);
-            
-            for (Int_t l = 0; l < nbranches; l++)
-             {
-//             printf("%s %#x \n", branches[l]->GetName(),pbuf[l]);
-               branches[l]->SetAddress(&(pbuf[l]));    
-             }
-    
-            for (Int_t l = 0; l < nl; l++)
-             {
-               AliLoader* loader = (AliLoader*)loaders->At(l);
-//               printf("Filling %s\n",loader->GetName());
-               loader->TreeD()->Fill();
-             }
-            #ifndef __MAKECINT__
-             #ifndef __CINT__
-              fflush(0);
-             #endif
-            #endif
-           }
-       printf("\n");
-              
-       ::Info("ConvertToNewIO.C","Copying Digits ...  Done");
-       for (Int_t l = 0; l < nl; l++)
-        {
-          AliLoader* loader = (AliLoader*)loaders->At(l);
-          loader->WriteDigits("OVERWRITE");
-          loader->UnloadDigits();
-        }
-       delete loaders;
-      }
-      else //tree has any entries
-       {
-         Info("ConvertToNewIO.C","S Digits Tree is Empty");
-       }
-      }
-     else //treeD
-      {
-        ::Warning("ConvertToNewIO.C","Could not get TreeD from in AliRun.");
-      }
-     delete treeD; 
-     for (Int_t l = 0; l < nbranches; l++)
-      {
-       delete (TObject*)pbuf[l];
-      }
-      nbranches = 0;       
-
-     /*****************************************/
-     /*          R e c  P o i n t s           */
-     /*****************************************/
-     ::Info("ConvertToNewIO.C","Copying RecPoints.");
-     TString treeRname("TreeR");
-     treeRname+=i;
-     TTree* treeR = (TTree*)infile->Get(treeRname);
-     if (treeR)
-      { 
-       if (treeR->GetEntries() > 0)
-        {   
-         TObjArray* lob = treeR->GetListOfBranches();
-         TObjArray* loaders = new TObjArray();
-         TIter nextnewmodule(outAliRun->Modules());
-        
-         while ((module = (AliModule*)nextnewmodule()))
-          {
-           TClass* modclass = module->IsA();
-           AliDetector *det = (AliDetector*)(modclass->DynamicCast(detclass,module));
-           TClonesArray* ca = 0;
-           if (det) 
-            {
-              AliLoader* loader = det->GetLoader();
-              if (loader == 0x0)
-               {
-                 ::Error("ConvertToNewIO.C","Can not find loader from %s.",det->GetName());
-                 continue;
-               }
-
-              TString mask(det->GetName());
-              
-              loader->LoadRecPoints("update");
-              loader->MakeTree("R");
-              loaders->Add(loader);
-              for(Int_t b=0; b<lob->GetEntries();b++)
-               {
-                 TBranch* branch = (TBranch*)lob->At(b);
-                 TString bname(branch->GetName());//
-                 if ( bname.BeginsWith(det->GetName()) )
-                  {
-                    
-                    ::Info("ConvertToNewIO.C","Found branch %s.",branch->GetName());
-                    ::Info("ConvertToNewIO.C","Buffer Class Name %s.",branch->GetClassName());
-                    TString contname(branch->GetClassName());
-                 
-                    Int_t splitlvl = branch->GetSplitLevel();
-                   // if (splitlvl) splitlvl = 99;
-                 
-                    if ( contname.CompareTo("TClonesArray") == 0)
-                     {
-                       TBranchElement* belem = (TBranchElement*)branch;
-                       ::Info("ConvertToNewIO.C","Clones Class Name %s.",belem->GetClonesName());
-                   
-                       ca = new TClonesArray(belem->GetClonesName());
-                       pbuf[nbranches] = ca;
-          
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Buffer addrss %#x",pbuf[nbranches]);
-
-                       ::Info("ConvertToNewIO.C","Creating branch for Clones SpliLvl = %d",splitlvl);
-                       branches[nbranches] = loader->TreeR()->Branch(branch->GetName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                    else
-                     {
-                       TClass* bcl = gROOT->GetClass(branch->GetClassName());
-                       if (bcl == 0x0)
-                        {
-                          ::Error("ConvertToNewIO.C","Can not get TClass object of class named %s",branch->GetClassName());
-                          continue;
-                        }
-                       pbuf[nbranches] = bcl->New();
-                       ::Info("ConvertToNewIO.C","Dumping buffer:");
-                       ((TObject*)pbuf[nbranches])->Dump();
-                       ::Info("ConvertToNewIO.C","Setting Adress:");
-                       branch->SetAddress(&(pbuf[nbranches]));
-                       ::Info("ConvertToNewIO.C","Creating branch SpliLvl = %d",splitlvl);
-                       branches[nbranches] =loader->TreeR()->Branch(branch->GetName(),branch->GetClassName(),&(pbuf[nbranches]),4000,splitlvl);
-                       nbranches++;
-                     }
-                  }
-               }//loop over branches
-            }//if module is detector
-         }//while loop over modules
-        Int_t nentr = (Int_t)treeR->GetEntries();
-        ::Info("ConvertToNewIO.C","Copying RecPoints. Number of entries %d  ... ",nentr);
-              
-//        ::Info("ConvertToNewIO.C","Getting event:");
-//        nentr = 100;
-        Int_t nl = loaders->GetEntries();
-        for (Int_t e = 0; e < nentr; e++)
-          {
-            printf("%d\r",e);
-            treeR->GetEntry(e);
-            
-            for (Int_t l = 0; l < nbranches; l++)
-             {
-//             printf("%s %#x \n", branches[l]->GetName(),pbuf[l]);
-               branches[l]->SetAddress(&(pbuf[l]));    
-             }
-    
-            for (Int_t l = 0; l < nl; l++)
-             {
-               AliLoader* loader = (AliLoader*)loaders->At(l);
-//               printf("Filling %s\n",loader->GetName());
-               loader->TreeR()->Fill();
-             }
-            #ifndef __MAKECINT__
-             #ifndef __CINT__
-              fflush(0);
-             #endif
-            #endif
-           }
-        printf("\n");
-              
-        ::Info("ConvertToNewIO.C","Copying RecPoints ...  Done");
-        for (Int_t l = 0; l < nl; l++)
-         {
-           AliLoader* loader = (AliLoader*)loaders->At(l);
-           loader->WriteRecPoints("OVERWRITE");
-           loader->UnloadRecPoints();
-         }
-        delete loaders;
-        for (Int_t l = 0; l < nbranches; l++)
-         {
-           delete (TObject*)pbuf[l];//delete branches buffers 
-         }
-        nbranches = 0;             
-       }
-      else //tree has any entries
-       {
-         Info("ConvertToNewIO.C","Rec Points Tree is Empty");
-       }
-      }
-     else //treeR
-      {
-        ::Warning("ConvertToNewIO.C","Could not get TreeR from in AliRun.");
-      }
-     delete treeR; 
-
-    }//end of loop over events
-    
-  /***************************************************/
-  /****             Run to Run           *************/
-  /***************************************************/
-
-  rl->WriteHeader("OVERWRITE");
-
-  infile->cd();
-  rl->CdGAFile();
-  
-  rl->WriteAliRun();
-  rl->WriteRunLoader();
-
-  ::Info("ConvertToNewIO.C","Done");
-  
-}
-
diff --git a/macros/display.C b/macros/display.C
deleted file mode 100644 (file)
index a4be79a..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-// This macro displays the hits belonging to a track for selected detectors
-// Input: in the tracks contains the interesting tracks
-//        ntracks is the number of interesing tracks
-//        The default values correspond to "Show everything"
-// Note: For the moment it works only with HIJING events, the PYTHIA is 
-//       still not supported 
-void display (const char *filename="galice.root",Int_t nevent=0, Int_t * tracks=0, Int_t ntracks=0) {
-// Dynamically link some shared libs
-   if (gClassTable->GetID("AliRun") < 0) {
-      gROOT->LoadMacro("loadlibs.C");
-      loadlibs();
-   } else {
-      delete AliRunLoader::Instance();
-      delete gAlice;
-      gAlice = 0;
-   }
-      
-// Connect the Root Galice file containing Geometry, Kine and Hits
-   AliRunLoader *rl = 0x0;
-   TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
-   if(file){
-     cout<<"galice.root is already open \n";
-   }
-
-   
-   rl = AliRunLoader::Open(filename,"DISPLAYED EVENT");
-   
-   if (rl == 0x0)
-    {
-      cerr<<"Error <display.C()>: can not get Run Loader. Exiting"<<endl;
-      return;
-    }
-// Get AliRun object from file or create it if not on file
-
-   rl->LoadgAlice();
-   gAlice = rl->GetAliRun();
-   if (!gAlice) {
-    cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
-    return;
-  }
-    
-// Load data
-   rl->GetEvent(nevent);
-   rl->LoadKinematics();
-   rl->LoadHeader();
-   rl->LoadHits();
-
-// Create Event Display object
-   AliDisplay *edisplay = new AliDisplay(750);
-   if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks);
-   
-// Display the requested event
-   edisplay->ShowNextEvent(0);
-
-// Define the buttons to switch on/off the existing modules
-   Float_t nodet=0.;
-   TObjArray *moduli = gAlice->Modules();
-   Int_t nomod=moduli->GetEntriesFast();
-   AliModule *modu;
-   for (Int_t j=0; j<nomod; j++){
-     modu=(AliModule*)moduli->At(j);
-     char *avoid=strstr("BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
-     if(avoid)continue;
-     nodet++;
-   }
-   TDialogCanvas *dialog = new TDialogCanvas("Modules"," ",150,30*nodet);
-   Float_t yval1=1./nodet*0.9*0.05;
-   Float_t yval2=1./nodet*0.9*0.95;
-   char action[50];
-   char title[30];
-   char bname[30];
-   TButton *butto1;
-   for (Int_t j=0; j<nomod; j++){
-     modu=(AliModule*)moduli->At(j);
-     char *avoid=strstr(" BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
-     if(avoid)continue;
-     sprintf(action,"swioff(\"%s\")",modu->GetName());
-     sprintf(title,"%s is on",modu->GetName());
-     sprintf(bname,"but%s",modu->GetName());
-     butto1 = new TButton(title,action,.05,yval1,.95,yval2);
-     butto1->SetName(bname);
-     butto1->SetFillColor(3);
-     butto1->Draw();
-     yval1+=1./nodet;
-     yval2+=1./nodet;
-   }
-} 
-
-void swioff(const char *dete){
-  gAlice->Display()->DisableDetector(dete);
-  gAlice->Display()->Pad()->Modified();
-  gAlice->Display()->Pad()->Update();
-  char bname[30];
-  char action[50];
-  char title[30];
-  sprintf(bname,"but%s",dete);
-  TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
-  TButton *bt = (TButton *)dia->FindObject(bname);
-  bt->SetFillColor(2);
-  sprintf(action,"swion(\"%s\")",dete);
-  bt->SetMethod(action);
-  sprintf(title,"%s is off",dete);
-  bt->SetTitle(title);
-  dia->Draw();
-}
-
-void swion(const char *dete){
-  gAlice->Display()->EnableDetector(dete);
-  gAlice->Display()->Pad()->Modified();
-  gAlice->Display()->Pad()->Update();
-  TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
-  char bname[30];
-  char action[50];
-  char title[30];
-  sprintf(bname,"but%s",dete);
-  TButton *bt = (TButton *)dia->FindObject(bname);
-  bt->SetFillColor(3);
-  sprintf(action,"swioff(\"%s\")",dete);
-  bt->SetMethod(action);
-  sprintf(title,"%s is on",dete);
-  bt->SetTitle(title);
-  dia->Draw();
-}
-
diff --git a/macros/grun.C b/macros/grun.C
deleted file mode 100644 (file)
index b64d793..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-void grun (Int_t nevent=1, const char *config="Config.C")
-{
-  //
-  // Simple macro to run aliroot in a batch mode
-  //
-  gAlice->Init(config);
-  TStopwatch timer;
-  timer.Start();
-//
-//  If nevent is negative it is assumed that in config the 
-//  global variable eventsPerRun has been set.
-//
-  if (nevent < 0) 
-      nevent = eventsPerRun;
-  gAlice->Run(nevent);
-  timer.Stop();
-  timer.Print();
-}