CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoParticleFlow/PFProducer/interface/PFBlockLink.h

Go to the documentation of this file.
00001 #ifndef RecoParticleFlow_PFAlgo_PFBlockLink_h
00002 #define RecoParticleFlow_PFAlgo_PFBlockLink_h 
00003 
00004 #include <vector>
00005 #include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
00006 
00011 class PFBlockLink {
00012 
00013  public:
00014     
00016   enum Type {
00017     NONE=0,
00018     ECALandECAL=0x8,
00019     TRACKandECAL=0x9,
00020     TRACKandHCAL=0x11,
00021     ECALandHCAL=0x18,
00022     PS1andECAL=0xA,
00023     PS2andECAL = 0xC,
00024     TRACKandPS1 = 0x3,
00025     TRACKandPS2 = 0x5,
00026     PS1andPS2 = 0x6,
00027     TRACKandTRACK = 0x1,
00028     ECALandGSF = 0x28,
00029     HCALandGSF = 0x30,
00030     TRACKandGSF = 0x21,
00031     GSFandBREM =0x60,
00032     GSFandGSF = 0x20,
00033     ECALandBREM = 0x48,
00034     HCALandBREM = 0x50,
00035     PS1andGSF = 0x22,
00036     PS2andGSF = 0x24,
00037     PS1andBREM = 0x42,
00038     PS2andBREM = 0x44,
00039     HFEMandHFHAD = 0x180,
00040     SCandECAL = 0x208
00041   };
00042   
00045   PFBlockLink() : 
00046     type_(NONE), 
00047     test_(reco::PFBlock::LINKTEST_RECHIT),
00048     dist_(0),
00049     element1_( 0 ), 
00050     element2_( 0 ) {}  
00051   
00053   PFBlockLink(Type type, 
00054               reco::PFBlock::LinkTest test,
00055               double dist,
00056               unsigned elem1, 
00057               unsigned elem2) 
00058     :  
00059     type_(type), 
00060     test_(test), 
00061     dist_(dist),
00062     element1_(elem1), 
00063     element2_(elem2) {}
00064   
00065   
00067   unsigned neighbour(unsigned elem) const {
00068     if( elem == element1_ ) return element2_;
00069     else if(elem == element2_ ) return element1_;
00070     else return elem;
00071   }
00072 
00074   Type type() const {return type_;}  
00075 
00078   reco::PFBlock::LinkTest test() const {return test_;}  
00079   
00081   double dist() const {return dist_;}
00082   
00084   unsigned element1() const {return element1_;}
00085   
00087   unsigned element2() const {return element2_;}
00088   
00089   
00091   friend std::ostream& operator<<(std::ostream& out, const PFBlockLink& l); 
00092   
00093  private:
00095   Type    type_;
00096   
00098   reco::PFBlock::LinkTest test_;
00099 
00101   double dist_;
00102   
00104   unsigned  element1_;
00105 
00107   unsigned  element2_;
00108   
00109 };  
00110 
00111 #endif