]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/qaRec/macros/TrackletsinTRD.h
From Bogdan: New macro for stand-alone visualization of MUON geometry.
[u/mrichter/AliRoot.git] / TRD / qaRec / macros / TrackletsinTRD.h
1 //////////////////////////////////////////////////////////
2 // This class has been automatically generated on
3 // Fri Mar 20 09:42:44 2009 by ROOT version 5.21/01
4 // from TTree TrackletsinTRD/TrackletsinTRD
5 // found on file: TRD.DebugTrackingMultiplicity.root
6 //////////////////////////////////////////////////////////
7
8 #ifndef TrackletsinTRD_h
9 #define TrackletsinTRD_h
10
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14
15 class TrackletsinTRD {
16 public :
17    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
18    Int_t           fCurrent; //!current Tree number in a TChain
19
20    // Declaration of leaf types
21    Int_t           standalone;
22    Int_t           eventcounter;
23    Int_t           layer;
24    Float_t         xtracklet;
25    Double_t        xtrack;
26    Float_t         ytracklet;
27    Double_t        ytrack;
28    Float_t         ztracklet;
29    Double_t        ztrack;
30    Int_t           num_tracklets;
31    Int_t           dettracklet;
32
33    // List of branches
34    TBranch        *b_B0;   //!
35    TBranch        *b_B1;   //!
36    TBranch        *b_B2;   //!
37    TBranch        *b_B3;   //!
38    TBranch        *b_B4;   //!
39    TBranch        *b_B5;   //!
40    TBranch        *b_B6;   //!
41    TBranch        *b_B7;   //!
42    TBranch        *b_B8;   //!
43    TBranch        *b_B9;   //!
44    TBranch        *b_B10;  //!
45
46    TrackletsinTRD(TTree *tree=0);
47    virtual ~TrackletsinTRD();
48    virtual Int_t    Cut(Long64_t entry);
49    virtual Int_t    GetEntry(Long64_t entry);
50    virtual Long64_t LoadTree(Long64_t entry);
51    virtual void     Init(TTree *tree);
52    virtual void     Loop();
53    virtual Bool_t   Notify();
54    virtual void     Show(Long64_t entry = -1);
55 };
56
57 #endif
58
59 #ifdef TrackletsinTRD_cxx
60 TrackletsinTRD::TrackletsinTRD(TTree *tree)
61 {
62 // if parameter tree is not specified (or zero), connect the file
63 // used to generate this class and read the Tree.
64    if (tree == 0) {
65       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/alidata80/alice_u/pachmay/AliRoot/v4-16-Rev-01/TRD/qaRec/TRD.DebugTrackingMultiplicity.root");
66       if (!f) {
67          f = new TFile("/alidata80/alice_u/pachmay/AliRoot/v4-16-Rev-01/TRD/qaRec/TRD.DebugTrackingMultiplicity.root");
68       }
69       tree = (TTree*)gDirectory->Get("TrackletsinTRD");
70
71    }
72    Init(tree);
73 }
74
75 TrackletsinTRD::~TrackletsinTRD()
76 {
77    if (!fChain) return;
78    delete fChain->GetCurrentFile();
79 }
80
81 Int_t TrackletsinTRD::GetEntry(Long64_t entry)
82 {
83 // Read contents of entry.
84    if (!fChain) return 0;
85    return fChain->GetEntry(entry);
86 }
87 Long64_t TrackletsinTRD::LoadTree(Long64_t entry)
88 {
89 // Set the environment to read one entry
90    if (!fChain) return -5;
91    Long64_t centry = fChain->LoadTree(entry);
92    if (centry < 0) return centry;
93    if (!fChain->InheritsFrom(TChain::Class()))  return centry;
94    TChain *chain = (TChain*)fChain;
95    if (chain->GetTreeNumber() != fCurrent) {
96       fCurrent = chain->GetTreeNumber();
97       Notify();
98    }
99    return centry;
100 }
101
102 void TrackletsinTRD::Init(TTree *tree)
103 {
104    // The Init() function is called when the selector needs to initialize
105    // a new tree or chain. Typically here the branch addresses and branch
106    // pointers of the tree will be set.
107    // It is normally not necessary to make changes to the generated
108    // code, but the routine can be extended by the user if needed.
109    // Init() will be called many times when running on PROOF
110    // (once per file to be processed).
111
112    // Set branch addresses and branch pointers
113    if (!tree) return;
114    fChain = tree;
115    fCurrent = -1;
116    fChain->SetMakeClass(1);
117
118    fChain->SetBranchAddress("standalone", &standalone, &b_B0);
119    fChain->SetBranchAddress("eventcounter", &eventcounter, &b_B1);
120    fChain->SetBranchAddress("layer", &layer, &b_B2);
121    fChain->SetBranchAddress("xtracklet", &xtracklet, &b_B3);
122    fChain->SetBranchAddress("xtrack", &xtrack, &b_B4);
123    fChain->SetBranchAddress("ytracklet", &ytracklet, &b_B5);
124    fChain->SetBranchAddress("ytrack", &ytrack, &b_B6);
125    fChain->SetBranchAddress("ztracklet", &ztracklet, &b_B7);
126    fChain->SetBranchAddress("ztrack", &ztrack, &b_B8);
127    fChain->SetBranchAddress("num_tracklets", &num_tracklets, &b_B9);
128    fChain->SetBranchAddress("dettracklet", &dettracklet, &b_B10);
129    Notify();
130 }
131
132 Bool_t TrackletsinTRD::Notify()
133 {
134    // The Notify() function is called when a new file is opened. This
135    // can be either for a new TTree in a TChain or when when a new TTree
136    // is started when using PROOF. It is normally not necessary to make changes
137    // to the generated code, but the routine can be extended by the
138    // user if needed. The return value is currently not used.
139
140    return kTRUE;
141 }
142
143 void TrackletsinTRD::Show(Long64_t entry)
144 {
145 // Print contents of entry.
146 // If entry is not specified, print current entry
147    if (!fChain) return;
148    fChain->Show(entry);
149 }
150 Int_t TrackletsinTRD::Cut(Long64_t entry)
151 {
152 // This function may be called from Loop.
153 // returns  1 if entry is accepted.
154 // returns -1 otherwise.
155    return 1;
156 }
157 #endif // #ifdef TrackletsinTRD_cxx