]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliInputEventHandler.cxx
Bug fix in copy constructor and assignement operator (Matthias + me)
[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 "AliLog.h"
27
28 ClassImp(AliInputEventHandler)
29
30 //______________________________________________________________________________
31 AliInputEventHandler::AliInputEventHandler() :
32     AliVEventHandler(),
33     fTree(0),
34     fBranches(""),
35     fBranchesOn("")
36 {
37   // default constructor
38 }
39
40 //______________________________________________________________________________
41 AliInputEventHandler::~AliInputEventHandler() 
42 {
43 // destructor
44 }
45
46 //______________________________________________________________________________
47 AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
48   AliVEventHandler(name, title),
49   fTree(0),
50   fBranches(""),
51   fBranchesOn("")
52 {
53 }
54
55 void AliInputEventHandler::SwitchOffBranches() const {
56   //
57   // Switch of branches on user request
58     TObjArray * tokens = fBranches.Tokenize(" ");
59     Int_t ntok = tokens->GetEntries();
60     for (Int_t i = 0; i < ntok; i++)  {
61         TString str = ((TObjString*) tokens->At(i))->GetString();
62         if (str.Length() == 0)
63             continue;
64         fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0);
65         AliInfo(Form("Branch %s switched off \n", str.Data()));
66     }
67 }
68
69 void AliInputEventHandler::SwitchOnBranches() const {
70   //
71   // Switch of branches on user request
72   TObjArray * tokens = fBranchesOn.Tokenize(" ");
73   Int_t ntok = tokens->GetEntries();
74
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(), "*"), 1);
80       AliInfo(Form("Branch %s switched on \n", str.Data()));
81   }
82 }