1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // Event handler for event input
20 // Author: Andreas Morsch, CERN
21 //-------------------------------------------------------------------------
24 #include "AliInputEventHandler.h"
25 #include "AliVEvent.h"
30 ClassImp(AliInputEventHandler)
32 //______________________________________________________________________________
33 AliInputEventHandler::AliInputEventHandler() :
44 // default constructor
47 //______________________________________________________________________________
48 AliInputEventHandler::~AliInputEventHandler()
53 //______________________________________________________________________________
54 AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
55 AliVEventHandler(name, title),
68 void AliInputEventHandler::SwitchOffBranches() const {
70 // Switch of branches on user request
71 TObjArray * tokens = fBranches.Tokenize(" ");
72 Int_t ntok = tokens->GetEntries();
73 for (Int_t i = 0; i < ntok; i++) {
74 TString str = ((TObjString*) tokens->At(i))->GetString();
75 if (str.Length() == 0)
77 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
78 AliDebug(1,Form("Branch %s switched off", str.Data()));
83 void AliInputEventHandler::SwitchOnBranches() const {
85 // Switch of branches on user request
86 TObjArray * tokens = fBranchesOn.Tokenize(" ");
87 Int_t ntok = tokens->GetEntries();
89 for (Int_t i = 0; i < ntok; i++) {
90 TString str = ((TObjString*) tokens->At(i))->GetString();
91 if (str.Length() == 0)
93 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
94 AliDebug(1,Form("Branch %s switched on", str.Data()));
99 TObject *AliInputEventHandler::GetStatistics(Option_t *) const
101 // Returns the statistics object(s) (TH2F histogram) produced by the physics
102 // selection. Implementations both for ESD and AOD input handlers.
106 Long64_t AliInputEventHandler::GetReadEntry() const
108 // Get the current entry.
109 return fTree->GetReadEntry();