Moving the classes that belong to the following libraries: STEERBase, ESD, CDB, AOD...
[u/mrichter/AliRoot.git] / STEER / STEER / AliObjectLoader.cxx
1 /////////////////////////////////////////////////////////////////////////////////////////////
2 //                                                                                         //
3 //  class AliObjectLoader                                                                  //
4 //                                                                                         //
5 //  Container of all data needed for full                                                  //
6 //  description of each data type                                                          //
7 //  (Hits, Kine, ...)                                                                      //
8 //                                                                                         //
9 //  Each data loader has a basic standard setup of BaseLoaders                             //
10 //  which can be identuified by indexes (defined by EStdBasicLoaders)                      //
11 //  Data managed by these standard base loaders has fixed naming convention                //
12 //  e.g. - tree with hits is always named TreeH                                            //
13 //                     (defined in AliLoader::fgkDefaultHitsContainerName)                 //
14 //       - task DtectorName+Name defined                                                   //
15 //                                                                                         //
16 //  EStdBasicLoaders   idx     Object Type        Description                              //
17 //      kData           0    TTree or TObject     main data itself (hits,digits,...)       //
18 //      kTask           1        TTask            object producing main data               //
19 //      kQA             2        TTree                quality assurance tree               //
20 //      kQATask         3        TTask            task producing QA object                 //
21 //                                                                                         //
22 //                                                                                         //
23 //  User can define and add more basic loaders even Run Time.                              //
24 //  Caution: in order to save information about added base loader                          //
25 //  user must rewrite Run Loader to galice.file, overwriting old setup                     //
26 //                                                                                         //
27 /////////////////////////////////////////////////////////////////////////////////////////////
28
29 #include "AliObjectLoader.h"
30 #include "AliDataLoader.h"
31 #include "AliLog.h"
32 #include <TFolder.h>
33
34 ClassImp(AliObjectLoader)
35
36 //______________________________________________________________________________
37 AliObjectLoader::AliObjectLoader(const TString& name, AliDataLoader* dl, Bool_t storeontop):
38   AliBaseLoader(name,dl,storeontop)
39 {
40   //
41   // Constructor
42   //
43 }
44
45 //______________________________________________________________________________
46 TFolder* AliObjectLoader::GetFolder() const
47 {
48   //
49   // Returns pointer to the object folder
50   //
51   TFolder* df = GetDataLoader()->GetFolder();
52   if (df == 0x0)
53     {
54       AliFatal("Data Folder is NULL");
55     }
56   return df;
57 }
58
59 //______________________________________________________________________________
60 void AliObjectLoader::RemoveFromBoard(TObject* obj)
61 {
62   //
63   // Removes "obj" from the board
64   //
65   GetFolder()->Remove(obj);
66 }
67
68 //______________________________________________________________________________
69 Int_t AliObjectLoader::AddToBoard(TObject* obj)
70 {
71   //
72   // Adds "obj" to the board
73   //
74   GetFolder()->Add(obj);
75   return 0;
76 }
77
78 //______________________________________________________________________________
79 TObject* AliObjectLoader::Get() const
80 {
81   //
82   // Returns pointer to the object loader
83   //
84   return (GetFolder()) ? GetFolder()->FindObject(GetName()) : 0x0;
85 }
86
87
88