]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/TRD/macros/AliTrackletsinTRD.h
Possibility to remove the contribution of D meson daughters to the number of tracklet...
[u/mrichter/AliRoot.git] / PWGPP / TRD / macros / AliTrackletsinTRD.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 AliTrackletsinTRD/AliTrackletsinTRD
5 // found on file: TRD.DebugTrackingMultiplicity.root
6 //////////////////////////////////////////////////////////
7
8 #ifndef ALITRACKLETSINTRD_h
9 #define ALITRACKLETSINTRD_h
10
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14
15 class AliTrackletsinTRD {
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           fstandalone;   //!flag is track reconstructed in TPC only or TPC+TRD
22    Int_t           feventcounter; //!event number
23    Int_t           flayer;        //!layer number
24    Float_t         fxtracklet;    //!x position of tracklet
25    Double_t        fxtrack;       //!x position of track
26    Float_t         fytracklet;    //!y position of tracklet
27    Double_t        fytrack;       //!y position of track
28    Float_t         fztracklet;    //!z position of tracklet
29    Double_t        fztrack;       //!z position of track
30    Int_t           fnumtracklets; //!number of tracklets
31    Int_t           fdettracklet;  //!detector number
32
33    // List of branches
34    TBranch        *fbB0;   //!
35    TBranch        *fbB1;   //!
36    TBranch        *fbB2;   //!
37    TBranch        *fbB3;   //!
38    TBranch        *fbB4;   //!
39    TBranch        *fbB5;   //!
40    TBranch        *fbB6;   //!
41    TBranch        *fbB7;   //!
42    TBranch        *fbB8;   //!
43    TBranch        *fbB9;   //!
44    TBranch        *fbB10;  //!
45
46    AliTrackletsinTRD(TTree *tree=0);
47    virtual ~AliTrackletsinTRD();
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    AliTrackletsinTRD (AliTrackletsinTRD& p):
58        fChain(p.fChain),
59        fbB0(p.fbB0),
60        fbB1(p.fbB1),
61        fbB2(p.fbB2),
62        fbB3(p.fbB3),
63        fbB4(p.fbB4),
64        fbB5(p.fbB5),
65        fbB6(p.fbB6),
66        fbB7(p.fbB7),
67        fbB8(p.fbB8),
68        fbB9(p.fbB9),
69        fbB10(p.fbB10)
70    {
71    }
72
73 };
74
75   
76
77 AliTrackletsinTRD::AliTrackletsinTRD(TTree *tree)
78 {
79 // if parameter tree is not specified (or zero), connect the file
80 // used to generate this class and read the Tree.
81    if (tree == 0) {
82       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/alidata80/alice_u/pachmay/AliRoot/v4-16-Rev-01/TRD/qaRec/TRD.DebugTrackingMultiplicity.root");
83       if (!f) {
84          f = new TFile("/alidata80/alice_u/pachmay/AliRoot/v4-16-Rev-01/TRD/qaRec/TRD.DebugTrackingMultiplicity.root");
85       }
86       tree = (TTree*)gDirectory->Get("TrackletsinTRD");
87
88    }
89    Init(tree);
90 }
91
92 AliTrackletsinTRD::~AliTrackletsinTRD()
93 {
94    if (!fChain) return;
95    delete fChain->GetCurrentFile();
96 }
97
98 Int_t AliTrackletsinTRD::GetEntry(Long64_t entry)
99 {
100 // Read contents of entry.
101    if (!fChain) return 0;
102    return fChain->GetEntry(entry);
103 }
104 Long64_t AliTrackletsinTRD::LoadTree(Long64_t entry)
105 {
106 // Set the environment to read one entry
107    if (!fChain) return -5;
108    Long64_t centry = fChain->LoadTree(entry);
109    if (centry < 0) return centry;
110    if (!fChain->InheritsFrom(TChain::Class()))  return centry;
111    TChain *chain = (TChain*)fChain;
112    if (chain->GetTreeNumber() != fCurrent) {
113       fCurrent = chain->GetTreeNumber();
114       Notify();
115    }
116    return centry;
117 }
118
119 void AliTrackletsinTRD::Init(TTree *tree)
120 {
121    // The Init() function is called when the selector needs to initialize
122    // a new tree or chain. Typically here the branch addresses and branch
123    // pointers of the tree will be set.
124    // It is normally not necessary to make changes to the generated
125    // code, but the routine can be extended by the user if needed.
126    // Init() will be called many times when running on PROOF
127    // (once per file to be processed).
128
129    // Set branch addresses and branch pointers
130    if (!tree) return;
131    fChain = tree;
132    fCurrent = -1;
133    fChain->SetMakeClass(1);
134
135    fChain->SetBranchAddress("standalone", &fstandalone, &fbB0);
136    fChain->SetBranchAddress("eventcounter", &feventcounter, &fbB1);
137    fChain->SetBranchAddress("layer", &flayer, &fbB2);
138    fChain->SetBranchAddress("xtracklet", &fxtracklet, &fbB3);
139    fChain->SetBranchAddress("xtrack", &fxtrack, &fbB4);
140    fChain->SetBranchAddress("ytracklet", &fytracklet, &fbB5);
141    fChain->SetBranchAddress("ytrack", &fytrack, &fbB6);
142    fChain->SetBranchAddress("ztracklet", &fztracklet, &fbB7);
143    fChain->SetBranchAddress("ztrack", &fztrack, &fbB8);
144    fChain->SetBranchAddress("num_tracklets", &fnumtracklets, &fbB9);
145    fChain->SetBranchAddress("dettracklet", &fdettracklet, &fbB10);
146    Notify();
147 }
148
149 Bool_t AliTrackletsinTRD::Notify()
150 {
151    // The Notify() function is called when a new file is opened. This
152    // can be either for a new TTree in a TChain or when when a new TTree
153    // is started when using PROOF. It is normally not necessary to make changes
154    // to the generated code, but the routine can be extended by the
155    // user if needed. The return value is currently not used.
156
157    return kTRUE;
158 }
159
160 void AliTrackletsinTRD::Show(Long64_t entry)
161 {
162 // Print contents of entry.
163 // If entry is not specified, print current entry
164    if (!fChain) return;
165    fChain->Show(entry);
166 }
167 Int_t AliTrackletsinTRD::Cut(Long64_t entry)
168 {
169 // This function may be called from Loop.
170 // returns  1 if entry is accepted.
171 // returns -1 otherwise.
172    return 1;
173 }
174 #endif // #ifdef AliTrackletsinTRD_cxx