1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // Task for Heavy Flavour Electron Analysis
17 // Fills a single-inclusive electron pt-spectrum
18 // For further information see implementation file
20 #ifndef ALIANALYSISTASKHFE_H
21 #define ALIANALYSISTASKHFE_H
23 #ifndef ALIANALYSISTASKSE_H
24 #include "AliAnalysisTaskSE.h"
27 #ifndef ROOT_THnSparse
28 #include <THnSparse.h>
35 class AliHFEelecbackground;
36 class AliHFEcollection;
44 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
53 kIsElecBackGround = 2,
57 AliAnalysisTaskHFE(const char * name);
58 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
59 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
60 virtual ~AliAnalysisTaskHFE();
62 virtual void UserCreateOutputObjects();
63 virtual void UserExec(Option_t *);
64 virtual void Terminate(Option_t *);
66 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
67 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
68 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
69 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
70 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
71 Int_t IsSignalElectron(AliVParticle *fTrack) const;
72 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
73 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
74 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
75 void SwitchOnPlugin(Int_t plug);
76 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
77 void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
78 void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
79 void AddPIDdetector(TString detector);
80 void SetTPCBetheBlochParameters(Double_t *pars);
81 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
82 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
83 void PrintStatus() const;
88 kAODanalysis = BIT(20)
92 LabelContainer(Int_t capacity);
93 ~LabelContainer() {delete[] fContainer; };
95 Bool_t Append(Int_t label);
96 Bool_t Find(Int_t Label) const;
98 void ResetIterator(){ fCurrent = fBegin; }
101 LabelContainer(const LabelContainer &);
102 LabelContainer &operator=(const LabelContainer &);
103 Int_t *fContainer; // the Container for the labels
104 Int_t *fBegin; // Pointer to the first entry
105 Int_t *fEnd; // Pointer to the end of the container
106 Int_t *fLast; // Pointer to the last entry
107 Int_t *fCurrent; // Current entry to mimic an iterator
109 void MakeParticleContainer();
110 void MakeEventContainer();
114 Bool_t ProcessMCtrack(AliVParticle *track);
115 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen);
117 ULong_t fQAlevel; // QA level
118 TString fPIDdetectors; // Detectors for Particle Identification
119 UInt_t fPIDstrategy; // PID Strategy
120 Double_t fTPCBetheBlochParameters[5]; // TPC Bethe-Bloch Parameters
121 UShort_t fPlugins; // Enabled Plugins
122 AliCFManager *fCFM; //! Correction Framework Manager
123 TList *fCorrelation; //! response matrix for unfolding
124 THnSparseF *fPIDperformance; //! info on contamination and yield of electron spectra
125 THnSparseF *fSignalToBackgroundMC; //! Signal To Background Studies on pure MC information
126 AliHFEpid *fPID; //! PID
127 AliHFEcuts *fCuts; // Cut Collection
128 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
129 AliHFEelecbackground *fElecBackGround;//! Background analysis
130 AliHFEmcQA *fMCQA; //! MC QA
131 TH1I *fNEvents; //! counter for the number of Events
132 TH1I *fNElectronTracksEvent; //! Number of Electron candidates after PID decision per Event
133 TList *fQA; //! QA histos for the cuts
134 TList *fOutput; //! Container for Task Output
135 TList *fHistMCQA; //! Output container for MC QA histograms
136 TList *fHistSECVTX; //! Output container for sec. vertexing results
137 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
138 // AliHFEcollection *fQAcoll; //! collection class for basic QA histograms
140 ClassDef(AliAnalysisTaskHFE, 1) // The electron Analysis Task