]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - JETAN/AliJet.cxx
Fixes to calls for MeanMaterialBudget (now in AliTracker) (From Jouri Belikov)
[u/mrichter/AliRoot.git] / JETAN / AliJet.cxx
index bf6d17727a981a095294bf29ad9d501d26e55d4f..d6940978b03fda17920a9828709a185a9b3fe04f 100644 (file)
@@ -12,6 +12,8 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
+/* $Id$ */
  
 //---------------------------------------------------------------------
 // Jet class 
 
 #include "AliJet.h"
 ClassImp(AliJet)
-////////////////////////////////////////////////////////////////////////
-
-AliJet::AliJet() 
+  
+AliJet::AliJet():
+  fNInput(0),
+  fNJets(0),
+  fEtAvg(0),
+  fInJet(0),
+  fMultiplicities(0),
+  fNCells(0),
+  fPtFromSignal(0),
+  fJets(0),
+  fEtaIn(0),
+  fPhiIn(0),
+  fPtIn(0)
 {
-  //
-  // Constructor
-  //
+  // Default constructor
   fJets = new TClonesArray("TLorentzVector",1000);
-  fNInput=0;
-  fNJets=0;
-  fInJet=TArrayI();
-  fPtFromSignal=TArrayF();
-  fMultiplicities=TArrayI();
+  fInJet = TArrayI();
+  fPtIn = TArrayF();
+  fEtaIn = TArrayF();
+  fPhiIn = TArrayF();
+  fPtFromSignal = TArrayF();
+  fMultiplicities = TArrayI();
+  fNCells = TArrayI();
 } 
 
 ////////////////////////////////////////////////////////////////////////
@@ -57,7 +67,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;
@@ -71,14 +81,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;
@@ -87,11 +96,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();
 }
@@ -102,7 +119,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();
 }
@@ -113,7 +129,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();
 }
@@ -124,7 +139,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();
 }
@@ -135,7 +149,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();
 }
@@ -146,7 +159,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();
 }
@@ -157,7 +169,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();
 }
@@ -168,7 +179,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());
 }
@@ -179,7 +189,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();
 }
@@ -190,7 +199,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();
 }
@@ -209,12 +217,36 @@ 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
@@ -233,6 +265,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
@@ -241,6 +280,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);
 }
 
 ////////////////////////////////////////////////////////////////////////