Transition to NewIO
[u/mrichter/AliRoot.git] / ITS / AliITSLoader.h
1 #ifndef ALIITSGETTER_H
2 #define ALIITSGETTER_H
3
4 #include <AliLoader.h>
5 #include <AliITSVertex.h>
6
7 class AliITSLoader: public AliLoader
8  {
9    public:
10     AliITSLoader(){};
11     AliITSLoader(const Char_t *name,const Char_t *topfoldername);
12     AliITSLoader(const Char_t *name,TFolder *topfolder);
13     
14     virtual ~AliITSLoader();
15
16     void           MakeTree(Option_t* opt);
17
18     //Raw Clusters
19     virtual void   CleanRawClusters() {fRawClustersDataLoader.GetBaseLoader(0)->Clean();}
20     Int_t          LoadRawClusters(Option_t* opt=""){return fRawClustersDataLoader.GetBaseLoader(0)->Load(opt);}
21     void           SetRawClustersFileName(const TString& fname){fRawClustersDataLoader.SetFileName(fname);}
22     TTree*         TreeC(){ return fRawClustersDataLoader.Tree();} // returns a pointer to the tree of  RawClusters
23     void           UnloadRawClusters(){fRawClustersDataLoader.GetBaseLoader(0)->Unload();}
24     virtual Int_t  WriteRawClusters(Option_t* opt=""){return fRawClustersDataLoader.GetBaseLoader(0)->WriteData(opt);}
25
26     //Vertices
27     virtual void   CleanVertices() {fVertexDataLoader.GetBaseLoader(0)->Clean();}
28     Int_t          LoadVertices(Option_t* opt=""){return fVertexDataLoader.GetBaseLoader(0)->Load(opt);}
29     void           SetVerticesFileName(const TString& fname){fVertexDataLoader.SetFileName(fname);}
30     void           UnloadVertices(){fVertexDataLoader.GetBaseLoader(0)->Unload();}
31     virtual Int_t  WriteVertices(Option_t* opt=""){return fVertexDataLoader.GetBaseLoader(0)->WriteData(opt);}
32     virtual Int_t PostVertex(AliITSVertex *ptr){return fVertexDataLoader.GetBaseLoader(0)->Post(ptr);}
33     //    virtual void SetVerticesContName(const char *name){fVertexDataLoader.GetBaseLoader(0)->SetName(name);}
34     AliITSVertex *GetVertex(){return static_cast <AliITSVertex*>(fVertexDataLoader.GetBaseLoader(0)->Get());}
35
36     //Back Propagated Tracks
37
38     virtual void   CleanBackTracks() {fBackTracksDataLoader.GetBaseLoader(0)->Clean();}
39     Int_t          LoadBackTracks(Option_t* opt=""){return fBackTracksDataLoader.GetBaseLoader(0)->Load(opt);}
40     void           SetBackTracksFileName(const TString& fname){fBackTracksDataLoader.SetFileName(fname);}
41     TTree*         TreeB(){ return fBackTracksDataLoader.Tree();} // returns a pointer to the tree of  BackTracks
42     void           UnloadBackTracks(){fBackTracksDataLoader.GetBaseLoader(0)->Unload();}
43     virtual Int_t  WriteBackTracks(Option_t* opt=""){return fBackTracksDataLoader.GetBaseLoader(0)->WriteData(opt);}
44     
45
46    protected:
47
48     // METHODS
49     virtual void   MakeRawClustersContainer() {fRawClustersDataLoader.MakeTree();}
50     Int_t          PostRawClusters(){return fRawClustersDataLoader.GetBaseLoader(0)->Post();}
51
52     virtual void   MakeBackTracksContainer() {fBackTracksDataLoader.MakeTree();}
53     Int_t          PostBackTracks(){return fBackTracksDataLoader.GetBaseLoader(0)->Post();}
54
55     // DATA
56     AliDataLoader fRawClustersDataLoader;
57     static const TString fgkDefaultRawClustersContainerName;
58
59     AliDataLoader fBackTracksDataLoader;
60     static const TString fgkDefaultBackTracksContainerName;
61
62     AliDataLoader fVertexDataLoader;
63     static const TString fgkDefaultVerticesContainerName;
64
65    public:
66      ClassDef(AliITSLoader,2)
67  };
68  
69 #endif
70
71