]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEpidITS.cxx
Updates for TRD HFE analysis
[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"
34
35#include "AliHFEpidITS.h"
36
3a72645a 37ClassImp(AliHFEpidITS)
38
e8a6457a 39//___________________________________________________________________
40AliHFEpidITS::AliHFEpidITS(const Char_t *name):
41 AliHFEpidBase(name)
e8a6457a 42{
43 //
44 // Default constructor
45 //
46}
47
48//___________________________________________________________________
49AliHFEpidITS::AliHFEpidITS(const AliHFEpidITS &ref):
50 AliHFEpidBase("")
e8a6457a 51{
52 //
53 // Copy constructor
54 //
55 ref.Copy(*this);
56}
57
58//___________________________________________________________________
59AliHFEpidITS &AliHFEpidITS::operator=(const AliHFEpidITS &ref){
60 //
61 // Assignment operator
62 //
63 if(this != &ref) ref.Copy(*this);
64 return *this;
65}
66
67//___________________________________________________________________
68AliHFEpidITS::~AliHFEpidITS(){
69 //
70 // Destructor
71 //
e8a6457a 72}
73
74//___________________________________________________________________
75void AliHFEpidITS::Copy(TObject &o) const {
76 //
77 // Copy function
78 // Provides a deep copy
79 //
3a72645a 80 AliHFEpidBase::Copy(o);
e8a6457a 81}
82
83//___________________________________________________________________
8c1c76e9 84Bool_t AliHFEpidITS::InitializePID(Int_t /*run*/){
e8a6457a 85 //
86 // ITS PID initialization
87 //
88 return kTRUE;
89}
90
91
92//___________________________________________________________________
6555e2ad 93Int_t AliHFEpidITS::IsSelected(const AliHFEpidObject* /*track*/, AliHFEpidQAmanager* /*pidqa*/) const {
e8a6457a 94 //
95 // Does PID decision for ITS
96 //
97 return 11; // @TODO: Implement ITS PID decision
98}
99
100//___________________________________________________________________
3a72645a 101Double_t AliHFEpidITS::GetITSSignalV1(AliVParticle *vtrack){
e8a6457a 102 //
103 // Calculate the ITS signal according to the mean charge of the clusters
104 //
3a72645a 105 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
722347d8 106 AliError("PID for AODs not implemented yet");
107 return 0.;
108 }
109 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
bf892a6a 110 if(!track) return 0.;
e8a6457a 111 Double_t signal = 0.;
112#ifdef TRUNK
113 Double_t dedx[4];
114 track->GetITSdEdxSamples(dedx);
115 signal = TMath::Mean(4, dedx);
116#else
117 signal = track->GetITSsignal();
118#endif
119 Double_t p = track->GetTPCInnerParam() ? track->GetTPCInnerParam()->P() : track->P();
120 AliDebug(1, Form("Momentum: %f, ITS Signal: %f", p, signal));
e8a6457a 121 return signal;
122}
123
124//___________________________________________________________________
3a72645a 125Double_t AliHFEpidITS::GetITSSignalV2(AliVParticle *vtrack){
e8a6457a 126 //
127 // Calculates the ITS signal. Truncated mean is used.
128 //
3a72645a 129 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
722347d8 130 AliError("PID for AODs not implemented yet");
131 return 0.;
132 }
133 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
bf892a6a 134 if(!track) return 0.;
e8a6457a 135 Double_t dedx[4], tmp[4];
136 Int_t indices[4];
137 track->GetITSdEdxSamples(tmp);
138 TMath::Sort(4, tmp, indices);
139 for(Int_t ien = 0; ien < 4; ien++) dedx[ien] = tmp[indices[ien]];
140 Double_t signal = TMath::Mean(3, dedx);
141 Double_t p = track->GetTPCInnerParam() ? track->GetTPCInnerParam()->P() : track->P();
142 AliDebug(1, Form("Momentum: %f, ITS Signal: %f", p, signal));
e8a6457a 143 return signal;
144}
145