1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 // checks ITS PID based on ITS dE/dx truncated mean
22 // Authors: Matus Kalisky <matus.kalisky@cern.ch>
23 // Markus Fasel <M.Fasel@gsi.de>
31 //#include "AliAODTrack.h"
32 //#include "AliAODMCParticle.h"
33 #include "AliESDtrack.h"
36 #include "AliVParticle.h"
38 #include "AliHFEpidITS.h"
40 ClassImp(AliHFEpidITS)
42 //___________________________________________________________________
43 AliHFEpidITS::AliHFEpidITS(const Char_t *name):
47 // Default constructor
51 //___________________________________________________________________
52 AliHFEpidITS::AliHFEpidITS(const AliHFEpidITS &ref):
61 //___________________________________________________________________
62 AliHFEpidITS &AliHFEpidITS::operator=(const AliHFEpidITS &ref){
64 // Assignment operator
66 if(this != &ref) ref.Copy(*this);
70 //___________________________________________________________________
71 AliHFEpidITS::~AliHFEpidITS(){
77 //___________________________________________________________________
78 void AliHFEpidITS::Copy(TObject &o) const {
81 // Provides a deep copy
83 AliHFEpidBase::Copy(o);
86 //___________________________________________________________________
87 Bool_t AliHFEpidITS::InitializePID(){
89 // ITS PID initialization
95 //___________________________________________________________________
96 Int_t AliHFEpidITS::IsSelected(const AliHFEpidObject* /*track*/, AliHFEpidQAmanager* /*pidqa*/) const {
98 // Does PID decision for ITS
100 return 11; // @TODO: Implement ITS PID decision
103 //___________________________________________________________________
104 Double_t AliHFEpidITS::GetITSSignalV1(AliVParticle *vtrack){
106 // Calculate the ITS signal according to the mean charge of the clusters
108 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
109 AliError("PID for AODs not implemented yet");
112 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
113 if(!track) return 0.;
114 Double_t signal = 0.;
117 track->GetITSdEdxSamples(dedx);
118 signal = TMath::Mean(4, dedx);
120 signal = track->GetITSsignal();
122 Double_t p = track->GetTPCInnerParam() ? track->GetTPCInnerParam()->P() : track->P();
123 AliDebug(1, Form("Momentum: %f, ITS Signal: %f", p, signal));
127 //___________________________________________________________________
128 Double_t AliHFEpidITS::GetITSSignalV2(AliVParticle *vtrack){
130 // Calculates the ITS signal. Truncated mean is used.
132 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
133 AliError("PID for AODs not implemented yet");
136 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
137 if(!track) return 0.;
138 Double_t dedx[4], tmp[4];
140 track->GetITSdEdxSamples(tmp);
141 TMath::Sort(4, tmp, indices);
142 for(Int_t ien = 0; ien < 4; ien++) dedx[ien] = tmp[indices[ien]];
143 Double_t signal = TMath::Mean(3, dedx);
144 Double_t p = track->GetTPCInnerParam() ? track->GetTPCInnerParam()->P() : track->P();
145 AliDebug(1, Form("Momentum: %f, ITS Signal: %f", p, signal));