Utility functions added (Markus)
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFE.h
CommitLineData
809a4336 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
dbe3abbe 18#ifndef ALIANALYSISTASK_H
809a4336 19#include "AliAnalysisTask.h"
dbe3abbe 20#endif
21
22#ifndef ROOT_THnSparse
23#include <THnSparse.h>
24#endif
809a4336 25
26class AliHFEpid;
27class AliHFEcuts;
259c3296 28class AliHFEmcQA;
29class AliHFEsecVtx;
809a4336 30class AliCFManager;
31class AliESDEvent;
32class AliESDtrackCuts;
33class AliMCEvent;
34class TH1I;
35class TList;
36
37class AliAnalysisTaskHFE : public AliAnalysisTask{
38 enum{
75d81601 39 kIsSecVtxOn = BIT(19),
6ad05e72 40 kIsPriVtxOn = BIT(20),
41 kIsRunningPostProcess = BIT(21)
809a4336 42 };
dbe3abbe 43 public:
75d81601 44 enum{
45 kPIDqa = 0,
46 kCUTqa = 1,
47 kMCqa = 2
48 };
dbe3abbe 49 AliAnalysisTaskHFE();
50 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
51 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
75d81601 52 virtual ~AliAnalysisTaskHFE();
809a4336 53
dbe3abbe 54 virtual void ConnectInputData(Option_t *);
55 virtual void CreateOutputObjects();
56 virtual void Exec(Option_t *);
57 virtual void Terminate(Option_t *);
809a4336 58
75d81601 59 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
259c3296 60 Bool_t IsSecVtxOn() const { return TestBit(kIsSecVtxOn); };
dbe3abbe 61 Bool_t IsPriVtxOn() const { return TestBit(kIsPriVtxOn); };
6ad05e72 62 Bool_t IsRunningPostProcess() const { return TestBit(kIsRunningPostProcess); };
78ea5ef4 63 Int_t IsSignalElectron(AliESDtrack *) const;
6ad05e72 64 void Load(TString filename = "HFEtask.root");
65 void PostProcess();
75d81601 66 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
6ad05e72 67 void SetPriVtxOn(Bool_t option = kTRUE) { SetBit(kIsPriVtxOn, option); };
68 void SetSecVtxOn(Bool_t option = kTRUE) { SetBit(kIsSecVtxOn, option); };
69 void SetRunPostProcess(Bool_t option = kTRUE) { SetBit(kIsRunningPostProcess, option); };
75d81601 70 void SetPIDdetectors(Char_t *detectors){ fPIDdetectors = detectors; }
71 void AddPIDdetector(Char_t *detector);
72 void PrintStatus();
dbe3abbe 73
dbe3abbe 74 private:
78ea5ef4 75 class LabelContainer{
76 public:
77 LabelContainer(Int_t capacity);
78 ~LabelContainer() {delete[] fContainer; };
79
80 Bool_t Append(Int_t label);
81 Bool_t Find(Int_t Label);
82 Int_t Next();
83 void ResetIterator(){ fCurrent = fBegin; }
84
85 private:
86 LabelContainer(const LabelContainer &);
87 LabelContainer &operator=(const LabelContainer &);
88 Int_t *fContainer; // the Container for the labels
89 Int_t *fBegin; // Pointer to the first entry
90 Int_t *fEnd; // Pointer to the end of the container
91 Int_t *fLast; // Pointer to the last entry
92 Int_t *fCurrent; // Current entry to mimic an iterator
93 };
809a4336 94 void MakeParticleContainer();
75d81601 95
96 ULong_t fQAlevel; // QA level
97 TString fPIDdetectors; // Detectors for Particle Identification
dbe3abbe 98 AliESDEvent *fESD; //! The ESD Event
99 AliMCEvent *fMC; //! The MC Event
100 AliCFManager *fCFM; //! Correction Framework Manager
78ea5ef4 101 TList *fCorrelation; //! response matrix for unfolding
102 THnSparseF *fPIDperformance; //! info on contamination and yield of electron spectra
dbe3abbe 103 AliHFEpid *fPID; //! PID
259c3296 104 AliHFEcuts *fCuts; //! Cut Collection
105 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
dbe3abbe 106 AliHFEmcQA *fMCQA; //! MC QA
107 TH1I *fNEvents; //! counter for the number of Events
75d81601 108 TH1I *fNElectronTracksEvent; //! Number of Electron candidates after PID decision per Event
dbe3abbe 109 TList *fQA; //! QA histos for the cuts
259c3296 110 TList *fOutput; //! Container for Task Output
111 TList *fHistMCQA; //! Output container for MC QA histograms
112 TList *fHistSECVTX; //! Output container for sec. vertexing results
809a4336 113
dbe3abbe 114 ClassDef(AliAnalysisTaskHFE, 1) // The electron Analysis Task
809a4336 115};
116#endif
dbe3abbe 117