add possibility to smear cluster energy, only for MC, some stetic changes in header...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnExpression.h
CommitLineData
4fbb2459 1//
9477aa42 2// AliRsnExpresion class is used to
3// handle operators &|!
4// in AliRsnCut
4fbb2459 5//
6// authors: Martin Vala (martin.vala@cern.ch)
7// Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
8//
9
baca856a 10#ifndef ALIRSNEXPRESSION_H
11#define ALIRSNEXPRESSION_H
12
13#include <TObject.h>
baca856a 14
15class TObjArray;
4fbb2459 16#include "AliRsnCutSet.h"
17class AliRsnVariableExpression;
baca856a 18
baca856a 19class AliRsnExpression : public TObject
20{
21
22 public:
aec0ec32 23
24 // operators for complex cut expressions
4fbb2459 25 enum ECutOp {
aec0ec32 26 kOpAND=1, // AND '&'
27 kOpOR, // OR '|'
28 kOpNOT // Unary negation '!'
e2bafbbc 29 };
aec0ec32 30
31 AliRsnExpression() : fVname(0), fArg1(0), fArg2(0), fOperator(0) {}
32 AliRsnExpression(TString exp);
baca856a 33 virtual ~AliRsnExpression();
aec0ec32 34 AliRsnExpression(const AliRsnExpression& exp);
35 AliRsnExpression& operator= (const AliRsnExpression& exp);
baca856a 36
aec0ec32 37 virtual Bool_t Value(TObjArray & vars);
baca856a 38 virtual TString Unparse() const;
39
4fbb2459 40 void SetCutSet(AliRsnCutSet* const theValue) { fgCutSet = theValue; }
41 AliRsnCutSet* GetCutSet() const { return fgCutSet; }
baca856a 42
43
4fbb2459 44 TString fVname; // Variable name
9477aa42 45 static AliRsnCutSet *fgCutSet; // global cutset
baca856a 46
47 private:
4fbb2459 48 AliRsnExpression* fArg1; // left argument
49 AliRsnExpression* fArg2; // right argument
50 Int_t fOperator; // operator
baca856a 51
aec0ec32 52 AliRsnExpression(int op, AliRsnExpression* a);
53 AliRsnExpression(int op, AliRsnExpression* a, AliRsnExpression* b);
baca856a 54
aec0ec32 55 TObjArray* Tokenize(TString str) const;
56 static AliRsnExpression* Element(TObjArray &st, Int_t &i);
57 static AliRsnExpression* Primary(TObjArray &st, Int_t &i);
58 static AliRsnExpression* Expression(TObjArray &st, Int_t &i);
baca856a 59
aec0ec32 60 ClassDef(AliRsnExpression, 1); // Class to evaluate an expression
baca856a 61};
62
baca856a 63#endif