16 #include <Riostream.h> 38 SetTitle(fType->GetName());
45 fParent(slot.fParent),
46 fContainer(slot.fContainer)
56 if (&slot ==
this)
return *
this;
57 TNamed::operator=(slot);
70 if (!cont || !
GetType())
return kFALSE;
72 cout<<
"Data slot of type "<<GetTitle()<<
" of task "<<
fParent->GetName()<<
" cannot be connected to data container "<<cont->GetName()<<
" of type "<<cont->GetTitle()<<endl;
86 if (!
fType)
printf(
"AliAnalysisDataSlot: Unknown class: %s\n", GetTitle());
97 if (!
fType->InheritsFrom(TTree::Class())) {
98 cout<<
"Cannot call GetBranchAddress() for data slot of task "<<
fParent->GetName()<<
" not pointing to tree-type data"<<endl;
103 cout<<
"Cannot call GetBranchAddress() for data slot of task "<<
fParent->GetName()<<
" while data is not ready"<<endl;
108 TBranch *br = tree->GetBranch(branchname);
110 cout<<
"Branch "<<branchname<<
" not found in tree "<<tree->GetName()<<
" as input of task "<<
fParent->GetName()<<
"..."<<endl;
114 return br->GetAddress();
121 TBranch *branch = tree->GetBranch(bname);
124 if (!branch)
return count;
129 branch->SetBit(kDoNotProcess, kFALSE);
130 TIter next(branch->GetListOfBranches());
134 while ((branch_sub=(TBranch*)next())) {
147 Error(
"SetBranchAddress",
"Branch address for %s already set by other task. Call first GetBranchAddress() in %s::ConnectInputData()",branchname,
fParent->GetName());
151 tree->SetBranchAddress(branchname, address);
172 cout<<
"Data slot of type "<<GetTitle()<<
" of task "<<
fParent->GetName()<<
" has no connected data container"<<endl;
AliAnalysysTask - Class representing a basic analysis task. Any user-defined task should derive from...
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Bool_t ConnectContainer(AliAnalysisDataContainer *cont)
Bool_t SetBranchAddress(const char *branch, void *address)
TObject * GetData() const
Getters.
void * GetBranchAddress(const char *branch) const
TClass * fType
! Type of the slot
AliAnalysysDataContainer AliAnalysysDataContainer - Container of data of arbitrary type deriving from...
static Int_t EnableBranch(const char *bname, TTree *tree)
TObject * GetData() const
Bool_t IsDataReady() const
Container status checking.
AliAnalysysDataSlot Class representing a data slot of an analysis task. An analysis slot enforces a c...
AliAnalysisDataContainer * fContainer
Container connected to the slot.
Bool_t IsDataReady() const
void SetType(TClass *type)
AliAnalysisDataSlot & operator=(const AliAnalysisDataSlot &slot)
AliAnalysisTask * fParent
Analysis task to which the slot belongs.