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 **************************************************************************/
17 // checks ITS PID based on ITS dE/dx truncated mean
19 // Authors: Matus Kalisky <matus.kalisky@cern.ch>
20 // Markus Fasel <M.Fasel@gsi.de>
28 //#include "AliAODTrack.h"
29 //#include "AliAODMCParticle.h"
30 #include "AliESDtrack.h"
33 #include "AliVParticle.h"
35 #include "AliHFEpidITS.h"
37 ClassImp(AliHFEpidITS)
39 //___________________________________________________________________
40 AliHFEpidITS::AliHFEpidITS(const Char_t *name):
44 // Default constructor
48 //___________________________________________________________________
49 AliHFEpidITS::AliHFEpidITS(const AliHFEpidITS &ref):
58 //___________________________________________________________________
59 AliHFEpidITS &AliHFEpidITS::operator=(const AliHFEpidITS &ref){
61 // Assignment operator
63 if(this != &ref) ref.Copy(*this);
67 //___________________________________________________________________
68 AliHFEpidITS::~AliHFEpidITS(){
74 //___________________________________________________________________
75 void AliHFEpidITS::Copy(TObject &o) const {
78 // Provides a deep copy
80 AliHFEpidBase::Copy(o);
83 //___________________________________________________________________
84 Bool_t AliHFEpidITS::InitializePID(Int_t /*run*/){
86 // ITS PID initialization
92 //___________________________________________________________________
93 Int_t AliHFEpidITS::IsSelected(const AliHFEpidObject* /*track*/, AliHFEpidQAmanager* /*pidqa*/) const {
95 // Does PID decision for ITS
97 return 11; // @TODO: Implement ITS PID decision
100 //___________________________________________________________________
101 Double_t AliHFEpidITS::GetITSSignalV1(AliVParticle *vtrack){
103 // Calculate the ITS signal according to the mean charge of the clusters
105 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
106 AliError("PID for AODs not implemented yet");
109 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
110 if(!track) return 0.;
111 Double_t signal = 0.;
114 track->GetITSdEdxSamples(dedx);
115 signal = TMath::Mean(4, dedx);
117 signal = track->GetITSsignal();
119 Double_t p = track->GetTPCInnerParam() ? track->GetTPCInnerParam()->P() : track->P();
120 AliDebug(1, Form("Momentum: %f, ITS Signal: %f", p, signal));
124 //___________________________________________________________________
125 Double_t AliHFEpidITS::GetITSSignalV2(AliVParticle *vtrack){
127 // Calculates the ITS signal. Truncated mean is used.
129 if(!TString(vtrack->IsA()->GetName()).CompareTo("AliAODTrack")){
130 AliError("PID for AODs not implemented yet");
133 AliESDtrack *track = dynamic_cast<AliESDtrack *>(vtrack);
134 if(!track) return 0.;
135 Double_t dedx[4], tmp[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));