* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
-
-//----------------------------------------------------------------------
-// Class containing the kinematic information of tracks at various
-// points in the simulation to check the reconstruction
-// Origin: M.Ivanov
-//----------------------------------------------------------------------
#include "AliTrackReference.h"
+#include "TParticle.h"
+#include "AliRun.h"
+#include "TLorentzVector.h"
+
+//
+// Track Reference object is created every time particle is
+// crossing detector bounds. The object is created by Step Manager
+//
+// The class stores the following informations:
+// track label,
+// track position: X,Y,X
+// track momentum px, py, pz
+// track length and time of fligth: both in cm
+// status bits from Monte Carlo
+//
+
ClassImp(AliTrackReference)
{
//
// Default constructor
+ // Creates empty object
+
+ for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
+}
+
+//_______________________________________________________________________
+AliTrackReference::AliTrackReference(Int_t label, TVirtualMC *vMC) {
+ //
+ // Create Reference object out of label and
+ // data in TVirtualMC object
+ //
+ // Creates an object and fill all parameters
+ // from data in VirtualMC
//
+ // Sylwester Radomski, (S.Radomski@gsi.de)
+ // GSI, Jan 31, 2003
+ //
+
+ TLorentzVector vec;
+
+ fTrack = label;
+ fLength = vMC->TrackLength();
+ fTime = vMC->TrackTime();
+
+ vMC->TrackPosition(vec);
+
+ fX = vec[0];
+ fY = vec[1];
+ fZ = vec[2];
+
+ vMC->TrackMomentum(vec);
+
+ fPx = vec[0];
+ fPy = vec[1];
+ fPy = vec[2];
+
+ // Set Up status code
+ // Copy Bits from virtual MC
+
+ for(Int_t i=0; i<16; i++) ResetBit(BIT(i));
+
+ SetBit(BIT(0), vMC->IsNewTrack());
+ SetBit(BIT(1), vMC->IsTrackAlive());
+ SetBit(BIT(2), vMC->IsTrackDisappeared());
+ SetBit(BIT(3), vMC->IsTrackEntering());
+ SetBit(BIT(4), vMC->IsTrackExiting());
+ SetBit(BIT(5), vMC->IsTrackInside());
+ SetBit(BIT(6), vMC->IsTrackOut());
+ SetBit(BIT(7), vMC->IsTrackStop());
}
+//_______________________________________________________________________
/* $Id$ */
#include "TObject.h"
-#include "TMath.h"
+#include "TVirtualMC.h"
class AliTrackReference : public TObject {
+
public:
+
AliTrackReference();
+ AliTrackReference(Int_t label, TVirtualMC *vMC);
virtual ~AliTrackReference() {}
+
virtual Int_t GetTrack() const {return fTrack;}
- virtual Int_t Label() const {return fTrack;}
virtual void SetTrack(Int_t track) {fTrack=track;}
- virtual void SetLabel(Int_t track) {fTrack=track;}
virtual void SetLength(Float_t length){fLength=length;}
+ virtual void SetTime(Float_t time) {fTime = time;}
virtual Float_t GetLength(){return fLength;}
+ virtual Float_t GetTime(){return fTime;}
virtual Float_t X() const {return fX;}
virtual Float_t Y() const {return fY;}
virtual Float_t Z() const {return fZ;}
- virtual Float_t R() const {return TMath::Sqrt(fX*fX+fY*fY);}
virtual Float_t Px() const {return fPx;}
virtual Float_t Py() const {return fPy;}
virtual Float_t Pz() const {return fPz;}
- virtual Float_t Pt() const {return TMath::Sqrt(fPx*fPx+fPy*fPy);}
- virtual Float_t Phi() const {return TMath::Pi()+TMath::ATan2(-fPy,-fPx);}
- virtual Float_t Theta() const {return (fZ==0)?TMath::Pi()/2:TMath::ACos(fZ/TMath::Sqrt(fX*fX+fY*fY+fZ*fZ)); }
virtual void SetPosition(Float_t x, Float_t y, Float_t z){fX=x; fY=y; fZ=z;}
virtual void SetMomentum(Float_t px, Float_t py, Float_t pz){fPx=px; fPy=py; fPz=pz;}
-
+
+
protected:
Int_t fTrack; // Track number
Float_t fX; // X reference position of the track
Float_t fPx; // momentum
Float_t fPy; // momentum
Float_t fPz; // momentum
- Float_t fLength; // track lenght from its origin
+ Float_t fLength; // track lenght from its origin in cm
+ Float_t fTime; // time of flight in cm
ClassDef(AliTrackReference,2) //Base class for all Alice track references
};
/*
$Log$
+Revision 1.65 2002/11/21 22:43:32 alibrary
+Removing AliMC and AliMCProcess
+
Revision 1.64 2002/10/23 07:17:33 alibrary
Introducing Riostream.h
AddHit2(track,vol,hits);
}
-void AliTPC::AddTrackReference(Int_t lab, TLorentzVector p, TLorentzVector x, Float_t length){
+void AliTPC::AddTrackReference(Int_t label, TVirtualMC *vMC){
//
// add a trackrefernce to the list
if (!fTrackReferences) {
}
Int_t nref = fTrackReferences->GetEntriesFast();
TClonesArray &lref = *fTrackReferences;
- AliTrackReference * ref = new(lref[nref]) AliTrackReference;
- ref->SetMomentum(p[0],p[1],p[2]);
- ref->SetPosition(x[0],x[1],x[2]);
- ref->SetTrack(lab);
- ref->SetLength(length);
+ new(lref[nref]) AliTrackReference(label, vMC);
}
//_____________________________________________________________________________
#include "AliHit.h"
#include "AliDigit.h"
#include "TLorentzVector.h"
+#include "TVirtualMC.h"
AliTPC(const char *name, const char *title);
virtual ~AliTPC();
virtual void AddHit(Int_t a1, Int_t *a2, Float_t *a3);
- virtual void AddTrackReference(Int_t lab, TLorentzVector p, TLorentzVector x,Float_t length);
+ virtual void AddTrackReference(Int_t label, TVirtualMC *vMC);
Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void BuildGeometry();
virtual void CreateGeometry() {}
/*
$Log$
+Revision 1.45 2003/01/14 10:50:20 alibrary
+Cleanup of STEER coding conventions
+
Revision 1.44 2002/11/21 22:43:32 alibrary
Removing AliMC and AliMCProcess
id = gMC->CurrentVolID(copy); // current volume Id
- if (gMC->IsTrackEntering() && ( (id == fIdLSec) || (id == fIdUSec))){
- // printf("track %d entering volume %d\n",gAlice->CurrentTrack(),id);
- TLorentzVector p;
- TLorentzVector x;
- gMC->TrackMomentum(p);
- gMC->TrackPosition(x);
- AddTrackReference(gAlice->CurrentTrack(),p,x,gMC->TrackLength());
- }
+ if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting()) &&
+ ((id == fIdLSec) || (id == fIdUSec)) ) {
- if (gMC->IsTrackExiting() && ( (id == fIdLSec) || (id == fIdUSec))){
- // printf("track %d exiting volume %d\n",gAlice->CurrentTrack(),id);
- TLorentzVector p;
- TLorentzVector x;
- gMC->TrackMomentum(p);
- gMC->TrackPosition(x);
- AddTrackReference(gAlice->CurrentTrack(),p,x,gMC->TrackLength());
+ AddTrackReference(gAlice->CurrentTrack(), gMC);
}
-
if(id == fIdLSec){
vol[0] = copy-1; // lower sector number
}
/*
$Log$
+Revision 1.44 2003/01/28 14:38:18 cblume
+Add track length to track references
+
Revision 1.43 2002/11/21 22:38:47 alibrary
Removing AliMC and AliMCProcess
}
//_____________________________________________________________________________
-void AliTRD::AddTrackReference(Int_t label, TLorentzVector p
- , TLorentzVector x, Float_t length)
+void AliTRD::AddTrackReference(Int_t label, TVirtualMC *vMC)
{
//
// Add a trackrefernce to the list
Int_t nref = fTrackReferences->GetEntriesFast();
TClonesArray &lref = *fTrackReferences;
- AliTrackReference * ref = new(lref[nref]) AliTrackReference();
- ref->SetMomentum(p[0],p[1],p[2]);
- ref->SetPosition(x[0],x[1],x[2]);
- ref->SetTrack(label);
- ref->SetLength(length);
-
+ new(lref[nref]) AliTrackReference(label, vMC);
}
//_____________________________________________________________________________
////////////////////////////////////////////////
#include "AliDetector.h"
+#include <TVirtualMC.h>
class TFile;
class TLorentzVector;
virtual void AddHit(Int_t track, Int_t det, Float_t *hits, Int_t q, Bool_t inDrift);
virtual void AddCluster(Float_t *pos, Int_t det, Float_t amp, Int_t *tracks
, Float_t *sig, Int_t iType);
- virtual void AddTrackReference(Int_t label, TLorentzVector p
- , TLorentzVector x, Float_t length);
+ virtual void AddTrackReference(Int_t label, TVirtualMC *vMC);
virtual void BuildGeometry();
virtual void Copy(TObject &trd);
virtual void CreateGeometry();
/*
$Log$
+Revision 1.38 2003/01/31 11:41:06 cblume
+Fix bug in StepManager in treating geometry with holes
+
Revision 1.37 2003/01/28 14:38:18 cblume
Add track length to track references
// momentum components of the particle
if (gMC->IsTrackEntering() || gMC->IsTrackExiting()) {
gMC->TrackMomentum(mom);
- AddTrackReference(gAlice->CurrentTrack(),mom,pos,gMC->TrackLength());
+ AddTrackReference(gAlice->CurrentTrack(),gMC);
}
// Create the hits from TR photons