]>
Commit | Line | Data |
---|---|---|
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 | 30 | ClassImp(AliInputEventHandler) |
31 | ||
32 | //______________________________________________________________________________ | |
33 | AliInputEventHandler::AliInputEventHandler() : | |
13054f41 | 34 | AliVEventHandler(), |
f16ba708 | 35 | fTree(0), |
36 | fBranches(""), | |
f0ee78b0 | 37 | fBranchesOn(""), |
b2af62ab | 38 | fNewEvent(kTRUE), |
39 | fEventCuts(0), | |
b890a10d | 40 | fIsSelectedResult(0), |
41 | fMixingHandler(0) | |
76147823 | 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): | |
0cd61c1d | 54 | AliVEventHandler(name, title), |
f16ba708 | 55 | fTree(0), |
56 | fBranches(""), | |
f0ee78b0 | 57 | fBranchesOn(""), |
b2af62ab | 58 | fNewEvent(kTRUE), |
59 | fEventCuts(0), | |
b890a10d | 60 | fIsSelectedResult(0), |
61 | fMixingHandler(0) | |
76147823 | 62 | { |
70908d05 | 63 | // Named constructor. |
76147823 | 64 | } |
65 | ||
f16ba708 | 66 | void AliInputEventHandler::SwitchOffBranches() const { |
67 | // | |
68 | // Switch of branches on user request | |
69 | TObjArray * tokens = fBranches.Tokenize(" "); | |
70 | Int_t ntok = tokens->GetEntries(); | |
71 | for (Int_t i = 0; i < ntok; i++) { | |
72 | TString str = ((TObjString*) tokens->At(i))->GetString(); | |
73 | if (str.Length() == 0) | |
74 | continue; | |
75 | fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 0); | |
76 | AliInfo(Form("Branch %s switched off \n", str.Data())); | |
77 | } | |
78 | } | |
79 | ||
80 | void AliInputEventHandler::SwitchOnBranches() const { | |
81 | // | |
82 | // Switch of branches on user request | |
83 | TObjArray * tokens = fBranchesOn.Tokenize(" "); | |
84 | Int_t ntok = tokens->GetEntries(); | |
85 | ||
86 | for (Int_t i = 0; i < ntok; i++) { | |
87 | TString str = ((TObjString*) tokens->At(i))->GetString(); | |
88 | if (str.Length() == 0) | |
89 | continue; | |
90 | fTree->SetBranchStatus(Form("%s%s%s","*", str.Data(), "*"), 1); | |
91 | AliInfo(Form("Branch %s switched on \n", str.Data())); | |
92 | } | |
93 | } | |
f0ee78b0 | 94 | |
70908d05 | 95 | TObject *AliInputEventHandler::GetStatistics(Option_t *) const |
96 | { | |
97 | // Returns the statistics object(s) (TH2F histogram) produced by the physics | |
98 | // selection. Implementations both for ESD and AOD input handlers. | |
99 | return NULL; | |
100 | } | |
101 | ||
f0ee78b0 | 102 | Long64_t AliInputEventHandler::GetReadEntry() const |
70908d05 | 103 | { |
104 | // Get the current entry. | |
105 | return fTree->GetReadEntry(); | |
106 | } |