Go to the documentation of this file.00001 #ifndef RecoEcal_EgammaClusterAlgos_PFSuperClusterAlgo_h
00002 #define RecoEcal_EgammaClusterAlgos_PFSuperClusterAlgo_h
00003
00004
00005 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
00006 #include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
00007 #include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
00008 #include "DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h"
00009 #include "DataFormats/ParticleFlowReco/interface/PFLayer.h"
00010 #include "DataFormats/Common/interface/OrphanHandle.h"
00011
00012 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00013 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00014 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00015 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00016
00017 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"
00018
00019 #include <string>
00020 #include <vector>
00021 #include <map>
00022 #include <set>
00023
00024 #include <memory>
00025
00026 class TFile;
00027 class TH2F;
00028
00030
00036 struct less_magPF : public std::binary_function<reco::PFClusterRef, reco::PFClusterRef, bool> {
00037 bool operator()(reco::PFClusterRef x, reco::PFClusterRef y) { return x->energy() > y->energy() ; }
00038 };
00039
00040
00041 class PFSuperClusterAlgo {
00042
00043 public:
00044
00046 PFSuperClusterAlgo();
00047
00049 virtual ~PFSuperClusterAlgo() {;}
00050
00051 void setVerbosityLevel(bool verbose){ verbose_ = verbose;}
00052
00053 void setThreshPFClusterSeedBarrel(double thresh){ threshPFClusterSeedBarrel_ = thresh;}
00054 void setThreshPFClusterBarrel(double thresh){ threshPFClusterBarrel_ = thresh;}
00055 void setThreshPFClusterSeedEndcap(double thresh){ threshPFClusterSeedEndcap_ = thresh;}
00056 void setThreshPFClusterEndcap(double thresh){ threshPFClusterEndcap_ = thresh;}
00057
00058 void setPhiwidthSuperClusterBarrel( double phiwidth ){ phiwidthSuperClusterBarrel_ = phiwidth;}
00059 void setEtawidthSuperClusterBarrel( double etawidth ){ etawidthSuperClusterBarrel_ = etawidth;}
00060 void setPhiwidthSuperClusterEndcap( double phiwidth ){ phiwidthSuperClusterEndcap_ = phiwidth;}
00061 void setEtawidthSuperClusterEndcap( double etawidth ){ etawidthSuperClusterEndcap_ = etawidth;}
00062
00063 void setThreshPFClusterES(double thresh){threshPFClusterES_ = thresh;}
00064
00065 void setMustacheCut( bool doMustacheCut ) { doMustacheCut_ = doMustacheCut;}
00066
00067
00068
00069 void setCrackCorrections( bool applyCrackCorrections) { applyCrackCorrections_ = applyCrackCorrections;}
00070
00071 void doClustering(const edm::Handle<reco::PFClusterCollection> & pfclustersHandle, std::auto_ptr< reco::BasicClusterCollection > & basicClusters_p, boost::shared_ptr<PFEnergyCalibration> thePFEnergyCalibration_, int detector);
00072
00073 void matchSCtoESclusters(const edm::Handle<reco::PFClusterCollection> & pfclustersHandl, std::auto_ptr< reco::SuperClusterCollection > & pfSuperClustersWithES_p, boost::shared_ptr<PFEnergyCalibration> thePFEnergyCalibration_, int detector);
00074
00075 void findClustersOutsideMustacheArea();
00076
00077 void storeSuperClusters(const edm::OrphanHandle<reco::BasicClusterCollection> & basicClustersHandle, std::auto_ptr< reco::SuperClusterCollection > & pfSuperClusters_p );
00078
00079
00080 private:
00081
00082 bool verbose_;
00083
00084 double threshPFClusterSeed_;
00085 double threshPFCluster_;
00086 double etawidthSuperCluster_;
00087 double phiwidthSuperCluster_;
00088
00089 double threshPFClusterSeedBarrel_;
00090 double threshPFClusterBarrel_;
00091 double threshPFClusterSeedEndcap_;
00092 double threshPFClusterEndcap_;
00093 double threshPFClusterES_;
00094
00095 double phiwidthSuperClusterBarrel_;
00096 double etawidthSuperClusterBarrel_;
00097 double phiwidthSuperClusterEndcap_;
00098 double etawidthSuperClusterEndcap_;
00099
00100 bool doMustacheCut_;
00101
00102
00103
00104 bool applyCrackCorrections_;
00105
00106 int nSuperClusters;
00107
00108 std::vector<int> scPFseedIndex_;
00109 std::vector<int> seedCandidateIndex_;
00110 std::vector<int> pfClusterIndex_;
00111
00112 std::vector<std::vector<const reco::PFCluster *> > pfClusters_;
00113 std::vector< reco::BasicClusterCollection > basicClusters_;
00114
00115 std::vector<reco::CaloClusterPtrVector> basicClusterPtr_;
00116
00117 std::vector<double> allPfClusterCalibratedEnergy_;
00118 std::vector<std::vector<double>> pfClusterCalibratedEnergy_;
00119 std::vector<std::vector<double>> pfClusterCalibratedEnergyWithES_;
00120
00121 std::vector<reco::PFClusterRef> seedCandidateCollection;
00122 std::vector<reco::PFClusterRef> pfClusterAboveThresholdCollection;
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 std::vector<std::vector<unsigned int>> insideMust_;
00133
00134
00135
00136 void createBasicCluster(const reco::PFClusterRef & myPFClusterRef,
00137 reco::BasicClusterCollection & basicClusters,
00138 std::vector<const reco::PFCluster *> & pfClusters) const;
00139
00140 void createBasicClusterPtrs(const edm::OrphanHandle<reco::BasicClusterCollection> & basicClustersHandle ) ;
00141
00142 void createSuperClusters(reco::SuperClusterCollection &superClusters, bool doEEwithES) const;
00143
00144 reco::SuperClusterCollection superClusters_;
00145
00146 };
00147
00148 #endif