Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:15

0001 #ifndef FastSimulation_Event_FSimVertex_H
0002 #define FastSimulation_Event_FSimVertex_H
0003 
0004 // CMSSW Headers
0005 #include "SimDataFormats/Vertex/interface/SimVertex.h"
0006 #include "DataFormats/Math/interface/LorentzVector.h"
0007 
0008 #include <vector>
0009 
0010 class FBaseSimEvent;
0011 class FSimTrack;
0012 
0013 /** A class that mimics SimVertex, with enhanced features.
0014  *  Essentially an interface to SimVertex.
0015  * \author Patrick Janot, CERN 
0016  * $Date: 9-Dec-2003
0017  */
0018 
0019 class FSimVertex : public SimVertex {
0020 public:
0021   /// Default constructor
0022   FSimVertex();
0023 
0024   /// constructor from the embedded vertex index in the FBaseSimEvent
0025   FSimVertex(const math::XYZTLorentzVector& v, int im, int id, FBaseSimEvent* mom);
0026 
0027   /// parent track
0028   inline const FSimTrack& parent() const;
0029 
0030   /// The vector of daughter indices
0031   inline const std::vector<int>& daughters() const { return daugh_; }
0032 
0033   /// The number of daughters
0034   inline int nDaughters() const { return daugh_.size(); }
0035 
0036   /// ith daughter
0037   inline const FSimTrack& daughter(int i) const;
0038 
0039   /// no Daughters
0040   inline bool noDaughter() const { return !nDaughters(); }
0041 
0042   /// the index in FBaseSimEvent
0043   inline int id() const { return id_; }
0044 
0045   inline void addDaughter(int i) { daugh_.push_back(i); }
0046 
0047   /// Temporary (until CMSSW moves to Mathcore) - No  ! Actually very useful
0048   inline const math::XYZTLorentzVector& position() const { return position_; }
0049 
0050   /// Reset the position (to be used with care)
0051   inline void setPosition(const math::XYZTLorentzVector& newPosition) { position_ = newPosition; }
0052 
0053   /// Simply returns the SimVertex
0054   inline const SimVertex& simVertex() const { return *this; }
0055 
0056 private:
0057   const FBaseSimEvent* mom_;
0058   int id_;                  // The index in the FSimVertex vector
0059   std::vector<int> daugh_;  // The indices of the daughters in FSimTrack
0060 
0061   math::XYZTLorentzVector position_;
0062 };
0063 
0064 #include <iosfwd>
0065 std::ostream& operator<<(std::ostream& o, const FSimVertex& t);
0066 
0067 #include "FastSimulation/Event/interface/FSimVertex.icc"
0068 
0069 #endif  // FSimVertex_H