]>
Commit | Line | Data |
---|---|---|
809a4336 | 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 | **************************************************************************/ | |
50685501 | 15 | // |
16 | // Class for TOF PID | |
17 | // Implements the abstract base class AliHFEpidBase | |
18 | // IsInitialized() does the PID decision | |
19 | // | |
20 | // Authors: | |
21 | // Markus Fasel <M.Fasel@gsi.de> | |
22 | // Matus Kalisky <matus.kalisky@cern.ch> (contact) | |
23 | // | |
809a4336 | 24 | |
809a4336 | 25 | #include <TMath.h> |
26 | ||
722347d8 | 27 | #include "AliAODTrack.h" |
809a4336 | 28 | #include "AliESDtrack.h" |
809a4336 | 29 | #include "AliPID.h" |
8c1c76e9 | 30 | #include "AliPIDResponse.h" |
809a4336 | 31 | |
3a72645a | 32 | #include "AliHFEdetPIDqa.h" |
809a4336 | 33 | #include "AliHFEpidTOF.h" |
3a72645a | 34 | #include "AliHFEpidQAmanager.h" |
809a4336 | 35 | |
36 | ||
37 | ClassImp(AliHFEpidTOF) | |
3a72645a | 38 | |
39 | //___________________________________________________________________ | |
40 | AliHFEpidTOF::AliHFEpidTOF(): | |
41 | AliHFEpidBase() | |
3a72645a | 42 | , fNsigmaTOF(3) |
43 | { | |
44 | // | |
45 | // Constructor | |
46 | // | |
47 | } | |
48 | ||
809a4336 | 49 | //___________________________________________________________________ |
50 | AliHFEpidTOF::AliHFEpidTOF(const Char_t *name): | |
51 | AliHFEpidBase(name) | |
9bcfd1ab | 52 | , fNsigmaTOF(3) |
809a4336 | 53 | { |
54 | // | |
55 | // Constructor | |
56 | // | |
57 | } | |
3a72645a | 58 | |
809a4336 | 59 | //___________________________________________________________________ |
60 | AliHFEpidTOF::AliHFEpidTOF(const AliHFEpidTOF &c): | |
61 | AliHFEpidBase("") | |
9bcfd1ab | 62 | , fNsigmaTOF(3) |
809a4336 | 63 | { |
64 | // | |
65 | // Copy operator | |
66 | // | |
67 | ||
68 | c.Copy(*this); | |
69 | } | |
70 | //___________________________________________________________________ | |
71 | AliHFEpidTOF &AliHFEpidTOF::operator=(const AliHFEpidTOF &ref){ | |
72 | // | |
73 | // Assignment operator | |
74 | // | |
75 | ||
76 | if(this != &ref){ | |
77 | ref.Copy(*this); | |
78 | } | |
79 | ||
80 | return *this; | |
81 | } | |
82 | //___________________________________________________________________ | |
83 | AliHFEpidTOF::~AliHFEpidTOF(){ | |
84 | // | |
85 | // Destructor | |
86 | // | |
809a4336 | 87 | } |
88 | //___________________________________________________________________ | |
89 | void AliHFEpidTOF::Copy(TObject &ref) const { | |
90 | // | |
91 | // Performs the copying of the object | |
92 | // | |
93 | AliHFEpidTOF &target = dynamic_cast<AliHFEpidTOF &>(ref); | |
94 | ||
e3fc062d | 95 | target.fNsigmaTOF = fNsigmaTOF; |
809a4336 | 96 | |
97 | AliHFEpidBase::Copy(ref); | |
98 | } | |
99 | //___________________________________________________________________ | |
8c1c76e9 | 100 | Bool_t AliHFEpidTOF::InitializePID(Int_t /*run*/){ |
809a4336 | 101 | // |
102 | // InitializePID: TOF experts have to implement code here | |
103 | // | |
104 | return kTRUE; | |
105 | } | |
106 | ||
107 | //___________________________________________________________________ | |
6555e2ad | 108 | Int_t AliHFEpidTOF::IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const |
809a4336 | 109 | { |
faee3b18 | 110 | // |
111 | // TOF PID based on n-Sigma cut | |
112 | // Selects Protons and Kaons via n-sigma cut up to 3 GeV/c | |
113 | // In addition histos for n-sigma before (all species) and after (only closest species) are filled | |
114 | // | |
8c1c76e9 | 115 | if(!fkPIDResponse) return 0; |
3a72645a | 116 | AliDebug(2, "PID object available"); |
e3fc062d | 117 | |
bf892a6a | 118 | const AliVTrack *vtrack = dynamic_cast<const AliVTrack *>(track->GetRecTrack()); |
ccc37cdc | 119 | if(!(vtrack && (vtrack->GetStatus() & AliESDtrack::kTOFpid))) return 0; |
3a72645a | 120 | AliDebug(2, "Track Has TOF PID"); |
121 | ||
122 | if(pidqa) pidqa->ProcessTrack(track, AliHFEpid::kTOFpid, AliHFEdetPIDqa::kBeforePID); | |
faee3b18 | 123 | |
124 | // Fill before selection | |
8c1c76e9 | 125 | Double_t sigEle = fkPIDResponse->NumberOfSigmasTOF(track->GetRecTrack(), AliPID::kElectron); |
3a72645a | 126 | AliDebug(2, Form("Number of sigmas in TOF: %f", sigEle)); |
faee3b18 | 127 | Int_t pdg = 0; |
3a72645a | 128 | if(TMath::Abs(sigEle) < fNsigmaTOF){ |
faee3b18 | 129 | pdg = 11; |
3a72645a | 130 | if(pidqa) pidqa->ProcessTrack(track, AliHFEpid::kTOFpid, AliHFEdetPIDqa::kAfterPID); |
faee3b18 | 131 | } |
132 | ||
133 | return pdg; | |
134 | } | |
722347d8 | 135 |