]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/JET/AliHLTJETJets.cxx
added load libraries (Chiara B)
[u/mrichter/AliRoot.git] / HLT / JET / AliHLTJETJets.cxx
CommitLineData
7c3c85cd 1//-*- Mode: C++ -*-
2// $Id: AliHLTJETJets.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 AliHLTJETJets.h
20 @author Jochen Thaeder
21 @date
22 @brief Container holding produced Jets
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 "AliHLTJETJets.h"
36#include "TLorentzVector.h"
37
38
39/** ROOT macro for the implementation of ROOT specific class methods */
40ClassImp(AliHLTJETJets)
41
42/*
43 * ---------------------------------------------------------------------------------
44 * Constructor / Destructor
45 * ---------------------------------------------------------------------------------
46 */
47
48//##################################################################################
49AliHLTJETJets::AliHLTJETJets() :
50 fNAODJets(0),
51 fAODJets(new TClonesArray( "AliAODJet", 20 ) ) {
52 // see header file for class documentation
53 // or
54 // refer to README to build package
55 // or
56 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
57
58}
59
60//##################################################################################
61AliHLTJETJets::~AliHLTJETJets() {
62 // see header file for class documentation
63
64 if ( fAODJets ){
65 fAODJets->Clear();
66 delete fAODJets;
67 }
68 fAODJets = NULL;
69}
70
71/*
72 * ---------------------------------------------------------------------------------
73 * Initialize / Reset
74 * ---------------------------------------------------------------------------------
75 */
76
77//##################################################################################
78void AliHLTJETJets::Reset() {
79 // see header file for class documentation
80
81 fAODJets->Clear();
82 fNAODJets = 0;
83
84 return;
85}
86
87/*
88 * ---------------------------------------------------------------------------------
89 * Getter
90 * ---------------------------------------------------------------------------------
91 */
92
93//##################################################################################
94AliAODJet* AliHLTJETJets::GetJet( Int_t iter ) {
95 // see header file for class documentation
96
97 if ( iter > fNAODJets )
98 return NULL;
99 else
100 return reinterpret_cast<AliAODJet*>((*fAODJets)[iter]);
101}
102
103/*
104 * ---------------------------------------------------------------------------------
105 * Setter
106 * ---------------------------------------------------------------------------------
107 */
108
109//##################################################################################
110void AliHLTJETJets::AddJet( AliHLTJETConeJetCandidate* jet ) {
111 // see header file for class documentation
112
113 // -- create TLorentzVector
114 TLorentzVector v;
115 v.SetPtEtaPhiE( jet->GetPt(),jet->GetEta(),jet->GetPhi(), jet->GetEt() );
116
117 // -- add AliAODJet
118 new ((*fAODJets)[fNAODJets]) AliAODJet(v);
119 fNAODJets++;
120
121 return;
122}