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