Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:44

0001 #ifndef DataFormats_TrackReco_interface_TrackExtrapolation_h
0002 #define DataFormats_TrackReco_interface_TrackExtrapolation_h
0003 /* \class reco::TrackExtrapolation TrackExtrapolation.h DataFormats/TrackReco/interface/TrackExtrapolation.h
0004 *
0005 * This class represents the track state at several radii (specified by user in producer).
0006 * It stores a TrackRef to the original track, as well as vectors of the positions and  momenta
0007 * of the track at the various radii. 
0008 *
0009 * \author Salvatore Rappoccio, JHU
0010 *
0011 *
0012 */
0013 
0014 #include "DataFormats/TrackReco/interface/Track.h"
0015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0016 #include "DataFormats/Math/interface/Vector3D.h"
0017 #include "DataFormats/Math/interface/Point3D.h"
0018 
0019 #include <vector>
0020 
0021 namespace reco {
0022   class TrackExtrapolation {
0023     // Next two typedefs use double in ROOT 6 rather than Double32_t due to a bug in ROOT 5,
0024     // which otherwise would make ROOT5 files unreadable in ROOT6.  This does not increase
0025     // the size on disk, because due to the bug, double was actually stored on disk in ROOT 5.
0026     typedef ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double> > Point;
0027     typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double> > Vector;
0028 
0029   public:
0030     TrackExtrapolation() {}
0031     TrackExtrapolation(reco::TrackRef const& track, std::vector<Point> const& pos, std::vector<Vector> const& mom)
0032         : track_(track) {
0033       pos_.resize(pos.size());
0034       copy(pos.begin(), pos.end(), pos_.begin());
0035       mom_.resize(mom.size());
0036       copy(mom.begin(), mom.end(), mom_.begin());
0037     }
0038 
0039     ~TrackExtrapolation() {}
0040 
0041     reco::TrackRef const& track() const { return track_; }
0042     std::vector<Point> const& positions() const { return pos_; }
0043     std::vector<Vector> const& momenta() const { return mom_; }
0044 
0045   protected:
0046     reco::TrackRef track_;
0047     std::vector<Point> pos_;
0048     std::vector<Vector> mom_;
0049   };
0050 }  // namespace reco
0051 
0052 #endif