Transition to NewIO
[u/mrichter/AliRoot.git] / ITS / AliITSLoader.cxx
CommitLineData
88cb7938 1#include "AliITSLoader.h"
2#include <AliRunLoader.h>
3
4#include <TTree.h>
5#include <TFile.h>
6
7const TString AliITSLoader::fgkDefaultRawClustersContainerName = "TreeC";
8const TString AliITSLoader::fgkDefaultBackTracksContainerName = "TreeB";
9const TString AliITSLoader::fgkDefaultVerticesContainerName = "Vertex";
10
11ClassImp(AliITSLoader)
12
13/*****************************************************************************/
14AliITSLoader::AliITSLoader(const Char_t *name,const Char_t *topfoldername):
15 AliLoader(name,topfoldername),
16 fRawClustersDataLoader(fDetectorName + ".RawCl.root",fgkDefaultRawClustersContainerName,"Raw Clusters"),
17 fBackTracksDataLoader(fDetectorName + ".BackTracks.root",fgkDefaultBackTracksContainerName,"Back Propagated Tracks"),
18 fVertexDataLoader(fDetectorName + ".Vertex.root",fgkDefaultVerticesContainerName,"Primary Vertices","O")
19{
20//ctor
21 fDataLoaders->Add(&fRawClustersDataLoader);
22 fRawClustersDataLoader.SetEventFolder(fEventFolder);
23 fRawClustersDataLoader.SetFolder(GetDetectorDataFolder());
24
25 fDataLoaders->Add(&fBackTracksDataLoader);
26 fBackTracksDataLoader.SetEventFolder(fEventFolder);
27 fBackTracksDataLoader.SetFolder(GetDetectorDataFolder());
28
29 fDataLoaders->Add(&fVertexDataLoader);
30 fVertexDataLoader.SetEventFolder(fEventFolder);
31 fVertexDataLoader.SetFolder(GetDetectorDataFolder());
32
33}
34/*****************************************************************************/
35
36AliITSLoader::AliITSLoader(const Char_t *name,TFolder *topfolder):
37 AliLoader(name,topfolder),
38 fRawClustersDataLoader(fDetectorName + ".RawCl.root",fgkDefaultRawClustersContainerName,"Raw Clusters"),
39 fBackTracksDataLoader(fDetectorName + ".BackTracks.root",fgkDefaultBackTracksContainerName,"Back Propagated Tracks"),
40 fVertexDataLoader(fDetectorName + ".Vertex.root",fgkDefaultVerticesContainerName,"Primary Vertices","O")
41{
42//ctor
43 fDataLoaders->Add(&fRawClustersDataLoader);
44 fRawClustersDataLoader.SetEventFolder(fEventFolder);
45 fRawClustersDataLoader.SetFolder(GetDetectorDataFolder());
46
47 fDataLoaders->Add(&fBackTracksDataLoader);
48 fBackTracksDataLoader.SetEventFolder(fEventFolder);
49 fBackTracksDataLoader.SetFolder(GetDetectorDataFolder());
50
51 fDataLoaders->Add(&fVertexDataLoader);
52 fVertexDataLoader.SetEventFolder(fEventFolder);
53 fVertexDataLoader.SetFolder(GetDetectorDataFolder());
54
55}
56/*****************************************************************************/
57AliITSLoader::~AliITSLoader()
58{
59 //destructor
60 UnloadRawClusters();
61 fDataLoaders->Remove(&fRawClustersDataLoader);
62
63 UnloadBackTracks();
64 fDataLoaders->Remove(&fBackTracksDataLoader);
65
66 UnloadVertices();
67 fDataLoaders->Remove(&fVertexDataLoader);
68
69}
70
71void AliITSLoader::MakeTree(Option_t *opt){
72 // invokes AliLoader::MakeTree + specific ITS tree(s)
73 // Valid options: H,S,D,R,T and C (C=raw clusters)
74 AliLoader::MakeTree(opt);
75 const char *oC = strstr(opt,"C");
76 if (oC) MakeRawClustersContainer();
77
78 const char *oB = strstr(opt,"B");
79 if (oB) MakeBackTracksContainer();
80
81}