]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - STEER/AliInputEventHandler.cxx
removerd double filling of histogram
[u/mrichter/AliRoot.git] / STEER / AliInputEventHandler.cxx
... / ...
CommitLineData
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
23
24#include "AliInputEventHandler.h"
25#include "AliVEvent.h"
26#include "AliVCuts.h"
27#include "AliLog.h"
28
29
30ClassImp(AliInputEventHandler)
31
32//______________________________________________________________________________
33AliInputEventHandler::AliInputEventHandler() :
34 AliVEventHandler(),
35 fTree(0),
36 fBranches(""),
37 fBranchesOn(""),
38 fNewEvent(kTRUE),
39 fEventCuts(0),
40 fIsSelected(kFALSE)
41{
42 // default constructor
43}
44
45//______________________________________________________________________________
46AliInputEventHandler::~AliInputEventHandler()
47{
48// destructor
49}
50
51//______________________________________________________________________________
52AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
53 AliVEventHandler(name, title),
54 fTree(0),
55 fBranches(""),
56 fBranchesOn(""),
57 fNewEvent(kTRUE),
58 fEventCuts(0),
59 fIsSelected(kFALSE)
60{
61}
62
63void AliInputEventHandler::SwitchOffBranches() const {
64 //
65 // Switch of branches on user request
66 TObjArray * tokens = fBranches.Tokenize(" ");
67 Int_t ntok = tokens->GetEntries();
68 for (Int_t i = 0; i < ntok; i++) {
69 TString str = ((TObjString*) tokens->At(i))->GetString();
70 if (str.Length() == 0)
71 continue;
72 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
73 AliInfo(Form("Branch %s switched off \n", str.Data()));
74 }
75}
76
77void AliInputEventHandler::SwitchOnBranches() const {
78 //
79 // Switch of branches on user request
80 TObjArray * tokens = fBranchesOn.Tokenize(" ");
81 Int_t ntok = tokens->GetEntries();
82
83 for (Int_t i = 0; i < ntok; i++) {
84 TString str = ((TObjString*) tokens->At(i))->GetString();
85 if (str.Length() == 0)
86 continue;
87 fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
88 AliInfo(Form("Branch %s switched on \n", str.Data()));
89 }
90}
91
92
93
94Long64_t AliInputEventHandler::GetReadEntry() const
95{return fTree->GetReadEntry();}