#ifndef ALIHFEPID_H
#define ALIHFEPID_H
#ifndef ROOT_TNamed
#include <TNamed.h>
#endif
#ifndef ALIHFEPIDBASE_H
#include "AliHFEpidBase.h"
#endif
#include <climits>
class AliHFEcontainer;
class AliHFEvarManager;
class AliPIDResponse;
class AliHFEpidBase;
class AliVParticle;
class AliMCParticle;
class TList;
class AliHFEpid : public TNamed{
public:
enum{
kUndefined = UINT_MAX
};
enum EDETtype_t {
kMCpid = 0,
kBAYESpid = 1,
kITSpid = 2,
kTPCpid = 3,
kTRDpid = 4,
kTOFpid = 5,
kEMCALpid = 6,
kNdetectorPID = 7
};
AliHFEpid();
AliHFEpid(const Char_t *name);
AliHFEpid(const AliHFEpid &c);
AliHFEpid &operator=(const AliHFEpid &c);
void Copy(TObject &o) const;
~AliHFEpid();
Bool_t InitializePID(Int_t run = 0);
Bool_t IsSelected(const AliHFEpidObject * const track, AliHFEcontainer *cont = NULL, const Char_t *contname = "trackContainer", AliHFEpidQAmanager *qa = NULL);
Bool_t HasMCData() const { return TestBit(kHasMCData); };
void AddDetector(TString detector, UInt_t position);
void SetDetectorsForAnalysis(TString detectors);
void SetPIDResponse(const AliPIDResponse * const pid);
void SetVarManager(AliHFEvarManager *vm) { fVarManager = vm; }
void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData, hasMCdata); };
const AliPIDResponse *GetPIDResponse() const;
UInt_t GetNumberOfPIDdetectors() const { return fNPIDdetectors; }
Bool_t HasDetector(EDETtype_t det) const { return IsDetectorOn(det); }
Bool_t IsInitialized() const { return TestBit(kIsInit); }
void SortDetectors();
AliHFEpidBase *GetDetPID(EDETtype_t det) const { return det < kNdetectorPID ? fDetectorPID[det] : NULL; }
void PrintStatus() const;
const Char_t *SortedDetectorName(Int_t det) {
if(!TestBit(kDetectorsSorted)) SortDetectors();
if(det < kNdetectorPID) return fgkDetectorName[fSortedOrder[det]];
else return fgkDetectorName[kNdetectorPID];
}
void ConfigureTOF(Float_t TOFcut = 3.);
void ConfigureTPCasymmetric(Double_t pmin = 0.1, Double_t pmax = 20., Double_t sigmamin = -0.2, Double_t sigmamax = 5.);
void ConfigureTPCrejectionSimple();
void ConfigureTPCcentralityCut(Int_t centralityBin, const char *lowerCutParam = NULL, const Double_t * const params = NULL, Float_t upperTPCCut=3.0);
void ConfigureTPCdefaultCut(const char *lowerCutParam = NULL, const Double_t * const params = NULL, Float_t upperTPCCut=3.0);
void ConfigureBayesDetectorMask(Int_t detmask = 10);
void ConfigureBayesPIDThreshold(Float_t pidthres = 0.9);
protected:
Bool_t MakePidTpcTof(AliHFEpidObject *track);
private:
enum{
kHasMCData = BIT(14),
kIsInit = BIT(15),
kDetectorsSorted = BIT(16)
};
enum{
kCombinedTPCTRD=0
};
enum{
kTRDSignal = 0,
kITSSignal = 1
};
void AddCommonObject(TObject * const o);
void ClearCommonObjects();
void SwitchOnDetector(UInt_t det){
if(det < kNdetectorPID) SETBIT(fEnabledDetectors, det);
}
void SwitchOffDetector(UInt_t det){
if(det < kNdetectorPID) CLRBIT(fEnabledDetectors, det);
}
Bool_t IsDetectorOn(UInt_t det) const {
return det < kNdetectorPID ? TESTBIT(fEnabledDetectors, det): kFALSE;
}
void ConfigureTPCcut(Int_t centralityBin, const char *lowerCutParam, const Double_t * const params, Float_t upperTPCCut);
static const Char_t *fgkDetectorName[kNdetectorPID + 1];
AliHFEpidBase *fDetectorPID[kNdetectorPID];
UInt_t fDetectorOrder[kNdetectorPID];
UInt_t fSortedOrder[kNdetectorPID];
UInt_t fEnabledDetectors;
UInt_t fNPIDdetectors;
AliHFEvarManager *fVarManager;
TObjArray *fCommonObjects;
ClassDef(AliHFEpid, 1)
};
#endif