]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskHFE.h
Various updates (Markus)
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFE.h
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  *
14 **************************************************************************/
15 #ifndef ALIANALYSISTASKHFE_H
16 #define ALIANALYSISTASKHFE_H
17
18 #ifndef ALIANALYSISTASK_H
19 #include "AliAnalysisTask.h"
20 #endif
21
22 #ifndef ROOT_THnSparse
23 #include <THnSparse.h>
24 #endif
25
26 class AliHFEpid;
27 class AliHFEcuts;
28 class AliHFEmcQA;
29 class AliHFEsecVtx;
30 class AliCFManager;
31 class AliESDEvent;
32 class AliESDtrackCuts;
33 class AliMCEvent;
34 class TH1I; 
35 class TList;
36
37 class AliAnalysisTaskHFE : public AliAnalysisTask{
38   enum{
39     kIsSecVtxOn = BIT(19),
40     kIsPriVtxOn = BIT(20)
41   };
42   public:
43   enum{
44     kPIDqa = 0,
45     kCUTqa = 1,
46     kMCqa = 2
47   };
48     AliAnalysisTaskHFE();
49     AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
50     AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
51     virtual ~AliAnalysisTaskHFE();
52
53     virtual void ConnectInputData(Option_t *);
54     virtual void CreateOutputObjects();
55     virtual void Exec(Option_t *);
56     virtual void Terminate(Option_t *);
57
58     Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
59     Bool_t IsSecVtxOn() const { return TestBit(kIsSecVtxOn); };
60     Bool_t IsPriVtxOn() const { return TestBit(kIsPriVtxOn); };
61     Int_t IsSignalElectron(AliESDtrack *) const;
62     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
63     void SetPriVtxOn()        { SetBit(kIsPriVtxOn, kTRUE); };
64     void SetSecVtxOn()        { SetBit(kIsSecVtxOn, kTRUE); };
65     void SetPIDdetectors(Char_t *detectors){ fPIDdetectors = detectors; }
66     void AddPIDdetector(Char_t *detector);
67     void PrintStatus();
68  
69   private:
70     class LabelContainer{
71       public:
72         LabelContainer(Int_t capacity);
73         ~LabelContainer() {delete[] fContainer; };
74
75         Bool_t Append(Int_t label);
76         Bool_t Find(Int_t Label);
77         Int_t Next();
78         void ResetIterator(){ fCurrent = fBegin; }
79
80       private:
81         LabelContainer(const LabelContainer &);
82         LabelContainer &operator=(const LabelContainer &);
83         Int_t *fContainer;    // the Container for the labels
84         Int_t *fBegin;        // Pointer to the first entry
85         Int_t *fEnd;          // Pointer to the end of the container
86         Int_t *fLast;         // Pointer to the last entry
87         Int_t *fCurrent;      // Current entry to mimic an iterator
88     };
89     void MakeParticleContainer();
90     
91     ULong_t fQAlevel;                     // QA level
92     TString fPIDdetectors;                // Detectors for Particle Identification
93     AliESDEvent *fESD;                    //! The ESD Event
94     AliMCEvent *fMC;                      //! The MC Event
95     AliCFManager *fCFM;                   //! Correction Framework Manager
96     TList *fCorrelation;                  //! response matrix for unfolding  
97     THnSparseF *fPIDperformance;          //! info on contamination and yield of electron spectra
98     AliHFEpid *fPID;                      //! PID
99     AliHFEcuts *fCuts;                    //! Cut Collection
100     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
101     AliHFEmcQA *fMCQA;                    //! MC QA
102     TH1I *fNEvents;                       //! counter for the number of Events
103     TH1I *fNElectronTracksEvent;          //! Number of Electron candidates after PID decision per Event
104     TList *fQA;                           //! QA histos for the cuts
105     TList *fOutput;                       //! Container for Task Output
106     TList *fHistMCQA;                     //! Output container for MC QA histograms 
107     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
108
109     ClassDef(AliAnalysisTaskHFE, 1)       // The electron Analysis Task
110 };
111 #endif
112