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