2 // $Id: AliHLTJETReaderHeader.cxx $
3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
8 * for The ALICE HLT Project. *
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 **************************************************************************/
19 /** @file AliHLTJETReader.cxx
20 @author Jochen Thaeder
22 @brief Reader for jet finder
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
35 #include "AliHLTJETReader.h"
37 #include "AliHLTJETTrackCuts.h"
39 #include "TLorentzVector.h"
40 #include "TParticle.h"
41 #include "TParticlePDG.h"
43 /** ROOT macro for the implementation of ROOT specific class methods */
44 ClassImp(AliHLTJETReader)
47 * ---------------------------------------------------------------------------------
48 * Constructor / Destructor
49 * ---------------------------------------------------------------------------------
52 // #################################################################################
53 AliHLTJETReader::AliHLTJETReader()
59 // see header file for class documentation
61 // refer to README to build package
63 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
67 // #################################################################################
68 AliHLTJETReader::~AliHLTJETReader() {
69 // see header file for class documentation
74 * ---------------------------------------------------------------------------------
75 * Reader functionality
76 * ---------------------------------------------------------------------------------
79 // #################################################################################
80 Bool_t AliHLTJETReader::FillMomentumArray() {
81 // see header file for class documentation
83 Bool_t bResult = kFALSE;
86 bResult = FillMomentumArrayESD();
88 bResult = FillMomentumArrayMC();
90 bResult = FillMomentumArrayAOD();
95 // #################################################################################
96 Bool_t AliHLTJETReader::FillMomentumArrayMC() {
97 // see header file for class documentation
100 HLTError( "No MC Event!" );
110 AliHLTJETTrackCuts *trackCuts = reinterpret_cast<AliHLTJETTrackCuts*>(GetReaderHeader()->GetAnalysisCuts()) ;
112 //---------------------------------------------------------------------------
113 // XXX fAliHeader = fMCEvent->Header();
114 //---------------------------------------------------------------------------
118 TParticle* particle = NULL;
120 // -- Loop over particles
121 // ------------------------
122 while ( (particle = fMC->NextParticle() ) ) {
125 if ( ! trackCuts->IsSelected(particle) )
129 p4 = TLorentzVector( particle->Px(), particle->Py(), particle->Pz(), particle->Energy() );
131 // -- new TClonesArray entry
132 new ( (*fMomentumArray)[nTracks] ) TLorentzVector(p4);
136 } // while ( (particle = fMC->NextParticle() ) ) {
138 HLTInfo(" Number of selected tracks %d \n", nTracks);
143 // #################################################################################
144 Bool_t AliHLTJETReader::FillMomentumArrayESD() {
145 // see header file for class documentation
150 // #################################################################################
151 Bool_t AliHLTJETReader::FillMomentumArrayAOD() {
152 // see header file for class documentation
158 * ---------------------------------------------------------------------------------
160 * ---------------------------------------------------------------------------------
164 // #################################################################################
165 void AliHLTJETReader::SetInputEvent(TObject* esd, TObject* aod, TObject* mc) {
166 // see header file for class documentation
169 fESD = dynamic_cast<AliESDEvent*> (esd);
171 fAOD = dynamic_cast<AliAODEvent*> (aod);
173 fMC = dynamic_cast<AliHLTMCEvent*> (mc);