]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpid.h
Possibility to keep only D mesons that have a c or b quark as a grandmother (Francesc...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpid.h
1 #ifndef ALIHFEPID_H
2 #define ALIHFEPID_H
3
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 *                                                                        *
7 * Author: The ALICE Off-line Project.                                    *
8 * Contributors are mentioned in the code where appropriate.              *
9 *                                                                        *
10 * Permission to use, copy, modify and distribute this software and its   *
11 * documentation strictly for non-commercial purposes is hereby granted   *
12 * without fee, provided that the above copyright notice appears in all   *
13 * copies and that both the copyright notice and this permission notice   *
14 * appear in the supporting documentation. The authors make no claims     *
15 * about the suitability of this software for any purpose. It is          *
16 * provided "as is" without express or implied warranty.                  *
17 **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
22 // Steering class for electron identification
23 // Combines detector PID objects
24 // For more information please check the implementation file
25 //
26 #ifndef ROOT_TNamed
27 #include <TNamed.h>
28 #endif
29
30 #ifndef ALIHFEPIDBASE_H
31 #include "AliHFEpidBase.h"
32 #endif
33
34 #include <climits>
35
36 class AliAODpidUtil;
37 class AliESDpid;
38 class AliHFEcontainer;
39 class AliHFEpidBase;
40 class AliHFEpidQAmanager;
41 class AliHFEvarManager;
42 class AliVParticle;
43 class AliMCParticle;
44
45 class TList;
46
47 class AliHFEpid : public TNamed{
48  public:
49     enum{
50       kUndefined = UINT_MAX 
51     };
52     enum EDETtype_t {
53       kMCpid = 0,
54       kESDpid = 1,
55       kITSpid = 2,
56       kTPCpid = 3,
57       kTRDpid = 4,
58       kTOFpid = 5,
59       kEMCALpid = 6,
60       kNdetectorPID = 7
61     };
62     AliHFEpid();
63     AliHFEpid(const Char_t *name);
64     AliHFEpid(const AliHFEpid &c);
65     AliHFEpid &operator=(const AliHFEpid &c);
66     void Copy(TObject &o) const;
67     ~AliHFEpid();
68     
69     Bool_t InitializePID();
70     Bool_t IsSelected(AliHFEpidObject *track, AliHFEcontainer *cont = NULL, const Char_t *contname = "trackContainer", AliHFEpidQAmanager *qa = NULL);
71
72     Bool_t HasMCData() const { return TestBit(kHasMCData); };
73
74     void AddDetector(TString detector, UInt_t position);
75     void SetESDpid(AliESDpid *pid);
76     void SetAODpid(AliAODpidUtil *pid);
77     void SetVarManager(AliHFEvarManager *vm) { fVarManager = vm; }
78     void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData, hasMCdata); };
79
80     UInt_t GetNumberOfPIDdetectors() const { return fNPIDdetectors; }
81     Bool_t HasDetector(EDETtype_t det) const { return IsDetectorOn(det); }
82     AliHFEpidBase *GetDetPID(EDETtype_t det) const { return det < kNdetectorPID ? fDetectorPID[det] : NULL; }
83
84     void PrintStatus() const;
85     const Char_t *SortedDetectorName(Int_t det) const {
86       if(det < kNdetectorPID) return fgkDetectorName[fSortedOrder[det]]; 
87       else return fgkDetectorName[kNdetectorPID];
88     }    
89     //-----Configure PID detectors with predefined stettings------
90     void ConfigureTPCasymmetric(Double_t pmin = 0.1, Double_t pmax = 20., Double_t sigmamin = -0.2, Double_t sigmamax = 5.);
91     void ConfigureTPCrejectionSimple();
92     void ConfigureTPCrejection(const char *lowerCutParam = NULL, Double_t *params = NULL);
93     void ConfigureTPCstrategyParis();
94     //------------------------------------------------------------
95
96   protected:
97     Bool_t MakePidTpcTof(AliHFEpidObject *track);
98
99   private:
100     enum{
101       kHasMCData = BIT(14)
102     };
103     enum{
104       kCombinedTPCTRD=0
105     };
106     enum{
107       kTRDSignal = 0,
108       kITSSignal = 1
109     };
110
111     void AddCommonObject(TObject * const o);
112     void ClearCommonObjects();
113     //-----Switch on/off detectors in PID sequence------
114     void SwitchOnDetector(UInt_t det){ 
115       if(det < kNdetectorPID) SETBIT(fEnabledDetectors, det);
116     }
117     void SwitchOffDetector(UInt_t det){
118       if(det < kNdetectorPID) CLRBIT(fEnabledDetectors, det);
119     }
120     Bool_t IsDetectorOn(UInt_t det) const {
121       return det < kNdetectorPID ? TESTBIT(fEnabledDetectors, det): kFALSE;
122     }
123     //--------------------------------------------------
124
125     static const Char_t *fgkDetectorName[kNdetectorPID + 1]; // PID Detector Names
126     AliHFEpidBase *fDetectorPID[kNdetectorPID];     //   Detector PID classes
127     UInt_t fDetectorOrder[kNdetectorPID];           //   Position requested by the user
128     UInt_t fSortedOrder[kNdetectorPID];             //   Sorted array of detectorIDs
129     UInt_t fEnabledDetectors;                       //   Enabled Detectors
130     UInt_t fNPIDdetectors;                          //   Number of PID detectors
131     AliHFEvarManager *fVarManager;                  //!  HFE Var Manager
132     TObjArray *fCommonObjects;                      //   Garbage Collector
133
134   ClassDef(AliHFEpid, 1)      // Steering class for Electron ID
135 };
136
137 #endif