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