]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliInputEventHandler.cxx
#99183: commit to trunk and port to release AliAODTZERO with T0 vertex
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliInputEventHandler.cxx
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
30 ClassImp(AliInputEventHandler)
31
32 //______________________________________________________________________________
33 AliInputEventHandler::AliInputEventHandler() :
34     AliVEventHandler(),
35     fTree(0),
36     fBranches(""),
37     fBranchesOn(""),
38     fNewEvent(kTRUE),
39     fEventCuts(0),
40     fIsSelectedResult(0),
41     fMixingHandler(0),
42     fParentHandler(0),
43     fUserInfo(0)
44 {
45   // default constructor
46 }
47
48 //______________________________________________________________________________
49 AliInputEventHandler::~AliInputEventHandler() 
50 {
51 // destructor
52 }
53
54 //______________________________________________________________________________
55 AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
56   AliVEventHandler(name, title),
57   fTree(0),
58   fBranches(""),
59   fBranchesOn(""),
60   fNewEvent(kTRUE),
61   fEventCuts(0),
62   fIsSelectedResult(0),
63   fMixingHandler(0),
64   fParentHandler(0),
65   fUserInfo(0)
66 {
67 // Named constructor.
68 }
69
70 void AliInputEventHandler::SwitchOffBranches() const {
71   //
72   // Switch of branches on user request
73     TObjArray * tokens = fBranches.Tokenize(" ");
74     Int_t ntok = tokens->GetEntries();
75     for (Int_t i = 0; i < ntok; i++)  {
76         TString str = ((TObjString*) tokens->At(i))->GetString();
77         if (str.Length() == 0)
78             continue;
79         fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
80         AliDebug(1,Form("Branch %s switched off", str.Data()));
81     }
82   delete tokens;
83 }
84
85 void AliInputEventHandler::SwitchOnBranches() const {
86   //
87   // Switch of branches on user request
88   TObjArray * tokens = fBranchesOn.Tokenize(" ");
89   Int_t ntok = tokens->GetEntries();
90
91   for (Int_t i = 0; i < ntok; i++)  {
92       TString str = ((TObjString*) tokens->At(i))->GetString();
93       if (str.Length() == 0)
94           continue;
95       fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
96       AliDebug(1,Form("Branch %s switched on", str.Data()));
97   }
98   delete tokens;
99 }
100
101 TObject *AliInputEventHandler::GetStatistics(Option_t *) const
102 {
103 // Returns the statistics object(s) (TH2F histogram) produced by the physics
104 // selection. Implementations both for ESD and AOD input handlers.
105   return NULL;
106 }
107    
108 Long64_t AliInputEventHandler::GetReadEntry() const 
109 {
110   // Get the current entry.
111   return fTree->GetReadEntry();
112 }