]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TENDER/TenderSupplies/AliHMPIDTenderSupply.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / TENDER / TenderSupplies / AliHMPIDTenderSupply.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 // HMPID tender: - recalculate pid bit using tighter cuts
20 //               - this is needed for all 2010 and 11a-c data
21 //             
22 //             
23 // Contacts: Giacomo.Volpe@ba.infn.it                                        //
24 //           Jens.Wiechula@cern.ch                                           //
25 ///////////////////////////////////////////////////////////////////////////////
26 #include <TMath.h>
27 #include <TRandom.h>
28 #include <AliLog.h>
29 #include <AliESDEvent.h>
30 #include <AliESDtrack.h>
31 #include <AliESDInputHandler.h>
32 #include <AliAnalysisManager.h>
33 #include <AliESDpid.h>
34 #include <AliTender.h>
35
36 #include "AliHMPIDTenderSupply.h"
37
38 ClassImp(AliHMPIDTenderSupply)
39
40 AliHMPIDTenderSupply::AliHMPIDTenderSupply() :
41 AliTenderSupply()
42 {
43   //
44   // default ctor
45   //
46 }
47
48 //_____________________________________________________
49 AliHMPIDTenderSupply::AliHMPIDTenderSupply(const char *name, const AliTender *tender) :
50 AliTenderSupply(name,tender)
51 {
52   //
53   // named ctor
54   //
55 }
56
57 //_____________________________________________________
58 void AliHMPIDTenderSupply::Init()
59 {
60   // Initialise HMPID tender
61   
62 }
63
64 //_____________________________________________________
65 void AliHMPIDTenderSupply::ProcessEvent()
66 {
67   //
68   // recalculate HMPIDpid bit
69   // 
70   
71
72   AliESDEvent *event=fTender->GetEvent();
73   if (!event) return;
74   
75   // re-evaluate the HMPIDpid bit for all tracks
76   Int_t ntracks=event->GetNumberOfTracks();
77   for(Int_t itrack = 0; itrack < ntracks; itrack++){
78     AliESDtrack *track=event->GetTrack(itrack);
79     if (!itrack) continue;
80     //reset pid bit first
81     track->ResetStatus(AliESDtrack::kHMPIDpid);
82
83     Float_t xPc=0., yPc=0., xMip=0., yMip=0., thetaTrk=0., phiTrk=0.;
84     Int_t nPhot=0, qMip=0;
85  
86     track->GetHMPIDtrk(xPc,yPc,thetaTrk,phiTrk);
87     track->GetHMPIDmip(xMip,yMip,qMip,nPhot);
88     //
89     //make cuts, just an example, THIS NEEDS TO BE CHANGED
90     //
91     //if ((track->GetStatus()&AliESDtrack::kHMPIDout)!=AliESDtrack::kHMPIDout) continue;
92    
93     Float_t dist = TMath::Sqrt((xPc-xMip)*(xPc-xMip) + (yPc-yMip)*(yPc-yMip));    
94
95     if(dist > 0.7 || nPhot> 30 || qMip < 100  ) continue;
96
97     //set pid bit, track was accepted
98     track->SetStatus(AliESDtrack::kHMPIDpid);
99     
100   }
101   
102   
103 }