]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEpid.h
Update of hfe code
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpid.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// Steering class for electron identification
17// Combines detector PID objects
18// For more information please check the implementation file
19//
c2690925 20#ifndef ALIHFEPID_H
21#define ALIHFEPID_H
22
e3fc062d 23#ifndef ROOT_TNamed
24#include <TNamed.h>
809a4336 25#endif
26
722347d8 27#ifndef ALIHFEPIDBASE_H
28#include "AliHFEpidBase.h"
29#endif
30
e3fc062d 31#include <climits>
8c1c76e9 32//#include "AliPIDResponse.h"
e3fc062d 33
3a72645a 34class AliHFEcontainer;
3a72645a 35class AliHFEvarManager;
8c1c76e9 36class AliPIDResponse;
37class AliHFEpidBase;
809a4336 38class AliVParticle;
722347d8 39class AliMCParticle;
809a4336 40
41class TList;
42
e3fc062d 43class AliHFEpid : public TNamed{
50685501 44 public:
e3fc062d 45 enum{
46 kUndefined = UINT_MAX
47 };
3a72645a 48 enum EDETtype_t {
e3fc062d 49 kMCpid = 0,
8c1c76e9 50 kBAYESpid = 1,
e3fc062d 51 kITSpid = 2,
52 kTPCpid = 3,
53 kTRDpid = 4,
54 kTOFpid = 5,
e3ae862b 55 kEMCALpid = 6,
56 kNdetectorPID = 7
e3fc062d 57 };
809a4336 58 AliHFEpid();
e3fc062d 59 AliHFEpid(const Char_t *name);
809a4336 60 AliHFEpid(const AliHFEpid &c);
61 AliHFEpid &operator=(const AliHFEpid &c);
e3fc062d 62 void Copy(TObject &o) const;
809a4336 63 ~AliHFEpid();
64
8c1c76e9 65 Bool_t InitializePID(Int_t run = 0);
e156c3bb 66 Bool_t IsSelected(const AliHFEpidObject * const track, AliHFEcontainer *cont = NULL, const Char_t *contname = "trackContainer", AliHFEpidQAmanager *qa = NULL);
809a4336 67
809a4336 68 Bool_t HasMCData() const { return TestBit(kHasMCData); };
3a72645a 69
70 void AddDetector(TString detector, UInt_t position);
8c1c76e9 71 void SetPIDResponse(const AliPIDResponse * const pid);
3a72645a 72 void SetVarManager(AliHFEvarManager *vm) { fVarManager = vm; }
809a4336 73 void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData, hasMCdata); };
3a72645a 74
8c1c76e9 75 const AliPIDResponse *GetPIDResponse() const;
3a72645a 76 UInt_t GetNumberOfPIDdetectors() const { return fNPIDdetectors; }
77 Bool_t HasDetector(EDETtype_t det) const { return IsDetectorOn(det); }
8c1c76e9 78 Bool_t IsInitialized() const { return TestBit(kIsInit); }
79 void SortDetectors();
3a72645a 80 AliHFEpidBase *GetDetPID(EDETtype_t det) const { return det < kNdetectorPID ? fDetectorPID[det] : NULL; }
81
e3fc062d 82 void PrintStatus() const;
8c1c76e9 83 const Char_t *SortedDetectorName(Int_t det) {
84 if(!TestBit(kDetectorsSorted)) SortDetectors();
3a72645a 85 if(det < kNdetectorPID) return fgkDetectorName[fSortedOrder[det]];
6555e2ad 86 else return fgkDetectorName[kNdetectorPID];
3a72645a 87 }
88 //-----Configure PID detectors with predefined stettings------
e156c3bb 89 void ConfigureTOF(Float_t TOFcut = 3.);
3a72645a 90 void ConfigureTPCasymmetric(Double_t pmin = 0.1, Double_t pmax = 20., Double_t sigmamin = -0.2, Double_t sigmamax = 5.);
91 void ConfigureTPCrejectionSimple();
e156c3bb 92 void ConfigureTPCcentralityCut(Int_t centralityBin, const char *lowerCutParam = NULL, const Double_t * const params = NULL, Float_t upperTPCCut=3.0);
93 void ConfigureTPCdefaultCut(const char *lowerCutParam = NULL, const Double_t * const params = NULL, Float_t upperTPCCut=3.0);
8c1c76e9 94 void ConfigureBayesDetectorMask(Int_t detmask = 10);
95 void ConfigureBayesPIDThreshold(Float_t pidthres = 0.9);
3a72645a 96 //------------------------------------------------------------
809a4336 97
98 protected:
722347d8 99 Bool_t MakePidTpcTof(AliHFEpidObject *track);
809a4336 100 private:
50685501 101 enum{
8c1c76e9 102 kHasMCData = BIT(14),
103 kIsInit = BIT(15),
104 kDetectorsSorted = BIT(16)
50685501 105 };
50685501 106 enum{
107 kCombinedTPCTRD=0
108 };
109 enum{
110 kTRDSignal = 0,
111 kITSSignal = 1
112 };
faee3b18 113
114 void AddCommonObject(TObject * const o);
115 void ClearCommonObjects();
e3fc062d 116 //-----Switch on/off detectors in PID sequence------
117 void SwitchOnDetector(UInt_t det){
118 if(det < kNdetectorPID) SETBIT(fEnabledDetectors, det);
119 }
120 void SwitchOffDetector(UInt_t det){
121 if(det < kNdetectorPID) CLRBIT(fEnabledDetectors, det);
122 }
123 Bool_t IsDetectorOn(UInt_t det) const {
124 return det < kNdetectorPID ? TESTBIT(fEnabledDetectors, det): kFALSE;
125 }
126 //--------------------------------------------------
e156c3bb 127 void ConfigureTPCcut(Int_t centralityBin, const char *lowerCutParam, const Double_t * const params, Float_t upperTPCCut);
faee3b18 128
3a72645a 129 static const Char_t *fgkDetectorName[kNdetectorPID + 1]; // PID Detector Names
130 AliHFEpidBase *fDetectorPID[kNdetectorPID]; // Detector PID classes
131 UInt_t fDetectorOrder[kNdetectorPID]; // Position requested by the user
132 UInt_t fSortedOrder[kNdetectorPID]; // Sorted array of detectorIDs
133 UInt_t fEnabledDetectors; // Enabled Detectors
134 UInt_t fNPIDdetectors; // Number of PID detectors
135 AliHFEvarManager *fVarManager; //! HFE Var Manager
136 TObjArray *fCommonObjects; // Garbage Collector
809a4336 137
138 ClassDef(AliHFEpid, 1) // Steering class for Electron ID
139};
140
141#endif