]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEpidITS.cxx
Fix of sigmaZ for crossing tracklets from Alex
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidITS.cxx
CommitLineData
e8a6457a 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// 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//
722347d8 22#include <TClass.h>
e8a6457a 23#include <TH2F.h>
24#include <TList.h>
25#include <TMath.h>
722347d8 26#include <TString.h>
e8a6457a 27
50685501 28//#include "AliAODTrack.h"
29//#include "AliAODMCParticle.h"
e8a6457a 30#include "AliESDtrack.h"
31#include "AliLog.h"
32#include "AliPID.h"
33#include "AliVParticle.h"
4437a0d2 34#include "AliPIDResponse.h"
e8a6457a 35
4437a0d2 36#include "AliHFEdetPIDqa.h"
e8a6457a 37#include "AliHFEpidITS.h"
4437a0d2 38#include "AliHFEpidQAmanager.h"
e8a6457a 39
3a72645a 40ClassImp(AliHFEpidITS)
41
4437a0d2 42//___________________________________________________________________
43AliHFEpidITS::AliHFEpidITS():
44 AliHFEpidBase()
45 , fNsigmaITS(3)
f06b970d 46 , fMeanShift(0)
4437a0d2 47{
48 //
49 // Constructor
50 //
51
52}
53
e8a6457a 54//___________________________________________________________________
55AliHFEpidITS::AliHFEpidITS(const Char_t *name):
f06b970d 56 AliHFEpidBase(name)
57 , fNsigmaITS(3)
58 , fMeanShift(0)
e8a6457a 59{
60 //
61 // Default constructor
62 //
63}
64
65//___________________________________________________________________
66AliHFEpidITS::AliHFEpidITS(const AliHFEpidITS &ref):
f06b970d 67 AliHFEpidBase("")
68 , fNsigmaITS(ref.fNsigmaITS)
69 , fMeanShift(ref.fMeanShift)
e8a6457a 70{
71 //
72 // Copy constructor
73 //
74 ref.Copy(*this);
75}
76
77//___________________________________________________________________
78AliHFEpidITS &AliHFEpidITS::operator=(const AliHFEpidITS &ref){
79 //
80 // Assignment operator
81 //
82 if(this != &ref) ref.Copy(*this);
83 return *this;
84}
85
86//___________________________________________________________________
87AliHFEpidITS::~AliHFEpidITS(){
88 //
89 // Destructor
90 //
e8a6457a 91}
92
93//___________________________________________________________________
4437a0d2 94void AliHFEpidITS::Copy(TObject &ref) const {
e8a6457a 95 //
96 // Copy function
97 // Provides a deep copy
4437a0d2 98 //
99 AliHFEpidITS &target = dynamic_cast<AliHFEpidITS &>(ref);
100
101 target.fNsigmaITS = fNsigmaITS;
f06b970d 102 target.fMeanShift = fMeanShift;
4437a0d2 103 AliHFEpidBase::Copy(ref);
e8a6457a 104}
105
106//___________________________________________________________________
8c1c76e9 107Bool_t AliHFEpidITS::InitializePID(Int_t /*run*/){
e8a6457a 108 //
109 // ITS PID initialization
110 //
111 return kTRUE;
112}
113
114
115//___________________________________________________________________
4437a0d2 116Int_t AliHFEpidITS::IsSelected(const AliHFEpidObject* track, AliHFEpidQAmanager* pidqa) const {
e8a6457a 117 //
118 // Does PID decision for ITS
4437a0d2 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;
f06b970d 130 Double_t sigEle = GetITSNsigmaCorrected(vtrack);
4437a0d2 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
e8a6457a 136}
137
138//___________________________________________________________________
f06b970d 139Double_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;
e8a6457a 144}