// -*- mode: c++ -*- #ifndef BRAT_BrGeantHit #define BRAT_BrGeantHit // $Id: BrGeantHit.h,v 1.2 2002/04/22 13:03:48 staszel Exp $ // // /////////////////////////////////////////////////////////////////////// // // // BrGeantHit // // // // BRAHMS Hit class // // // // BrGeantHit is the GBRAHMS hit class which is a ROOT class // // equivalent to data structs in the stream files. // // programs // // // // Author : Kris Hagel // // Created : October 97 // // Version : 1.0 // // Changed : 31/12/97 fv // 08/26/00 fv - add pointer to tracks // // // /////////////////////////////////////////////////////////////////////// #include "iostream.h" // Root Classes #ifndef ROOT_TObject #include "TObject.h" #endif // BRAT Classes #ifndef BRAT_BrLine3D #include "BrLine3D.h" #endif class BrGeantTrack; // Brahms Classes struct GeantStreamHits { int trackno; int DetectorId; float LocalPositionIn[3]; float LocalPositionOut[3]; float GlobalPositionIn[3]; float GlobalPositionOut[3]; float Tof; float dedx; float Etot; int Isub; int Pid; }; class BrGeantHit : public TObject { public: BrGeantHit(); BrGeantHit(GeantStreamHits& fHits); BrGeantHit(const BrGeantHit *hit); virtual ~BrGeantHit() { }; virtual Int_t TrackNo() const {return fTrackNo; } virtual BrGeantTrack* GetTrack() {return fTrackp;} virtual Int_t DetectorID() const {return fDetectorID; } virtual Float_t *LocalPosIn() {return fLocalPosIn; } virtual Float_t *LocalPosOut() {return fLocalPosOut; } virtual Float_t *GlobalPosIn() {return fGlobalPosIn; } virtual Float_t *GlobalPosOut(){return fGlobalPosOut;} virtual Float_t LocalYPosIn() const {return fLocalPosIn[1];} virtual Float_t LocalXPosIn() const {return fLocalPosIn[0];} virtual Float_t LocalZPosIn() const {return fLocalPosIn[2];} virtual Float_t LocalYPosOut() const {return fLocalPosOut[1];} virtual Float_t LocalXPosOut() const {return fLocalPosOut[0];} virtual Float_t LocalZPosOut() const {return fLocalPosOut[2];} virtual Float_t Tof() const {return fTof; } virtual Float_t Dedx() const {return fDedx;} virtual Float_t Pdet() const {return fPdet;} virtual Int_t Isub() const {return fIsub; } virtual Int_t Pid() const {return fPid; } virtual BrLine3D GetGlobalLine(); virtual BrLine3D GetLocalLine(); virtual void SetTrackNo(Int_t i ) {fTrackNo = i;} virtual void SetTrack(BrGeantTrack* track) {fTrackp = track;} virtual void SetDetectorID(Int_t i) {fDetectorID = i; } virtual void SetLocalPosIn(Float_t x[3]) { fLocalPosIn[0] = x[0]; fLocalPosIn[1] = x[1]; fLocalPosIn[2] = x[2]; } virtual void SetLocalPosOut(Float_t x[3]) { fLocalPosOut[0] = x[0]; fLocalPosOut[1] = x[1]; fLocalPosOut[2] = x[2]; } virtual void SetGlobalPosIn(Float_t x[3]) { fGlobalPosIn[0] = x[0]; fGlobalPosIn[1] = x[1]; fGlobalPosIn[2] = x[2]; } virtual void SetGlobalPosOut(Float_t x[3]) { fGlobalPosOut[0] = x[0]; fGlobalPosOut[1] = x[1]; fGlobalPosOut[2] = x[2]; } virtual void SetTof(Float_t x) {fTof = x;} virtual void SetDedx(Float_t x){fDedx = x;} virtual void SetPdet(Float_t x){fPdet = x;} virtual void SetIsub(Int_t i) {fIsub = i;} virtual void SetPid(Int_t i) {fPid = i;} private: Int_t fTrackNo; // Trackno of generating Hit Int_t fDetectorID; // Detector number for hit Float_t fLocalPosIn[3]; // Coordinates for hit entrance (in // local system) Float_t fLocalPosOut[3]; // Coordinates for hit exit (in local system) Float_t fGlobalPosIn[3]; Float_t fGlobalPosOut[3]; Float_t fTof; // Time-Of-Flight (nsec) Float_t fDedx; // Dedx (MeV) Float_t fPdet; // particle momentum at detector Int_t fIsub; // Detector number (slat, padrow, volume no etc) Int_t fPid; // Geant Particle ID code. BrGeantTrack * fTrackp; //!Pointer to Track public: friend ostream& operator<< (ostream& os,BrGeantHit* ghit); static Double_t Mass(Int_t pid); static Double_t Charge(Int_t pid); ClassDef(BrGeantHit,1) // BRAHMS hit data class }; extern ostream& operator<< (ostream& os,BrGeantHit* ghit); #endif //__________________________________________________________________________ // // $Log: BrGeantHit.h,v $ // Revision 1.2 2002/04/22 13:03:48 staszel // Added two methods GetLocalLine and GetGlobalLine which return respectively, // local and global line associated with a given hit. // // Revision 1.1.1.1 2001/06/21 14:55:00 hagel // Initial revision of brat2 // // Revision 1.16 2000/09/18 21:34:17 videbaek // Fill track pointer in BrGeantHit // // Revision 1.15 2000/09/14 16:13:01 hito // Hiro added charge info to geant hit. // // Revision 1.14 2000/08/29 16:25:07 videbaek // Add track pointer (dummy yet) // // Revision 1.13 2000/03/21 21:22:06 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/30 22:21:37 videbaek // Added copyconstructor // // Revision 1.11 1999/05/25 20:38:59 videbaek // Add iostream methods // // Revision 1.10 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.9 1998/12/01 19:38:16 videbaek // Changed dedx to be in standard MeV not KeV // // Revision 1.8 1998/09/27 17:05:35 alv // made most of the "get" methods const. // // Revision 1.7 1998/09/17 16:16:05 videbaek // Moved Mass() static fct to BrGeantHit class // // Revision 1.6 1998/07/28 21:30:59 videbaek // Change units to MeV // // Revision 1.5 1998/07/20 17:42:39 videbaek // Added Pid hit to hit structure. Needed for effecient handling // of detector response. // // Revision 1.4 1998/06/19 20:03:48 videbaek // Add parameteer description // // Revision 1.3 1998/06/06 21:45:10 hagel // Add ostream capabilities to some objects // // Revision 1.2 1998/04/06 21:12:08 videbaek // Clean up and additions for Win95 //