Coverity 16571
[u/mrichter/AliRoot.git] / STEER / AliInputEventHandler.cxx
CommitLineData
76147823 1/**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18//-------------------------------------------------------------------------
19// Event handler for event input
20// Author: Andreas Morsch, CERN
21//-------------------------------------------------------------------------
22
76147823 23
24#include "AliInputEventHandler.h"
25#include "AliVEvent.h"
b2af62ab 26#include "AliVCuts.h"
f16ba708 27#include "AliLog.h"
76147823 28
b2af62ab 29
76147823 30ClassImp(AliInputEventHandler)
31
32//______________________________________________________________________________
33AliInputEventHandler::AliInputEventHandler() :
13054f41 34 AliVEventHandler(),
f16ba708 35 fTree(0),
36 fBranches(""),
f0ee78b0 37 fBranchesOn(""),
b2af62ab 38 fNewEvent(kTRUE),
39 fEventCuts(0),
b890a10d 40 fIsSelectedResult(0),
7af7146c 41 fMixingHandler(0),
42 fParentHandler(0)
76147823 43{
44 // default constructor
45}
46
47//______________________________________________________________________________
48AliInputEventHandler::~AliInputEventHandler()
49{
50// destructor
51}
52
53//______________________________________________________________________________
54AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
0cd61c1d 55 AliVEventHandler(name, title),
f16ba708 56 fTree(0),
57 fBranches(""),
f0ee78b0 58 fBranchesOn(""),
b2af62ab 59 fNewEvent(kTRUE),
60 fEventCuts(0),
b890a10d 61 fIsSelectedResult(0),
7af7146c 62 fMixingHandler(0),
63 fParentHandler(0)
76147823 64{
70908d05 65// Named constructor.
76147823 66}
67
f16ba708 68void AliInputEventHandler::SwitchOffBranches() const {
69 //
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)
76 continue;
77 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
e06036ee 78 AliDebug(1,Form("Branch %s switched off", str.Data()));
f16ba708 79 }
62e57953 80 delete tokens;
f16ba708 81}
82
83void AliInputEventHandler::SwitchOnBranches() const {
84 //
85 // Switch of branches on user request
86 TObjArray * tokens = fBranchesOn.Tokenize(" ");
87 Int_t ntok = tokens->GetEntries();
88
89 for (Int_t i = 0; i < ntok; i++) {
90 TString str = ((TObjString*) tokens->At(i))->GetString();
91 if (str.Length() == 0)
92 continue;
93 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
e06036ee 94 AliDebug(1,Form("Branch %s switched on", str.Data()));
f16ba708 95 }
62e57953 96 delete tokens;
f16ba708 97}
f0ee78b0 98
70908d05 99TObject *AliInputEventHandler::GetStatistics(Option_t *) const
100{
101// Returns the statistics object(s) (TH2F histogram) produced by the physics
102// selection. Implementations both for ESD and AOD input handlers.
103 return NULL;
104}
105
f0ee78b0 106Long64_t AliInputEventHandler::GetReadEntry() const
70908d05 107{
108 // Get the current entry.
109 return fTree->GetReadEntry();
110}