1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //---------------------------------------------------------------------
20 // manages the search for jets
21 // Author: jgcn@mda.cinvestav.mx
22 //---------------------------------------------------------------------
24 #include <Riostream.h>
25 #include <TLorentzVector.h>
26 #include "AliPxconeJetFinder.h"
27 #include "AliPxconeJetHeader.h"
28 #include "AliJetReader.h"
31 ClassImp(AliPxconeJetFinder)
33 ////////////////////////////////////////////////////////////////////////
35 AliPxconeJetFinder::AliPxconeJetFinder()
44 ////////////////////////////////////////////////////////////////////////
46 AliPxconeJetFinder::~AliPxconeJetFinder()
53 // reset and delete header
56 ////////////////////////////////////////////////////////////////////////
59 # define pxcone pxcone_
63 # define pxcone PXCONE
64 # define type_of_call _stdcall
67 extern "C" void type_of_call
68 pxcone_(int* mode, int* ntrak, int* dim, double* ptrak,
69 double* coner, double* epslon, double* ovlim,
70 int * maxjet, int* njet, double* pjet, int* ipass,
71 int* ijmul, int* ierr);
73 void AliPxconeJetFinder::FindJets()
76 // get number of entries
77 // Int_t ne=fReader->GetNEvents();
78 // loops over entries (check user request for number of events)
79 // (this info should be stored in reader-header)
81 // test with one event
82 TClonesArray *lvArray = fReader->GetMomentumArray();
83 Int_t nIn = lvArray->GetEntries();
85 // local arrays for input
86 const Int_t kNmaxVec = 30000;
88 cout << " AliPxconeJetFinder::FindJets: Too many input vectors."
90 cout << " Using only the first " << kNmaxVec << endl;
94 Double_t pIn[kNmaxVec][4];
95 Double_t pJet[kNmaxVec][5];
100 // load input vectors
101 for (Int_t i=0; i<nIn;i++){
102 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
108 fJets->SetNinput(nIn);
110 // run the algorithm. Get parameters from header
112 Int_t mode=fHeader->GetMode();
113 Double_t radius=fHeader->GetRadius();
114 Double_t minpt=fHeader->GetMinPt();
115 Double_t ov=fHeader->GetOverlap();
117 pxcone(&mode,&nIn,&dim,&pIn[0][0],&radius,&minpt,&ov,&nIn,&nj,
118 &pJet[0][0],&ipass[0],&ijmul[0],&ierr);
121 fJets->SetInJet(ipass);
122 for(Int_t i=0; i<nj; i++)
123 fJets->AddJet(pJet[i][0],pJet[i][1],
124 pJet[i][2],pJet[i][3]);
125 fJets->SetMultiplicities(ijmul);
128 ////////////////////////////////////////////////////////////////////////
130 void AliPxconeJetFinder::WriteJHeaderToFile()
132 // Write Header to file
138 ////////////////////////////////////////////////////////////////////////
140 void AliPxconeJetFinder::Reset()