CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/RecoParticleFlow/PFProducer/interface/KDTreeLinkerPSEcal.h

Go to the documentation of this file.
00001 #ifndef KDTreeLinkerPSEcal_h
00002 #define KDTreeLinkerPSEcal_h
00003 
00004 #include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerBase.h"
00005 #include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerTools.h"
00006 #include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerAlgo.h"
00007 
00008 
00009 // This class is used to find all links between PreShower clusters and ECAL clusters
00010 // using a KDTree algorithm.
00011 // It is used in PFBlockAlgo.cc in the function links().
00012 class KDTreeLinkerPSEcal : public KDTreeLinkerBase
00013 {
00014  public:
00015   KDTreeLinkerPSEcal();
00016   ~KDTreeLinkerPSEcal();
00017   
00018   // With this method, we create the list of psCluster that we want to link.
00019   void insertTargetElt(reco::PFBlockElement             *psCluster);
00020 
00021   // Here, we create the list of ecalCluster that we want to link. From ecalCluster
00022   // and fraction, we will create a second list of rechits that will be used to
00023   // build the KDTree.
00024   void insertFieldClusterElt(reco::PFBlockElement       *ecalCluster);  
00025 
00026   // The KDTree building from rechits list.
00027   void buildTree();
00028   
00029   // Here we will iterate over all psCluster. For each one, we will search the closest
00030   // rechits in the KDTree, from rechits we will find the ecalClusters and after that
00031   // we will check the links between the psCluster and all closest ecalClusters.
00032   void searchLinks();
00033   
00034   // Here, we will store all PS/ECAL founded links in the PFBlockElement class
00035   // of each psCluster in the PFmultilinks field.
00036   void updatePFBlockEltWithLinks();
00037   
00038   // Here we free all allocated structures.
00039   void clear();
00040   
00041 
00042  private:
00043   // This method allows us to build the "tree" from the "rechitsSet".
00044   void buildTree(const RecHitSet        &rechitsSet,
00045                    KDTreeLinkerAlgo     &tree);
00046 
00047  private:
00048   // Some const values. 
00049   const double  resPSpitch_;
00050   const double  resPSlength_;
00051   const double  ps1ToEcal_; // ratio : zEcal / zPS1
00052   const double  ps2ToEcal_; // ration : zEcal / zPS2
00053 
00054   // Data used by the KDTree algorithm : sets of PS and ECAL clusters.
00055   BlockEltSet           targetSet_;
00056   BlockEltSet           fieldClusterSet_;
00057 
00058   // Sets of rechits that compose the ECAL clusters. We differenctiate 
00059   // the rechits by their Z value.
00060   RecHitSet             rechitsNegSet_;
00061   RecHitSet             rechitsPosSet_;
00062   
00063   // Map of linked PS/ECAL clusters.
00064   BlockElt2BlockEltMap  target2ClusterLinks_;
00065 
00066   // Map of the ECAL clusters associated to a rechit.
00067   RecHit2BlockEltMap    rechit2ClusterLinks_;
00068     
00069   // KD trees
00070   KDTreeLinkerAlgo      treeNeg_;
00071   KDTreeLinkerAlgo      treePos_;
00072 };
00073 
00074 #endif /* !KDTreeLinkerPSEcal_h */