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