]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AliMuonEventCuts.h
Merge remote-tracking branch 'origin/master' into TPCdev
[u/mrichter/AliRoot.git] / PWG / muon / AliMuonEventCuts.h
1 #ifndef ALIMUONEVENTCUTS_H
2 #define ALIMUONEVENTCUTS_H
3
4 #include "AliAnalysisCuts.h"
5
6 class AliVEvent;
7 class AliVVertex;
8 class TList;
9 class TAxis;
10 class TArrayI;
11 class TString;
12 class TObjString;
13 class TObjArray;
14 class AliAnalysisUtils;
15
16 class AliMuonEventCuts : public AliAnalysisCuts
17 {
18  public:
19   
20   enum {
21     kPhysicsSelected = BIT(0),
22     kSelectedCentrality = BIT(1),
23     kSelectedTrig = BIT(2),
24     kGoodVertex = BIT(3),
25     kNoPileup = BIT(4)
26   };
27   
28   AliMuonEventCuts();
29   AliMuonEventCuts(const char* name, const char* title);
30   AliMuonEventCuts(const AliMuonEventCuts& obj);
31   AliMuonEventCuts& operator=(const AliMuonEventCuts& obj);
32   
33   virtual ~AliMuonEventCuts();
34   
35   virtual UInt_t GetSelectionMask ( const TObject* obj );
36   virtual Bool_t IsSelected ( TObject* obj );
37   virtual Bool_t IsSelected ( TList* /*list */ );
38   
39   void SetDefaultFilterMask();
40   void SetDefaultParameters();
41   
42   /// Skip tests which are not active in the filter mask
43   void SkipTestsNonInFilterMask ( UInt_t skipMask = 0xFFFF) { fCheckMask = ~skipMask; }
44   
45   // Handle trigger
46   void SetTrigClassPatterns ( const TString trigPattern );
47   /// Get default trigger class patterns
48   TString GetDefaultTrigClassPatterns() { return fDefaultTrigClassPatterns; };
49   void SetTrigClassLevels ( const TString pattern = "MSL:Lpt,MUSL:Lpt,MSH:Hpt,MUSH:Hpt,MUL:LptLpt,MUU:LptLpt,MLL:LptLpt" );
50   TArrayI GetTrigClassPtCutLevel ( const TString trigClassName ) const;
51   void SetTrigInputsMap ( const TString trigInputsMap );
52   /// Get trigger classes found in run
53   TList* GetAllSelectedTrigClasses () const { return fAllSelectedTrigClasses; }
54   const TObjArray* GetSelectedTrigClassesInEvent ( const AliVEvent* event );
55   const TObjArray* GetSelectedTrigClassesInEvent(const TString& firedTriggerClasses,
56                                                  UInt_t l0Inputs, UInt_t l1Inputs, UInt_t l2Inputs);
57
58   UInt_t GetTriggerInputBitMaskFromInputName(const char* inputName) const;
59
60   // Handle centrality
61   void SetCentralityClasses(Int_t nCentralityBins = -1, Double_t* centralityBins = 0x0);
62   /// Get centrality classes
63   TAxis* GetCentralityClasses() const { return fCentralityClasses; }
64   
65   void SetCentralityEstimator ( const TString centralityEstimator = "V0M" );
66   TString GetCentralityEstimator () const;
67   Double_t GetCentrality ( const AliVEvent* event ) const;
68   
69   
70   /// Set Physics selection mask
71   void SetPhysicsSelectionMask ( const UInt_t physicsSelectionMask ) { fPhysicsSelectionMask = physicsSelectionMask; }
72   
73   
74   /// Set minimum number of vertex contributors
75   void SetVertexMinNContributors ( const Int_t vertexMinNContributors ) { fVertexMinNContributors = vertexMinNContributors; }
76   /// Get minimum number of vertex contributors
77   Int_t GetVertexMinNContributors () const { return fVertexMinNContributors; }
78   /// Set Vz limits
79   void SetVertexVzLimits ( Double_t vzMin = -999., Double_t vzMax = 999. ) { fVertexVzMin = vzMin; fVertexVzMax = vzMax; }
80   /// Get Vtx vz min
81   Double_t GetVertexVzMin () const { return fVertexVzMin; }
82   /// Get Vtx vz max
83   Double_t GetVertexVzMax () const { return fVertexVzMax; }
84   
85   /// Return pointer to analysis utils (to configure cuts)
86   AliAnalysisUtils* GetAnalysisUtils ( ) { return fAnalysisUtils; }
87
88   void Print ( Option_t* option = "" ) const;
89
90  protected:
91   
92   void BuildTriggerClasses ( const TString firedTrigClasses, UInt_t l0Inputs, UInt_t l1Inputs, UInt_t l2Inputs );
93   Bool_t CheckTriggerClassPattern ( const TString& toCheck ) const;
94   Bool_t CheckTriggerClassCombination ( const TObjArray* combo, const TString& firedTriggerClasses, UInt_t l0Inputs, UInt_t l1Inputs, UInt_t l2Inputs ) const;
95   void AddToEventSelectedClass ( const TString& toCheck, const TObjString* foundTrig, const UInt_t comboType = 0 );
96   Bool_t UpdateEvent( const AliVEvent* event );
97   void SetDefaultTrigClassPatterns();
98   void SetDefaultTrigInputsMap();
99     
100   UInt_t fPhysicsSelectionMask; ///< Physics selection mask
101   
102   Int_t fVertexMinNContributors;  ///< Minimum number of SPD vertex contributors
103   Double_t fVertexVzMin;          ///< SPD vertex Vz min
104   Double_t fVertexVzMax;          ///< SPD vertex Vz max
105   
106   UInt_t fCheckMask;              ///< Mask telling which cuts to check (by default check filter mask)
107   
108   TString fDefaultTrigClassPatterns; ///< Default trigger class patterns
109   TObjArray* fSelectedTrigPattern; ///< List of triggers to be kept
110   TObjArray* fRejectedTrigPattern; ///< List of triggers to be rejected
111   TObjArray* fSelectedTrigLevel;   ///< Track-trigger pt cut for selected trigger class
112   TObjArray* fSelectedTrigCombination; ///< Selected trigger combinations
113   TList* fTrigInputsMap;       ///< Trigger inputs map
114   TList* fAllSelectedTrigClasses;  ///< List of all selected trigger classes found
115   TAxis* fCentralityClasses;   ///< Centrality classes
116   AliAnalysisUtils* fAnalysisUtils;    ///< Analysis utility
117   
118   private:
119   ULong64_t fEventTriggerMask; //!< Fired trigger mask in the event
120   TObjArray* fSelectedTrigClassesInEvent; //!< list of selected trigger classes in current event
121   enum {kComboSimple, kComboFormula, kComboAND, kComboOR}; //!< Trigger combination types
122   
123   ClassDef(AliMuonEventCuts, 5); // Class for muon event filters
124 };
125
126 #endif
127