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()
39 fLeading = new TLorentzVector(0.,0.,0.,0.);
40 fLow = -TMath::Pi()/2.0;
42 fCorr = TArrayI(fnBin);
46 ////////////////////////////////////////////////////////////////////////
48 AliLeading::~AliLeading()
54 ////////////////////////////////////////////////////////////////////////
56 void AliLeading::FindLeading(AliJetReader *reader)
58 // find leading particle in the array of lorentz vectors
59 // lvArray and fill the correlation histogram
61 AliJetReaderHeader* header = reader->GetReaderHeader();
63 TClonesArray* lvArray = reader->GetMomentumArray();
64 Int_t nIn = lvArray->GetEntries();
69 for (Int_t i = 0; i < nIn; i++){
70 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
71 if ((reader->GetCutFlag(i) == 1) &&
73 lv->Eta() > header->GetFiducialEtaMin() &&
74 lv->Eta() < header->GetFiducialEtaMax()){
86 // fill correlation array
87 fLeading = (TLorentzVector*) lvArray->At(idxMax);
91 for (Int_t i = 0; i < nIn; i++) {
92 if (i == idxMax) continue;
93 TLorentzVector *lv = (TLorentzVector*) lvArray->At(i);
94 if ( (reader->GetCutFlag(i) == 1) &&
95 lv->Eta() > header->GetFiducialEtaMin() &&
96 lv->Eta() < header->GetFiducialEtaMax()) {
97 Double_t dphi = fLeading->DeltaPhi(*lv);
98 if (dphi < fLow) dphi = 2.0 * TMath::Pi() + dphi;
99 // find bin and fill array
101 TMath::Floor((dphi - fLow)
102 *((Double_t) fnBin) / (2.0 * TMath::Pi()));
103 fCorr.AddAt(fCorr.At(iBin)+1,iBin);
109 ////////////////////////////////////////////////////////////////////////
111 void AliLeading::Reset()
114 // Reset leading particle information
115 fLeading->SetPxPyPzE(0., 0., 0., 0.);
120 ////////////////////////////////////////////////////////////////////////
122 void AliLeading::PrintLeading()
124 // Print leading particle information
126 cout << " No leading particle in this event" << endl;
129 cout << " Leading particle: " << endl;
130 cout << " (px,py,pz,e) = (" << fLeading->Px() << ","
131 << fLeading->Py() << "," << fLeading->Pz() << ","
132 << fLeading->E() << ")" << endl;
133 cout << " (pt,eta,phi) = (" << fLeading->Pt() << ","
134 << fLeading->Eta() << "," << fLeading->Phi() << ")" << endl;
135 cout << " " << fNassoc << " associated particles." << endl;
138 ////////////////////////////////////////////////////////////////////////
140 Double_t AliLeading::GetE()
142 return fLeading->E();
145 ////////////////////////////////////////////////////////////////////////
147 Double_t AliLeading::GetPt()
149 return fLeading->Pt();
152 ////////////////////////////////////////////////////////////////////////
154 Double_t AliLeading::GetEta()
156 return fLeading->Eta();
159 ////////////////////////////////////////////////////////////////////////
161 Double_t AliLeading::GetPhi()
163 // get phi of leading
164 return ( (fLeading->Phi() < 0) ?
165 (fLeading->Phi()) + 2. * TMath::Pi() :