Moving ALiITSVertex to AliESDVertex
[u/mrichter/AliRoot.git] / ITS / AliITSLoader.h
1 #ifndef ALIITSLOADER_H
2 #define ALIITSLOADER_H
3
4 #include <AliLoader.h>
5 #include <AliESDVertex.h>
6
7
8 class AliITSLoader: public AliLoader
9  {
10    public:
11     AliITSLoader();
12     AliITSLoader(const Char_t *name,const Char_t *topfoldername);
13     AliITSLoader(const Char_t *name,TFolder *topfolder);
14     
15     virtual ~AliITSLoader();
16
17     void           MakeTree(Option_t* opt);
18
19     //Raw Clusters
20     AliDataLoader* GetRawClLoader() {return GetDataLoader("Raw Clusters");}
21     virtual void   CleanRawClusters() {GetRawClLoader()->GetBaseLoader(0)->Clean();}
22     Int_t          LoadRawClusters(Option_t* opt=""){return GetRawClLoader()->GetBaseLoader(0)->Load(opt);}
23     void           SetRawClustersFileName(const TString& fname){GetRawClLoader()->SetFileName(fname);}
24     TTree*         TreeC(){ return GetRawClLoader()->Tree();} // returns a pointer to the tree of  RawClusters
25     void           UnloadRawClusters(){GetRawClLoader()->GetBaseLoader(0)->Unload();}
26     virtual Int_t  WriteRawClusters(Option_t* opt=""){return GetRawClLoader()->GetBaseLoader(0)->WriteData(opt);}
27
28     //Vertices
29     AliDataLoader* GetVertexDataLoader() {return GetDataLoader("Primary Vertices");}
30     virtual void   CleanVertices() {GetVertexDataLoader()->GetBaseLoader(0)->Clean();}
31     Int_t          LoadVertices(Option_t* opt=""){return GetVertexDataLoader()->GetBaseLoader(0)->Load(opt);}
32     void           SetVerticesFileName(const TString& fname){GetVertexDataLoader()->SetFileName(fname);}
33     void           UnloadVertices(){GetVertexDataLoader()->GetBaseLoader(0)->Unload();}
34     virtual Int_t  WriteVertices(Option_t* opt=""){return GetVertexDataLoader()->GetBaseLoader(0)->WriteData(opt);}
35     virtual Int_t PostVertex(AliESDVertex *ptr){return GetVertexDataLoader()->GetBaseLoader(0)->Post(ptr);}
36     //    virtual void SetVerticesContName(const char *name){GetVertexDataLoader()->GetBaseLoader(0)->SetName(name);}
37     AliESDVertex *GetVertex(){return static_cast <AliESDVertex*>(GetVertexDataLoader()->GetBaseLoader(0)->Get());}
38
39     //V0s
40     AliDataLoader* GetV0DataLoader() {return GetDataLoader("V0 Vertices");}
41     virtual void   CleanV0s() {GetV0DataLoader()->GetBaseLoader(0)->Clean();}
42     Int_t          LoadV0s(Option_t* opt=""){return GetV0DataLoader()->GetBaseLoader(0)->Load(opt);}
43     void           SetV0FileName(const TString& fname){GetV0DataLoader()->SetFileName(fname);}
44     void           UnloadV0s(){GetV0DataLoader()->GetBaseLoader(0)->Unload();}
45     virtual Int_t  WriteV0s(Option_t* opt=""){return GetV0DataLoader()->GetBaseLoader(0)->WriteData(opt);}
46     TTree*         TreeV0(){ return GetV0DataLoader()->Tree();}
47
48     //Cascades
49     AliDataLoader* GetCascadeDataLoader() {return GetDataLoader("Cascades");}
50     virtual void   CleanCascades() {GetCascadeDataLoader()->GetBaseLoader(0)->Clean();}
51     Int_t          LoadCascades(Option_t* opt=""){return GetCascadeDataLoader()->GetBaseLoader(0)->Load(opt);}
52     void           SetCascadeFileName(const TString& fname){GetCascadeDataLoader()->SetFileName(fname);}
53     void           UnloadCascades(){GetCascadeDataLoader()->GetBaseLoader(0)->Unload();}
54     virtual Int_t  WriteCascades(Option_t* opt=""){return GetCascadeDataLoader()->GetBaseLoader(0)->WriteData(opt);}
55     TTree*         TreeX(){ return GetCascadeDataLoader()->Tree();}
56
57     //Back Propagated Tracks
58     AliDataLoader* GetBackTracksDataLoader() {return GetDataLoader("Back Propagated Tracks");}
59     virtual void   CleanBackTracks() {GetBackTracksDataLoader()->GetBaseLoader(0)->Clean();}
60     Int_t          LoadBackTracks(Option_t* opt=""){return GetBackTracksDataLoader()->GetBaseLoader(0)->Load(opt);}
61     void           SetBackTracksFileName(const TString& fname){GetBackTracksDataLoader()->SetFileName(fname);}
62     TTree*         TreeB(){ return GetBackTracksDataLoader()->Tree();} // returns a pointer to the tree of  BackTracks
63     void           UnloadBackTracks(){GetBackTracksDataLoader()->GetBaseLoader(0)->Unload();}
64     virtual Int_t  WriteBackTracks(Option_t* opt=""){return GetBackTracksDataLoader()->GetBaseLoader(0)->WriteData(opt);}
65     
66
67    protected:
68
69     // METHODS
70     virtual void   MakeRawClustersContainer() {GetRawClLoader()->MakeTree();}
71     Int_t          PostRawClusters(){return GetRawClLoader()->GetBaseLoader(0)->Post();}
72
73     virtual void   MakeBackTracksContainer() {GetBackTracksDataLoader()->MakeTree();}
74     Int_t          PostBackTracks(){return GetBackTracksDataLoader()->GetBaseLoader(0)->Post();}
75     virtual void   MakeV0Container() {GetV0DataLoader()->MakeTree();}
76     Int_t          PostV0s(){return GetV0DataLoader()->GetBaseLoader(0)->Post();}
77
78     virtual void   MakeCascadeContainer() {GetCascadeDataLoader()->MakeTree();}
79     Int_t          PostCascades(){return GetCascadeDataLoader()->GetBaseLoader(0)->Post();}
80
81     // DATA
82     static const TString fgkDefaultRawClustersContainerName;  //default for Raw Clusters container name
83     static const TString fgkDefaultBackTracksContainerName;   //default for Back propag. tracks container name
84     static const TString fgkDefaultVerticesContainerName;     //default for primary vertices container name
85     static const TString fgkDefaultV0ContainerName;           //default for V0 container name
86     static const TString fgkDefaultCascadeContainerName;      //default fo cascade container name
87
88      ClassDef(AliITSLoader,3)
89  };
90  
91 #endif
92
93