]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AliMuonEventCuts.h
Improve computing time
[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 AliTimeStamp;
11 class TArrayI;
12 class TString;
13 class TObjString;
14 class TObjArray;
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   };
26   
27   AliMuonEventCuts();
28   AliMuonEventCuts(const char* name, const char* title);
29   AliMuonEventCuts(const AliMuonEventCuts& obj);
30   AliMuonEventCuts& operator=(const AliMuonEventCuts& obj);
31   
32   virtual ~AliMuonEventCuts();
33   
34   virtual UInt_t GetSelectionMask ( const TObject* obj );
35   virtual Bool_t IsSelected ( TObject* obj );
36   virtual Bool_t IsSelected ( TList* /*list */ );
37   
38   void SetDefaultFilterMask();
39   void SetDefaultParameters();
40   
41   // Handle trigger
42   void SetTrigClassPatterns ( const TString pattern );
43   /// Get default trigger class patterns
44   TString GetDefaultTrigClassPatterns() { return fDefaultTrigClassPatterns; };
45   void SetTrigClassLevels ( const TString pattern = "MSL:Lpt,MUSL:Lpt,MSH:Hpt,MUSH:Hpt,MUL:LptLpt,MUU:LptLpt,MLL:LptLpt" );
46   TArrayI GetTrigClassPtCutLevel ( const TString trigClassName ) const;
47   void SetTrigClassCombination ( const TString trigClassCombination, Bool_t disableTrigPattern = kTRUE );
48   void SetTrigInputsMap ( const TString trigInputsMap );
49   /// Get trigger classes found in run
50   TList* GetAllSelectedTrigClasses () const { return fAllSelectedTrigClasses; }
51   TObjArray* GetSelectedTrigClassesInEvent ( const AliVEvent* event );
52
53   
54   // Handle centrality
55   void SetCentralityClasses(Int_t nCentralityBins = -1, Double_t* centralityBins = 0x0);
56   /// Get centrality classes
57   TAxis* GetCentralityClasses() const { return fCentralityClasses; }
58   
59   void SetCentralityEstimator ( const TString centralityEstimator = "V0M" );
60   TString GetCentralityEstimator () const;
61   Double_t GetCentrality ( const AliVEvent* event ) const;
62   
63   
64   /// Set Physics selection mask
65   void SetPhysicsSelectionMask ( const UInt_t physicsSelectionMask ) { fPhysicsSelectionMask = physicsSelectionMask; }
66   
67   
68   /// Set minimum number of vertex contributors
69   void SetVertexMinNContributors ( const Int_t vertexMinNContributors ) { fVertexMinNContributors = vertexMinNContributors; }
70   /// Get minimum number of vertex contributors
71   Int_t GetVertexMinNContributors () const { return fVertexMinNContributors; }
72   /// Set Vz limits
73   void SetVertexVzLimits ( Double_t vzMin = -999., Double_t vzMax = 999. ) { fVertexVzMin = vzMin; fVertexVzMax = vzMax; }
74   /// Get Vtx vz min
75   Double_t GetVertexVzMin () const { return fVertexVzMin; }
76   /// Get Vtx vz max
77   Double_t GetVertexVzMax () const { return fVertexVzMax; }
78
79   void Print ( Option_t* option = "" ) const;
80
81  protected:
82   
83   void BuildTriggerClasses ( const TString firedTrigClasses, UInt_t l0Inputs, UInt_t l1Inputs, UInt_t l2Inputs );
84   Bool_t CheckTriggerClassPattern ( const TString& toCheck ) const;
85   Bool_t CheckTriggerClassCombination ( const TObjArray* combo, const TString& firedTriggerClasses, UInt_t l0Inputs, UInt_t l1Inputs, UInt_t l2Inputs ) const;
86   void AddToEventSelectedClass ( const TString& toCheck, const TObjString* foundTrig );
87   Bool_t UpdateEvent( const AliVEvent* event );
88   void SetDefaultTrigClassPatterns();
89   void SetDefaultTrigInputsMap();
90     
91   UInt_t fPhysicsSelectionMask; ///< Physics selection mask
92   
93   Int_t fVertexMinNContributors;  ///< Minimum number of SPD vertex contributors
94   Double_t fVertexVzMin;          ///< SPD vertex Vz min
95   Double_t fVertexVzMax;          ///< SPD vertex Vz max
96   
97   TString fDefaultTrigClassPatterns; ///< Default trigger class patterns
98   TObjArray* fSelectedTrigPattern; ///< List of triggers to be kept
99   TObjArray* fRejectedTrigPattern; ///< List of triggers to be rejected
100   TObjArray* fSelectedTrigLevel;   ///< Track-trigger pt cut for selected trigger class
101   TObjArray* fSelectedTrigCombination; ///< Selected trigger combinations
102   TList* fTrigInputsMap;       ///< Trigger inputs map
103   TList* fAllSelectedTrigClasses;  ///< List of all selected trigger classes found
104   TAxis* fCentralityClasses;   ///< Centrality classes
105   
106   private:
107   AliTimeStamp* fTimeStamp; //!< current event time stamp
108   TObjArray* fSelectedTrigClassesInEvent; //!< list of selected trigger classes in current event 
109   
110   ClassDef(AliMuonEventCuts, 3); // Class for muon event filters
111 };
112
113 #endif
114