Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:51

0001 #ifndef __PFBlockElementGsfTrack__
0002 #define __PFBlockElementGsfTrack__
0003 
0004 #include <iostream>
0005 #include "DataFormats/Math/interface/Point3D.h"
0006 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
0007 #include "DataFormats/ParticleFlowReco/interface/PFRecTrackFwd.h"
0008 #include "DataFormats/ParticleFlowReco/interface/GsfPFRecTrackFwd.h"
0009 #include "DataFormats/ParticleFlowReco/interface/GsfPFRecTrack.h"
0010 #include "DataFormats/Math/interface/LorentzVector.h"
0011 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0012 
0013 namespace reco {
0014 
0015   /// \brief Track Element.
0016   ///
0017   /// this class contains a reference to a PFRecTrack
0018   class PFBlockElementGsfTrack final : public PFBlockElement {
0019   public:
0020     PFBlockElementGsfTrack() {}
0021 
0022     PFBlockElementGsfTrack(const GsfPFRecTrackRef& gsfref,
0023                            const math::XYZTLorentzVector& Pin,
0024                            const math::XYZTLorentzVector& Pout);
0025 
0026     PFBlockElement* clone() const override { return new PFBlockElementGsfTrack(*this); }
0027 
0028     void Dump(std::ostream& out = std::cout, const char* tab = " ") const override;
0029 
0030     /// \return tracktype
0031     bool trackType(TrackType trType) const override { return (trackType_ >> trType) & 1; }
0032 
0033     /// \set the trackType
0034     void setTrackType(TrackType trType, bool value) override {
0035       if (value)
0036         trackType_ = trackType_ | (1 << trType);
0037       else
0038         trackType_ = trackType_ ^ (1 << trType);
0039     }
0040 
0041     static constexpr unsigned int kSecondaryMask = 1 << T_FROM_GAMMACONV;
0042 
0043     bool isSecondary() const override { return trackType_ & kSecondaryMask; }
0044 
0045     /// \return reference to the corresponding PFGsfRecTrack
0046     const GsfPFRecTrackRef& GsftrackRefPF() const { return GsftrackRefPF_; }
0047 
0048     /// \return reference to the corresponding GsfTrack
0049     const reco::GsfTrackRef& GsftrackRef() const { return GsftrackRef_; }
0050 
0051     /// \return position at ECAL entrance
0052     const math::XYZPointF& positionAtECALEntrance() const { return positionAtECALEntrance_; }
0053 
0054     const GsfPFRecTrack& GsftrackPF() const { return *GsftrackRefPF_; }
0055 
0056     const math::XYZTLorentzVector& Pin() const { return Pin_; }
0057     const math::XYZTLorentzVector& Pout() const { return Pout_; }
0058 
0059   private:
0060     /// reference to the corresponding GSF track (transient)
0061     GsfPFRecTrackRef GsftrackRefPF_;
0062 
0063     /// reference to the corresponding GSF track
0064     reco::GsfTrackRef GsftrackRef_;
0065 
0066     /// The CorrespondingKFTrackRef is needeed.
0067     math::XYZTLorentzVector Pin_;
0068     math::XYZTLorentzVector Pout_;
0069     unsigned int trackType_;
0070 
0071     /// position at ECAL entrance
0072     math::XYZPointF positionAtECALEntrance_;
0073   };
0074 }  // namespace reco
0075 
0076 #endif