Skip to content

Commit

Permalink
PPR version of the JETAN code (M. Lopez Noriega)
Browse files Browse the repository at this point in the history
  • Loading branch information
hristov committed Jan 19, 2006
1 parent f6fb6d8 commit 16d6c48
Show file tree
Hide file tree
Showing 36 changed files with 2,066 additions and 923 deletions.
74 changes: 55 additions & 19 deletions JETAN/AliJet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@

#include "AliJet.h"
ClassImp(AliJet)


////////////////////////////////////////////////////////////////////////


AliJet::AliJet()
{
//
// Constructor
//
fJets = new TClonesArray("TLorentzVector",1000);
fNInput=0;
fNJets=0;
fEtAvg = 0;
fInJet=TArrayI();
fPtIn=TArrayF();
fEtaIn=TArrayF();
fPhiIn=TArrayF();
fPtFromSignal=TArrayF();
fMultiplicities=TArrayI();
fNCells=TArrayI();
}

////////////////////////////////////////////////////////////////////////
Expand All @@ -57,7 +58,7 @@ AliJet::~AliJet()

Bool_t AliJet::OutOfRange(Int_t i, const char *s) const
{
// checks if i is a valid index. s= name of calling method
// checks if i is a valid index. s = name of calling method
if (i >= fNJets || i < 0) {
cout << s << " Index " << i << " out of range" << endl;
return kTRUE;
Expand All @@ -71,14 +72,13 @@ TLorentzVector* AliJet::GetJet(Int_t i)
{
// returns i-jet
if (OutOfRange(i, "AliJet::GetJet:")) return 0;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv;
}

////////////////////////////////////////////////////////////////////////

Int_t AliJet::GetMultiplicity(Int_t i)
Int_t AliJet::GetMultiplicity(Int_t i) const
{
// gets multiplicity of i-jet
if (OutOfRange(i, "AliJet::GetMultiplicity:")) return 0;
Expand All @@ -87,11 +87,19 @@ Int_t AliJet::GetMultiplicity(Int_t i)

////////////////////////////////////////////////////////////////////////

Int_t AliJet::GetNCell(Int_t i) const
{
// gets number of cell of i-jet
if (OutOfRange(i, "AliJet::GetNCell:")) return 0;
return fNCells[i];
}

////////////////////////////////////////////////////////////////////////

Double_t AliJet::GetPx(Int_t i)
{
// Get Px component of jet i
if (OutOfRange(i, "AliJet::GetPx:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Px();
}
Expand All @@ -102,7 +110,6 @@ Double_t AliJet::GetPy(Int_t i)
{
// Get Py component of jet i
if (OutOfRange(i, "AliJet::GetPy:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Py();
}
Expand All @@ -113,7 +120,6 @@ Double_t AliJet::GetPz(Int_t i)
{
// Get Pz component of jet i
if (OutOfRange(i, "AliJet::GetPz:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Pz();
}
Expand All @@ -124,7 +130,6 @@ Double_t AliJet::GetP(Int_t i)
{
// Get momentum of jet i
if (OutOfRange(i, "AliJet::GetP:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->P();
}
Expand All @@ -135,7 +140,6 @@ Double_t AliJet::GetE(Int_t i)
{
// Get energy of jet i
if (OutOfRange(i, "AliJet::GetE:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->E();
}
Expand All @@ -146,7 +150,6 @@ Double_t AliJet::GetPt(Int_t i)
{
// Get transverse momentum of jet i
if (OutOfRange(i, "AliJet::GetPt:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Pt();
}
Expand All @@ -157,7 +160,6 @@ Double_t AliJet::GetEta(Int_t i)
{
// Get eta of jet i
if (OutOfRange(i, "AliJet::GetEta:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Eta();
}
Expand All @@ -168,7 +170,6 @@ Double_t AliJet::GetPhi(Int_t i)
{
// Get phi of jet i
if (OutOfRange(i, "AliJet::GetPhi:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return ( (lv->Phi() < 0) ? (lv->Phi()) + 2. * TMath::Pi() : lv->Phi());
}
Expand All @@ -179,7 +180,6 @@ Double_t AliJet::GetTheta(Int_t i)
{
// Get theta of jet i
if (OutOfRange(i, "AliJet::GetTheta:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->Theta();
}
Expand All @@ -190,7 +190,6 @@ Double_t AliJet::GetMass(Int_t i)
{
// Get invariant mass of jet i
if (OutOfRange(i, "AliJet::GetMass:")) return -1e30;

TLorentzVector *lv = (TLorentzVector*) fJets->At(i);
return lv->M();
}
Expand All @@ -209,12 +208,37 @@ void AliJet::AddJet(Double_t px, Double_t py, Double_t pz, Double_t e)
void AliJet::SetInJet(Int_t* j)
{
// set information of which input object belongs
// to each jet. filled in by AliJetFinder
// to each jet. If zero, object was not assigned to
// a jet, if n,positive, it was assiged to jet n
// if n, negative, it is within cone of jet n, but
// it did not passed the user cuts. filled in by AliJetFinder

if (fNInput>0) fInJet.Set(fNInput, j);
}

////////////////////////////////////////////////////////////////////////

void AliJet::SetEtaIn(Float_t* r)
{
if (fNInput>0) fEtaIn.Set(fNInput, r);
}

////////////////////////////////////////////////////////////////////////

void AliJet::SetPtIn(Float_t* pt)
{
if (fNInput>0) fPtIn.Set(fNInput, pt);
}

////////////////////////////////////////////////////////////////////////

void AliJet::SetPhiIn(Float_t* x)
{
if (fNInput>0) fPhiIn.Set(fNInput, x);
}

////////////////////////////////////////////////////////////////////////

void AliJet::SetPtFromSignal(Float_t* p)
{
// set information of percentage of pt of jets
Expand All @@ -233,6 +257,13 @@ void AliJet::SetMultiplicities(Int_t* m)

////////////////////////////////////////////////////////////////////////

void AliJet::SetNCells(Int_t* n)
{
if (fNJets>0) fNCells.Set(fNJets, n);
}

////////////////////////////////////////////////////////////////////////

void AliJet::ClearJets(Option_t *option)
{
// reset all values
Expand All @@ -241,6 +272,11 @@ void AliJet::ClearJets(Option_t *option)
fNJets=0;
fMultiplicities.Set(0);
fInJet.Set(0);
fPtFromSignal.Set(0);
fPhiIn.Set(0);
fEtaIn.Set(0);
fPtIn.Set(0);
fNCells.Set(0);
}

////////////////////////////////////////////////////////////////////////
Expand Down
24 changes: 21 additions & 3 deletions JETAN/AliJet.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ class AliJet : public TObject
TClonesArray* GetJets() const {return fJets;}
TArrayI GetInJet() const {return fInJet;}
TArrayI GetMultiplicities() const {return fMultiplicities;}
TArrayI GetNCells() const {return fNCells;}
TArrayF GetPtFromSignal() const {return fPtFromSignal;}
TArrayF GetEtaIn() const { return fEtaIn; }
TArrayF GetPhiIn() const { return fPhiIn; }
TArrayF GetPtIn() const { return fPtIn; }
Double_t GetEtAvg() const { return fEtAvg; }

TLorentzVector* GetJet(Int_t i);
Int_t GetMultiplicity(Int_t i);
Int_t GetMultiplicity(Int_t i) const;
Int_t GetNCell(Int_t i) const;
Double_t GetPx(Int_t i);
Double_t GetPy(Int_t i);
Double_t GetPz(Int_t i);
Expand All @@ -49,10 +55,15 @@ class AliJet : public TObject
// Setters
void SetNinput(Int_t i) {fNInput = i;}
void AddJet(Double_t px, Double_t py, Double_t pz, Double_t e);
void SetInJet(Int_t* j);
void SetMultiplicities(Int_t* m);
void SetNCells(Int_t* n);
void SetPtFromSignal(Float_t* p);

void SetEtaIn(Float_t* eta);
void SetPhiIn(Float_t* phi);
void SetPtIn(Float_t* pt);
void SetInJet(Int_t* idx);
void SetEtAvg(Double_t et) { fEtAvg = et; }

// others
Bool_t OutOfRange(Int_t i, const char *s) const;
void ClearJets(Option_t *option="");
Expand All @@ -62,11 +73,18 @@ class AliJet : public TObject

Int_t fNInput; // number of input objects
Int_t fNJets; // number of jets found
Double_t fEtAvg; // average background et per cell

TArrayI fInJet; // i-input object belongs to k-jet
TArrayI fMultiplicities; // Multiplicity of each jet
TArrayI fNCells; // Number of cells in jet
TArrayF fPtFromSignal; // percentage of pt from signal
TClonesArray* fJets; // 4-momenta of jets

TArrayF fEtaIn; // Arrays of input particles kine:Eta
TArrayF fPhiIn; // Arrays of input particles kine:Phi
TArrayF fPtIn; // Arrays of input particles kine:Pt

ClassDef(AliJet,1)
};

Expand Down
Loading

0 comments on commit 16d6c48

Please sign in to comment.