]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliAnalysisTaskHFE.h
extra check on pointer
[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**************************************************************************/
50685501 15//
16// Task for Heavy Flavour Electron Analysis
17// Fills a single-inclusive electron pt-spectrum
18// For further information see implementation file
19//
809a4336 20#ifndef ALIANALYSISTASKHFE_H
21#define ALIANALYSISTASKHFE_H
22
d2af20c5 23#ifndef ALIANALYSISTASKSE_H
24#include "AliAnalysisTaskSE.h"
dbe3abbe 25#endif
26
27#ifndef ROOT_THnSparse
28#include <THnSparse.h>
29#endif
809a4336 30
31class AliHFEpid;
32class AliHFEcuts;
259c3296 33class AliHFEmcQA;
34class AliHFEsecVtx;
9bcfd1ab 35class AliHFEelecbackground;
36class AliHFEcollection;
809a4336 37class AliCFManager;
9bcfd1ab 38class AliVEvent;
809a4336 39class AliMCEvent;
722347d8 40class AliVParticle;
809a4336 41class TH1I;
42class TList;
43
d2af20c5 44class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
dbe3abbe 45 public:
9bcfd1ab 46 enum{
47 kPIDqa = 0,
48 kMCqa =1
49 };
50 enum{
51 kPriVtx = 0,
52 kSecVtx = 1,
53 kIsElecBackGround = 2,
54 kPostProcess = 3
55 };
dbe3abbe 56 AliAnalysisTaskHFE();
0792aa82 57 AliAnalysisTaskHFE(const char * name);
dbe3abbe 58 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
59 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
75d81601 60 virtual ~AliAnalysisTaskHFE();
809a4336 61
d2af20c5 62 virtual void UserCreateOutputObjects();
63 virtual void UserExec(Option_t *);
dbe3abbe 64 virtual void Terminate(Option_t *);
809a4336 65
75d81601 66 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
9bcfd1ab 67 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
68 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
722347d8 69 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
9bcfd1ab 70 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
722347d8 71 Int_t IsSignalElectron(AliVParticle *fTrack) const;
722347d8 72 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
75d81601 73 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
9bcfd1ab 74 void SwitchOnPlugin(Int_t plug);
722347d8 75 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
50685501 76 void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
0792aa82 77 void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
75d81601 78 void AddPIDdetector(Char_t *detector);
9bcfd1ab 79 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
80 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
50685501 81 void PrintStatus() const;
82 Float_t GetRapidity(TParticle *part) const;
dbe3abbe 83
dbe3abbe 84 private:
50685501 85 enum{
9bcfd1ab 86 kHasMCdata = BIT(19),
87 kAODanalysis = BIT(20)
50685501 88 };
78ea5ef4 89 class LabelContainer{
90 public:
91 LabelContainer(Int_t capacity);
92 ~LabelContainer() {delete[] fContainer; };
93
94 Bool_t Append(Int_t label);
50685501 95 Bool_t Find(Int_t Label) const;
78ea5ef4 96 Int_t Next();
97 void ResetIterator(){ fCurrent = fBegin; }
98
99 private:
100 LabelContainer(const LabelContainer &);
101 LabelContainer &operator=(const LabelContainer &);
102 Int_t *fContainer; // the Container for the labels
103 Int_t *fBegin; // Pointer to the first entry
104 Int_t *fEnd; // Pointer to the end of the container
105 Int_t *fLast; // Pointer to the last entry
106 Int_t *fCurrent; // Current entry to mimic an iterator
107 };
809a4336 108 void MakeParticleContainer();
9bcfd1ab 109 void ProcessMC();
110 void ProcessESD();
111 void ProcessAOD();
112 Bool_t ProcessMCtrack(AliVParticle *track);
113 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen);
75d81601 114
115 ULong_t fQAlevel; // QA level
116 TString fPIDdetectors; // Detectors for Particle Identification
0792aa82 117 UInt_t fPIDstrategy; // PID Strategy
9bcfd1ab 118 UShort_t fPlugins; // Enabled Plugins
dbe3abbe 119 AliCFManager *fCFM; //! Correction Framework Manager
78ea5ef4 120 TList *fCorrelation; //! response matrix for unfolding
121 THnSparseF *fPIDperformance; //! info on contamination and yield of electron spectra
9bcfd1ab 122 THnSparseF *fSignalToBackgroundMC; //! Signal To Background Studies on pure MC information
dbe3abbe 123 AliHFEpid *fPID; //! PID
722347d8 124 AliHFEcuts *fCuts; // Cut Collection
259c3296 125 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
9bcfd1ab 126 AliHFEelecbackground *fElecBackGround;//! Background analysis
dbe3abbe 127 AliHFEmcQA *fMCQA; //! MC QA
128 TH1I *fNEvents; //! counter for the number of Events
75d81601 129 TH1I *fNElectronTracksEvent; //! Number of Electron candidates after PID decision per Event
dbe3abbe 130 TList *fQA; //! QA histos for the cuts
259c3296 131 TList *fOutput; //! Container for Task Output
132 TList *fHistMCQA; //! Output container for MC QA histograms
133 TList *fHistSECVTX; //! Output container for sec. vertexing results
9bcfd1ab 134 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
135// AliHFEcollection *fQAcoll; //! collection class for basic QA histograms
809a4336 136
dbe3abbe 137 ClassDef(AliAnalysisTaskHFE, 1) // The electron Analysis Task
809a4336 138};
139#endif
dbe3abbe 140