Changing to centrality dependent corrections
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliHMPIDTenderSupply.cxx
CommitLineData
e26aa0bb 1/**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15\r
16\r
17///////////////////////////////////////////////////////////////////////////////\r
18// //\r
19// HMPID tender: - recalculate pid bit using tighter cuts\r
20// - this is needed for all 2010 and 11a-c data\r
21// \r
22// \r
23// Contacts: Giacomo.Volpe@ba.infn.it //\r
24// Jens.Wiechula@cern.ch //\r
25///////////////////////////////////////////////////////////////////////////////\r
26#include <TMath.h>\r
27#include <TRandom.h>\r
28#include <AliLog.h>\r
29#include <AliESDEvent.h>\r
30#include <AliESDtrack.h>\r
31#include <AliESDInputHandler.h>\r
32#include <AliAnalysisManager.h>\r
33#include <AliESDpid.h>\r
34#include <AliTender.h>\r
35\r
36#include "AliHMPIDTenderSupply.h"\r
37\r
38ClassImp(AliHMPIDTenderSupply)\r
39\r
40AliHMPIDTenderSupply::AliHMPIDTenderSupply() :\r
41AliTenderSupply()\r
42{\r
43 //\r
44 // default ctor\r
45 //\r
46}\r
47\r
48//_____________________________________________________\r
49AliHMPIDTenderSupply::AliHMPIDTenderSupply(const char *name, const AliTender *tender) :\r
50AliTenderSupply(name,tender)\r
51{\r
52 //\r
53 // named ctor\r
54 //\r
55}\r
56\r
57//_____________________________________________________\r
58void AliHMPIDTenderSupply::Init()\r
59{\r
60 // Initialise HMPID tender\r
61 \r
62}\r
63\r
64//_____________________________________________________\r
65void AliHMPIDTenderSupply::ProcessEvent()\r
66{\r
67 //\r
68 // recalculate HMPIDpid bit\r
69 // \r
70 \r
71\r
72 AliESDEvent *event=fTender->GetEvent();\r
73 if (!event) return;\r
74 \r
75 // re-evaluate the HMPIDpid bit for all tracks\r
76 Int_t ntracks=event->GetNumberOfTracks();\r
77 for(Int_t itrack = 0; itrack < ntracks; itrack++){\r
78 AliESDtrack *track=event->GetTrack(itrack);\r
79 if (!itrack) continue;\r
80 //reset pid bit first\r
81 track->ResetStatus(AliESDtrack::kHMPIDpid);\r
82\r
83 Float_t xPc=0., yPc=0., xMip=0., yMip=0., thetaTrk=0., phiTrk=0.;\r
84 Int_t nPhot=0, qMip=0;\r
85 \r
86 track->GetHMPIDtrk(xPc,yPc,thetaTrk,phiTrk);\r
87 track->GetHMPIDmip(xMip,yMip,qMip,nPhot);\r
88 //\r
89 //make cuts, just an example, THIS NEEDS TO BE CHANGED\r
90 //\r
91 //if ((track->GetStatus()&AliESDtrack::kHMPIDout)!=AliESDtrack::kHMPIDout) continue;\r
92 \r
93 Float_t dist = TMath::Sqrt((xPc-xMip)*(xPc-xMip) + (yPc-yMip)*(yPc-yMip)); \r
94\r
95 if(dist > 0.7 || nPhot> 30 || qMip < 100 ) continue;\r
96\r
97 //set pid bit, track was accepted\r
98 track->SetStatus(AliESDtrack::kHMPIDpid);\r
99 \r
100 }\r
101 \r
102 \r
103}\r