CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/ParticleFlowReco/interface/PFBlockElement.h

Go to the documentation of this file.
00001 #ifndef __PFBlockElement__
00002 #define __PFBlockElement__
00003 
00004 #include "DataFormats/ParticleFlowReco/interface/PFRecTrackFwd.h"
00005 #include "DataFormats/ParticleFlowReco/interface/PFDisplacedTrackerVertex.h" 
00006 #include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
00007 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00008 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00009 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
00010 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00011 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
00012 #include "DataFormats/Candidate/interface/VertexCompositeCandidateFwd.h"
00013 
00014 #include <iostream>
00015 
00016 
00017 namespace reco {
00018   class PFBlockElementCluster;
00019   class PFBlockElementTrack;
00020   
00021   
00026   class PFBlockElement {
00027   public:
00028     
00031     enum Type { 
00032       NONE=0,
00033       TRACK=1, 
00034       PS1=2, 
00035       PS2=3, 
00036       ECAL=4, 
00037       HCAL=5,
00038       GSF=6,
00039       BREM=7,
00040       HFEM=8,
00041       HFHAD=9,
00042       SC=10
00043     };
00044 
00045     enum TrackType {
00046       DEFAULT=0,
00047       T_FROM_DISP,
00048       T_TO_DISP,
00049       T_FROM_GAMMACONV,
00050       MUON,
00051       T_FROM_V0
00052     };
00053 
00055     PFBlockElement(Type type=NONE) :  
00056       type_(type), 
00057       locked_(false),
00058       index_( static_cast<unsigned>(-1) ) {
00059     }
00060 
00061 
00063     virtual ~PFBlockElement() {}
00064   
00066     virtual void Dump(std::ostream& out=std::cout, 
00067                       const char* tab=" " ) const;
00068     
00070     virtual PFBlockElement* clone() const = 0;
00071       
00073     void lock() {locked_ = true;}
00074 
00076     void unLock() {locked_ = false;}
00077 
00079     Type type() const { return type_; }
00080 
00082     virtual bool trackType(TrackType trType) const { return false; }
00083 
00085     virtual void setTrackType(TrackType trType, bool value) { 
00086              std::cout << "Error in PFBlockElement::setTrackType : this base class method is not implemented" << std::endl;}
00087 
00089     bool    locked() const {return locked_;}
00090     
00092     void     setIndex(unsigned index) { index_ = index; }
00093 
00095     unsigned index() const {return index_;} 
00096 
00097     virtual reco::TrackRef trackRef()  const {return reco::TrackRef(); }
00098     virtual PFRecTrackRef trackRefPF()  const {return PFRecTrackRef(); }
00099     virtual PFClusterRef clusterRef() const {return PFClusterRef(); }
00100     virtual PFDisplacedTrackerVertexRef displacedVertexRef(TrackType trType) const { return PFDisplacedTrackerVertexRef(); }
00101     virtual ConversionRef    convRef() const { return ConversionRef();}
00102     virtual MuonRef muonRef() const { return MuonRef(); }
00103     virtual VertexCompositeCandidateRef V0Ref()  const { return VertexCompositeCandidateRef(); }
00104     virtual void setDisplacedVertexRef(const PFDisplacedTrackerVertexRef& niref, TrackType trType) { 
00105       std::cout << "Error in PFBlockElement::setDisplacedVertexRef : this base class method is not implemented" << std::endl;}
00106     virtual void setConversionRef(const ConversionRef& convRef, TrackType trType) { 
00107       std::cout << "Error in PFBlockElement::setConversionRef : this base class method is not implemented" << std::endl;}
00108     virtual void setMuonRef(const MuonRef& muref) { 
00109       std::cout << "Error in PFBlockElement::setMuonRef : this base class method is not implemented" << std::endl;}
00110     virtual void setV0Ref(const VertexCompositeCandidateRef& v0ref,TrackType trType) { 
00111       
00112       std::cout << "Error in PFBlockElement::setV0Ref : this base class method is not implemented" << std::endl;
00113     }
00114 
00115 
00116     virtual bool isSecondary() const { return false; }
00117     virtual bool isPrimary() const { return false; }
00118     virtual bool isLinkedToDisplacedVertex() const {return false;}
00119 
00120     friend std::ostream& operator<<( std::ostream& out, 
00121                                      const PFBlockElement& element );
00122     
00123   protected:  
00124   
00127     Type     type_;
00128 
00132     bool       locked_;
00133     
00135     unsigned   index_;
00136 
00137 
00138   };
00139 }
00140 #endif