]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDQaEsd.C
try to fix coverity 24179, 24178, 24125, 24124, check cast to pointers not being...
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDQaEsd.C
index 492c6f5bb4990cc5443166ea08fe331d606a11f2..2ce1b7129c6ee0326f6869afd937c78736d27a69 100644 (file)
@@ -23,7 +23,7 @@
 #include <TROOT.h>
 #include <TVector3.h> 
 
-#include <AliESD.h> 
+#include <AliESDEvent.h> 
 #include <AliLog.h>
 #include <AliPID.h>
 
@@ -45,7 +45,7 @@ public:
 
 private:
   TTree   * fChain ;            //!pointer to the analyzed TTree or TChain
-  AliESD  * fESD ;              //! Declaration of leave types
+  AliESDEvent  * fESD ;              //! Declaration of leave types
 
   TObjArray * fOutputContainer; //output data container
 
@@ -77,12 +77,13 @@ void AliHMPIDQaEsd::ConnectInputData(const Option_t*)
   // One should first check if the branch address was taken by some other task
   char ** address = (char **)GetBranchAddress(0, "ESD");
   if (address) {
-    fESD = (AliESD*)(*address);
+    fESD = (AliESDEvent*)(*address);
   } else {
-    fESD = new AliESD();
-    SetBranchAddress(0, "ESD", &fESD);
-    fChain->SetBranchStatus("*", 1);
-    fChain->SetBranchStatus("fTracks.*", 1);
+    fESD = new AliESDEvent();
+    fESD->ReadFromTree(fChain);                                                                   //clm: new ESD access works for local, need to test it for PROOF!
+    //SetBranchAddress(0, "esdTree", &fESD);
+    //fChain->SetBranchStatus("*", 1);
+    //fChain->SetBranchStatus("fTracks.*", 1);
   }
 }//ConnectInputData()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -176,11 +177,19 @@ void AliHMPIDQaEsd::Terminate(Option_t *)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void qa(Int_t mode=0)
 {
+  
+  /*
+  AliAODHandler* aodHandler   = new AliAODHandler();
+    mgr->SetEventHandler(aodHandler);
+  */
+  
   gBenchmark->Start("HMPID QA");
   
   TChain* chain =new TChain("esdTree");  
-  AliAnalysisManager *mgr=new AliAnalysisManager("FunnyName");
-  
+  AliAnalysisManager *mgr=new AliAnalysisManager("FunnyName");                                                   //clm: 
+  //AliAODHandler* aodHandler   = new AliAODHandler();
+  //mgr->SetEventHandler(aodHandler);
+    
   AliAnalysisTask *qa=new AliHMPIDQaEsd();
   qa->ConnectInput (0,mgr->CreateContainer("EsdChain",TChain::Class()   ,AliAnalysisManager::kInputContainer));
   qa->ConnectOutput(0,mgr->CreateContainer("HistLst",TObjArray::Class(),AliAnalysisManager::kOutputContainer));