]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliInputEventHandler.cxx
modify systematic r-phi plotting
[u/mrichter/AliRoot.git] / STEER / 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 {
43   // default constructor
44 }
45
46 //______________________________________________________________________________
47 AliInputEventHandler::~AliInputEventHandler() 
48 {
49 // destructor
50 }
51
52 //______________________________________________________________________________
53 AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
54   AliVEventHandler(name, title),
55   fTree(0),
56   fBranches(""),
57   fBranchesOn(""),
58   fNewEvent(kTRUE),
59   fEventCuts(0),
60   fIsSelectedResult(0),
61   fMixingHandler(0)
62 {
63 }
64
65 void AliInputEventHandler::SwitchOffBranches() const {
66   //
67   // Switch of branches on user request
68     TObjArray * tokens = fBranches.Tokenize(" ");
69     Int_t ntok = tokens->GetEntries();
70     for (Int_t i = 0; i < ntok; i++)  {
71         TString str = ((TObjString*) tokens->At(i))->GetString();
72         if (str.Length() == 0)
73             continue;
74         fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
75         AliInfo(Form("Branch %s switched off \n", str.Data()));
76     }
77 }
78
79 void AliInputEventHandler::SwitchOnBranches() const {
80   //
81   // Switch of branches on user request
82   TObjArray * tokens = fBranchesOn.Tokenize(" ");
83   Int_t ntok = tokens->GetEntries();
84
85   for (Int_t i = 0; i < ntok; i++)  {
86       TString str = ((TObjString*) tokens->At(i))->GetString();
87       if (str.Length() == 0)
88           continue;
89       fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1);
90       AliInfo(Form("Branch %s switched on \n", str.Data()));
91   }
92 }
93
94
95
96 Long64_t AliInputEventHandler::GetReadEntry() const 
97 {return fTree->GetReadEntry();}