CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h

Go to the documentation of this file.
00001 #ifndef __PFBlockElementTrack__
00002 #define __PFBlockElementTrack__
00003 
00004 #include <iostream>
00005 
00006 #include "DataFormats/Math/interface/Point3D.h"
00007 
00008 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
00009 #include "DataFormats/ParticleFlowReco/interface/PFRecTrackFwd.h"
00010 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00011 
00012 namespace reco {
00013   
00017   class PFBlockElementTrack : public PFBlockElement {
00018   public:
00019 
00020     PFBlockElementTrack() {} 
00021 
00022     PFBlockElementTrack(const PFRecTrackRef& ref);
00023 
00024     PFBlockElement* clone() const { return new PFBlockElementTrack(*this); }
00025     
00026     void Dump(std::ostream& out = std::cout, 
00027               const char* tab = " " ) const;
00028 
00030     virtual bool trackType(TrackType trType) const { 
00031       return (trackType_>>trType) & 1; 
00032     }
00033 
00035     virtual void setTrackType(TrackType trType, bool value) {
00036       if(value)  trackType_ = trackType_ | (1<<trType);
00037       else trackType_ = trackType_ ^ (1<<trType);
00038     }
00039 
00040 
00042     void setPositionAtECALEntrance(float x, float y, float z) {
00043       positionAtECALEntrance_.SetCoordinates(x, y, z);
00044     }
00045  
00046 
00048     const math::XYZPointF& positionAtECALEntrance() const {
00049       return positionAtECALEntrance_;
00050     }
00051     
00054     PFRecTrackRef trackRefPF() const { return trackRefPF_; }
00055     
00057     reco::TrackRef trackRef() const { return trackRef_; }
00058 
00060     bool isSecondary() const { 
00061       return 
00062         trackType(T_FROM_DISP) || 
00063         trackType(T_FROM_GAMMACONV) || 
00064         trackType(T_FROM_V0); 
00065     }
00066 
00067     bool isPrimary() const{
00068       return trackType(T_TO_DISP); 
00069     }
00070 
00071     bool isLinkedToDisplacedVertex() const{
00072       return isSecondary() || isPrimary();
00073     }
00074 
00076     PFDisplacedTrackerVertexRef displacedVertexRef(TrackType trType) const {
00077       if (trType == T_TO_DISP)
00078         return displacedVertexDaughterRef_;
00079       else if (trType == T_FROM_DISP)
00080         return displacedVertexMotherRef_;
00081       else return PFDisplacedTrackerVertexRef();
00082     }
00083 
00085     void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) { 
00086 
00087       if (trType == T_TO_DISP) {
00088         displacedVertexDaughterRef_ = niref; setTrackType(trType,true);}
00089       else if (trType == T_FROM_DISP) {
00090         displacedVertexMotherRef_ = niref; setTrackType(trType,true);}
00091     } 
00092     
00094     reco::MuonRef muonRef() const { return muonRef_; }
00095 
00097     void setMuonRef(const MuonRef& muref) { 
00098       muonRef_=muref; setTrackType(MUON,true); 
00099     }
00100 
00102     ConversionRef convRef() const {return convRef_;} 
00103 
00105     void setConversionRef(const ConversionRef& convRef, TrackType trType) { 
00106       convRef_ = convRef; setTrackType(trType,true); 
00107     } 
00108 
00110     VertexCompositeCandidateRef V0Ref() const {return v0Ref_;} 
00111 
00113     void setV0Ref(const VertexCompositeCandidateRef& V0Ref, TrackType trType) { 
00114       v0Ref_ = V0Ref; setTrackType(trType,true); 
00115     } 
00116 
00117 
00118     
00119   private:
00120 
00122     PFRecTrackRef  trackRefPF_;
00123 
00125     reco::TrackRef trackRef_;
00126 
00127     unsigned int  trackType_;
00128 
00130     math::XYZPointF        positionAtECALEntrance_;
00131     
00133     PFDisplacedTrackerVertexRef  displacedVertexMotherRef_;
00134 
00136     PFDisplacedTrackerVertexRef  displacedVertexDaughterRef_;
00137                                  
00139     reco::MuonRef muonRef_;
00140 
00142     ConversionRef convRef_;      
00143 
00145     VertexCompositeCandidateRef v0Ref_;
00146   };
00147 }
00148 
00149 #endif
00150