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>
27 #include "AliPxconeJetFinder.h"
28 #include "AliPxconeJetHeader.h"
29 #include "AliJetReader.h"
31 ClassImp(AliPxconeJetFinder)
33 ////////////////////////////////////////////////////////////////////////
35 AliPxconeJetFinder::AliPxconeJetFinder():
43 ////////////////////////////////////////////////////////////////////////
45 AliPxconeJetFinder::~AliPxconeJetFinder()
52 // reset and delete header
55 ////////////////////////////////////////////////////////////////////////
58 # define pxcone pxcone_
62 # define pxcone PXCONE
63 # define type_of_call _stdcall
66 extern "C" void type_of_call
67 pxcone_(int* mode, int* ntrak, int* dim, double* ptrak,
68 double* coner, double* epslon, double* ovlim,
69 int * maxjet, int* njet, double* pjet, int* ipass,
70 int* ijmul, int* ierr);
72 void AliPxconeJetFinder::FindJets()
75 // get number of entries
76 // Int_t ne=fReader->GetNEvents();
77 // loops over entries (check user request for number of events)
78 // (this info should be stored in reader-header)
80 // test with one event
81 TClonesArray *lvArray = fReader->GetMomentumArray();
82 Int_t nIn = lvArray->GetEntries();
84 // local arrays for input
85 const Int_t kNmaxVec = 30000;
87 cout << " AliPxconeJetFinder::FindJets: Too many input vectors."
89 cout << " Using only the first " << kNmaxVec << endl;
93 Double_t pIn[kNmaxVec][4];
94 Double_t pJet[kNmaxVec][5];
100 for (Int_t i=0; i<nIn;i++){
101 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
107 fJets->SetNinput(nIn);
109 // run the algorithm. Get parameters from header
111 Int_t mode=fHeader->GetMode();
112 Double_t radius=fHeader->GetRadius();
113 Double_t minpt=fHeader->GetMinPt();
114 Double_t ov=fHeader->GetOverlap();
116 pxcone(&mode,&nIn,&dim,&pIn[0][0],&radius,&minpt,&ov,&nIn,&nj,
117 &pJet[0][0],&ipass[0],&ijmul[0],&ierr);
120 fJets->SetInJet(ipass);
121 for(Int_t i=0; i<nj; i++)
122 fJets->AddJet(pJet[i][0],pJet[i][1],
123 pJet[i][2],pJet[i][3]);
124 fJets->SetMultiplicities(ijmul);
127 ////////////////////////////////////////////////////////////////////////
129 void AliPxconeJetFinder::WriteJHeaderToFile()
131 // Write Header to file
137 ////////////////////////////////////////////////////////////////////////
139 void AliPxconeJetFinder::Reset()