]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
09-jul-2001 NvE Support for impact points and user identifier introduced in AliTrack.
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jul 2001 11:50:17 +0000 (11:50 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jul 2001 11:50:17 +0000 (11:50 +0000)
                Also user identifier facility introduced for AliJet and AliVertex.
12-jul-2001 NvE Memberfunction GetDistance() introduced for AliPosition and support for
                point of closest approach introduced in AliTrack.

RALICE/AliJet.cxx
RALICE/AliJet.h
RALICE/AliPosition.cxx
RALICE/AliPosition.h
RALICE/AliTrack.cxx
RALICE/AliTrack.h
RALICE/AliVertex.cxx
RALICE/AliVertex.h
RALICE/history.txt

index e667584238754d58b3b715e066aa17f28f18a41a..ae492ff4c675005c70a29f16d813f48fdbf8932c 100644 (file)
@@ -156,6 +156,7 @@ void AliJet::Reset()
 // The max. number of tracks is set to the initial value again
  fNtrk=0;
  fQ=0;
+ fUserId=0;
  Double_t a[4]={0,0,0,0};
  SetVector(a,"sph");
  if (fNtinit > 0) SetNtinit(fNtinit);
@@ -195,7 +196,7 @@ void AliJet::AddTrack(AliTrack& t)
 void AliJet::Info(TString f)
 {
 // Provide jet information within the coordinate frame f
- cout << " *AliJet::Info* Invmass : " << GetInvmass() << " Charge : " << fQ
+ cout << " *AliJet::Info* Id : " << fUserId << " Invmass : " << GetInvmass() << " Charge : " << fQ
       << " Momentum : " << GetMomentum() << " Ntracks : " << fNtrk << endl;
  cout << " ";
  Ali4Vector::Info(f); 
@@ -321,6 +322,27 @@ AliTrack* AliJet::GetTrack(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
+AliTrack* AliJet::GetIdTrack(Int_t id)
+{
+// Return the track with user identifier "id" of this jet
+ AliTrack* tx=0;
+ AliTrack* t=0;
+ if (!fTracks)
+ {
+  cout << " *AliJet*::GetIdTrack* No tracks present." << endl;
+  return 0;
+ }
+ else
+ {
+  for (Int_t i=0; i<fNtrk; i++)
+  {
+   tx=(AliTrack*)fTracks->At(i);
+   if (id == tx->GetId()) t=tx;
+  }
+  return t;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
 Double_t AliJet::GetPt()
 {
 // Provide trans. momentum value w.r.t. z-axis.
@@ -451,3 +473,15 @@ Int_t AliJet::GetTrackCopy()
  return fTrackCopy;
 }
 ///////////////////////////////////////////////////////////////////////////
+void AliJet::SetId(Int_t id)
+{
+// Set a user defined identifier for this jet.
+ fUserId=id;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliJet::GetId()
+{
+// Provide the user defined identifier of this jet.
+ return fUserId;
+}
+///////////////////////////////////////////////////////////////////////////
index c4b5a375e6d89137dbc060909f17759511012c31..43d191059f75d9ccd523f98b1459ea29d353147a 100644 (file)
@@ -33,6 +33,7 @@ class AliJet : public TObject,public Ali4Vector
   Float_t GetCharge();               // Provide the total charge of the jet
   Int_t GetNtracks();                // Return the number of tracks in the jet
   AliTrack* GetTrack(Int_t i);       // Provide i-th track of the jet (1=first track)
+  AliTrack* GetIdTrack(Int_t id);    // Provide the track with user identifier "id"
   Double_t GetPt();                  // Provide trans. momentum w.r.t. z-axis
   Double_t GetPl();                  // Provide long. momentum w.r.t. z-axis
   Double_t GetEt();                  // Provide trans. energy w.r.t. z-axis
@@ -41,6 +42,8 @@ class AliJet : public TObject,public Ali4Vector
   Double_t GetRapidity();            // Provide rapidity value w.r.t. z-axis
   void SetTrackCopy(Int_t j);        // (De)activate creation of private copies in fTracks
   Int_t GetTrackCopy();              // Provide TrackCopy flag value      
+  void SetId(Int_t id);              // Set the user defined identifier
+  Int_t GetId();                     // Provide the user defined identifier
 
  protected:
   void SetNtinit(Int_t n=2); // Set the initial max. number of tracks for this Jet
@@ -50,6 +53,7 @@ class AliJet : public TObject,public Ali4Vector
   Int_t fNtrk;               // The number of tracks in the jet
   TObjArray* fTracks;        // Array to hold the pointers to the tracks of the jet
   Int_t fTrackCopy;          // Flag to denote creation of private copies in fTracks
+  Int_t fUserId;             // The user defined identifier
  
  ClassDef(AliJet,1) // Creation and investigation of a jet of particle tracks.
 };
index 94541f701fbf62bdfa4b993be5d6182507a74a5a..e20f1b97bfdb4e0c09c6102d1a7a681ad99f6f70 100644 (file)
@@ -131,3 +131,14 @@ void AliPosition::GetPositionErrors(Float_t* r,TString f)
  GetErrors(r,f);
 }
 ///////////////////////////////////////////////////////////////////////////
+Double_t AliPosition::GetDistance(AliPosition& p)
+{
+// Provide distance to position p.
+// The error on the result can be obtained as usual by invoking
+// GetResultError() afterwards. 
+ Ali3Vector d=(Ali3Vector)((*this)-p);
+ Double_t dist=d.GetNorm();
+ fDresult=d.GetResultError();
+ return dist;
+}
+///////////////////////////////////////////////////////////////////////////
index cb49c0dba0ab2dff17acfaa6fc6863616514d0fa..997a10b3c1ad915dd4bf60a82540d67bb8a4f802 100644 (file)
@@ -24,7 +24,7 @@ class AliPosition : public Ali3Vector
   virtual void GetPosition(Float_t*  r,TString f);       // Provide position r in frame f
   AliPosition& GetPosition();                            // Provide position
   virtual void SetPosition(Ali3Vector& r);               // Store position r
-
+  Double_t GetDistance(AliPosition& p);                  // Provide distance to position p
   virtual void SetPositionErrors(Double_t* r,TString f); // Store position r in frame f
   virtual void GetPositionErrors(Double_t* r,TString f); // Provide position r in frame f
   virtual void SetPositionErrors(Float_t*  r,TString f); // Store position r in frame f
index 9b76f1c9775eabaaf8d1da7a9facf83a45eb82d8..67ed2355edf86b26f09434c9c7e12a889fabcf90 100644 (file)
@@ -126,6 +126,7 @@ void AliTrack::Reset()
 {
 // Reset all variables to 0 and delete all auto-generated decay tracks.
  fQ=0;
+ fUserId=0;
  fNdec=0;
  fNsig=0;
  fNmasses=0;
@@ -146,6 +147,10 @@ void AliTrack::Reset()
  Double_t b[3]={0,0,0};
  fBegin.SetPosition(b,"sph");
  fEnd.SetPosition(b,"sph");
+ fImpactXY.SetPosition(b,"sph");
+ fImpactXZ.SetPosition(b,"sph");
+ fImpactYZ.SetPosition(b,"sph");
+ fClosest.SetPosition(b,"sph");
  if (fMasses)
  {
   delete fMasses;
@@ -199,7 +204,7 @@ void AliTrack::Info(TString f)
 // Provide track information within the coordinate frame f
  Double_t m=GetMass();
  Double_t dm=GetResultError();
- cout << " *AliTrack::Info* Mass : " << m
+ cout << " *AliTrack::Info* Id : " << fUserId << " Mass : " << m
       << " error : " << dm << " Charge : " << fQ
       << " Momentum : " << GetMomentum() << " Nmass hyp. : " << fNmasses
       << " Ntracks : " << fNdec << " Nsignals : " << fNsig << endl;
@@ -779,3 +784,89 @@ Double_t AliTrack::GetRapidity()
  return y;
 }
 ///////////////////////////////////////////////////////////////////////////
+void AliTrack::SetImpactPoint(AliPosition p,TString q)
+{
+// Store the position of the impact-point in the plane "q=0".
+// Here q denotes one of the axes X, Y or Z.
+// Note : The character to denote the axis may be entered in lower or
+//        in uppercase.
+ Int_t axis=0;
+ if (q=="x" || q=="X") axis=1;
+ if (q=="y" || q=="Y") axis=2;
+ if (q=="z" || q=="Z") axis=3;
+
+ switch (axis)
+ {
+  case 1: // Impact-point in the plane X=0
+   fImpactYZ=p;
+   break;
+
+  case 2: // Impact-point in the plane Y=0
+   fImpactXZ=p;
+   break;
+
+  case 3: // Impact-point in the plane Z=0
+   fImpactXY=p;
+   break;
+
+  default: // Unsupported axis
+   cout << "*AliTrack::SetImpactPoint* Unsupported axis : " << q << endl
+        << " Possible axes are 'X', 'Y' and 'Z'." << endl; 
+   break;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+AliPosition AliTrack::GetImpactPoint(TString q)
+{
+// Provide the position of the impact-point in the plane "q=0".
+// Here q denotes one of the axes X, Y or Z.
+// Note : The character to denote the axis may be entered in lower or
+//        in uppercase.
+ AliPosition dummy;
+ Int_t axis=0;
+ if (q=="x" || q=="X") axis=1;
+ if (q=="y" || q=="Y") axis=2;
+ if (q=="z" || q=="Z") axis=3;
+
+ switch (axis)
+ {
+  case 1: // Impact-point in the plane X=0
+   return fImpactYZ;
+
+  case 2: // Impact-point in the plane Y=0
+   return fImpactXZ;
+
+  case 3: // Impact-point in the plane Z=0
+   return fImpactXY;
+
+  default: // Unsupported axis
+   cout << "*AliTrack::GetImpactPoint* Unsupported axis : " << q << endl
+        << " Possible axes are 'X', 'Y' and 'Z'." << endl; 
+   return dummy;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+void AliTrack::SetId(Int_t id)
+{
+// Set a user defined identifier for this track.
+ fUserId=id;
+}
+///////////////////////////////////////////////////////////////////////////
+Int_t AliTrack::GetId()
+{
+// Provide the user defined identifier of this track.
+ return fUserId;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliTrack::SetClosestPoint(AliPosition p)
+{
+// Set position p as the point of closest approach w.r.t. some reference
+ fClosest=p;
+}
+///////////////////////////////////////////////////////////////////////////
+AliPosition AliTrack::GetClosestPoint()
+{
+// Provide the point of closest approach w.r.t. some reference
+ return fClosest;
+}
+///////////////////////////////////////////////////////////////////////////
index eff2b9eadda20d49db27b408a82cccfc8243e1ff..7bfb1ed5f18131ed64b4f51811c429047b9dd51f 100644 (file)
@@ -57,19 +57,30 @@ class AliTrack : public TObject,public Ali4Vector
   Double_t GetMt();                 // Provide trans. mass w.r.t. z-axis
   Double_t GetMt(Int_t j);          // Provide trans. mass w.r.t. z-axis and jth mass hypothesis
   Double_t GetRapidity();           // Provide rapidity value w.r.t. z-axis
+  void SetImpactPoint(AliPosition p,TString q); // Set the impact-point in plane "q=0"
+  AliPosition GetImpactPoint(TString q);        // Provide the impact-point in plane "q=0"
+  void SetId(Int_t id);             // Set the user defined identifier
+  Int_t GetId();                    // Provide the user defined identifier
+  void SetClosestPoint(AliPosition p); // Set position p as point of closest approach w.r.t. some reference
+  AliPosition GetClosestPoint();       // Provide point of closest approach w.r.t. some reference
  
  protected:
-  Float_t fQ;          // The charge of the particle
-  Int_t fNdec;         // The number of decay products
-  TObjArray* fDecays;  // The array of decay produced tracks
-  Int_t fNsig;         // The number of related AliSignals
-  TObjArray* fSignals; // The array of related AliSignals
-  AliPosition fBegin;  // The begin-point of the track 
-  AliPosition fEnd;    // The end-point of the track 
-  Int_t fNmasses;      // The number of mass hypotheses
-  TArrayD* fMasses;    // The various mass hypotheses
-  TArrayD* fDmasses;   // The errors on the various masses
-  TArrayD* fPmasses;   // The probabilities of the various mass hypotheses
+  Float_t fQ;            // The charge of the particle
+  Int_t fNdec;           // The number of decay products
+  TObjArray* fDecays;    // The array of decay produced tracks
+  Int_t fNsig;           // The number of related AliSignals
+  TObjArray* fSignals;   // The array of related AliSignals
+  AliPosition fBegin;    // The begin-point of the track 
+  AliPosition fEnd;      // The end-point of the track 
+  Int_t fNmasses;        // The number of mass hypotheses
+  TArrayD* fMasses;      // The various mass hypotheses
+  TArrayD* fDmasses;     // The errors on the various masses
+  TArrayD* fPmasses;     // The probabilities of the various mass hypotheses
+  AliPosition fImpactXY; // The (extrapolated) impact-point in the plane z=0
+  AliPosition fImpactXZ; // The (extrapolated) impact-point in the plane y=0
+  AliPosition fImpactYZ; // The (extrapolated) impact-point in the plane x=0
+  Int_t fUserId;         // The user defined identifier
+  AliPosition fClosest;  // The (extrapolated) point of closest approach w.r.t some reference
 
  private:
   void Dump(AliTrack* t,Int_t n,TString f); // Recursively print all decay levels
index 9550e8b0cb1f2c842a99f1fa24b9c3c7d9234129..8ee85692029d9a2fea94cac72c848f75e271a2ab 100644 (file)
@@ -400,7 +400,7 @@ void AliVertex::AddVertex(AliVertex& v,Int_t connect)
   Double_t v2=v.GetInvariant();
   Double_t dv2=v.Ali4Vector::GetResultError();
 
-  AliTrack* t=new AliTrack;
+  AliTrack* t=new AliTrack();
   t->SetBeginPoint(r1);
   t->SetEndPoint(r2);
   t->SetCharge(q);
@@ -417,7 +417,7 @@ void AliVertex::AddVertex(AliVertex& v,Int_t connect)
 void AliVertex::Info(TString f)
 {
 // Provide vertex information within the coordinate frame f
- cout << " *AliVertex::Info* Invmass : " << GetInvmass()
+ cout << " *AliVertex::Info* Id : " << fUserId << " Invmass : " << GetInvmass()
       << " Charge : " << GetCharge() << " Momentum : " << GetMomentum()
       << " Ntracks : " << GetNtracks() << " Nvertices : " << fNvtx 
       << " Njets : " << fNjets << endl;
@@ -564,6 +564,27 @@ AliVertex* AliVertex::GetVertex(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
+AliVertex* AliVertex::GetIdVertex(Int_t id)
+{
+// Return the (sec.) vertex with user identifier "id"
+ AliVertex* vx=0;
+ AliVertex* v=0;
+ if (!fVertices)
+ {
+  cout << " *AliVertex*::GetIdVertex* No (secondary) vertices present." << endl;
+  return 0;
+ }
+ else
+ {
+  for (Int_t i=0; i<fNvtx; i++)
+  {
+   vx=(AliVertex*)fVertices->At(i);
+   if (id == vx->GetId()) v=vx;
+  }
+  return v;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
 void AliVertex::SetVertexCopy(Int_t j)
 {
 // (De)activate the creation of private copies of the added vertices.
@@ -629,6 +650,27 @@ AliJet* AliVertex::GetJet(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
+AliJet* AliVertex::GetIdJet(Int_t id)
+{
+// Return the jet with user identifier "id"
+ AliJet* jx=0;
+ AliJet* j=0;
+ if (!fJets)
+ {
+  cout << " *AliVertex*::GetIdJet* No jets present." << endl;
+  return 0;
+ }
+ else
+ {
+  for (Int_t i=0; i<fNjets; i++)
+  {
+   jx=(AliJet*)fJets->At(i);
+   if (id == jx->GetId()) j=jx;
+  }
+  return j;
+ }
+}
+///////////////////////////////////////////////////////////////////////////
 void AliVertex::SetJetCopy(Int_t j)
 {
 // (De)activate the creation of private copies of the added jets.
index aba1b45f735569a3eef29d1810cbbd3003e6b350..57507546b1a37af8e79a0a05a1c07aa78044eb3f 100644 (file)
@@ -31,11 +31,13 @@ class AliVertex : public AliJet,public AliPosition
   void ListAll(TString f="car");          // Print prim. + sec. vertex full track info for coord. frame f
   Int_t GetNvertices();                   // Return the number of (secondary) vertices
   AliVertex* GetVertex(Int_t i);          // Provide i-th (secondary) vertex
+  AliVertex* GetIdVertex(Int_t id);       // Provide the vertex with user identifier "id"
   void SetNvmax(Int_t n=2);               // Set the initial max. number of (secondary) vertices
   void SetVertexCopy(Int_t j);            // (De)activate creation of private copies in fVertices
   Int_t GetVertexCopy();                  // Provide VertexCopy flag value      
   Int_t GetNjets();                       // Return the number of jets
   AliJet* GetJet(Int_t i);                // Provide i-th jet
+  AliJet* GetIdJet(Int_t id);             // Provide the jet with user identifier "id"
   void SetNjmax(Int_t n=2);               // Set the initial max. number of jets
   void SetJetCopy(Int_t j);               // (De)activate creation of private copies in fJets
   Int_t GetJetCopy();                     // Provide JetCopy flag value      
index eef5361f1165c52cee89bf4baf5d58054d734835..d0ec5fae6ff501c5a539883a5a1e9b8423588bf1 100644 (file)
                 AliTrack etc... storage in AliEvent & co.
                 Also (Ali4Vector&) casting stmt. in AliVertex::ResetVertices() changed
                 to make it ANSI compatible for all compilers/platforms.  
+09-jul-2001 NvE Support for impact points and user identifier introduced in AliTrack.
+                Also user identifier facility introduced for AliJet and AliVertex.
+12-jul-2001 NvE Memberfunction GetDistance() introduced for AliPosition and support for
+                point of closest approach introduced in AliTrack.