AliPhysics  6bc8652 (6bc8652)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QAStructs.h
Go to the documentation of this file.
1 
10 #ifndef QASTRUCTS_H
11 #define QASTRUCTS_H
12 #ifndef __CINT__
13 # include <TTree.h>
14 # include <TString.h>
15 #else
16 class TTree;
17 #endif
18 
19 // --- A quantity ----------------------------------------------------
25 struct Quantity
26 {
27  Double_t mean; // Mean
28  Double_t var; // Variance
29  Double_t min; // Minimum
30  Double_t max; // Maximum
40  static Quantity* MakeBranch(TTree* tree, const char* name)
41  {
42  Quantity* q = new Quantity;
43  if (tree) tree->Branch(name, q, "mean/D:var:min:max");
44  return q;
45  }
55  static Quantity* SetBranch(TTree* tree, const char* name)
56  {
57  Quantity* q = new Quantity;
58  if (tree) tree->SetBranchAddress(name, q);
59  return q;
60  }
61 };
62 
63 // --- A quantity ----------------------------------------------------
69 struct RingQuantity : public Quantity
70 {
73 
83  static const char* BranchName(UShort_t d, Char_t r, const char* name)
84  {
85  return Form("FMD%d%c_%s", d, r, name);
86  }
99  const char* name)
100  {
101  RingQuantity* q = new RingQuantity;
102  if (tree)
103  tree->Branch(BranchName(d, r, name), q, "mean/D:var:min:max:d/s:r/b");
104  q->det = d;
105  q->ring = r;
106  return q;
107  }
120  const char* name)
121  {
122  RingQuantity* q = new RingQuantity;
123  if (tree) tree->SetBranchAddress(BranchName(d, r, name), q);
124  return q;
125  }
126 };
127 
128 // --- A quantity ----------------------------------------------------
134 struct Global
135 {
148  static Global* MakeBranch(TTree* tree)
149  {
150  Global* g = new Global;
151  if (tree) tree->Branch("global", g, "run/i:accepted:meanVz/D:sigmaVz");
152  return g;
153  }
162  static Global* SetBranch(TTree* tree)
163  {
164  Global* g = new Global;
165  if (tree) tree->SetBranchAddress("global", g);
166  return g;
167  }
168 };
169 
170 // --- A quantity ----------------------------------------------------
176 struct FitStatus
177 {
183 
192  static const char* BranchName(UShort_t d, Char_t r)
193  {
194  return Form("FMD%d%c_fitstatus", d, r);
195  }
206  static FitStatus* MakeBranch(TTree* tree, UShort_t d, Char_t r)
207  {
208  FitStatus* s = new FitStatus;
209  if (tree)
210  tree->Branch(BranchName(d, r), s, "low/s:candidates:fitted:d:r/b");
211  s->det = d;
212  s->ring = r;
213  return s;
214  }
225  static FitStatus* SetBranch(TTree* tree, UShort_t d, Char_t r)
226  {
227  FitStatus* s = new FitStatus;
228  if (tree) tree->SetBranchAddress(BranchName(d, r), s);
229  return s;
230  }
231 };
232 
233 
234 // --- A quantity ----------------------------------------------------
240 struct Merge
241 {
247 
256  static const char* BranchName(UShort_t d, Char_t r)
257  {
258  return Form("FMD%d%c_merge", d, r);
259  }
270  static Merge* MakeBranch(TTree* tree, UShort_t d, Char_t r)
271  {
272  Merge* s = new Merge;
273  if (tree) tree->Branch(BranchName(d, r), s, "one/D:two:three:d:r/b");
274  s->det = d;
275  s->ring = r;
276  return s;
277  }
288  static Merge* SetBranch(TTree* tree, UShort_t d, Char_t r)
289  {
290  Merge* s = new Merge;
291  if (tree) tree->SetBranchAddress(BranchName(d, r), s);
292  return s;
293  }
294 };
295 
296 // --- Cuts ----------------------------------------------------------
302 struct DataLoss
303 {
309 
318  static const char* BranchName(UShort_t d, Char_t r)
319  {
320  return Form("FMD%d%c_dataloss", d, r);
321  }
332  static DataLoss* MakeBranch(TTree* tree, UShort_t d, Char_t r)
333  {
334  DataLoss* s = new DataLoss;
335  if (tree) tree->Branch(BranchName(d, r), s, "merge/D:density:full:d:r/b");
336  s->det = d;
337  s->ring = r;
338  return s;
339  }
350  static DataLoss* SetBranch(TTree* tree, UShort_t d, Char_t r)
351  {
352  DataLoss* s = new DataLoss;
353  if (tree) tree->SetBranchAddress(BranchName(d, r), s);
354  return s;
355  }
356 };
357 
358 // --- A quantity ----------------------------------------------------
365 {
383  static const char* BranchName(UShort_t d, Char_t r)
384  {
385  return Form("FMD%d%c_correlation", d, r);
386  }
398  {
399  Correlation* s = new Correlation;
400  if (tree) tree->Branch(BranchName(d, r), s,
401  "alpha/D:beta:a:ea:b:eb:chi2:d/s:r/b");
402  s->det = d;
403  s->ring = r;
404  return s;
405  }
417  {
418  Correlation* s = new Correlation;
419  if (tree) tree->SetBranchAddress(BranchName(d, r), s);
420  return s;
421  }
422 };
423 #endif // QASTRUCTS_H
424 // Local Variables:
425 // mode: C++
426 // End:
Double_t sigmaVz
Definition: QAStructs.h:139
double Double_t
Definition: External.C:58
UShort_t nFitted
Definition: QAStructs.h:180
Double_t one
Definition: QAStructs.h:242
static FitStatus * MakeBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:206
Char_t ring
Definition: QAStructs.h:308
Double_t a
Definition: QAStructs.h:368
static const char * BranchName(UShort_t d, Char_t r)
Definition: QAStructs.h:256
Double_t three
Definition: QAStructs.h:244
static const char * BranchName(UShort_t d, Char_t r)
Definition: QAStructs.h:318
char Char_t
Definition: External.C:18
Double_t beta
Definition: QAStructs.h:367
Double_t eb
Definition: QAStructs.h:371
static Global * MakeBranch(TTree *tree)
Definition: QAStructs.h:148
Double_t merge
Definition: QAStructs.h:304
static Correlation * SetBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:416
Char_t ring
Definition: QAStructs.h:374
static Merge * MakeBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:270
UInt_t runNo
Definition: QAStructs.h:136
Double_t density
Definition: QAStructs.h:305
UShort_t det
Definition: QAStructs.h:373
Double_t max
Definition: QAStructs.h:30
static RingQuantity * SetBranch(TTree *tree, UShort_t d, Char_t r, const char *name)
Definition: QAStructs.h:119
unsigned int UInt_t
Definition: External.C:33
Double_t alpha
Definition: QAStructs.h:366
static const char * BranchName(UShort_t d, Char_t r)
Definition: QAStructs.h:192
static Quantity * SetBranch(TTree *tree, const char *name)
Definition: QAStructs.h:55
UShort_t det
Definition: QAStructs.h:181
static const char * BranchName(UShort_t d, Char_t r, const char *name)
Definition: QAStructs.h:83
UShort_t nCandidates
Definition: QAStructs.h:179
Double_t var
Definition: QAStructs.h:28
static const char * BranchName(UShort_t d, Char_t r)
Definition: QAStructs.h:383
Double_t chi2
Definition: QAStructs.h:372
static Merge * SetBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:288
UShort_t det
Definition: QAStructs.h:307
Double_t b
Definition: QAStructs.h:370
TH1 * Merge(const TH1 *cen, const TH1 *fwd, Double_t &xlow, Double_t &xhigh)
UShort_t det
Definition: QAStructs.h:71
static DataLoss * MakeBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:332
Double_t full
Definition: QAStructs.h:306
static Correlation * MakeBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:397
UShort_t nLow
Definition: QAStructs.h:178
UInt_t nAccepted
Definition: QAStructs.h:137
static FitStatus * SetBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:225
Double_t min
Definition: QAStructs.h:29
Double_t ea
Definition: QAStructs.h:369
Double_t mean
Definition: QAStructs.h:27
Double_t two
Definition: QAStructs.h:243
unsigned short UShort_t
Definition: External.C:28
Char_t ring
Definition: QAStructs.h:182
static Global * SetBranch(TTree *tree)
Definition: QAStructs.h:162
static Quantity * MakeBranch(TTree *tree, const char *name)
Definition: QAStructs.h:40
static RingQuantity * MakeBranch(TTree *tree, UShort_t d, Char_t r, const char *name)
Definition: QAStructs.h:98
Char_t ring
Definition: QAStructs.h:246
Char_t ring
Definition: QAStructs.h:72
static DataLoss * SetBranch(TTree *tree, UShort_t d, Char_t r)
Definition: QAStructs.h:350
Double_t meanVz
Definition: QAStructs.h:138
UShort_t det
Definition: QAStructs.h:245