]>
Commit | Line | Data |
---|---|---|
7c3c85cd | 1 | //-*- Mode: C++ -*- |
2 | // $Id: AliHLTJETConeEtaPhiCell.cxx $ | |
3 | //************************************************************************** | |
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* * | |
7 | //* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> * | |
8 | //* for The ALICE HLT Project. * | |
9 | //* * | |
10 | //* Permission to use, copy, modify and distribute this software and its * | |
11 | //* documentation strictly for non-commercial purposes is hereby granted * | |
12 | //* without fee, provided that the above copyright notice appears in all * | |
13 | //* copies and that both the copyright notice and this permission notice * | |
14 | //* appear in the supporting documentation. The authors make no claims * | |
15 | //* about the suitability of this software for any purpose. It is * | |
16 | //* provided "as is" without express or implied warranty. * | |
17 | //************************************************************************** | |
18 | ||
19 | /** @file AliHLTJETConeEtaPhiCell.cxx | |
20 | @author Jochen Thaeder | |
21 | @date | |
22 | @brief Cell in eta-phi space of the cone finder | |
23 | */ | |
24 | ||
25 | // see header file for class documentation | |
26 | // or | |
27 | // refer to README to build package | |
28 | // or | |
29 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
30 | ||
7c3c85cd | 31 | #include "AliHLTJETConeEtaPhiCell.h" |
32 | ||
a7f38894 | 33 | using namespace std; |
34 | ||
7c3c85cd | 35 | /** ROOT macro for the implementation of ROOT specific class methods */ |
36 | ClassImp(AliHLTJETConeEtaPhiCell) | |
37 | ||
38 | /* | |
39 | * --------------------------------------------------------------------------------- | |
40 | * Constructor / Destructor | |
41 | * --------------------------------------------------------------------------------- | |
42 | */ | |
43 | ||
44 | //################################################################################## | |
45 | AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell() : | |
46 | fEtaIdx(0), | |
47 | fPhiIdx(0), | |
48 | fPt(0.), | |
49 | fEta(0.), | |
50 | fPhi(0.), | |
51 | fNTracks(0), | |
52 | fTrackList(NULL), | |
53 | fTrackType(0) { | |
54 | // see header file for class documentation | |
55 | // or | |
56 | // refer to README to build package | |
57 | // or | |
58 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
59 | } | |
60 | ||
61 | //################################################################################## | |
62 | AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell( Int_t etaIdx, Int_t phiIdx, | |
63 | AliESDtrack* track ) : | |
64 | fEtaIdx(etaIdx), | |
65 | fPhiIdx(phiIdx), | |
66 | fPt(0.), | |
67 | fEta(0.), | |
68 | fPhi(0.), | |
69 | fNTracks(0), | |
70 | fTrackList( new TObjArray(20)), // XXXXXX 20 | |
71 | fTrackType( kTrackESD ) { | |
72 | // see header file for class documentation | |
73 | ||
74 | HLTDebug("New cell for ESD etaIdx %d - phiIdx %d", etaIdx, phiIdx ); | |
75 | ||
76 | AddTrack( track ); | |
77 | } | |
78 | ||
79 | //################################################################################## | |
80 | AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell( Int_t etaIdx, Int_t phiIdx, | |
81 | TParticle* particle ) : | |
82 | fEtaIdx(etaIdx), | |
83 | fPhiIdx(phiIdx), | |
84 | fPt(0.), | |
85 | fEta(0.), | |
86 | fPhi(0.), | |
87 | fNTracks(0), | |
88 | fTrackList( new TObjArray(20)), // XXXXXX 20 | |
89 | fTrackType( kTrackMC ) { | |
90 | // see header file for class documentation | |
91 | ||
92 | HLTDebug("New cell for MC etaIdx %d - phiIdx %d", etaIdx, phiIdx ); | |
93 | ||
94 | AddTrack( particle ); | |
95 | } | |
96 | ||
97 | ||
98 | //################################################################################## | |
99 | AliHLTJETConeEtaPhiCell::~AliHLTJETConeEtaPhiCell() { | |
100 | // see header file for class documentation | |
101 | ||
102 | if ( fTrackList ) | |
103 | delete fTrackList; | |
104 | fTrackList = NULL; | |
105 | } | |
106 | ||
107 | //################################################################################## | |
108 | void AliHLTJETConeEtaPhiCell::Clear( Option_t* /*option*/ ) { | |
109 | // see header file for class documentation | |
110 | ||
111 | if ( fTrackList ) | |
112 | delete fTrackList; | |
113 | fTrackList = NULL; | |
114 | ||
115 | return; | |
116 | } | |
117 | ||
118 | /* | |
119 | * --------------------------------------------------------------------------------- | |
120 | * Process | |
121 | * --------------------------------------------------------------------------------- | |
122 | */ | |
123 | ||
124 | //################################################################################## | |
125 | void AliHLTJETConeEtaPhiCell::AddTrack( AliESDtrack* track ){ | |
126 | // see header file for class documentation | |
127 | ||
128 | Float_t weight = 1.0; // ** XXXX | |
129 | ||
130 | fEta += (weight * track->Eta()); | |
131 | fPhi += (weight * track->Phi()); | |
132 | fPt += (weight * TMath::Abs(track->Pt())); | |
133 | ||
134 | fTrackList->Add( (TObject*) track ); | |
135 | ++fNTracks; | |
136 | ||
137 | return; | |
138 | } | |
139 | ||
140 | //################################################################################## | |
141 | void AliHLTJETConeEtaPhiCell::AddTrack( TParticle* particle ){ | |
142 | // see header file for class documentation | |
143 | ||
144 | Float_t weight = 1.0; // ** XXXX | |
145 | ||
146 | fEta += (weight * particle->Eta()); | |
147 | fPhi += (weight * particle->Phi()); | |
148 | fPt += (weight * TMath::Abs( particle->Pt())); | |
149 | ||
150 | fTrackList->Add( (TObject*) particle ); | |
151 | ++fNTracks; | |
152 | ||
153 | return; | |
154 | } |