]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliInputEventHandler.cxx
Coverity fix.
[u/mrichter/AliRoot.git] / STEER / AliInputEventHandler.cxx
index c9f72fbbe336321eedba569ed4d1422e9d8249a8..9a163e8e80f6a90782d8be99f3dd7c3df5c7f7fb 100644 (file)
 //     Author: Andreas Morsch, CERN
 //-------------------------------------------------------------------------
 
-#include <TChain.h>
 
 #include "AliInputEventHandler.h"
 #include "AliVEvent.h"
+#include "AliVCuts.h"
+#include "AliLog.h"
+
 
 ClassImp(AliInputEventHandler)
 
 //______________________________________________________________________________
 AliInputEventHandler::AliInputEventHandler() :
-  AliVEventHandler()
+    AliVEventHandler(),
+    fTree(0),
+    fBranches(""),
+    fBranchesOn(""),
+    fNewEvent(kTRUE),
+    fEventCuts(0),
+    fIsSelectedResult(0),
+    fMixingHandler(0)
 {
   // default constructor
 }
@@ -42,7 +51,58 @@ AliInputEventHandler::~AliInputEventHandler()
 
 //______________________________________________________________________________
 AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
-    AliVEventHandler(name, title)
+  AliVEventHandler(name, title),
+  fTree(0),
+  fBranches(""),
+  fBranchesOn(""),
+  fNewEvent(kTRUE),
+  fEventCuts(0),
+  fIsSelectedResult(0),
+  fMixingHandler(0)
 {
+// Named constructor.
+}
+
+void AliInputEventHandler::SwitchOffBranches() const {
+  //
+  // Switch of branches on user request
+    TObjArray * tokens = fBranches.Tokenize(" ");
+    Int_t ntok = tokens->GetEntries();
+    for (Int_t i = 0; i < ntok; i++)  {
+       TString str = ((TObjString*) tokens->At(i))->GetString();
+       if (str.Length() == 0)
+           continue;
+       fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
+       AliDebug(1,Form("Branch %s switched off", str.Data()));
+    }
+  delete tokens;
+}
+
+void AliInputEventHandler::SwitchOnBranches() const {
+  //
+  // Switch of branches on user request
+  TObjArray * tokens = fBranchesOn.Tokenize(" ");
+  Int_t ntok = tokens->GetEntries();
+
+  for (Int_t i = 0; i < ntok; i++)  {
+      TString str = ((TObjString*) tokens->At(i))->GetString();
+      if (str.Length() == 0)
+         continue;
+      fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
+      AliDebug(1,Form("Branch %s switched on", str.Data()));
+  }
+  delete tokens;
 }
 
+TObject *AliInputEventHandler::GetStatistics(Option_t *) const
+{
+// Returns the statistics object(s) (TH2F histogram) produced by the physics
+// selection. Implementations both for ESD and AOD input handlers.
+  return NULL;
+}
+   
+Long64_t AliInputEventHandler::GetReadEntry() const 
+{
+  // Get the current entry.
+  return fTree->GetReadEntry();
+}