]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/WriteAOD.C
Merge branch 'master', remote branch 'origin' into TPCdev
[u/mrichter/AliRoot.git] / ANALYSIS / WriteAOD.C
index be404362b02e70031e29b369937c8c56c842b4f2..b10ea063e4df959f16e75ab4dbf2f783a3215cec 100644 (file)
@@ -2,6 +2,7 @@
   #include "$(ALICE_ROOT)/TPC/alles.h"
   #include "AliReader.h"
   #include "AliReaderKineTree.h"
+  #include "AliReaderESDTree.h"
   #include "AliAODParticleCut.h"
   #include "AliAOD.h"
   #include "AliAODPairCut.h"
@@ -47,6 +48,7 @@ void WriteAOD(Option_t* datatype, Int_t first = -1,Int_t last = -1,
   cout<<"WriteAOD.C: ..... Loaded\n";
   
   Int_t PID[11];
+
   PID[0]=kProton;
   PID[1]=kProtonBar;
   PID[2]=kKPlus;
@@ -76,6 +78,7 @@ void WriteAOD(Option_t* datatype, Int_t first = -1,Int_t last = -1,
   AliReader* reader;
   Int_t kine = strcmp(datatype,"Kine");
   Int_t ESD = strcmp(datatype,"ESD");
+  Int_t ESDMuon = strcmp(datatype,"ESDMuon");
   Int_t intern = strcmp(datatype,"AOD");
 
   if(!kine)
@@ -98,9 +101,31 @@ void WriteAOD(Option_t* datatype, Int_t first = -1,Int_t last = -1,
 
   else if(!intern)
    {
-    reader = new AliHBTReaderAOD("AOD.root");
+    AliReaderAOD* aodreader = new AliReaderAOD("AOD.root");
+    if (strstr(processopt,"Particles"))
+      aodreader->ReadSimulatedData(kTRUE);
+    else
+      aodreader->ReadSimulatedData(kFALSE);
+    
+    reader = aodreader;
+    
     multcheck = kTRUE;
    }
+
+  else if (!ESDMuon)
+   {
+     // set reader for ESD
+     AliReaderESDTree* muonreader = new AliReaderESDTree("AliESDs.root");
+     // active muon ESD reader
+     muonreader->SetReadMuon(kTRUE);
+     // disable central barrel (default = kTRUE)
+     muonreader->SetReadCentralBarrel(kFALSE);
+     // disable simulated data (not implemented yet)
+     muonreader->ReadSimulatedData(kFALSE);
+
+     reader = muonreader;
+     multcheck = kFALSE;
+   }
   else
    {
     cerr<<"Option "<<datatype<<"  not recognized. Exiting"<<endl;
@@ -122,7 +147,7 @@ void WriteAOD(Option_t* datatype, Int_t first = -1,Int_t last = -1,
       }
     }
 
-   reader->SetDirs(dirs);
+  reader->SetDirs(dirs);
 
   AliAODParticleCut* readerpartcut= new AliAODParticleCut();