Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:24:03

0001 #ifndef SimTrack_H
0002 #define SimTrack_H
0003 
0004 #include "SimDataFormats/Track/interface/CoreSimTrack.h"
0005 #include "DataFormats/Math/interface/Vector3D.h"
0006 #include "DataFormats/Math/interface/LorentzVector.h"
0007 #include "FWCore/Utilities/interface/Exception.h"
0008 
0009 class SimTrack : public CoreSimTrack {
0010 public:
0011   typedef CoreSimTrack Core;
0012 
0013   /// constructor
0014   SimTrack();
0015   SimTrack(int ipart, const math::XYZTLorentzVectorD& p);
0016 
0017   /// full constructor (pdg type, momentum, time,
0018   /// index of parent vertex in final vector
0019   /// index of corresponding gen part in final vector)
0020   SimTrack(int ipart, const math::XYZTLorentzVectorD& p, int iv, int ig);
0021 
0022   SimTrack(int ipart,
0023            const math::XYZTLorentzVectorD& p,
0024            int iv,
0025            int ig,
0026            const math::XYZVectorD& tkp,
0027            const math::XYZTLorentzVectorD& tkm);
0028 
0029   /// constructor from transient
0030   SimTrack(const CoreSimTrack& t, int iv, int ig);
0031 
0032   /// index of the vertex in the Event container (-1 if no vertex)
0033   int vertIndex() const { return ivert; }
0034   bool noVertex() const { return ivert == -1; }
0035 
0036   /// index of the corresponding Generator particle in the Event container (-1 if no Genpart)
0037   int genpartIndex() const { return igenpart; }
0038   bool noGenpart() const { return igenpart == -1; }
0039 
0040   const math::XYZVectorD& trackerSurfacePosition() const { return tkposition; }
0041 
0042   const math::XYZTLorentzVectorD& trackerSurfaceMomentum() const { return tkmomentum; }
0043 
0044   inline void setTkPosition(const math::XYZVectorD& pos) { tkposition = pos; }
0045 
0046   inline void setTkMomentum(const math::XYZTLorentzVectorD& mom) { tkmomentum = mom; }
0047 
0048   inline void setVertexIndex(const int v) { ivert = v; }
0049 
0050   void setCrossedBoundaryVars(bool crossedBoundary,
0051                               int idAtBoundary,
0052                               math::XYZTLorentzVectorF positionAtBoundary,
0053                               math::XYZTLorentzVectorF momentumAtBoundary) {
0054     crossedBoundary_ = crossedBoundary;
0055     idAtBoundary_ = idAtBoundary;
0056     positionAtBoundary_ = positionAtBoundary;
0057     momentumAtBoundary_ = momentumAtBoundary;
0058   }
0059   bool crossedBoundary() const { return crossedBoundary_; }
0060   const math::XYZTLorentzVectorF& getPositionAtBoundary() const { return positionAtBoundary_; }
0061   const math::XYZTLorentzVectorF& getMomentumAtBoundary() const { return momentumAtBoundary_; }
0062   int getIDAtBoundary() const { return idAtBoundary_; }
0063 
0064 private:
0065   int ivert;
0066   int igenpart;
0067 
0068   math::XYZVectorD tkposition;
0069   math::XYZTLorentzVectorD tkmomentum;
0070 
0071   bool crossedBoundary_;
0072   int idAtBoundary_;
0073   math::XYZTLorentzVectorF positionAtBoundary_;
0074   math::XYZTLorentzVectorF momentumAtBoundary_;
0075 };
0076 
0077 #include <iosfwd>
0078 std::ostream& operator<<(std::ostream& o, const SimTrack& t);
0079 
0080 #endif