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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////
20 // Creation and investigation of a jet of particle tracks.
21 // An AliJet can be constructed by adding AliTracks.
23 // To provide maximal flexibility to the user, two modes of track storage
24 // are provided by means of the memberfunction SetTrackCopy().
26 // a) SetTrackCopy(0) (which is the default).
27 // Only the pointers of the 'added' tracks are stored.
28 // This mode is typically used by making jet studies based on a fixed list
29 // of tracks which stays under user control or is contained for instance
31 // In this way the AliJet just represents a 'logical structure' for the
32 // physics analysis which can be embedded in e.g. an AliEvent or AliVertex.
35 // Modifications made to the original tracks also affect the AliTrack objects
36 // which are stored in the AliJet.
38 // b) SetTrackCopy(1).
39 // Of every 'added' track a private copy will be made of which the pointer
41 // In this way the AliJet represents an entity on its own and modifications
42 // made to the original tracks do not affect the AliTrack objects which are
43 // stored in the AliJet.
44 // This mode will allow 'adding' many different AliTracks into an AliJet by
45 // creating only one AliTrack instance in the main programme and using the
46 // AliTrack::Reset() and AliTrack parameter setting memberfunctions.
48 // See also the documentation provided for the memberfunction SetOwner().
50 // Coding example to make 2 jets j1 and j2.
51 // ----------------------------------------
52 // j1 contains the AliTracks t1 and t2
53 // j2 contains 10 different AliTracks via tx
57 // ... // code to fill the AliTrack data
64 // j2.SetTrackCopy(1);
65 // AliTrack* tx=new AliTrack();
66 // for (Int_t i=0; i<10; i++)
69 // ... // code to set momentum etc... of the track tx
78 // Float_t e1=j1.GetEnergy();
79 // Float_t pnorm=j1->GetMomentum();
80 // Ali3Vector p=j1->Get3Momentum();
81 // Float_t m=j1.GetInvmass();
82 // Int_t ntk=j1.GetNtracks();
83 // AliTrack* tj=j1.GetTrack(1);
87 // Note : All quantities are in GeV, GeV/c or GeV/c**2
89 //--- Author: Nick van Eijndhoven 10-jul-1997 UU-SAP Utrecht
90 //- Modified: NvE $Date$ UU-SAP Utrecht
91 ///////////////////////////////////////////////////////////////////////////
94 #include "Riostream.h"
96 ClassImp(AliJet) // Class implementation to enable ROOT I/O
98 AliJet::AliJet() : TNamed(),Ali4Vector()
100 // Default constructor
101 // All variables initialised to 0
102 // Initial maximum number of tracks is set to the default value
107 ///////////////////////////////////////////////////////////////////////////
110 // Initialisation of pointers etc...
117 ///////////////////////////////////////////////////////////////////////////
118 AliJet::AliJet(Int_t n) : TNamed(),Ali4Vector()
120 // Create a jet to hold initially a maximum of n tracks
121 // All variables initialised to 0
131 cout << " *AliJet* Initial max. number of tracks entered : " << n << endl;
132 cout << " This is invalid. Default initial maximum will be used." << endl;
137 ///////////////////////////////////////////////////////////////////////////
140 // Default destructor
157 ///////////////////////////////////////////////////////////////////////////
158 void AliJet::SetOwner(Bool_t own)
160 // Set ownership of all added objects.
161 // The default parameter is own=kTRUE.
163 // Invokation of this memberfunction also sets all the copy modes
164 // (e.g. TrackCopy & co.) according to the value of own.
166 // This function (with own=kTRUE) is particularly useful when reading data
167 // from a tree/file, since Reset() will then actually remove all the
168 // added objects from memory irrespective of the copy mode settings
169 // during the tree/file creation process. In this way it provides a nice way
170 // of preventing possible memory leaks in the reading/analysis process.
172 // In addition this memberfunction can also be used as a shortcut to set all
173 // copy modes in one go during a tree/file creation process.
174 // However, in this case the user has to take care to only set/change the
175 // ownership (and copy mode) for empty objects (e.g. newly created objects
176 // or after invokation of the Reset() memberfunction) otherwise it will
177 // very likely result in inconsistent destructor behaviour.
181 if (fTracks) fTracks->SetOwner(own);
184 ///////////////////////////////////////////////////////////////////////////
185 AliJet::AliJet(const AliJet& j) : TNamed(j),Ali4Vector(j)
192 fTrackCopy=j.fTrackCopy;
194 if (j.fRef) fRef=new AliPositionObj(*(j.fRef));
201 fTracks=new TObjArray(fNtmax);
202 if (fTrackCopy) fTracks->SetOwner();
205 for (Int_t i=1; i<=fNtrk; i++)
207 AliTrack* tx=j.GetTrack(i);
210 fTracks->Add(tx->Clone());
218 ///////////////////////////////////////////////////////////////////////////
219 void AliJet::SetNtinit(Int_t n)
221 // Set the initial maximum number of tracks for this jet
236 ///////////////////////////////////////////////////////////////////////////
239 // Reset all variables to 0
240 // The max. number of tracks is set to the initial value again
244 Double_t a[4]={0,0,0,0};
246 if (fNtinit > 0) SetNtinit(fNtinit);
248 ///////////////////////////////////////////////////////////////////////////
249 void AliJet::AddTrack(AliTrack& t)
251 // Add a track to the jet.
252 // In case the maximum number of tracks has been reached
253 // space will be extended to hold an additional amount of tracks as
254 // was initially reserved.
255 // See SetTrackCopy() to tailor the functionality of the stored structures.
259 // In case a private copy is made, this is performed via the Clone() memberfunction.
260 // All AliTrack and derived classes have the default TObject::Clone() memberfunction.
261 // However, derived classes generally contain an internal data structure which may
262 // include pointers to other objects. Therefore it is recommended to provide
263 // for all derived classes a specific copy constructor and override the default Clone()
264 // memberfunction using this copy constructor.
265 // An example for this may be seen from AliTrack.
267 // In case NO private copy is made, a check will be performed if this
268 // specific track is already present in the jet.
269 // If this is the case, no action is performed to prevent multiple
270 // additions of the same track.
275 ///////////////////////////////////////////////////////////////////////////
276 void AliJet::AddTrack(AliTrack& t,Int_t copy)
278 // Internal memberfunction to actually add a track to the jet.
279 // In case the maximum number of tracks has been reached
280 // space will be extended to hold an additional amount of tracks as
281 // was initially reserved.
283 // If copy=0 NO copy of the track will be made, irrespective of the setting
284 // of the TrackCopy flag.
285 // This allows a proper treatment of automatically generated connecting
286 // tracks between vertices.
288 // In case NO copy of the track is made, a check will be performed if this
289 // specific track is already present in the jet.
290 // If this is the case, no action is performed to prevent multiple
291 // additions of the same track.
294 // In case a private copy is made, this is performed via the Clone() memberfunction.
298 fTracks=new TObjArray(fNtmax);
299 if (fTrackCopy) fTracks->SetOwner();
301 else if (!fTrackCopy || !copy) // Check if this track is already present
303 for (Int_t i=0; i<fNtrk; i++)
305 AliTrack* tx=(AliTrack*)fTracks->At(i);
306 if (tx == &t) return;
310 if (fNtrk == fNtmax) // Check if maximum track number is reached
313 fTracks->Expand(fNtmax);
316 // Add the track to this jet
318 if (fTrackCopy && copy)
320 fTracks->Add(t.Clone());
327 (*this)+=(Ali4Vector&)t;
331 ///////////////////////////////////////////////////////////////////////////
332 void AliJet::Data(TString f,TString u)
334 // Provide jet information within the coordinate frame f
336 // The string argument "u" allows to choose between different angular units
337 // in case e.g. a spherical frame is selected.
338 // u = "rad" : angles provided in radians
339 // "deg" : angles provided in degrees
341 // The defaults are f="car" and u="rad".
343 const char* name=GetName();
344 const char* title=GetTitle();
346 cout << " *AliJet::Data*";
347 if (strlen(name)) cout << " Name : " << GetName();
348 if (strlen(title)) cout << " Title : " << GetTitle();
350 cout << " Id : " << fUserId << " Invmass : " << GetInvmass() << " Charge : " << fQ
351 << " Momentum : " << GetMomentum() << endl;
355 Ali4Vector::Data(f,u);
357 ///////////////////////////////////////////////////////////////////////////
358 void AliJet::List(TString f,TString u)
360 // Provide jet and primary track information within the coordinate frame f
362 // The string argument "u" allows to choose between different angular units
363 // in case e.g. a spherical frame is selected.
364 // u = "rad" : angles provided in radians
365 // "deg" : angles provided in degrees
367 // The defaults are f="car" and u="rad".
369 Data(f,u); // Information of the current jet
370 if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); }
372 // The tracks of this jet
374 for (Int_t it=1; it<=fNtrk; it++)
379 cout << " ---Track no. " << it << endl;
385 cout << " *AliJet::List* Error : No track present." << endl;
389 ///////////////////////////////////////////////////////////////////////////
390 void AliJet::ListAll(TString f,TString u)
392 // Provide jet and prim.+sec. track information within the coordinate frame f
394 // The string argument "u" allows to choose between different angular units
395 // in case e.g. a spherical frame is selected.
396 // u = "rad" : angles provided in radians
397 // "deg" : angles provided in degrees
399 // The defaults are f="car" and u="rad".
401 Data(f,u); // Information of the current jet
402 if (fRef) { cout << " Ref-point :"; fRef->Data(f,u); }
404 // The tracks of this jet
406 for (Int_t it=1; it<=fNtrk; it++)
411 cout << " ---Track no. " << it << endl;
417 cout << " *AliJet::List* Error : No track present." << endl;
421 ///////////////////////////////////////////////////////////////////////////
422 Int_t AliJet::GetNtracks(Int_t idmode,Int_t chmode,Int_t pcode)
424 // Provide the number of user selected tracks in this jet based on the
425 // idmode, chmode and pcode selections as specified by the user.
426 // For specification of the selection parameters see GetTracks().
427 // The default parameters correspond to no selection, which implies
428 // that invokation of GetNtracks() just returns the total number of
429 // tracks registered in this jet.
431 // Note : In case certain selections are specified, this function
432 // invokes GetTracks(idmode,chmode,pcode) to determine the
433 // number of tracks corresponding to the selections.
434 // When the jet contains a large number of tracks, invokation
435 // of GetTracks(idmode,chmode,pcode) and subsequently invoking
436 // GetEntries() for the resulting TObjArray* might be slightly
440 if (idmode==0 && chmode==2 && pcode==0)
446 TObjArray* arr=GetTracks(idmode,chmode,pcode);
451 ///////////////////////////////////////////////////////////////////////////
452 Double_t AliJet::GetEnergy()
454 // Return the total energy of the jet
457 ///////////////////////////////////////////////////////////////////////////
458 Double_t AliJet::GetMomentum()
460 // Return the value of the total jet 3-momentum
461 // The error can be obtained by invoking GetResultError() after
462 // invokation of GetMomentum().
463 Double_t norm=fV.GetNorm();
464 fDresult=fV.GetResultError();
467 ///////////////////////////////////////////////////////////////////////////
468 Ali3Vector AliJet::Get3Momentum() const
470 // Return the the total jet 3-momentum
471 Ali3Vector p=Get3Vector();
474 ///////////////////////////////////////////////////////////////////////////
475 Double_t AliJet::GetInvmass()
477 // Return the invariant mass of the jet
478 Double_t m2=Dot(*this);
488 ///////////////////////////////////////////////////////////////////////////
489 Float_t AliJet::GetCharge() const
491 // Return the total charge of the jet
494 ///////////////////////////////////////////////////////////////////////////
495 AliTrack* AliJet::GetTrack(Int_t i) const
497 // Return the i-th track of this jet
499 if (!fTracks) return 0;
503 cout << " *AliJet*::GetTrack* Invalid argument i : " << i
504 << " Ntrk = " << fNtrk << endl;
509 return (AliTrack*)fTracks->At(i-1);
512 ///////////////////////////////////////////////////////////////////////////
513 AliTrack* AliJet::GetIdTrack(Int_t id) const
515 // Return the track with user identifier "id" of this jet
516 if (!fTracks) return 0;
519 for (Int_t i=0; i<fNtrk; i++)
521 tx=(AliTrack*)fTracks->At(i);
522 if (id == tx->GetId()) return tx;
524 return 0; // No matching id found
526 ///////////////////////////////////////////////////////////////////////////
527 TObjArray* AliJet::GetTracks(Int_t idmode,Int_t chmode,Int_t pcode)
529 // Provide references to user selected tracks based on the idmode, chmode
530 // and pcode selections as specified by the user.
532 // The following selection combinations are available :
533 // ----------------------------------------------------
534 // idmode = -1 ==> Select tracks with negative user identifier "id"
535 // 0 ==> No selection on user identifier
536 // 1 ==> Select tracks with positive user identifier "id"
538 // chmode = -1 ==> Select tracks with negative charge
539 // 0 ==> Select neutral tracks
540 // 1 ==> Select tracks with positive charge
541 // 2 ==> No selection on charge
542 // 3 ==> Select all charged tracks
544 // pcode = 0 ==> No selection on particle code
545 // X ==> Select tracks with particle code +X or -X
546 // This allows selection of both particles and anti-particles
547 // in case of PDG particle codes.
548 // Selection of either particles or anti-particles can be
549 // obtained in combination with the "chmode" selector.
553 // idmode=-1 chmode=0 pcode=0 : Selection of all neutral tracks with negative id.
554 // idmode=0 chmode=2 pcode=211 : Selection of all charged pions (PDG convention).
555 // idmode=0 chmode=1 pcode=321 : Selection of all positive kaons (PDG convention).
557 // The default values are idmode=0 chmode=2 pcode=0 (i.e. no selections applied).
561 // 1) In case the user has labeled simulated tracks with negative id and
562 // reconstructed tracks with positive id, this memberfunction provides
563 // easy access to either all simulated or reconstructed tracks.
564 // 2) Subsequent invokations of this memberfunction with e.g. chmode=-1 and chmode=1
565 // provides a convenient way to investigate particle pairs with opposite charge
566 // (e.g. for invariant mass analysis).
574 fSelected=new TObjArray();
577 if (!fTracks) return fSelected;
583 for (Int_t i=0; i<fNtrk; i++)
585 tx=(AliTrack*)fTracks->At(i);
588 code=tx->GetParticleCode();
589 if (pcode && abs(pcode)!=abs(code)) continue;
592 if (idmode==-1 && id>=0) continue;
593 if (idmode==1 && id<=0) continue;
596 if (chmode==-1 && q>=0) continue;
597 if (chmode==0 && fabs(q)>1e-10) continue;
598 if (chmode==1 && q<=0) continue;
599 if (chmode==3 && fabs(q)<1e-10) continue;
606 ///////////////////////////////////////////////////////////////////////////
607 void AliJet::ShowTracks(Int_t mode)
609 // Provide an overview of the available tracks.
610 // The argument mode determines the amount of information as follows :
611 // mode = 0 ==> Only printout of the number of tracks
612 // 1 ==> Provide a listing with 1 line of info for each track
614 // The default is mode=1.
616 Int_t ntk=GetNtracks();
621 cout << " There are " << ntk << " tracks available." << endl;
625 cout << " The following " << ntk << " tracks are available :" << endl;
626 for (Int_t i=1; i<=ntk; i++)
628 AliTrack* tx=GetTrack(i);
631 const char* name=tx->GetName();
632 const char* title=tx->GetTitle();
633 cout << " Track : " << i;
634 cout << " Id : " << tx->GetId();
635 cout << " Q : " << tx->GetCharge() << " m : " << tx->GetMass() << " p : " << tx->GetMomentum();
636 if (strlen(name)) cout << " Name : " << name;
637 if (strlen(title)) cout << " Title : " << title;
645 cout << " No tracks are present." << endl;
648 ///////////////////////////////////////////////////////////////////////////
649 Double_t AliJet::GetPt()
651 // Provide trans. momentum value w.r.t. z-axis.
652 // The error on the value can be obtained by GetResultError()
653 // after invokation of GetPt().
656 Double_t norm=v.GetNorm();
657 fDresult=v.GetResultError();
661 ///////////////////////////////////////////////////////////////////////////
662 Double_t AliJet::GetPl()
664 // Provide long. momentum value w.r.t. z-axis.
665 // Note : the returned value can also be negative.
666 // The error on the value can be obtained by GetResultError()
667 // after invokation of GetPl().
671 Double_t pl=v.GetNorm();
672 fDresult=v.GetResultError();
675 v.GetVector(a,"sph");
676 if (cos(a[1])<0) pl=-pl;
680 ///////////////////////////////////////////////////////////////////////////
681 Double_t AliJet::GetEt()
683 // Provide trans. energy value w.r.t. z-axis.
684 // The error on the value can be obtained by GetResultError()
685 // after invokation of GetEt().
686 Double_t et=GetScaTrans();
690 ///////////////////////////////////////////////////////////////////////////
691 Double_t AliJet::GetEl()
693 // Provide long. energy value w.r.t. z-axis.
694 // Note : the returned value can also be negative.
695 // The error on the value can be obtained by GetResultError()
696 // after invokation of GetEl().
697 Double_t el=GetScaLong();
701 ///////////////////////////////////////////////////////////////////////////
702 Double_t AliJet::GetMt()
704 // Provide transverse mass value w.r.t. z-axis.
705 // The error on the value can be obtained by GetResultError()
706 // after invokation of GetMt().
708 Double_t dpt=GetResultError();
709 Double_t m=GetInvmass();
710 Double_t dm=GetResultError();
712 Double_t mt=sqrt(pt*pt+m*m);
714 if (mt) dmt2=(pow((pt*dpt),2)+pow((m*dm),2))/(mt*mt);
719 ///////////////////////////////////////////////////////////////////////////
720 Double_t AliJet::GetRapidity()
722 // Provide rapidity value w.r.t. z-axis.
723 // The error on the value can be obtained by GetResultError()
724 // after invokation of GetRapidity().
725 // Note : Also GetPseudoRapidity() is available since this class is
726 // derived from Ali4Vector.
727 Double_t e=GetEnergy();
728 Double_t de=GetResultError();
730 Double_t dpl=GetResultError();
734 Double_t y=9999,dy2=0;
735 if (sum && dif) y=0.5*log(sum/dif);
737 if (sum*dif) dy2=(1./(sum*dif))*(pow((pl*de),2)+pow((e*dpl),2));
742 ///////////////////////////////////////////////////////////////////////////
743 void AliJet::SetTrackCopy(Int_t j)
745 // (De)activate the creation of private copies of the added tracks.
746 // j=0 ==> No private copies are made; pointers of original tracks are stored.
747 // j=1 ==> Private copies of the tracks are made and these pointers are stored.
749 // Note : Once the storage contains pointer(s) to AliTrack(s) one cannot
750 // change the TrackCopy mode anymore.
751 // To change the TrackCopy mode for an existing AliJet containing
752 // tracks one first has to invoke Reset().
761 cout << "*AliJet::SetTrackCopy* Invalid argument : " << j << endl;
766 cout << "*AliJet::SetTrackCopy* Storage already contained tracks."
767 << " ==> TrackCopy mode not changed." << endl;
770 ///////////////////////////////////////////////////////////////////////////
771 Int_t AliJet::GetTrackCopy() const
773 // Provide value of the TrackCopy mode.
774 // 0 ==> No private copies are made; pointers of original tracks are stored.
775 // 1 ==> Private copies of the tracks are made and these pointers are stored.
778 ///////////////////////////////////////////////////////////////////////////
779 void AliJet::SetId(Int_t id)
781 // Set a user defined identifier for this jet.
784 ///////////////////////////////////////////////////////////////////////////
785 Int_t AliJet::GetId() const
787 // Provide the user defined identifier of this jet.
790 ///////////////////////////////////////////////////////////////////////////
791 void AliJet::SetReferencePoint(AliPosition& p)
793 // Store the position of the jet reference-point.
794 // The reference-point of a jet provides a means to define a generic
795 // space-time location for the jet as a whole.
796 // This doesn't have to be necessarily the location where all the constituent
797 // tracks originate (e.g. a bundle of parallel tracks doesn't have such
798 // a location). As such the meaning of this reference-point is different from
799 // a normal vertex position and allows to provide complimentary information.
800 // This reference point is the preferable point to start e.g. extrapolations
801 // and investigate coincidences in space and/or time.
802 if (fRef) delete fRef;
803 fRef=new AliPositionObj(p);
805 ///////////////////////////////////////////////////////////////////////////
806 AliPosition* AliJet::GetReferencePoint()
808 // Provide the position of the jet reference-point.
809 // The reference-point of a jet provides a means to define a generic
810 // space-time location for the jet as a whole.
811 // This doesn't have to be necessarily the location where all the constituent
812 // tracks originate (e.g. a bundle of parallel tracks doesn't have such
813 // a location). As such the meaning of this reference-point is different from
814 // a normal vertex position and allows to provide complimentary information.
815 // This reference point is the preferable point to start e.g. extrapolations
816 // and investigate coincidences in space and/or time.
819 ///////////////////////////////////////////////////////////////////////////
820 TObjArray* AliJet::SortTracks(Int_t mode,TObjArray* tracks)
822 // Order the references to an array of tracks by looping over the input array "tracks"
823 // and checking the value of a certain observable.
824 // The ordered array is returned as a TObjArray.
825 // In case tracks=0 (default), the registered tracks of the current jet are used.
826 // Note that the original track array is not modified.
827 // Via the "mode" argument the user can specify the observable to be checked upon
828 // and specify whether sorting should be performed in decreasing order (mode<0)
829 // or in increasing order (mode>0).
831 // The convention for the observable selection is the following :
832 // mode : 1 ==> Number of signals associated to the track
833 // 2 ==> Track energy
834 // 3 ==> Track momentum
835 // 4 ==> Mass of the track
836 // 5 ==> Transverse momentum of the track
837 // 6 ==> Longitudinal momentum of the track
838 // 7 ==> Transverse energy of the track
839 // 8 ==> Longitudinal energy of the track
840 // 9 ==> Transverse mass of the track
841 // 10 ==> Track rapidity
842 // 11 ==> Pseudo-rapidity of the track
844 // The default is mode=-1.
846 // Note : This sorting routine uses a common area in memory, which is used
847 // by various other sorting facilities as well.
848 // This means that the resulting sorted TObjArray may be overwritten
849 // when another sorting is invoked.
850 // To retain the sorted list of pointers, the user is advised to copy
851 // the pointers contained in the returned TObjArray into a private
852 // TObjArray instance.
860 if (!tracks) tracks=fTracks;
862 if (abs(mode)>11 || !tracks) return fSelected;
864 Int_t ntracks=tracks->GetEntries();
871 fSelected=new TObjArray(ntracks);
874 Double_t val1,val2; // Values of the observable to be tested upon
877 for (Int_t i=0; i<ntracks; i++) // Loop over all tracks of the array
879 AliTrack* tx=(AliTrack*)tracks->At(i);
883 if (nord == 0) // store the first track at the first ordered position
886 fSelected->AddAt(tx,nord-1);
890 for (Int_t j=0; j<=nord; j++) // put track in the right ordered position
892 if (j == nord) // track has smallest (mode<0) or largest (mode>0) observable value seen so far
895 fSelected->AddAt(tx,j); // add track at the end
896 break; // go for next track
902 val1=tx->GetNsignals();
903 val2=((AliTrack*)fSelected->At(j))->GetNsignals();
906 val1=tx->GetEnergy();
907 val2=((AliTrack*)fSelected->At(j))->GetEnergy();
910 val1=tx->GetMomentum();
911 val2=((AliTrack*)fSelected->At(j))->GetMomentum();
915 val2=((AliTrack*)fSelected->At(j))->GetMass();
919 val2=((AliTrack*)fSelected->At(j))->GetPt();
923 val2=((AliTrack*)fSelected->At(j))->GetPl();
927 val2=((AliTrack*)fSelected->At(j))->GetEt();
931 val2=((AliTrack*)fSelected->At(j))->GetEl();
935 val2=((AliTrack*)fSelected->At(j))->GetMt();
938 val1=tx->GetRapidity();
939 val2=((AliTrack*)fSelected->At(j))->GetRapidity();
942 val1=tx->GetPseudoRapidity();
943 val2=((AliTrack*)fSelected->At(j))->GetPseudoRapidity();
947 if (mode<0 && val1 <= val2) continue;
948 if (mode>0 && val1 >= val2) continue;
951 for (Int_t k=nord-1; k>j; k--) // create empty position
953 fSelected->AddAt(fSelected->At(k-1),k);
955 fSelected->AddAt(tx,j); // put track at empty position
956 break; // go for next track
961 ///////////////////////////////////////////////////////////////////////////
962 TObject* AliJet::Clone(const char* name) const
964 // Make a deep copy of the current object and provide the pointer to the copy.
965 // This memberfunction enables automatic creation of new objects of the
966 // correct type depending on the object type, a feature which may be very useful
967 // for containers when adding objects in case the container owns the objects.
968 // This feature allows e.g. AliVertex to store either AliJet objects or
969 // objects derived from AliJet via the AddJet memberfunction, provided
970 // these derived classes also have a proper Clone memberfunction.
972 AliJet* jet=new AliJet(*this);
975 if (strlen(name)) jet->SetName(name);
979 ///////////////////////////////////////////////////////////////////////////