]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEpidITS.cxx
Yvonne for the TPC-TOF MB pPb analysis
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidITS.cxx
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 // ITS PID class
17 // checks ITS PID based on ITS dE/dx truncated mean
18 //
19 // Authors: Matus Kalisky <matus.kalisky@cern.ch>
20 //          Markus Fasel <M.Fasel@gsi.de>
21 //
22 #include <TClass.h>
23 #include <TH2F.h>
24 #include <TList.h>
25 #include <TMath.h>
26 #include <TString.h>
27
28 //#include "AliAODTrack.h"
29 //#include "AliAODMCParticle.h"
30 #include "AliESDtrack.h"
31 #include "AliLog.h"
32 #include "AliPID.h"
33 #include "AliVParticle.h"
34 #include "AliPIDResponse.h"
35
36 #include "AliHFEdetPIDqa.h"
37 #include "AliHFEpidITS.h"
38 #include "AliHFEpidQAmanager.h"
39
40 ClassImp(AliHFEpidITS)
41
42 //___________________________________________________________________
43 AliHFEpidITS::AliHFEpidITS():
44   AliHFEpidBase()
45   , fNsigmaITS(3)
46   , fMeanShift(0)
47 {
48   //
49   // Constructor
50   //
51   
52
53
54 //___________________________________________________________________
55 AliHFEpidITS::AliHFEpidITS(const Char_t *name):
56   AliHFEpidBase(name)
57   , fNsigmaITS(3)
58   , fMeanShift(0)
59 {
60   //
61   // Default constructor
62   //
63 }
64
65 //___________________________________________________________________
66 AliHFEpidITS::AliHFEpidITS(const AliHFEpidITS &ref):
67   AliHFEpidBase("")
68   , fNsigmaITS(ref.fNsigmaITS)
69   , fMeanShift(ref.fMeanShift)
70 {
71   //
72   // Copy constructor
73   //
74   ref.Copy(*this);
75 }
76
77 //___________________________________________________________________
78 AliHFEpidITS &AliHFEpidITS::operator=(const AliHFEpidITS &ref){
79   //
80   // Assignment operator
81   //
82   if(this != &ref) ref.Copy(*this);
83   return *this;
84 }
85
86 //___________________________________________________________________
87 AliHFEpidITS::~AliHFEpidITS(){
88   //
89   // Destructor
90   //
91 }
92
93 //___________________________________________________________________
94 void AliHFEpidITS::Copy(TObject &ref) const {
95   //
96   // Copy function
97   // Provides a deep copy
98     //
99     AliHFEpidITS &target = dynamic_cast<AliHFEpidITS &>(ref);
100
101     target.fNsigmaITS = fNsigmaITS;
102     target.fMeanShift = fMeanShift;
103     AliHFEpidBase::Copy(ref);
104 }
105
106 //___________________________________________________________________
107 Bool_t AliHFEpidITS::InitializePID(Int_t /*run*/){
108   //
109   // ITS PID initialization
110   //
111   return kTRUE;
112 }
113
114
115 //___________________________________________________________________
116 Int_t AliHFEpidITS::IsSelected(const AliHFEpidObject* track, AliHFEpidQAmanager* pidqa) const {
117   //
118   // Does PID decision for ITS
119   //
120     if(!fkPIDResponse) return 0;
121     AliDebug(2, "PID object available");
122
123     const AliVTrack *vtrack = dynamic_cast<const AliVTrack *>(track->GetRecTrack());
124     if(!vtrack) return 0;
125
126     if(pidqa) pidqa->ProcessTrack(track, AliHFEpid::kITSpid, AliHFEdetPIDqa::kBeforePID);
127     
128     // Fill before selection
129     Int_t pdg = 0;
130     Double_t sigEle = GetITSNsigmaCorrected(vtrack);
131     AliDebug(2, Form("Number of sigmas in ITS: %f", sigEle));
132     if(TMath::Abs(sigEle) < fNsigmaITS) pdg = 11;
133     if(pdg == 11 && pidqa) pidqa->ProcessTrack(track, AliHFEpid::kITSpid, AliHFEdetPIDqa::kAfterPID);
134     return pdg;
135 //  return 11;  // @TODO: Implement ITS PID decision
136 }
137
138 //___________________________________________________________________
139 Double_t AliHFEpidITS::GetITSNsigmaCorrected(const AliVTrack *track) const {
140   //
141   // Get the ITS number of sigmas corrected for a possible shift of the mean dE/dx
142   //
143   return fkPIDResponse->NumberOfSigmasITS(track, AliPID::kElectron) - fMeanShift;
144 }