3 ClassImp(AliJet) // Class implementation to enable ROOT I/O
8 // All variables initialised to 0
9 // Initial maximum number of tracks is set to the default value
15 ///////////////////////////////////////////////////////////////////////////
16 AliJet::AliJet(Int_t n)
18 // Create a jet to hold initially a maximum of n tracks
19 // All variables initialised to 0
30 cout << " *AliJet* Initial max. number of tracks entered : " << n << endl;
31 cout << " This is invalid. Default initial maximum will be used." << endl;
36 ///////////////////////////////////////////////////////////////////////////
40 if (fTracks) delete fTracks;
43 ///////////////////////////////////////////////////////////////////////////
44 void AliJet::SetNtinit(Int_t n)
46 // Set the initial maximum number of tracks for this jet
49 if (fTracks) delete fTracks;
50 fTracks=new TObjArray(fNtmax);
52 ///////////////////////////////////////////////////////////////////////////
55 // Reset all variables to 0
56 // The max. number of tracks is set to the initial value again
59 Double_t a[4]={0,0,0,0};
61 if (fNtinit > 0) SetNtinit(fNtinit);
63 ///////////////////////////////////////////////////////////////////////////
64 void AliJet::Add(AliTrack& t)
66 // Add a track to the jet
67 // In case the maximum number of tracks has been reached
68 // space will be extended to hold an additional amount of tracks as
69 // was initially reserved
70 if (fNtrk == fNtmax) // Check if maximum track number is reached
73 fTracks->Expand(fNtmax);
76 // Add the track to this jet
79 (*this)+=(Ali4Vector&)t;
82 ///////////////////////////////////////////////////////////////////////////
83 void AliJet::Info(TString f)
85 // Provide jet information within the coordinate frame f
86 cout << " *AliJet::Info* Invmass : " << GetInvmass() << " Charge : " << fQ
87 << " Momentum : " << GetMomentum() << " Ntracks : " << fNtrk << endl;
91 ///////////////////////////////////////////////////////////////////////////
92 void AliJet::List(TString f)
94 // Provide jet and primary track information within the coordinate frame f
96 Info(f); // Information of the current jet
98 // The tracks of this jet
100 for (Int_t it=1; it<=fNtrk; it++)
105 cout << " ---Track no. " << it << endl;
111 cout << " *AliJet::List* Error : No track present." << endl;
115 ///////////////////////////////////////////////////////////////////////////
116 void AliJet::ListAll(TString f)
118 // Provide jet and prim.+sec. track information within the coordinate frame f
120 Info(f); // Information of the current jet
122 // The tracks of this jet
124 for (Int_t it=1; it<=fNtrk; it++)
129 cout << " ---Track no. " << it << endl;
135 cout << " *AliJet::List* Error : No track present." << endl;
139 ///////////////////////////////////////////////////////////////////////////
140 Int_t AliJet::GetNtracks()
142 // Return the current number of tracks of this jet
145 ///////////////////////////////////////////////////////////////////////////
146 Double_t AliJet::GetEnergy()
148 // Return the total energy of the jet
151 ///////////////////////////////////////////////////////////////////////////
152 Double_t AliJet::GetMomentum()
154 // Return the value of the total jet 3-momentum
155 Ali3Vector p=Get3Vector();
156 Double_t p2=p.Dot(p);
159 ///////////////////////////////////////////////////////////////////////////
160 Ali3Vector AliJet::Get3Momentum()
162 // Return the the total jet 3-momentum
163 Ali3Vector p=Get3Vector();
166 ///////////////////////////////////////////////////////////////////////////
167 Double_t AliJet::GetInvmass()
169 // Return the invariant mass of the jet
170 Double_t m2=Dot(*this);
180 ///////////////////////////////////////////////////////////////////////////
181 Float_t AliJet::GetCharge()
183 // Return the total charge of the jet
186 ///////////////////////////////////////////////////////////////////////////
187 AliTrack* AliJet::GetTrack(Int_t i)
189 // Return the i-th track of this jet
190 return (AliTrack*)fTracks->At(i-1);
192 ///////////////////////////////////////////////////////////////////////////