]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIITSLOADER_H | |
2 | #define ALIITSLOADER_H | |
3 | ////////////////////////////////////////////////////////// | |
4 | // Loader class for ITS // | |
5 | ////////////////////////////////////////////////////////// | |
6 | #include <AliLoader.h> | |
7 | #include <AliESDVertex.h> | |
8 | #include <AliITSgeom.h> | |
9 | #include <AliITSpidESD.h> | |
10 | class AliITSdigit; | |
11 | class TObjArray; | |
12 | ||
13 | class AliITSLoader: public AliLoader{ | |
14 | public: | |
15 | AliITSLoader(); | |
16 | AliITSLoader(const Char_t *name,const Char_t *topfoldername); | |
17 | AliITSLoader(const Char_t *name,TFolder *topfolder); | |
18 | AliITSLoader(const AliITSLoader &ob); // copy constructor | |
19 | AliITSLoader& operator=(const AliITSLoader & /* source */); // ass. | |
20 | ||
21 | ||
22 | virtual ~AliITSLoader(); | |
23 | ||
24 | void MakeTree(Option_t* opt); | |
25 | virtual void SetupDigits(TObjArray *digPerDet,Int_t n, | |
26 | const Char_t **digclass); // Sets up digits | |
27 | // Gets the AliITSdigit for a given module and a specific digit in that | |
28 | // module. Array of digits stored in AliITS (must use | |
29 | // SetupDigits(AliITS *its)). | |
30 | // virtual AliITSdigit* GetDigit(AliITS *its,Int_t module,Int_t digit); | |
31 | // Gets the AliITSdigit for a given module and a specific digit in that | |
32 | // module. Array of digits stored in a user defined TObjArray digPerDet | |
33 | virtual AliITSdigit* GetDigit(TObjArray *digPerDet,Int_t module,Int_t digit); | |
34 | ||
35 | //Raw Clusters | |
36 | AliDataLoader* GetRawClLoader() {return GetDataLoader("Raw Clusters");} | |
37 | virtual void CleanRawClusters() { | |
38 | GetRawClLoader()->GetBaseLoader(0)->Clean();} | |
39 | Int_t LoadRawClusters(Option_t* opt=""){ | |
40 | return GetRawClLoader()->GetBaseLoader(0)->Load(opt);} | |
41 | void SetRawClustersFileName(const TString& fname){ | |
42 | GetRawClLoader()->SetFileName(fname);} | |
43 | // returns a pointer to the tree of RawClusters | |
44 | TTree* TreeC(){ return GetRawClLoader()->Tree();} | |
45 | void UnloadRawClusters(){ | |
46 | GetRawClLoader()->GetBaseLoader(0)->Unload();} | |
47 | virtual Int_t WriteRawClusters(Option_t* opt=""){ | |
48 | return GetRawClLoader()->GetBaseLoader(0)->WriteData(opt);} | |
49 | ||
50 | //Vertices | |
51 | AliDataLoader* GetVertexDataLoader() { | |
52 | return GetDataLoader("Primary Vertices");} | |
53 | virtual void CleanVertices() { | |
54 | GetVertexDataLoader()->GetBaseLoader(0)->Clean();} | |
55 | Int_t LoadVertices(Option_t* opt=""){ | |
56 | return GetVertexDataLoader()->GetBaseLoader(0)->Load(opt);} | |
57 | void SetVerticesFileName(const TString& fname){ | |
58 | GetVertexDataLoader()->SetFileName(fname);} | |
59 | void UnloadVertices(){ | |
60 | GetVertexDataLoader()->GetBaseLoader(0)->Unload();} | |
61 | virtual Int_t WriteVertices(Option_t* opt=""){ | |
62 | return GetVertexDataLoader()->GetBaseLoader(0)->WriteData(opt);} | |
63 | virtual Int_t PostVertex(AliESDVertex *ptr){ | |
64 | return GetVertexDataLoader()->GetBaseLoader(0)->Post(ptr);} | |
65 | // virtual void SetVerticesContName(const char *name){ | |
66 | // GetVertexDataLoader()->GetBaseLoader(0)->SetName(name);} | |
67 | AliESDVertex *GetVertex(){ | |
68 | return static_cast <AliESDVertex*>(GetVertexDataLoader()-> | |
69 | GetBaseLoader(0)->Get());} | |
70 | //V0s | |
71 | AliDataLoader* GetV0DataLoader() {return GetDataLoader("V0 Vertices");} | |
72 | virtual void CleanV0s() {GetV0DataLoader()->GetBaseLoader(0)->Clean();} | |
73 | Int_t LoadV0s(Option_t* opt=""){ | |
74 | return GetV0DataLoader()->GetBaseLoader(0)->Load(opt);} | |
75 | void SetV0FileName(const TString& fname){ | |
76 | GetV0DataLoader()->SetFileName(fname);} | |
77 | void UnloadV0s(){GetV0DataLoader()->GetBaseLoader(0)->Unload();} | |
78 | virtual Int_t WriteV0s(Option_t* opt=""){ | |
79 | return GetV0DataLoader()->GetBaseLoader(0)->WriteData(opt);} | |
80 | TTree* TreeV0(){ return GetV0DataLoader()->Tree();} | |
81 | ||
82 | //Cascades | |
83 | AliDataLoader* GetCascadeDataLoader() {return GetDataLoader("Cascades");} | |
84 | virtual void CleanCascades() { | |
85 | GetCascadeDataLoader()->GetBaseLoader(0)->Clean();} | |
86 | Int_t LoadCascades(Option_t* opt=""){ | |
87 | return GetCascadeDataLoader()->GetBaseLoader(0)->Load(opt);} | |
88 | void SetCascadeFileName(const TString& fname){ | |
89 | GetCascadeDataLoader()->SetFileName(fname);} | |
90 | void UnloadCascades(){ | |
91 | GetCascadeDataLoader()->GetBaseLoader(0)->Unload();} | |
92 | virtual Int_t WriteCascades(Option_t* opt=""){ | |
93 | return GetCascadeDataLoader()->GetBaseLoader(0)->WriteData(opt);} | |
94 | TTree* TreeX(){ return GetCascadeDataLoader()->Tree();} | |
95 | ||
96 | //Back Propagated Tracks | |
97 | AliDataLoader* GetBackTracksDataLoader() { | |
98 | return GetDataLoader("Back Propagated Tracks");} | |
99 | virtual void CleanBackTracks() { | |
100 | GetBackTracksDataLoader()->GetBaseLoader(0)->Clean();} | |
101 | Int_t LoadBackTracks(Option_t* opt=""){ | |
102 | return GetBackTracksDataLoader()->GetBaseLoader(0)->Load(opt);} | |
103 | void SetBackTracksFileName(const TString& fname){ | |
104 | GetBackTracksDataLoader()->SetFileName(fname);} | |
105 | // returns a pointer to the tree of BackTracks | |
106 | TTree* TreeB(){ return GetBackTracksDataLoader()->Tree();} | |
107 | void UnloadBackTracks(){ | |
108 | GetBackTracksDataLoader()->GetBaseLoader(0)->Unload();} | |
109 | virtual Int_t WriteBackTracks(Option_t* opt=""){ | |
110 | return GetBackTracksDataLoader()->GetBaseLoader(0)->WriteData(opt);} | |
111 | ||
112 | // Geometry. Geom is read from file, unless already loaded | |
113 | // readout from file can be forced if force=kTRUE | |
114 | AliITSgeom* GetITSgeom(Bool_t force=kFALSE); | |
115 | void SetITSgeom(AliITSgeom* g); | |
116 | // PID | |
117 | AliITSpidESD* GetITSpid() const {return fITSpid;} | |
118 | void AdoptITSpid(AliITSpidESD* pid) {fITSpid=pid;} | |
119 | protected: | |
120 | ||
121 | // METHODS | |
122 | virtual void MakeRawClustersContainer() {GetRawClLoader()->MakeTree();} | |
123 | Int_t PostRawClusters(){ | |
124 | return GetRawClLoader()->GetBaseLoader(0)->Post();} | |
125 | ||
126 | virtual void MakeBackTracksContainer() { | |
127 | GetBackTracksDataLoader()->MakeTree();} | |
128 | Int_t PostBackTracks(){ | |
129 | return GetBackTracksDataLoader()->GetBaseLoader(0)->Post();} | |
130 | virtual void MakeV0Container() {GetV0DataLoader()->MakeTree();} | |
131 | Int_t PostV0s(){ | |
132 | return GetV0DataLoader()->GetBaseLoader(0)->Post();} | |
133 | ||
134 | virtual void MakeCascadeContainer() {GetCascadeDataLoader()->MakeTree();} | |
135 | Int_t PostCascades(){ | |
136 | return GetCascadeDataLoader()->GetBaseLoader(0)->Post();} | |
137 | ||
138 | // DATA | |
139 | static const TString fgkDefaultRawClustersContainerName; //default for Raw Clusters container name | |
140 | static const TString fgkDefaultBackTracksContainerName; //default for Back propag. tracks container name | |
141 | static const TString fgkDefaultVerticesContainerName; //default for primary vertices container name | |
142 | static const TString fgkDefaultV0ContainerName; //default for V0 container name | |
143 | static const TString fgkDefaultCascadeContainerName; //default fo cascade container name | |
144 | AliITSpidESD* fITSpid; //! pointer for ITS pid | |
145 | AliITSgeom *fGeom; //! pointer to the ITS geometry class | |
146 | ClassDef(AliITSLoader,5) // Loader for additional ITS specific trees. | |
147 | }; | |
148 | ||
149 | #endif |