]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muon/AliAnalysisTaskMuonQA.h
Transition PWG3 --> PWGHF
[u/mrichter/AliRoot.git] / PWG / muon / AliAnalysisTaskMuonQA.h
1 #ifndef ALIANALYSISTASKMUONQA_H
2 #define ALIANALYSISTASKMUONQA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */ 
7
8 /// \ingroup muondep
9 /// \class AliAnalysisTaskMuonQA
10 /// \brief Quality assurance of MUON ESDs
11 //Author: Philippe Pillot - SUBATECH Nantes
12
13 class TMap;
14 class TList;
15 class TObjArray;
16 class AliCounterCollection;
17
18 class AliAnalysisTaskMuonQA : public AliAnalysisTaskSE {
19  public:
20   
21   AliAnalysisTaskMuonQA();
22   AliAnalysisTaskMuonQA(const char *name);
23   virtual ~AliAnalysisTaskMuonQA();
24   
25   virtual void   UserCreateOutputObjects();
26   virtual void   UserExec(Option_t *);
27   virtual void   Terminate(Option_t *);
28   
29   /// Select negative (<0), positive (>0) or all (==0) tracks to fill histograms
30   void SelectCharge(Short_t charge = 0) {fSelectCharge = charge;}
31   
32   /// Select events passing the physics selection to fill histograms
33   void SelectPhysics(Bool_t flag = kTRUE) {fSelectPhysics = flag;}
34   
35   /// Select events belonging to at least one of the trigger classes selected by the mask to fill histograms:
36   /// - if the physics selection is used, apply the mask to the trigger word returned by the physics selection
37   /// - if not, apply the mask to the trigger word built by looking for triggers listed in "fSelectTriggerClass"
38   void SelectTrigger(Bool_t flag = kTRUE, UInt_t mask = AliVEvent::kMUON) {fSelectTrigger = flag; fTriggerMask = mask;}
39         
40   /// Select track matching the trigger to fill histograms
41   void SelectMatched(Bool_t flag = kTRUE) {fSelectMatched = flag;}
42   
43   /// Use only tracks passing the acceptance cuts (Rabs, eta)
44   void ApplyAccCut(Bool_t flag = kTRUE) { fApplyAccCut = flag; }
45   
46  private:
47   
48   /// Not implemented
49   AliAnalysisTaskMuonQA(const AliAnalysisTaskMuonQA& rhs);
50   /// Not implemented
51   AliAnalysisTaskMuonQA& operator = (const AliAnalysisTaskMuonQA& rhs);
52   
53   Double_t ChangeThetaRange(Double_t theta);
54   
55   UInt_t BuildTriggerWord(TString& FiredTriggerClasses);
56   
57   TList* BuildListOfTriggerCases(TString& FiredTriggerClasses);
58   TList* BuildListOfAllTriggerCases(TString& FiredTriggerClasses);
59   TList* BuildListOfSelectedTriggerCases(TString& FiredTriggerClasses);
60         
61  private:
62   
63   enum eList {
64     kNTracks                 = 0,  ///< number of tracks
65     kMatchTrig               = 1,  ///< number of tracks matched with trigger
66     kSign                    = 2,  ///< track sign
67     kDCA                     = 3,  ///< DCA distribution
68     kP                       = 4,  ///< P distribution
69     kPMuPlus                 = 5,  ///< P distribution of mu+
70     kPMuMinus                = 6,  ///< P distribution of mu-
71     kPt                      = 7,  ///< Pt distribution
72     kPtMuPlus                = 8,  ///< Pt distribution of mu+
73     kPtMuMinus               = 9,  ///< Pt distribution of mu-
74     kRapidity                = 10, ///< rapidity distribution
75     kThetaX                  = 11, ///< thetaX distribution
76     kThetaY                  = 12, ///< thetaY distribution
77     kChi2                    = 13, ///< normalized chi2 distribution
78     kProbChi2                = 14, ///< distribution of probability of chi2
79     kNClustersPerTrack       = 15, ///< number of clusters per track
80     kNChamberHitPerTrack     = 16,  ///< number of chamber hit per track
81     kPtMatchLpt              = 17, ///< Pt distribution match Lpt
82     kPtMatchHpt              = 18, ///< Pt distribution match Hpt
83     kPtMuPlusMatchLpt        = 19,  ///< Pt distribution of mu+ match Lpt
84     kPtMuPlusMatchHpt        = 20,  ///< Pt distribution of mu+ match Hpt
85     kPtMuMinusMatchLpt       = 21,  ///< Pt distribution of mu- match Lpt
86     kPtMuMinusMatchHpt       = 22   ///< Pt distribution of mu- match Hpt
87   };
88   
89   enum eListExpert {
90     kNClustersPerCh          = 0,  ///< number of clusters per chamber
91     kNClustersPerDE          = 1,  ///< number of clusters per DE
92     kClusterHitMapInCh       = 2,  ///< cluster position distribution in chamber i
93     kClusterChargeInCh       = 12, ///< cluster charge distribution in chamber i
94     kClusterChargePerDE      = 22, ///< cluster charge distribution per DE
95     kClusterSizeInCh         = 23, ///< cluster size distribution in chamber i
96     kClusterSizePerDE        = 33  ///< cluster size distribution per DE
97   };
98   
99   enum eListNorm {
100     kClusterChargePerChMean  = 0,  ///< cluster charge per Ch: mean
101     kClusterChargePerChSigma = 1,  ///< cluster charge per Ch: dispersion
102     kClusterChargePerDEMean  = 2,  ///< cluster charge per DE: mean
103     kClusterChargePerDESigma = 3,  ///< cluster charge per DE: dispersion
104     kClusterSizePerChMean    = 4,  ///< cluster size per Ch: mean
105     kClusterSizePerChSigma   = 5,  ///< cluster size per Ch: dispersion
106     kClusterSizePerDEMean    = 6,  ///< cluster size per DE: mean
107     kClusterSizePerDESigma   = 7,  ///< cluster size per DE: dispersion
108     kNClustersPerChPerTrack  = 8,  ///< number of clusters per chamber per track
109     kNClustersPerDEPerTrack  = 9   ///< number of clusters per DE per track
110   };
111   
112   TObjArray*  fList;       //!< List of output object for everybody
113   TObjArray*  fListExpert; //!< List of output object for experts
114   TObjArray*  fListNorm;   //!< Normalized histograms
115   
116   AliCounterCollection* fTrackCounters; //!< track statistics
117   AliCounterCollection* fEventCounters; //!< event statistics
118   
119   Short_t fSelectCharge;  ///< Fill histograms only with negative/position tracks (0=all)
120   Bool_t  fSelectPhysics; ///< Fill histograms only with events passing the physics selection
121   Bool_t  fSelectTrigger; ///< Fill histograms only with events passing the trigger selection
122   UInt_t  fTriggerMask;   ///< Trigger mask to be used when selecting events
123   Bool_t  fSelectMatched; ///< Fill histograms only with tracks matching the trigger
124   Bool_t  fApplyAccCut;   ///< use only tracks passing the acceptance cuts (Rabs, eta)
125   
126   TMap*  fTriggerClass;       //!< map of trigger class name associated to short name
127   TList* fSelectTriggerClass; //!< list of trigger class that can be selected to fill histograms
128   
129   static const Int_t nCh;       ///< number of tracking chambers
130   static const Int_t nDE;       ///< number of DE
131   static const Float_t dMax[5]; ///< maximum diameter of each station
132   
133   ClassDef(AliAnalysisTaskMuonQA, 6);
134 };
135
136 #endif
137