00001
00002
00003
00004 #ifndef STJMCPARTICLELIST_H
00005 #define STJMCPARTICLELIST_H
00006
00007 #include <TObject.h>
00008
00009 #include <ostream>
00010 #include <vector>
00011
00012 struct StjMCParticle : public TObject {
00013 public:
00014 int runNumber;
00015 int eventId;
00016 int mcparticleId;
00017 int pdg;
00018 int firstMotherId;
00019 int lastMotherId;
00020 int firstDaughterId;
00021 int lastDaughterId;
00022 double pt;
00023 double eta;
00024 double phi;
00025 double m;
00026 double e;
00027 int status;
00028 double vertexZ;
00029 ClassDef(StjMCParticle, 1)
00030 };
00031
00032 typedef std::vector<StjMCParticle> StjMCParticleList;
00033
00034 inline bool operator==(const StjMCParticle& v1, const StjMCParticle& v2)
00035 {
00036 if(v1.runNumber != v2.runNumber) return false;
00037 if(v1.eventId != v2.eventId) return false;
00038 if(v1.mcparticleId != v2.mcparticleId) return false;
00039 if(v1.pdg != v2.pdg) return false;
00040 if(v1.firstMotherId != v2.firstMotherId) return false;
00041 if(v1.lastMotherId != v2.lastMotherId) return false;
00042 if(v1.firstDaughterId != v2.firstDaughterId) return false;
00043 if(v1.lastDaughterId != v2.lastDaughterId) return false;
00044 if(v1.pt != v2.pt) return false;
00045 if(v1.eta != v2.eta) return false;
00046 if(v1.phi != v2.phi) return false;
00047 if(v1.m != v2.m) return false;
00048 if(v1.e != v2.e) return false;
00049 if(v1.vertexZ != v2.vertexZ) return false;
00050 return true;
00051 }
00052
00053 inline bool operator!=(const StjMCParticle& v1, const StjMCParticle& v2)
00054 {
00055 return(!(v1 == v2));
00056 }
00057
00058 inline bool operator==(const StjMCParticleList& v1, const StjMCParticleList& v2){
00059 if(v1.size() != v2.size()) return false;
00060 for(size_t i = 0; i < v1.size(); ++i) if(v1[i] != v2[i]) return false;
00061 return true;
00062 }
00063
00064 inline std::ostream& operator<<(std::ostream& out, const StjMCParticle& v)
00065 {
00066 out << "mcparticleId: " << v.mcparticleId << ", pt: " << v.pt << ", .... ";
00067 return out;
00068 }
00069
00070 inline std::ostream& operator<<(std::ostream& out, const StjMCParticleList& v)
00071 {
00072 out << "MCParticleList size: " << v.size();
00073 return out;
00074 }
00075
00076 #endif // STJMCPARTICLELIST_H