Add new classes for the jet cone finder
[u/mrichter/AliRoot.git] / HLT / JET / cone / AliHLTJETConeEtaPhiCell.cxx
CommitLineData
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
31#if __GNUC__>= 3
32 using namespace std;
33#endif
34
35#include "AliHLTJETConeEtaPhiCell.h"
36
37/** ROOT macro for the implementation of ROOT specific class methods */
38ClassImp(AliHLTJETConeEtaPhiCell)
39
40/*
41 * ---------------------------------------------------------------------------------
42 * Constructor / Destructor
43 * ---------------------------------------------------------------------------------
44 */
45
46//##################################################################################
47 AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell() :
48 fEtaIdx(0),
49 fPhiIdx(0),
50 fPt(0.),
51 fEta(0.),
52 fPhi(0.),
53 fNTracks(0),
54 fTrackList(NULL),
55 fTrackType(0) {
56 // see header file for class documentation
57 // or
58 // refer to README to build package
59 // or
60 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
61}
62
63//##################################################################################
64AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell( Int_t etaIdx, Int_t phiIdx,
65 AliESDtrack* track ) :
66 fEtaIdx(etaIdx),
67 fPhiIdx(phiIdx),
68 fPt(0.),
69 fEta(0.),
70 fPhi(0.),
71 fNTracks(0),
72 fTrackList( new TObjArray(20)), // XXXXXX 20
73 fTrackType( kTrackESD ) {
74 // see header file for class documentation
75
76 HLTDebug("New cell for ESD etaIdx %d - phiIdx %d", etaIdx, phiIdx );
77
78 AddTrack( track );
79}
80
81//##################################################################################
82AliHLTJETConeEtaPhiCell::AliHLTJETConeEtaPhiCell( Int_t etaIdx, Int_t phiIdx,
83 TParticle* particle ) :
84 fEtaIdx(etaIdx),
85 fPhiIdx(phiIdx),
86 fPt(0.),
87 fEta(0.),
88 fPhi(0.),
89 fNTracks(0),
90 fTrackList( new TObjArray(20)), // XXXXXX 20
91 fTrackType( kTrackMC ) {
92 // see header file for class documentation
93
94 HLTDebug("New cell for MC etaIdx %d - phiIdx %d", etaIdx, phiIdx );
95
96 AddTrack( particle );
97}
98
99
100//##################################################################################
101AliHLTJETConeEtaPhiCell::~AliHLTJETConeEtaPhiCell() {
102 // see header file for class documentation
103
104 if ( fTrackList )
105 delete fTrackList;
106 fTrackList = NULL;
107}
108
109//##################################################################################
110void AliHLTJETConeEtaPhiCell::Clear( Option_t* /*option*/ ) {
111 // see header file for class documentation
112
113 if ( fTrackList )
114 delete fTrackList;
115 fTrackList = NULL;
116
117 return;
118}
119
120/*
121 * ---------------------------------------------------------------------------------
122 * Process
123 * ---------------------------------------------------------------------------------
124 */
125
126//##################################################################################
127void AliHLTJETConeEtaPhiCell::AddTrack( AliESDtrack* track ){
128 // see header file for class documentation
129
130 Float_t weight = 1.0; // ** XXXX
131
132 fEta += (weight * track->Eta());
133 fPhi += (weight * track->Phi());
134 fPt += (weight * TMath::Abs(track->Pt()));
135
136 fTrackList->Add( (TObject*) track );
137 ++fNTracks;
138
139 return;
140}
141
142//##################################################################################
143void AliHLTJETConeEtaPhiCell::AddTrack( TParticle* particle ){
144 // see header file for class documentation
145
146 Float_t weight = 1.0; // ** XXXX
147
148 fEta += (weight * particle->Eta());
149 fPhi += (weight * particle->Phi());
150 fPt += (weight * TMath::Abs( particle->Pt()));
151
152 fTrackList->Add( (TObject*) particle );
153 ++fNTracks;
154
155 return;
156}