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 **************************************************************************/
16 //---------------------------------------------------------------------
17 // Class to find and store the leading particle in event and
18 // store its correlation to associated particles
19 // Author: jgcn@mda.cinvestav.mx
20 //---------------------------------------------------------------------
22 #include <Riostream.h>
24 #include <TClonesArray.h>
25 #include <TLorentzVector.h>
27 #include "AliLeading.h"
28 #include "AliJetReader.h"
29 #include "AliJetReaderHeader.h"
33 ////////////////////////////////////////////////////////////////////////
35 AliLeading::AliLeading():
40 fLow(-TMath::Pi()/2.0),
44 fLeading = new TLorentzVector(0.,0.,0.,0.);
45 fCorr = TArrayI(fnBin);
48 ////////////////////////////////////////////////////////////////////////
50 AliLeading::~AliLeading()
56 ////////////////////////////////////////////////////////////////////////
58 void AliLeading::FindLeading(AliJetReader *reader)
60 // find leading particle in the array of lorentz vectors
61 // lvArray and fill the correlation histogram
63 AliJetReaderHeader* header = reader->GetReaderHeader();
65 TClonesArray* lvArray = reader->GetMomentumArray();
66 Int_t nIn = lvArray->GetEntries();
71 for (Int_t i = 0; i < nIn; i++){
72 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
73 if ((reader->GetCutFlag(i) == 1) &&
75 lv->Eta() > header->GetFiducialEtaMin() &&
76 lv->Eta() < header->GetFiducialEtaMax()){
88 // fill correlation array
89 *fLeading = *((TLorentzVector*) lvArray->At(idxMax));
93 for (Int_t i = 0; i < nIn; i++) {
94 if (i == idxMax) continue;
95 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
96 if ( (reader->GetCutFlag(i) == 1) &&
97 lv->Eta() > header->GetFiducialEtaMin() &&
98 lv->Eta() < header->GetFiducialEtaMax()) {
99 Double_t dphi = fLeading->DeltaPhi(*lv);
100 if (dphi < fLow) dphi = 2.0 * TMath::Pi() + dphi;
101 // find bin and fill array
103 TMath::Floor((dphi - fLow)
104 *((Double_t) fnBin) / (2.0 * TMath::Pi()));
105 fCorr.AddAt(fCorr.At(iBin)+1,iBin);
111 ////////////////////////////////////////////////////////////////////////
113 void AliLeading::Reset()
116 // Reset leading particle information
117 fLeading->SetPxPyPzE(0., 0., 0., 0.);
122 ////////////////////////////////////////////////////////////////////////
124 void AliLeading::PrintLeading()
126 // Print leading particle information
128 cout << " No leading particle in this event" << endl;
131 cout << " Leading particle: " << endl;
132 cout << " (px,py,pz,e) = (" << fLeading->Px() << ","
133 << fLeading->Py() << "," << fLeading->Pz() << ","
134 << fLeading->E() << ")" << endl;
135 cout << " (pt,eta,phi) = (" << fLeading->Pt() << ","
136 << fLeading->Eta() << "," << fLeading->Phi() << ")" << endl;
137 cout << " " << fNassoc << " associated particles." << endl;
140 ////////////////////////////////////////////////////////////////////////
142 Double_t AliLeading::GetE()
144 return fLeading->E();
147 ////////////////////////////////////////////////////////////////////////
149 Double_t AliLeading::GetPt()
151 return fLeading->Pt();
154 ////////////////////////////////////////////////////////////////////////
156 Double_t AliLeading::GetEta()
158 return fLeading->Eta();
161 ////////////////////////////////////////////////////////////////////////
163 Double_t AliLeading::GetPhi()
165 // get phi of leading
166 return ( (fLeading->Phi() < 0) ?
167 (fLeading->Phi()) + 2. * TMath::Pi() :