From: nick Date: Wed, 10 May 2006 12:17:23 +0000 (+0000) Subject: 10-may-2006 NvE Distance determination between tracks and/or jets introduced in X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=9427ac754110972a47a45578d57c5135d5c0126a 10-may-2006 NvE Distance determination between tracks and/or jets introduced in AliTrack and AliJet. Also compiler warnings activated for overloaded virtuals in installation script for AMD Athlon in the /scripts sub-directory. --- diff --git a/RALICE/AliJet.cxx b/RALICE/AliJet.cxx index 0c3a103988e..32f1accd22e 100644 --- a/RALICE/AliJet.cxx +++ b/RALICE/AliJet.cxx @@ -1069,6 +1069,115 @@ TObjArray* AliJet::SortTracks(Int_t mode,TObjArray* tracks) return fSelected; } /////////////////////////////////////////////////////////////////////////// +Double_t AliJet::GetDistance(AliPosition* p) +{ +// Provide distance of the current jet to the position p. +// The error on the result can be obtained as usual by invoking +// GetResultError() afterwards. +// +// The distance will be provided in the unit scale of the AliPosition p. +// As such it is possible to obtain a correctly computed distance even in case +// the jet parameters have a different unit scale. +// However, it is recommended to work always with one single unit scale. +// +// Note : In case of incomplete information, a distance value of -1 is +// returned. + + Double_t dist=-1.; + fDresult=0.; + + if (!p) return dist; + + // Obtain a defined position on this jet + AliPosition* rx=fRef; + + if (!rx) return dist; + + Ali3Vector pj=Get3Momentum(); + + if (pj.GetNorm() <= 0.) return dist; + + AliTrack tj; + tj.Set3Momentum(pj); + tj.SetReferencePoint(*rx); + dist=tj.GetDistance(p); + fDresult=tj.GetResultError(); + return dist; +} +/////////////////////////////////////////////////////////////////////////// +Double_t AliJet::GetDistance(AliTrack* t) +{ +// Provide distance of the current jet to the track t. +// The error on the result can be obtained as usual by invoking +// GetResultError() afterwards. +// +// The distance will be provided in the unit scale of the current jet. +// As such it is possible to obtain a correctly computed distance even in case +// the jet and track parameters have a different unit scale. +// However, it is recommended to work always with one single unit scale. +// +// Note : In case of incomplete information, a distance value of -1 is +// returned. + + Double_t dist=-1.; + fDresult=0.; + + if (!t) return dist; + + // Obtain a defined position on this jet + AliPosition* rx=fRef; + + if (!rx) return dist; + + Ali3Vector pj=Get3Momentum(); + + if (pj.GetNorm() <= 0.) return dist; + + AliTrack tj; + tj.Set3Momentum(pj); + tj.SetReferencePoint(*rx); + dist=tj.GetDistance(t); + fDresult=tj.GetResultError(); + return dist; +} +/////////////////////////////////////////////////////////////////////////// +Double_t AliJet::GetDistance(AliJet* j) +{ +// Provide distance of the current jet to the jet j. +// The error on the result can be obtained as usual by invoking +// GetResultError() afterwards. +// +// The distance will be provided in the unit scale of the current jet. +// As such it is possible to obtain a correctly computed distance even in case +// the jet and track parameters have a different unit scale. +// This implies that in such cases the results of j1.GetDistance(j2) and +// j2.GetDistance(j1) will be numerically different. +// However, it is recommended to work always with one single unit scale. +// +// Note : In case of incomplete information, a distance value of -1 is +// returned. + + Double_t dist=-1.; + fDresult=0.; + + if (!j) return dist; + + // Obtain a defined position on jet j + AliPosition* rx=j->GetReferencePoint(); + + if (!rx) return dist; + + Ali3Vector pj=j->Get3Momentum(); + + if (pj.GetNorm() <= 0.) return dist; + + AliTrack tj; + tj.Set3Momentum(pj); + tj.SetReferencePoint(*rx); + dist=GetDistance(tj); + return dist; +} +/////////////////////////////////////////////////////////////////////////// TObject* AliJet::Clone(const char* name) const { // Make a deep copy of the current object and provide the pointer to the copy. diff --git a/RALICE/AliJet.h b/RALICE/AliJet.h index 2baa7041a67..339a95e3193 100644 --- a/RALICE/AliJet.h +++ b/RALICE/AliJet.h @@ -54,6 +54,12 @@ class AliJet : public TNamed,public Ali4Vector void SetReferencePoint(AliPosition& p); // Set the jet reference-point AliPosition* GetReferencePoint(); // Provide the jet reference-point TObjArray* SortTracks(Int_t mode=-1,TObjArray* tracks=0); // Sort tracks by a certain observable + Double_t GetDistance(AliPosition* p); // Provide distance to position p + Double_t GetDistance(AliPosition& p) { return GetDistance(&p); } + Double_t GetDistance(AliTrack* t); // Provide distance to track t + Double_t GetDistance(AliTrack& t) { return GetDistance(&t); } + Double_t GetDistance(AliJet* j); // Provide distance to jet j + Double_t GetDistance(AliJet& j) { return GetDistance(&j); } protected: void Init(); // Initialisation of pointers etc... @@ -70,6 +76,6 @@ class AliJet : public TNamed,public Ali4Vector AliPositionObj* fRef; // The reference-point of the jet TObjArray* fSelected; //! Temp. array to hold user selected or ordered objects - ClassDef(AliJet,16) // Creation and investigation of a jet of particle tracks. + ClassDef(AliJet,17) // Creation and investigation of a jet of particle tracks. }; #endif diff --git a/RALICE/AliTrack.cxx b/RALICE/AliTrack.cxx index 8287e1b766b..08caaaed29b 100644 --- a/RALICE/AliTrack.cxx +++ b/RALICE/AliTrack.cxx @@ -1306,6 +1306,10 @@ Double_t AliTrack::GetDistance(AliPosition* p) if (!rx) return dist; + Ali3Vector p1=Get3Momentum(); + + if (p1.GetNorm() <= 0.) return dist; + Ali3Vector r0=(Ali3Vector)(*rx); Float_t tscale=rx->GetUnitScale(); @@ -1315,7 +1319,6 @@ Double_t AliTrack::GetDistance(AliPosition* p) // Obtain the direction unit vector of this track Double_t vec[3]; Double_t err[3]; - Ali3Vector p1=Get3Momentum(); p1.GetVector(vec,"sph"); p1.GetErrors(err,"sph"); vec[0]=1.; @@ -1331,6 +1334,78 @@ Double_t AliTrack::GetDistance(AliPosition* p) return dist; } /////////////////////////////////////////////////////////////////////////// +Double_t AliTrack::GetDistance(AliTrack* t) +{ +// Provide distance of the current track to the track t. +// The error on the result can be obtained as usual by invoking +// GetResultError() afterwards. +// +// The distance will be provided in the unit scale of the current track. +// As such it is possible to obtain a correctly computed distance even in case +// the track parameters have a different unit scale. +// This implies that in such cases the results of t1.GetDistance(t2) and +// t2.GetDistance(t1) will be numerically different. +// However, it is recommended to work always with one single unit scale. +// +// Note : In case of incomplete information, a distance value of -1 is +// returned. + + Double_t dist=-1.; + fDresult=0.; + + if (!t) return dist; + + // Obtain a defined position on this track + AliPosition* rx=fRef; + if (!rx) rx=fBegin; + if (!rx) rx=fEnd; + + if (!rx) return dist; + + // Obtain a defined position on track t + AliPosition* ry=t->GetReferencePoint(); + if (!ry) ry=t->GetBeginPoint(); + if (!ry) ry=t->GetEndPoint(); + + if (!ry) return dist; + + Ali3Vector p1=Get3Momentum(); + Ali3Vector p2=t->Get3Momentum(); + + if (p1.GetNorm() <= 0. || p2.GetNorm() <= 0.) return dist; + + // The vector normal to both track directions + Ali3Vector n=p1.Cross(p2); + + if (n.GetNorm() > 1.e-10) + { + // Normalise n to a unit vector + Double_t vec[3]; + Double_t err[3]; + n.GetVector(vec,"sph"); + n.GetErrors(err,"sph"); + vec[0]=1.; + err[0]=0.; + n.SetVector(vec,"sph"); + n.SetErrors(err,"sph"); + Ali3Vector r1=(Ali3Vector)(*rx); + Ali3Vector r2=(Ali3Vector)(*ry); + // Correct components of r2 in case of different unit scales + Float_t scale=rx->GetUnitScale(); + Float_t tscale=ry->GetUnitScale(); + if ((tscale/scale > 1.1) || (scale/tscale > 1.1)) r2=r2*(tscale/scale); + Ali3Vector r=r1-r2; + dist=fabs(r.Dot(n)); + fDresult=r.GetResultError(); + } + else // Parallel tracks + { + dist=t->GetDistance(rx); + fDresult=t->GetResultError(); + } + return dist; +} +/////////////////////////////////////////////////////////////////////////// TObject* AliTrack::Clone(const char* name) const { // Make a deep copy of the current object and provide the pointer to the copy. diff --git a/RALICE/AliTrack.h b/RALICE/AliTrack.h index 5e62633e2c8..7e687e9adab 100644 --- a/RALICE/AliTrack.h +++ b/RALICE/AliTrack.h @@ -89,6 +89,8 @@ class AliTrack : public TNamed,public Ali4Vector void RemoveTimestamp(); // Remove timestamp from this track Double_t GetDistance(AliPosition* p); // Provide distance to position p Double_t GetDistance(AliPosition& p) { return GetDistance(&p); } + Double_t GetDistance(AliTrack* t); // Provide distance to track t + Double_t GetDistance(AliTrack& t) { return GetDistance(&t); } protected: void Init(); // Initialisation of pointers etc... @@ -115,6 +117,6 @@ class AliTrack : public TNamed,public Ali4Vector private: void Dumps(AliTrack* t,Int_t n,TString f,TString u); // Recursively print all decay levels - ClassDef(AliTrack,16) // Handling of the attributes of a reconstructed particle track. + ClassDef(AliTrack,17) // Handling of the attributes of a reconstructed particle track. }; #endif diff --git a/RALICE/history.txt b/RALICE/history.txt index 8ac4a54485e..c15a983e684 100644 --- a/RALICE/history.txt +++ b/RALICE/history.txt @@ -686,3 +686,7 @@ Also copy ctor of AliHelix made complete for new datamembers. 22-mar-2006 NvE Line attribute selections for displays extended in AliHelix. 20-apr-2006 NvE Several small modifications to prevent gcc warnings. +10-may-2006 NvE Distance determination between tracks and/or jets introduced in + AliTrack and AliJet. + Also compiler warnings activated for overloaded virtuals in installation + script for AMD Athlon in the /scripts sub-directory. diff --git a/RALICE/icepack/history.txt b/RALICE/icepack/history.txt index 460d9b46767..805dc6a431d 100644 --- a/RALICE/icepack/history.txt +++ b/RALICE/icepack/history.txt @@ -65,3 +65,5 @@ Also new memberfunction SetPenalty() introduced in IcePandel. 21-apr-2006 NvE TFile.h included in header files of IceCalibrate and IceXtalk to prevent compiler error with new ROOT 5.11 version. +10-may-2006 NvE Compiler warnings activated for overloaded virtuals in installation + script for AMD Athlon in the /scripts sub-directory. diff --git a/RALICE/icepack/iceconvert/history.txt b/RALICE/icepack/iceconvert/history.txt index 67c06032214..4cb4d1c133c 100644 --- a/RALICE/icepack/iceconvert/history.txt +++ b/RALICE/icepack/iceconvert/history.txt @@ -55,4 +55,6 @@ 08-mar-2006 NvE Time offset correction in IceF2k extended to allow also a user defined offset to cope with Monte Carlo data. 22-mar-2006 NvE Support for selective MC track storage introduced in IceF2k. +10-may-2006 NvE Compiler warnings activated for overloaded virtuals in installation + script for AMD Athlon in the /scripts sub-directory. diff --git a/RALICE/icepack/iceconvert/scripts/amdgcclib.sh b/RALICE/icepack/iceconvert/scripts/amdgcclib.sh index 20e6fcab690..8af57fc32fe 100644 --- a/RALICE/icepack/iceconvert/scripts/amdgcclib.sh +++ b/RALICE/icepack/iceconvert/scripts/amdgcclib.sh @@ -14,7 +14,7 @@ gcccomp="-fPIC -c -g0 -Wall -Wno-long-long -I\$ROOTSYS/include -I\$ALIROOT/RALICE ### The option string for GCC shared lib compilation and linking *** ### For the GCC ROOT loadable shared lib the strict requirements are *** ### dropped to avoid many warnings from the rootcint generated code *** -gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -I\$ROOTSYS/include -I\$ALIROOT/RALICE -I\$ALIROOT/RALICE/icepack -o \$lib" +gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -Woverloaded-virtual -I\$ROOTSYS/include -I\$ALIROOT/RALICE -I\$ALIROOT/RALICE/icepack -o \$lib" # echo "lib = " \$lib echo "gcccomp = " \$gcccomp diff --git a/RALICE/icepack/scripts/amdgcclib.sh b/RALICE/icepack/scripts/amdgcclib.sh index 47df8fb4712..5edc58a1847 100644 --- a/RALICE/icepack/scripts/amdgcclib.sh +++ b/RALICE/icepack/scripts/amdgcclib.sh @@ -9,7 +9,7 @@ lib=icepack.so ### The option string for GCC shared lib compilation and linking *** ### For the GCC ROOT loadable shared lib the strict requirements are *** ### dropped to avoid many warnings from the rootcint generated code *** -gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -I\$ROOTSYS/include -I\$ALIROOT/RALICE -o \$lib" +gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -Woverloaded-virtual -I\$ROOTSYS/include -I\$ALIROOT/RALICE -o \$lib" # echo "lib = " \$lib echo "gccroot = " \$gccroot diff --git a/RALICE/scripts/amdgcclib.sh b/RALICE/scripts/amdgcclib.sh index 3abd75a33d6..a0b815bb525 100644 --- a/RALICE/scripts/amdgcclib.sh +++ b/RALICE/scripts/amdgcclib.sh @@ -9,7 +9,7 @@ lib=ralice.so ### The option string for GCC shared lib compilation and linking *** ### For the GCC ROOT loadable shared lib the strict requirements are *** ### dropped to avoid many warnings from the rootcint generated code *** -gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -I\$ROOTSYS/include -o \$lib" +gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -Woverloaded-virtual -I\$ROOTSYS/include -o \$lib" # echo "lib = " \$lib echo "gccroot = " \$gccroot diff --git a/RALICE/wa98/history.txt b/RALICE/wa98/history.txt index c4a5ef63dba..c543a433d3c 100644 --- a/RALICE/wa98/history.txt +++ b/RALICE/wa98/history.txt @@ -46,3 +46,5 @@ Also installation script macgcclib.sh for gcc on MAC systems introduced. 16-feb-2005 NvE Support for user selectable split level and buffer size of the output tree introduced in Wa98Convert. +10-may-2006 NvE Compiler warnings activated for overloaded virtuals in installation + script for AMD Athlon in the /scripts sub-directory. diff --git a/RALICE/wa98/scripts/amdgcclib.sh b/RALICE/wa98/scripts/amdgcclib.sh index 39f3727ef65..0acb79bd83a 100644 --- a/RALICE/wa98/scripts/amdgcclib.sh +++ b/RALICE/wa98/scripts/amdgcclib.sh @@ -9,7 +9,7 @@ lib=rwa98.so ### The option string for GCC shared lib compilation and linking *** ### For the GCC ROOT loadable shared lib the strict requirements are *** ### dropped to avoid many warnings from the rootcint generated code *** -gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -I\$ROOTSYS/include -I\$ALIROOT/RALICE -o \$lib" +gccroot="-fPIC -shared -g0 -ansi -pedantic -Wall -Wno-long-long -Woverloaded-virtual -I\$ROOTSYS/include -I\$ALIROOT/RALICE -o \$lib" # echo "lib = " \$lib echo "gccroot = " \$gccroot