CMS 3D CMS Logo

HybridClusterAlgo.h

Go to the documentation of this file.
00001 #ifndef RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
00002 #define RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
00003 
00004 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00005 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00006 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00007 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00008 #include "RecoCaloTools/Navigation/interface/EcalBarrelNavigator.h"
00009 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00010 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00011 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00012 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00013 #include "FWCore/Framework/interface/ESHandle.h"
00014 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00015 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00016 #include "RecoEcal/EgammaCoreTools/interface/BremRecoveryPhiRoadAlgo.h"
00017 #include "RecoEcal/EgammaCoreTools/interface/SuperClusterShapeAlgo.h"
00018 
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 
00021 #include <vector>
00022 #include <set>
00023 
00024 //Less than operator for sorting EcalRecHits according to energy.
00025 struct less_mag : public std::binary_function<EcalRecHit, EcalRecHit, bool> {
00026   bool operator()(EcalRecHit x, EcalRecHit y) { return x.energy() > y.energy() ; }
00027 };
00028 
00029 class HybridClusterAlgo
00030 {
00031  private:
00032   //Quick typedef for position calculation.
00033   typedef math::XYZPoint Point;
00034 
00035   //Thresholds for seeds.
00036   double eb_st;
00037 
00038   //Number of steps in phi that the Hybrid algorithm will take
00039   //when clustering.  Remember, uses phiSteps_ in positive direction
00040   //and then phiSteps_ in negative direction.
00041   int phiSteps_;
00042 
00043   // et in 25
00044   double et25(EcalBarrelNavigator &navigator,
00045                 const EcalRecHitCollection *hits,
00046                 const CaloSubdetectorGeometry *geometry);
00047 
00048 
00049   BremRecoveryPhiRoadAlgo *phiRoadAlgo_;
00050 
00051   //Threshold for basic cluster.
00052   double eThres_;
00053   double eThresA_;
00054   double eThresB_;
00055 
00056   //Threshold for becoming a sub-peak in the supercluster.
00057   double Eseed;
00058 
00059   //Threshold for adding the additional two 'wing' cells to domino. 
00060   double Ewing;
00061 
00062   // do dynamic phi road
00063   bool dynamicPhiRoad_;
00064 
00065   // do dynamic ethres
00066   bool dynamicEThres_;
00067 
00068   //Map of DetId, RecHit relationship.  EcalRecHit knows what DetId it is,
00069   //but DetId doesn't  know what EcalRecHit it is. 
00070   //  std::map<DetId, EcalRecHit>  rechits_m;
00071 
00072   // colection of all rechits
00073   const EcalRecHitCollection *recHits_;
00074 
00075 
00076   // geometry
00077   const CaloSubdetectorGeometry* geometry;
00078 
00079   //  SuperClusterShapeAlgo* SCShape_;
00080 
00081   //Set of DetIds that have already been used.
00082   std::set<DetId> useddetids;
00083 
00084   // The vector of seeds:
00085   std::vector<EcalRecHit> seeds;
00086 
00087   //The vector of seed clusters:
00088   std::vector<reco::BasicCluster> seedClus_;
00089 
00090   //Map of basicclusters and what supercluster they will belong to.
00091   std::map<int, std::vector<reco::BasicCluster> > clustered_;
00092 
00093   //Control the verbosity.
00094   int debugLevel_;
00095 
00096   //algo to calulate position of clusters
00097   PositionCalc posCalculator_;
00098 
00099  public:
00100    enum DebugLevel { pDEBUG = 0, pINFO = 1, pERROR = 2 }; 
00101   
00102   //The default constructor
00103   HybridClusterAlgo(){ }
00104   
00105   //The real constructor
00106   HybridClusterAlgo(double eb_str, 
00107                     int step,
00108                     double eseed,
00109                     double ewing,
00110                     double ethres,
00111                     const PositionCalc& posCalculator,
00112 //                    bool dynamicPhiRoad = false,
00113                     bool dynamicEThres = false,
00114                     double eThresA = 0,
00115                     double eThresB = 0.1,
00116 //                    const edm::ParameterSet &bremRecoveryPset,
00117                     DebugLevel debugLevel = pINFO);
00118 
00119   // destructor
00120   ~HybridClusterAlgo() 
00121   {
00122      if (dynamicPhiRoad_) delete phiRoadAlgo_;
00123      //     delete SCShape_;
00124   } 
00125 
00126   void setDynamicPhiRoad(const edm::ParameterSet &bremRecoveryPset)
00127   {
00128      dynamicPhiRoad_ = true;
00129      phiRoadAlgo_ = new BremRecoveryPhiRoadAlgo(bremRecoveryPset);
00130   }
00131 
00132   //Hand over the map, the geometry, and I'll hand you back clusters.
00133   void makeClusters(const EcalRecHitCollection*,
00134                     const CaloSubdetectorGeometry * geometry,
00135                     reco::BasicClusterCollection &basicClusters,
00136                     bool regional = false,
00137                     const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
00138 
00139   //Make superclusters from the references to the BasicClusters in the event.
00140   reco::SuperClusterCollection makeSuperClusters(const reco::BasicClusterRefVector&);
00141 
00142   //The routine doing the real work.
00143   void mainSearch(const EcalRecHitCollection* hits, const CaloSubdetectorGeometry * geometry);
00144   
00145   //Make dominos for the hybrid method.
00146   double makeDomino(EcalBarrelNavigator &navigator, std::vector <EcalRecHit> &cells);
00147 
00148 };
00149 
00150 #endif

Generated on Tue Jun 9 17:43:11 2009 for CMSSW by  doxygen 1.5.4