]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliJet.cxx
05-jul-2001 NvE Clone() facility used in AddTrack() etc... of AliEvent & co. instead of
[u/mrichter/AliRoot.git] / RALICE / AliJet.cxx
index 6a22c617d0d46c61f65b3ca46ccf6a6398d4bdff..e667584238754d58b3b715e066aa17f28f18a41a 100644 (file)
 //    in an AliEvent.  
 //    In this way the AliJet just represents a 'logical structure' for the
 //    physics analysis which can be embedded in e.g. an AliEvent or AliVertex.
 //    in an AliEvent.  
 //    In this way the AliJet just represents a 'logical structure' for the
 //    physics analysis which can be embedded in e.g. an AliEvent or AliVertex.
+//
+//    Note :
 //    Modifications made to the original tracks also affect the AliTrack objects
 //    which are stored in the AliJet. 
 //    Modifications made to the original tracks also affect the AliTrack objects
 //    which are stored in the AliJet. 
+//
 // b) SetTrackCopy(1).
 //    Of every 'added' track a private copy will be made of which the pointer
 //    will be stored.
 // b) SetTrackCopy(1).
 //    Of every 'added' track a private copy will be made of which the pointer
 //    will be stored.
@@ -160,10 +163,12 @@ void AliJet::Reset()
 ///////////////////////////////////////////////////////////////////////////
 void AliJet::AddTrack(AliTrack& t)
 {
 ///////////////////////////////////////////////////////////////////////////
 void AliJet::AddTrack(AliTrack& t)
 {
-// Add a track to the jet
+// Add a track to the jet.
+// Note : In case TrackCopy is set, the originally entered track
+//        will be automatically reset.
 // In case the maximum number of tracks has been reached
 // space will be extended to hold an additional amount of tracks as
 // In case the maximum number of tracks has been reached
 // space will be extended to hold an additional amount of tracks as
-// was initially reserved
+// was initially reserved.
  if (!fTracks) fTracks=new TObjArray(fNtmax);
  if (fNtrk == fNtmax) // Check if maximum track number is reached
  {
  if (!fTracks) fTracks=new TObjArray(fNtmax);
  if (fNtrk == fNtmax) // Check if maximum track number is reached
  {
@@ -175,15 +180,16 @@ void AliJet::AddTrack(AliTrack& t)
  fNtrk++;
  if (fTrackCopy)
  {
  fNtrk++;
  if (fTrackCopy)
  {
-  AliTrack* tx=new AliTrack(t);
-  fTracks->Add(tx);
+  fTracks->Add(t.Clone());
  }
  else
  {
   fTracks->Add(&t);
  }
  }
  else
  {
   fTracks->Add(&t);
  }
+
  (*this)+=(Ali4Vector&)t;
  fQ+=t.GetCharge();
  (*this)+=(Ali4Vector&)t;
  fQ+=t.GetCharge();
+
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliJet::Info(TString f)
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliJet::Info(TString f)