- Reshuffling of the particle codes in AliPID. Now the light nuclei are between the
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliPIDTenderSupply.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
17 ///////////////////////////////////////////////////////////////////////////////
18 //                                                                           //
19 // PID tender: Do combined PID                                               //
20 //                                                                           //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24
25 #include <AliESDpid.h>
26 #include <AliESDEvent.h>
27 #include <AliESDInputHandler.h>
28 #include "AliTender.h"
29
30 #include "AliPIDTenderSupply.h"
31
32 ClassImp(AliPIDTenderSupply)
33
34 AliPIDTenderSupply::AliPIDTenderSupply() :
35   AliTenderSupply(),
36   fCachePID(kFALSE)
37 {
38   //
39   // default ctor
40   //
41 }
42
43 //_____________________________________________________
44 AliPIDTenderSupply::AliPIDTenderSupply(const char *name, const AliTender *tender) :
45   AliTenderSupply(name,tender),
46   fCachePID(kFALSE)
47 {
48   //
49   // named ctor
50   //
51 }
52
53 //_____________________________________________________
54 void AliPIDTenderSupply::ProcessEvent()
55 {
56   //
57   // Combine PID information
58   //
59
60   AliESDEvent *event=fTender->GetEvent();
61   if (!event) return;
62
63   AliESDpid *pid=fTender->GetESDhandler()->GetESDpid();
64   if (!pid) return;
65   // chache pid if requested
66   if (fCachePID) {
67     pid->FillTrackDetectorPID();
68   }
69   
70   //
71   // recalculate combined PID probabilities
72   //
73   Int_t ntracks=event->GetNumberOfTracks();
74   for(Int_t itrack = 0; itrack < ntracks; itrack++)
75     pid->CombinePID(event->GetTrack(itrack));
76   
77 }