Fixed bug in parent assignment and implemented Birk's law in the Step Manager
[u/mrichter/AliRoot.git] / ITS / AliITSLoader.cxx
CommitLineData
88cb7938 1#include "AliITSLoader.h"
88cb7938 2
88cb7938 3
eeac5f9f 4
5
6//////////////////////////////////////////////////////////////////////////////////////////
7// Loader for ITS
8// it manages the I/O for:
9// raw clusters, primary vertices
10// V0 and cascade
11// and tracks propagated to the origin
12//////////////////////////////////////////////////////////////////////////////////////////
88cb7938 13const TString AliITSLoader::fgkDefaultRawClustersContainerName = "TreeC";
14const TString AliITSLoader::fgkDefaultBackTracksContainerName = "TreeB";
15const TString AliITSLoader::fgkDefaultVerticesContainerName = "Vertex";
566abf75 16const TString AliITSLoader::fgkDefaultV0ContainerName = "V0";
17const TString AliITSLoader::fgkDefaultCascadeContainerName = "Cascade";
88cb7938 18
19ClassImp(AliITSLoader)
20
21/*****************************************************************************/
eeac5f9f 22
23 AliITSLoader::AliITSLoader():AliLoader(){
24 // Default constructor
25
26}
27
28/*****************************************************************************/
29AliITSLoader::AliITSLoader(const Char_t *name,const Char_t *topfoldername): AliLoader(name,topfoldername){
30 //ctor
31 AliDataLoader* rawClustersDataLoader = new AliDataLoader(fDetectorName + ".RawCl.root",fgkDefaultRawClustersContainerName,"Raw Clusters");
32 fDataLoaders->Add(rawClustersDataLoader);
33 rawClustersDataLoader->SetEventFolder(fEventFolder);
34 rawClustersDataLoader->SetFolder(GetDetectorDataFolder());
35
36 AliDataLoader* backTracksDataLoader =
37 new AliDataLoader(fDetectorName + ".BackTracks.root",fgkDefaultBackTracksContainerName,"Back Propagated Tracks");
38 fDataLoaders->Add(backTracksDataLoader);
39 backTracksDataLoader->SetEventFolder(fEventFolder);
40 backTracksDataLoader->SetFolder(GetDetectorDataFolder());
41
42 AliDataLoader* vertexDataLoader = new AliDataLoader(fDetectorName + ".Vertex.root",fgkDefaultVerticesContainerName,"Primary Vertices","O");
43 fDataLoaders->Add(vertexDataLoader);
44 vertexDataLoader->SetEventFolder(fEventFolder);
45 vertexDataLoader->SetFolder(GetDetectorDataFolder());
46
47 AliDataLoader* v0DataLoader = new AliDataLoader(fDetectorName + ".V0s.root",fgkDefaultV0ContainerName,"V0 Vertices");
48 fDataLoaders->Add(v0DataLoader);
49 v0DataLoader->SetEventFolder(fEventFolder);
50 v0DataLoader->SetFolder(GetDetectorDataFolder());
566abf75 51
eeac5f9f 52 AliDataLoader* cascadeDataLoader = new AliDataLoader(fDetectorName + ".Cascades.root",fgkDefaultCascadeContainerName,"Cascades");
53 fDataLoaders->Add(cascadeDataLoader);
54 cascadeDataLoader->SetEventFolder(fEventFolder);
55 cascadeDataLoader->SetFolder(GetDetectorDataFolder());
566abf75 56
88cb7938 57}
58/*****************************************************************************/
59
eeac5f9f 60AliITSLoader::AliITSLoader(const Char_t *name,TFolder *topfolder): AliLoader(name,topfolder) {
61 //ctor
62 AliDataLoader* rawClustersDataLoader = new AliDataLoader(fDetectorName + ".RawCl.root",fgkDefaultRawClustersContainerName,"Raw Clusters");
63 fDataLoaders->Add(rawClustersDataLoader);
64 rawClustersDataLoader->SetEventFolder(fEventFolder);
65 rawClustersDataLoader->SetFolder(GetDetectorDataFolder());
66
67 AliDataLoader* backTracksDataLoader =
68 new AliDataLoader(fDetectorName + ".BackTracks.root",fgkDefaultBackTracksContainerName,"Back Propagated Tracks");
69 fDataLoaders->Add(backTracksDataLoader);
70 backTracksDataLoader->SetEventFolder(fEventFolder);
71 backTracksDataLoader->SetFolder(GetDetectorDataFolder());
72
73 AliDataLoader* vertexDataLoader = new AliDataLoader(fDetectorName + ".Vertex.root",fgkDefaultVerticesContainerName,"Primary Vertices","O");
74 fDataLoaders->Add(vertexDataLoader);
75 vertexDataLoader->SetEventFolder(fEventFolder);
76 vertexDataLoader->SetFolder(GetDetectorDataFolder());
77
78 AliDataLoader* v0DataLoader = new AliDataLoader(fDetectorName + ".V0.root",fgkDefaultV0ContainerName,"V0 Vertices");
79 fDataLoaders->Add(v0DataLoader);
80 v0DataLoader->SetEventFolder(fEventFolder);
81 v0DataLoader->SetFolder(GetDetectorDataFolder());
566abf75 82
eeac5f9f 83 AliDataLoader* cascadeDataLoader = new AliDataLoader(fDetectorName + ".Cascade.root",fgkDefaultCascadeContainerName,"Cascades");
84 fDataLoaders->Add(cascadeDataLoader);
85 cascadeDataLoader->SetEventFolder(fEventFolder);
86 cascadeDataLoader->SetFolder(GetDetectorDataFolder());
566abf75 87
88cb7938 88}
89/*****************************************************************************/
90AliITSLoader::~AliITSLoader()
91{
92 //destructor
eeac5f9f 93 AliDataLoader* dl = 0;
88cb7938 94 UnloadRawClusters();
eeac5f9f 95 dl = GetRawClLoader();
96 fDataLoaders->Remove(dl);
88cb7938 97
98 UnloadBackTracks();
eeac5f9f 99 dl = GetBackTracksDataLoader();
100 fDataLoaders->Remove(dl);
88cb7938 101
102 UnloadVertices();
eeac5f9f 103 dl = GetVertexDataLoader();
104 fDataLoaders->Remove(dl);
88cb7938 105
566abf75 106 UnloadV0s();
eeac5f9f 107 dl = GetV0DataLoader();
108 fDataLoaders->Remove(dl);
566abf75 109
110 UnloadCascades();
eeac5f9f 111 dl = GetCascadeDataLoader();
112 fDataLoaders->Remove(dl);
566abf75 113
88cb7938 114}
115
116void AliITSLoader::MakeTree(Option_t *opt){
117 // invokes AliLoader::MakeTree + specific ITS tree(s)
118 // Valid options: H,S,D,R,T and C (C=raw clusters)
119 AliLoader::MakeTree(opt);
120 const char *oC = strstr(opt,"C");
121 if (oC) MakeRawClustersContainer();
122
123 const char *oB = strstr(opt,"B");
124 if (oB) MakeBackTracksContainer();
125
566abf75 126 const char *oV0 = strstr(opt,"V0");
127 if (oV0) MakeV0Container();
128
129 const char *oX = strstr(opt,"X");
130 if (oX) MakeCascadeContainer();
131
88cb7938 132}