Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:50:51

0001 #ifndef DataFormats_ParticleFlowReco_PFTrack_h
0002 #define DataFormats_ParticleFlowReco_PFTrack_h
0003 
0004 #include "DataFormats/ParticleFlowReco/interface/PFTrajectoryPoint.h"
0005 
0006 #include <iostream>
0007 #include <vector>
0008 
0009 namespace reco {
0010 
0011   /**\class PFTrack
0012      \brief  Base class for particle flow input reconstructed tracks
0013      and simulated particles.
0014      
0015      A PFTrack contains a vector of PFTrajectoryPoint objects. 
0016      These points are stored in a vector to benefit from the 
0017      random access. One must take care of storing the points in 
0018      the right order, and it might even be necessary to insert dummy points.
0019 
0020      For a PFRecTrack, the ordering of the points is the following:
0021      
0022      - point 1: Closest approach
0023 
0024      - point 2: Beam Pipe
0025 
0026      - point 3 to n: Trajectory measurements (from the tracker layers)
0027 
0028      - point n+1: Preshower Layer 1, or dummy point if 
0029      not in the preshower zone
0030      
0031      - point n+2: Preshower Layer 2, or dummy point if 
0032      not in the preshower zone
0033 
0034      - point n+3: ECAL Entrance
0035 
0036      - point n+4: ECAL expected position of the shower maximum, 
0037      assuming the track is an electron track.
0038      
0039      - point n+5: HCAL Entrance
0040 
0041      For a PFSimParticle, the ordering of the points is the following.
0042      
0043      - If the particle decays before ECAL:
0044      - point 1: start point
0045      - point 2: end point 
0046 
0047      - If the particle does not decay before ECAL:
0048      - point 1: start point
0049      - point 2: PS1 or dummy
0050      - point 3: PS2 or dummy
0051      - point 4: ECAL entrance
0052      - point 5: HCAL entrance
0053      
0054 
0055      \todo Note that some points are missing, and should be added: shower max,
0056      intersection with the tracker layers maybe. 
0057      
0058      PFRecTracks and PFSimParticles are created in the PFTrackProducer module. 
0059      \todo   Make this class abstract ? 
0060      \author Renaud Bruneliere
0061      \date   July 2006
0062   */
0063   class PFTrack {
0064   public:
0065     PFTrack();
0066 
0067     PFTrack(double charge);
0068 
0069     PFTrack(const PFTrack& other);
0070 
0071     /// add a trajectory measurement
0072     /// \todo throw an exception if the number of points is too large
0073     void addPoint(const reco::PFTrajectoryPoint& trajPt);
0074 
0075     /// set a trajectory point
0076     void setPoint(unsigned int index, const reco::PFTrajectoryPoint& measurement) {
0077       trajectoryPoints_[index] = measurement;
0078     }
0079 
0080     /// \return electric charge
0081     double charge() const { return charge_; }
0082 
0083     /// \return number of trajectory points
0084     unsigned int nTrajectoryPoints() const { return trajectoryPoints_.size(); }
0085 
0086     /// \return number of trajectory measurements in tracker
0087     unsigned int nTrajectoryMeasurements() const {
0088       return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
0089     }
0090 
0091     /// \return vector of trajectory points
0092     const std::vector<reco::PFTrajectoryPoint>& trajectoryPoints() const { return trajectoryPoints_; }
0093 
0094     /// \return a trajectory point
0095     const reco::PFTrajectoryPoint& trajectoryPoint(unsigned index) const { return trajectoryPoints_[index]; }
0096 
0097     /// \return an extrapolated point
0098     /// \todo throw an exception in case of invalid point.
0099     const reco::PFTrajectoryPoint& extrapolatedPoint(unsigned layerid) const;
0100 
0101     /// iterator on innermost tracker measurement
0102     std::vector<reco::PFTrajectoryPoint>::const_iterator innermostMeasurement() const {
0103       return trajectoryPoints_.begin() + indexInnermost_;
0104     }
0105 
0106     /// iterator on outermost tracker measurement
0107     std::vector<reco::PFTrajectoryPoint>::const_iterator outermostMeasurement() const {
0108       return trajectoryPoints_.begin() + indexOutermost_;
0109     }
0110 
0111   protected:
0112     /// maximal number of tracking layers
0113     static const unsigned int nMaxTrackingLayers_;
0114 
0115     /// charge
0116     double charge_;
0117 
0118     /// vector of trajectory points
0119     std::vector<reco::PFTrajectoryPoint> trajectoryPoints_;
0120 
0121     /// index innermost tracker measurement
0122     unsigned int indexInnermost_;
0123 
0124     /// index outermost tracker measurement
0125     unsigned int indexOutermost_;
0126   };
0127   std::ostream& operator<<(std::ostream& out, const PFTrack& track);
0128 
0129 }  // namespace reco
0130 
0131 #endif