// -*- mode: c++ -*- #ifndef BRAT_BrGeantTrack #define BRAT_BrGeantTrack // $Id: BrGeantTrack.h,v 1.2 2002/04/22 12:53:07 staszel Exp $ // /////////////////////////////////////////////////////////////////////// // // // BrGeantTrack // // // // BRAHMS Geant track class // // // // BrGeantTrack is a ROOT equivalent of the track structures used // // in the c-stream files. // // // // Author : Kris Hagel from a template by G.Roland // // Created : October 97 // // Version : 1.1 // // Changed : 31/12/97 fv; Major re-write // // // /////////////////////////////////////////////////////////////////////// // Root Classes #include "TObject.h" #include "TObjArray.h" // BRAHMS Classes #include "BrGeantHit.h" #ifndef BRAT_BrLine3D #include "BrLine3D.h" #endif struct GeantStreamTracks { int trackno; int pid; int charge; float pvert[3]; float vert[3]; int ntbeam; int subvol; int fVolu; int fReason; }; class BrGeantTrack : public TObject { public: BrGeantTrack(); BrGeantTrack(GeantStreamTracks& ffTracks); BrGeantTrack(const BrGeantTrack *track); virtual ~BrGeantTrack(); virtual Double_t Vx() const { return fVx;} virtual Double_t Vy() const { return fVy;} virtual Double_t Vz() const { return fVz;} virtual Double_t Px() const { return fPx;} virtual Double_t Py() const { return fPy;} virtual Double_t Pz() const { return fPz;} virtual Double_t Pt() const { return sqrt(fPx*fPx+fPy*fPy);} virtual Int_t TrackNo() const { return fTrackno;} virtual Double_t Energy() const; virtual Double_t P() const; virtual Double_t Rap() const; virtual Double_t Beta() const; virtual Double_t Theta() const; virtual Double_t Phi() const; virtual Double_t Dip() const; virtual Bool_t IsParent() const {return fNtbeam%10000==0;} virtual Int_t Ntbeam(){return fNtbeam;} virtual Double_t Charge() const { return fCharge;} virtual void SetStatus(Int_t n) { fStatus = n; } virtual void SetVx(Double_t x) { fVx = x; } virtual void SetVy(Double_t x) { fVy = x; } virtual void SetVz(Double_t x) { fVz = x; } virtual void SetPx(Double_t x) { fPx = x; } virtual void SetPy(Double_t x) { fPy = x; } virtual void SetPz(Double_t x) { fPz = x; } virtual void SetMass(Double_t x) { fMass = x; } virtual void SetPid(Int_t n) { fPid = n; } virtual void SetCharge(Double_t x) { fCharge = x; } virtual void AddHit(BrGeantHit *hit); virtual TObjArray *HitListp() { return fHitList; } virtual TObjArray *GetHitList() { return fHitList; } virtual Int_t NHits() const; virtual Int_t Status() const { return fStatus; } virtual Double_t Mass() const { return fMass; } virtual Int_t Pid() const { return fPid; } virtual BrGeantHit *NextHit(); virtual void ResetHitCounter() { fHitCounter = 0; } virtual void MakeHitList(); virtual void ListHits(); virtual UInt_t GetHitBits() const { return fHitBits; } virtual void SetHitBit(Int_t ivol) { SETBIT(fHitBits,ivol); } virtual Bool_t HasHitsIn(UInt_t DetectorBits) const { return (Bool_t)(DetectorBits ? (fHitBits & DetectorBits) == DetectorBits : 0); } virtual BrLine3D GetTrackLine(); private: Int_t fStatus; // track status flag Double_t fVx; // X-origin of the track (cm) Double_t fVy; // Y-origin of the track (cm) Double_t fVz; // Z-origin of the track (cm) Double_t fMass; // Particle mass Double_t fCharge; // Charge of Track Double_t fPx; // Momentum in X at vertex (GeV/c) Double_t fPy; // Momentum in Y at vertex (GeV/c) Double_t fPz; // Momentum in Z at vertex (GeV/c) Int_t fPid; // Particle GEANT ID Int_t fTrackno; // Geant Track Number Int_t fNtbeam; // Parent Track number (0 if none module 10000) TObjArray *fHitList; //! List of hits on the track Int_t fHitCounter; //! Counter for GetNextHit member function UInt_t fHitBits; //! Bit mask of detector volumes hit public: friend ostream& operator<< (ostream& os,BrGeantTrack* gtrack); ClassDef(BrGeantTrack,1) // BRAHMS Geant track class }; extern ostream& operator<< (ostream &os, BrGeantTrack *gtrack); #endif ///////////////////////////////////////////////////////////////////////////////// // // $Log: BrGeantTrack.h,v $ // Revision 1.2 2002/04/22 12:53:07 staszel // Added method GetTrackLine that returns a track line at vertex. // // Revision 1.1.1.1 2001/06/21 14:55:00 hagel // Initial revision of brat2 // // Revision 1.16 2001/06/19 19:02:02 trine // Added Charge() and SetCharge(Double_t x) // // Revision 1.15 2000/10/17 20:50:14 videbaek // Moved cvs log to add. Changed some comment to reflect proper units for momenta. // // Revision 1.14 2000/04/28 21:20:20 videbaek // Use BrUnits to convert from geanthits to dedx intrinsic values. // // Revision 1.13 2000/03/21 21:22:07 cholm // Several changes: // A few hacks where needed to compile on Digital Unix, // noticably in my - Christian Holm - classes for the DB and Exceptions. // Proberly still need to do something to some of Konstantins stuff. // Also, I removed a lot of warnings fromt the compiler, by teddying up the code. // Several places, old C-style indecies in for loops were assumed. Corrected. // Unused variables have been commented out. // // Revision 1.12 1999/11/26 17:00:22 hehi // Added prototype for put-to operator - Christian Holm // // Revision 1.11 1999/11/19 17:00:45 videbaek // Update for NT and 2.2o // fHitList allocationUpdate for NT and 2.2tructor. // // // Revision 1.10 1999/10/06 13:21:07 videbaek // Fixed for memory leaks when hits are added. // // Revision 1.9 1999/09/15 15:57:30 videbaek // Modified fHitlist that point to BrGeantHit(s) not to be written out // in the streamer method. This caused memory leak in reading the root tree files. // The list should probably be done by means of an list of Ids. // // Revision 1.8 1999/05/25 20:38:59 videbaek // Add iostream methods // // Revision 1.7 1999/04/14 20:09:58 videbaek // Corrected P(). added method Phi() // // Revision 1.6 1999/03/17 21:36:29 videbaek // Added member functions to BrGeantTrack class which are // useful in analysis Pt(). Modiifed the Rap() to take no-argument. // The Mass of the particle in the track has already been set by the // reading routine. // // Revision 1.5 1999/01/21 23:23:23 hagel // 1. Changed convention for checking includes. Current convention is: // BRAT_Br...... eg BRAT_BrModule ala ROOT. // 2. Added CVS logs to .h files that didnt have them. // 3. Moved checking of include definition to first line for easier reading // 4. Put checks before all includes in the include files as per BRAT specifications // 5. Added BrGeantHeader to Geant Makefile // 6. All changes have been checked to compile on NT ala Cygnus // // Revision 1.4 1998/09/27 17:08:07 alv // added copy constructor // added member fHitBits // added member functions GetHitBits, SetHitBit and HasHitsIn // made the "get" methods const // // Revision 1.3 1998/07/20 17:42:40 videbaek // Added Pid hit to hit structure. Needed for effecient handling // of detector response. // // Revision 1.2 1998/04/06 21:12:09 videbaek // Clean up and additions for Win95 // //