]>
Commit | Line | Data |
---|---|---|
ac4edd2e | 1 | #ifndef ALIVANALYSISMUON_H |
2 | #define ALIVANALYSISMUON_H | |
3 | ||
4 | /* $Id: AliVAnalysisMuon.h 47782 2011-02-24 18:37:31Z martinez $ */ | |
5 | ||
6 | // | |
7 | // Base class for single muon analysis | |
8 | // | |
9 | // Author: Diego Stocco | |
10 | // | |
11 | ||
12 | #include "AliAnalysisTaskSE.h" | |
ac4edd2e | 13 | |
14 | class TString; | |
15 | class TObjArray; | |
16 | class TAxis; | |
17 | class TLorentzVector; | |
18 | class TList; | |
dba277b7 | 19 | class THashList; |
ac4edd2e | 20 | class AliMergeableCollection; |
21 | class AliCounterCollection; | |
22 | class AliVParticle; | |
23 | class AliAODEvent; | |
24 | class AliESDEvent; | |
25 | class AliCFGridSparse; | |
ebba9ef0 | 26 | class AliMuonEventCuts; |
c6e0141f | 27 | class AliMuonTrackCuts; |
28 | class AliMuonPairCuts; | |
12e33589 | 29 | class AliVVertex; |
33898693 | 30 | class AliUtilityMuonAncestor; |
ac4edd2e | 31 | |
32 | class AliVAnalysisMuon : public AliAnalysisTaskSE { | |
33 | public: | |
34 | AliVAnalysisMuon(); | |
35 | AliVAnalysisMuon(const char *name, const AliMuonTrackCuts& trackCuts); | |
36 | AliVAnalysisMuon(const char *name, const AliMuonPairCuts& pairCuts); | |
37 | AliVAnalysisMuon(const char *name, const AliMuonTrackCuts& trackCuts, const AliMuonPairCuts& pairCuts); | |
c6e0141f | 38 | |
ac4edd2e | 39 | virtual ~AliVAnalysisMuon(); |
40 | ||
41 | virtual void UserCreateOutputObjects(); | |
42 | virtual void UserExec(Option_t *option); | |
43 | virtual void Terminate(Option_t *option); | |
44 | virtual void NotifyRun(); | |
45 | virtual void FinishTaskOutput(); | |
46 | ||
47 | void SetCentralityClasses(Int_t nCentralityBins = -1, Double_t* centralityBins = 0x0); | |
ebba9ef0 | 48 | TAxis* GetCentralityClasses() const; |
d30d0019 | 49 | Bool_t SetCentralityClassesFromOutput(); |
ac4edd2e | 50 | |
ebba9ef0 | 51 | void SetTrigClassPatterns(const TString pattern); |
52 | TString GetDefaultTrigClassPatterns() const; | |
53 | /// Get trigger classes | |
54 | TList* GetAllSelectedTrigClasses() const; | |
55 | ||
ac4edd2e | 56 | void SetTerminateOptions(TString physSel="All", TString trigClass="ANY", TString centralityRange="", TString furtherOpts=""); |
57 | ||
ebba9ef0 | 58 | /// Get muon event cuts |
59 | AliMuonEventCuts* GetMuonEventCuts() { return fMuonEventCuts; } | |
c6e0141f | 60 | /// Get muon track cuts |
61 | AliMuonTrackCuts* GetMuonTrackCuts() { return fMuonTrackCuts; } | |
62 | /// Get muon pair cuts | |
63 | AliMuonPairCuts* GetMuonPairCuts() { return fMuonPairCuts; } | |
64 | ||
ac4edd2e | 65 | // Utility methods for CF container |
66 | static Bool_t SetSparseRange(AliCFGridSparse* gridSparse, | |
67 | Int_t ivar, TString labelName, | |
68 | Double_t varMin, Double_t varMax, | |
69 | TString option = ""); | |
dba277b7 | 70 | |
71 | void SetWeight ( TObject* wgtObj ); | |
72 | TObject* GetWeight ( const char* wgtName ); | |
d5a197f5 | 73 | |
74 | enum { | |
75 | kPhysSelPass, ///< Physics selected events | |
76 | kPhysSelReject, ///< Events non-passing selection | |
77 | kNselections ///< Number of selections | |
78 | }; | |
79 | ||
80 | enum { | |
81 | kCharmMu, ///< Mu from charm | |
82 | kBeautyMu, ///< Mu from beauty | |
83 | kQuarkoniumMu, ///< Mu from resonance | |
84 | kWbosonMu, ///< Mu from W | |
33898693 | 85 | kZbosonMu, ///< Mu from Z |
d5a197f5 | 86 | kDecayMu, ///< Decay mu |
87 | kSecondaryMu, ///< Secondary mu | |
88 | kRecoHadron, ///< Reconstructed hadron | |
89 | kUnidentified, ///< Particle that fails matching kine | |
90 | kNtrackSources ///< Total number of track sources | |
91 | }; | |
92 | ||
ac4edd2e | 93 | |
94 | protected: | |
95 | ||
96 | ///////////////////////////////////////////////////// | |
97 | // Pure virtual methods to be implemented bu users // | |
98 | ///////////////////////////////////////////////////// | |
99 | ||
8396b417 | 100 | virtual void MyUserCreateOutputObjects() = 0; |
101 | // In this method you have to create your own output as well as | |
102 | // the mergeable objects that will be then used | |
ac4edd2e | 103 | // in the counter collection. |
8396b417 | 104 | // To do so, create your object and add it to the collection through: |
ac4edd2e | 105 | // TH1* histo = new TH1F(); |
8396b417 | 106 | // AddObjectToCollection(histo, index) |
ac4edd2e | 107 | |
108 | virtual void ProcessEvent(TString physSel, const TObjArray& selectTrigClasses, TString centrality) = 0; | |
109 | // This method is called at each event. | |
110 | // In this method you can fill the histograms or the CF container that you have created | |
111 | ||
ac4edd2e | 112 | ///////////////////// |
113 | // Utility methods // | |
114 | ///////////////////// | |
ebba9ef0 | 115 | |
ac4edd2e | 116 | // Methods for MC |
33898693 | 117 | Int_t GetParticleType ( AliVParticle* track ); |
ac4edd2e | 118 | |
119 | // Methods for mergeable object collections | |
8396b417 | 120 | Bool_t AddObjectToCollection(TObject* object, Int_t index = -1); |
ac4edd2e | 121 | TObject* GetMergeableObject(TString physSel, TString trigClassName, TString centrality, TString objectName); |
8396b417 | 122 | TObject* GetSum(TString physSel, TString trigClassNames, TString centrality, TString objectPattern); |
ac4edd2e | 123 | |
d5a197f5 | 124 | |
ebba9ef0 | 125 | AliMuonEventCuts* fMuonEventCuts; ///< Muon event cuts |
c6e0141f | 126 | AliMuonTrackCuts* fMuonTrackCuts; ///< Muon track cuts |
127 | AliMuonPairCuts* fMuonPairCuts; ///< Muon pair track cuts | |
ac4edd2e | 128 | AliESDEvent* fESDEvent; //!< ESD event, not owner |
129 | AliAODEvent* fAODEvent; //!< AOD event, not owner | |
130 | TObjArray* fTerminateOptions; ///< Terminate options | |
8396b417 | 131 | TObjArray* fChargeKeys; ///< Muon charge keys |
132 | TObjArray* fSrcKeys; ///< MC sources names | |
133 | TObjArray* fPhysSelKeys; ///< Physics selection names | |
dba277b7 | 134 | THashList* fWeights; ///< List of objects to weight histograms |
33898693 | 135 | AliUtilityMuonAncestor* fUtilityMuonAncestor; ///< Utility to get the muon ancestor |
ac4edd2e | 136 | |
137 | AliCounterCollection* fEventCounters; //!< event counters | |
138 | AliMergeableCollection* fMergeableCollection; //!< collection of mergeable objects | |
139 | TObjArray* fOutputList; //!< List of outputs | |
140 | ||
141 | private: | |
142 | AliVAnalysisMuon(const AliVAnalysisMuon&); | |
143 | AliVAnalysisMuon& operator=(const AliVAnalysisMuon&); | |
144 | ||
145 | void InitKeys(); | |
146 | void CreateMergeableObjects(TString physSel, TString trigClassName, TString centrality); | |
ac4edd2e | 147 | TObjArray* fOutputPrototypeList; //!< List of prototype object to be used in collection |
148 | ||
33898693 | 149 | ClassDef(AliVAnalysisMuon, 6); |
ac4edd2e | 150 | }; |
151 | ||
152 | #endif |