]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTWriteInternFormat.C
New version including TOF
[u/mrichter/AliRoot.git] / HBTAN / AliHBTWriteInternFormat.C
index 0af4d0b0cd929b599b46aed62f14b6498660a4a5..0808efdc39f7b12249cb48e0e5d6fda3c6631d3e 100644 (file)
@@ -18,7 +18,7 @@
 #endif
 
 
-void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAndParticles", 
+void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAndParticles",
                 Int_t first = -1,Int_t last = -1,
                 char *outfile = "data.root")
  {
@@ -44,42 +44,64 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
 //if first or last is negative (or both), it reads from current directory
 //
 //these names I use when analysis is done directly from CASTOR files via RFIO
-  const char* basedir="rfio:/castor/cern.ch/user/s/skowron";
-  const char* serie="10k.12fm";
-  const char* field = "0.2";
+
+  const char* basedir=".";
+  const char* serie="";
+  const char* field = "";
+  cout<<"AliHBTWriteInternFormat.C: datatype is "<<datatype<<" dir is basedir"<<endl;
   // Dynamically link some shared libs                    
   
-//  gROOT->LoadMacro("loadlibs.C");
-//  loadlibs();
-  
+  cout<<"AliHBTWriteInternFormat.C: Loading  HBTAN .....\n";
   gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libHBTAN");
+  cout<<"AliHBTWriteInternFormat.C: ..... Loaded\n";
   
-
+  Bool_t multcheck = kTRUE;
   /***********************************************************/
-  
+   
   AliHBTReader* reader;
   Int_t kine = strcmp(datatype,"Kine");
+  Int_t ESD = strcmp(datatype,"ESD");
   Int_t TPC = strcmp(datatype,"TPC");
   Int_t ITSv1 = strcmp(datatype,"ITSv1");
   Int_t ITSv2 = strcmp(datatype,"ITSv2");
+  Int_t intern = strcmp(datatype,"Intern");
 
   if(!kine)
    {
     reader = new AliHBTReaderKineTree();
     processopt="Particles"; //this reader by definition reads only simulated particles
+    multcheck = kFALSE;
+   }
+  else if(!ESD)
+   {
+    AliHBTReaderESD* esdreader = new AliHBTReaderESD();
+    esdreader->ReadParticles(kTRUE);
+    reader = esdreader;
+    multcheck = kTRUE;
    }
   else if(!TPC)
    {
+    cout<<"AliHBTWriteInternFormat.C: Creating Reader TPC .....\n";
     reader = new AliHBTReaderTPC();
+    multcheck = kFALSE;
+    cout<<"AliHBTWriteInternFormat.C: ..... Created\n";
    }
   else if(!ITSv1)
    {
     reader = new AliHBTReaderITSv1();
+    multcheck = kFALSE;
    }
   else if(!ITSv2)
    {
+    cout<<"AliHBTWriteInternFormat.C: Creating Reader ITSv2 .....\n";
     reader = new AliHBTReaderITSv2();
+    multcheck = kFALSE;
+    cout<<"AliHBTWriteInternFormat.C: ..... Created\n";
+   }
+  else if(!intern)
+   {
+    reader = new AliHBTReaderInternal("data.root");
+    multcheck = kTRUE;
    }
   else
    {
@@ -90,8 +112,10 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
   TObjArray* dirs=0;
   if ( (first >= 0) && (last>=0) && ( (last-first)>=0 ) )
    {//read from many dirs dirs
+     cout<<"AliHBTWriteInternFormat.C: ..... Setting dirs first="<<first<<" last="<<last<<"\n";
      char buff[50];
      dirs = new TObjArray(last-first+1);
+     dirs->SetOwner();
      for (Int_t i = first; i<=last; i++)
       { 
         sprintf(buff,"%s/%s/%s/%d",basedir,field,serie,i);
@@ -99,8 +123,14 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
         dirs->Add(odir);
       }
     }
+    
    reader->SetDirs(dirs);
-   AliHBTReaderInternal::Write(reader,outfile);
+
+   cout<<"AliHBTWriteInternFormat.C:   P R O C S E S S I N G .....\n\n";
+   AliHBTReaderInternal::Write(reader,outfile,multcheck);
+   cout<<"\n\nAliHBTWriteInternFormat.C:   F I N I S H E D\n";
    
+   if (dirs) delete dirs;
+   delete reader;
  }