]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpid.h
Corrections for Coverity warnings
[u/mrichter/AliRoot.git] / PWG3 / 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
33 class AliAODpidUtil;
34 class AliESDpid;
35 class AliHFEcontainer;
36 class AliHFEpidBase;
37 class AliHFEpidQAmanager;
38 class AliHFEvarManager;
39 class AliVParticle;
40 class AliMCParticle;
41
42 class TList;
43
44 class AliHFEpid : public TNamed{
45  public:
46     enum{
47       kUndefined = UINT_MAX 
48     };
49     enum EDETtype_t {
50       kMCpid = 0,
51       kESDpid = 1,
52       kITSpid = 2,
53       kTPCpid = 3,
54       kTRDpid = 4,
55       kTOFpid = 5,
56       kEMCALpid = 6,
57       kNdetectorPID = 7
58     };
59     AliHFEpid();
60     AliHFEpid(const Char_t *name);
61     AliHFEpid(const AliHFEpid &c);
62     AliHFEpid &operator=(const AliHFEpid &c);
63     void Copy(TObject &o) const;
64     ~AliHFEpid();
65     
66     Bool_t InitializePID();
67     Bool_t IsSelected(AliHFEpidObject *track, AliHFEcontainer *cont = NULL, const Char_t *contname = "trackContainer", AliHFEpidQAmanager *qa = NULL);
68
69     Bool_t HasMCData() const { return TestBit(kHasMCData); };
70
71     void AddDetector(TString detector, UInt_t position);
72     void SetESDpid(AliESDpid *pid);
73     void SetAODpid(AliAODpidUtil *pid);
74     void SetVarManager(AliHFEvarManager *vm) { fVarManager = vm; }
75     void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData, hasMCdata); };
76
77     UInt_t GetNumberOfPIDdetectors() const { return fNPIDdetectors; }
78     Bool_t HasDetector(EDETtype_t det) const { return IsDetectorOn(det); }
79     AliHFEpidBase *GetDetPID(EDETtype_t det) const { return det < kNdetectorPID ? fDetectorPID[det] : NULL; }
80
81     void PrintStatus() const;
82     const Char_t *SortedDetectorName(Int_t det) const {
83       if(det < kNdetectorPID) return fgkDetectorName[fSortedOrder[det]]; 
84       else return fgkDetectorName[kNdetectorPID];
85     }    
86     //-----Configure PID detectors with predefined stettings------
87     void ConfigureTPCasymmetric(Double_t pmin = 0.1, Double_t pmax = 20., Double_t sigmamin = -0.2, Double_t sigmamax = 5.);
88     void ConfigureTPCrejectionSimple();
89     void ConfigureTPCrejection(const char *lowerCutParam = NULL, Double_t *params = NULL);
90     void ConfigureTPCstrategyParis();
91     //------------------------------------------------------------
92
93   protected:
94     Bool_t MakePidTpcTof(AliHFEpidObject *track);
95
96   private:
97     enum{
98       kHasMCData = BIT(14)
99     };
100     enum{
101       kCombinedTPCTRD=0
102     };
103     enum{
104       kTRDSignal = 0,
105       kITSSignal = 1
106     };
107
108     void AddCommonObject(TObject * const o);
109     void ClearCommonObjects();
110     //-----Switch on/off detectors in PID sequence------
111     void SwitchOnDetector(UInt_t det){ 
112       if(det < kNdetectorPID) SETBIT(fEnabledDetectors, det);
113     }
114     void SwitchOffDetector(UInt_t det){
115       if(det < kNdetectorPID) CLRBIT(fEnabledDetectors, det);
116     }
117     Bool_t IsDetectorOn(UInt_t det) const {
118       return det < kNdetectorPID ? TESTBIT(fEnabledDetectors, det): kFALSE;
119     }
120     //--------------------------------------------------
121
122     static const Char_t *fgkDetectorName[kNdetectorPID + 1]; // PID Detector Names
123     AliHFEpidBase *fDetectorPID[kNdetectorPID];     //   Detector PID classes
124     UInt_t fDetectorOrder[kNdetectorPID];           //   Position requested by the user
125     UInt_t fSortedOrder[kNdetectorPID];             //   Sorted array of detectorIDs
126     UInt_t fEnabledDetectors;                       //   Enabled Detectors
127     UInt_t fNPIDdetectors;                          //   Number of PID detectors
128     AliHFEvarManager *fVarManager;                  //!  HFE Var Manager
129     TObjArray *fCommonObjects;                      //   Garbage Collector
130
131   ClassDef(AliHFEpid, 1)      // Steering class for Electron ID
132 };
133
134 #endif