]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CORRFW/AliCFTrackCutPid.h
some cleanup
[u/mrichter/AliRoot.git] / CORRFW / AliCFTrackCutPid.h
CommitLineData
563113d0 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//
17// author : A. Mastroserio
18//
19
20#ifndef ALICFTRACKCUTPID_H
21#define ALICFTRACKCUTPID_H
22
23#include "AliCFCutBase.h"
24#include "AliPID.h"
25#include "AliESDtrack.h"
26#include <TString.h>
27#include <TObject.h>
28#include <TH1F.h>
29#include <TF1.h>
30//__________________________________________________________________________________
31// CUT ON TRACK PID
32//__________________________________________________________________________________
33class AliESDtrack;
34
35class AliCFTrackCutPid : public AliCFCutBase
36{
37 public :
38 AliCFTrackCutPid() ;
39 AliCFTrackCutPid(const Char_t* name, const Char_t* title) ;
40 AliCFTrackCutPid(const AliCFTrackCutPid& c) ;
41 AliCFTrackCutPid& operator=(const AliCFTrackCutPid& c) ;
42
43 virtual ~AliCFTrackCutPid();
44
45 enum EDetType {kITS = 0, kTPC, kTRD, kTOF, kHMPID=4, kNoDet=-11};
46 enum EDetNum {kNdets=5};
47 enum ENoId {kCheckProb = -10, kCheckResp = -11, kDetRestr = -12};
48
49 // Setters
50
51 void SetDetectors(TString dets);
52 void SetPriors(Double_t r[AliPID::kSPECIES]);
53 void SetProbabilityCut(Double_t cut) {fCut=cut;}
54 void SetParticleType(Int_t iType, Bool_t tocombine) {fgParticleType=iType; fgIsComb=tocombine;}
55 void SetMinDiffResp(Bool_t check, Double_t mindiff) {fCheckResponse=check; fMinDiffResponse=mindiff;}
56 void SetMinDiffProb(Bool_t check, Double_t mindiff) {fCheckSelection=check; fMinDiffProbability=mindiff;}
57 void SetPriorFunctions(TF1 *func[AliPID::kSPECIES]);
58 void SetANDstatus(TString dets);
59 void SetDetectorProbabilityRestriction(TString det, Int_t iPart, Double_t upperprob);
60 void SetHistogramAxis(Int_t nbins, Double_t xmin, Double_t xmax) {fNbins=nbins; fXmin = xmin; fXmax = xmax;}
61
62 //loads the track detector responses and the track status
63 void TrackInfo(const AliESDtrack *pTrk,ULong_t status[kNdets+1], Double_t pid[kNdets+1][AliPID::kSPECIES]) const;
64
65 //identifies the track
66 Int_t Identify(Double_t pid[AliPID::kSPECIES]) const;
67
68 //identifies the track filling the QA histograms
69 Int_t IdentifyQA(const Double_t pid[AliPID::kSPECIES],Int_t idets) const;
70
71 //returns the track identification number
72 Int_t GetID(ULong_t status[kNdets+1], Double_t pid[kNdets+1][AliPID::kSPECIES]) const;
73
74 //main
75 virtual Bool_t IsSelected(TObject *track);
76
77 //histo booking
78 void Init();
79
80 //histos are added to a list
81 void AddQAHistograms(TList *qalist) const;
82
83
84 private:
85 void SetPPriors(AliESDtrack *pTrk);
86 ULong_t StatusForAND(ULong_t status[kNdets+1]) const; //
87 void InitialiseHisto();
88 void DefineHistograms();
89 Bool_t Check(const Double_t *p, Int_t iPsel, Double_t minDiff) const;
90 void CombPID(ULong_t status[kNdets+1],Double_t pid[kNdets+1][AliPID::kSPECIES],Double_t *combpid) const;
91
92 Double_t fCut; //probability cut
93 Double_t fMinDiffResponse; // minimum difference between detector resposes
94 Double_t fMinDiffProbability; // minimum difference between probability values
95 Int_t fgParticleType; // requested particle type
96 Bool_t fgIsComb; // flag for the combined pid
97 Bool_t fCheckResponse; // flag to check the minimum difference of det responsess
98 Bool_t fCheckSelection; // flag to check the minimum difference of probabilities
99 Bool_t fIsPpriors; //flag for momentum dependent priors
100 Bool_t fIsDetAND; //flag for AND with multiple detectors
101 Double_t fXmin; //x min QA histo
102 Double_t fXmax; //x max QA histo
103 Int_t fNbins; //n bins QA histo
104 Int_t fDetRestr; //id of the detector for the restriction
105 Int_t fiPartRestr; //id of the particle for the restriction
106 Double_t fDetProbRestr; //probability restriction value
107
108 Double_t fPriors[AliPID::kSPECIES]; //a priori concentrations
109 TF1 *fPriorsFunc[AliPID::kSPECIES]; //momentum dependent priors
110 Bool_t fDets[kNdets]; //boolean(s) corresponding to the chosen detector(s)
111 Bool_t fDetsInAnd[kNdets]; //detector to be in AND for the combined PID
112 TH1F *fhResp[kNdets][AliPID::kSPECIES]; //QA histo
113 TH1F *fhProb[kNdets][AliPID::kSPECIES]; //QA histo
114 TH1F *fhCombResp[AliPID::kSPECIES]; //QA histo
115 TH1F *fhCombProb[AliPID::kSPECIES]; //QA histo
116
117 ClassDef(AliCFTrackCutPid,1);
118};
119#endif
120