00001
00002
00003
00004 #ifndef STJTRACKLIST_H
00005 #define STJTRACKLIST_H
00006
00007 #include <ostream>
00008 #include <vector>
00009 #include "TObject.h"
00010 #include "TVector3.h"
00011
00012 class StjTrack : public TObject {
00013 public:
00014 int runNumber;
00015 int eventId;
00016 int detectorId;
00017 double pt;
00018 double eta;
00019 double phi;
00020 short flag;
00021 unsigned short nHits;
00022 short charge;
00023 unsigned short nHitsPoss;
00024 unsigned short nHitsDedx;
00025 unsigned short nHitsFit;
00026 double nSigmaPion;
00027 double nSigmaKaon;
00028 double nSigmaProton;
00029 double nSigmaElectron;
00030 double Tdca;
00031 double dcaX;
00032 double dcaY;
00033 double dcaZ;
00034 double dcaD;
00035 double chi2;
00036 double chi2prob;
00037 double BField;
00038 double bemcRadius;
00039 double vertexZ;
00040 int exitDetectorId;
00041 int exitTowerId;
00042 double exitEta;
00043 double exitPhi;
00044 double dEdx;
00045 double beta;
00046 int trackIndex;
00047 short id;
00048 TVector3 firstPoint;
00049 TVector3 lastPoint;
00050 ClassDef(StjTrack,4)
00051 };
00052
00053 typedef std::vector<StjTrack> StjTrackList;
00054
00055 inline bool operator==(const StjTrack& v1, const StjTrack& v2)
00056 {
00057 if(v1.runNumber != v2.runNumber) return false;
00058 if(v1.eventId != v2.eventId) return false;
00059 if(v1.detectorId != v2.detectorId) return false;
00060 if(v1.pt != v2.pt) return false;
00061 if(v1.eta != v2.eta) return false;
00062 if(v1.phi != v2.phi) return false;
00063 if(v1.flag != v2.flag) return false;
00064 if(v1.nHits != v2.nHits) return false;
00065 if(v1.charge != v2.charge) return false;
00066 if(v1.nHitsPoss != v2.nHitsPoss) return false;
00067 if(v1.nHitsDedx != v2.nHitsDedx) return false;
00068 if(v1.nHitsFit != v2.nHitsFit) return false;
00069 if(v1.nSigmaPion != v2.nSigmaPion) return false;
00070 if(v1.Tdca != v2.Tdca) return false;
00071 if(v1.dcaX != v2.dcaX) return false;
00072 if(v1.dcaY != v2.dcaY) return false;
00073 if(v1.dcaZ != v2.dcaZ) return false;
00074 if(v1.dcaD != v2.dcaD) return false;
00075 if(v1.chi2 != v2.chi2) return false;
00076 if(v1.chi2prob != v2.chi2prob) return false;
00077 if(v1.BField != v2.BField) return false;
00078 if(v1.bemcRadius != v2.bemcRadius) return false;
00079 if(v1.exitDetectorId != v2.exitDetectorId) return false;
00080 if(v1.exitTowerId != v2.exitTowerId) return false;
00081 if(v1.exitEta != v2.exitEta) return false;
00082 if(v1.exitPhi != v2.exitPhi) return false;
00083 if(v1.dEdx != v2.dEdx) return false;
00084 if(v1.beta != v2.beta) return false;
00085 if(v1.trackIndex != v2.trackIndex) return false;
00086 if(v1.id != v2.id) return false;
00087 if(v1.firstPoint != v2.firstPoint) return false;
00088 if(v1.lastPoint != v2.lastPoint) return false;
00089 return true;
00090 }
00091
00092 inline bool operator!=(const StjTrack& v1, const StjTrack& v2)
00093 {
00094 return(!(v1 == v2));
00095 }
00096
00097 inline bool operator==(const StjTrackList& v1, const StjTrackList& v2){
00098 if(v1.size() != v2.size()) return false;
00099 for(size_t i = 0; i < v1.size(); ++i) if(v1[i] != v2[i]) return false;
00100 return true;
00101 }
00102
00103
00104 inline std::ostream& operator<<(std::ostream& out, const StjTrack& v)
00105 {
00106 out << "trackId: " << v.id << ", pt: " << v.pt << ", .... ";
00107 return out;
00108 }
00109
00110 inline std::ostream& operator<<(std::ostream& out, const StjTrackList& v)
00111 {
00112 out << "TrackList size: " << v.size();
00113 return out;
00114 }
00115
00116 #endif // STJTRACKLIST_H