00001 #ifndef KinematicTree_H 00002 #define KinematicTree_H 00003 00004 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicParticle.h" 00005 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicVertex.h" 00006 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h" 00007 #include "DetectorDescription/Core/interface/adjgraph.h" 00008 #include "DetectorDescription/Core/interface/graphwalker.h" 00009 00036 class KinematicTree : public ReferenceCounted 00037 { 00038 public: 00039 00044 KinematicTree(); 00045 00046 00047 virtual ~KinematicTree(); 00048 00052 bool isEmpty() const; 00053 00054 00061 bool isConsistent() const; 00062 00068 void addParticle(RefCountedKinematicVertex prodVtx, 00069 RefCountedKinematicVertex decVtx, 00070 RefCountedKinematicParticle part); 00071 00081 vector<RefCountedKinematicParticle> finalStateParticles() const; 00082 00088 RefCountedKinematicParticle topParticle() const; 00089 00094 RefCountedKinematicVertex currentDecayVertex() const; 00095 00100 RefCountedKinematicVertex currentProductionVertex() const; 00101 00106 RefCountedKinematicParticle currentParticle() const; 00107 00114 pair<bool,RefCountedKinematicParticle> motherParticle() const; 00115 00116 00122 vector<RefCountedKinematicParticle> daughterParticles() const; 00123 00129 void movePointerToTheTop() const; 00130 00136 bool movePointerToTheMother() const; 00137 00142 bool movePointerToTheFirstChild() const; 00143 00148 bool movePointerToTheNextChild() const; 00149 00157 bool findParticle(RefCountedKinematicParticle part) const; 00158 00166 bool findDecayVertex(RefCountedKinematicVertex vert) const; 00167 00177 void replaceCurrentParticle(RefCountedKinematicParticle newPart) const; 00178 00179 00184 void replaceCurrentVertex(RefCountedKinematicVertex newVert) const; 00185 00195 void addTree(RefCountedKinematicVertex vtx, KinematicTree * tr); 00196 private: 00197 00204 bool leftBranchSearch(RefCountedKinematicParticle part) const; 00205 00206 bool leftBranchVertexSearch(RefCountedKinematicVertex vtx) const; 00207 00208 bool leftFinalParticle() const; 00209 00210 void leftBranchAdd(KinematicTree * otherTree, RefCountedKinematicVertex vtx); 00211 00212 mutable bool empt; 00213 00214 mutable graph<RefCountedKinematicVertex,RefCountedKinematicParticle> treeGraph; 00215 mutable graphwalker<RefCountedKinematicVertex, RefCountedKinematicParticle> * treeWalker; 00216 00217 }; 00218 #endif