#include <RecoEgamma/EgammaIsolationAlgos/interface/EgammaEcalIsolation.h>
Public Member Functions | |
EgammaEcalIsolation (double extRadius, double etLow, const reco::BasicClusterCollection *, const reco::SuperClusterCollection *) | |
double | getEcalEtSum (const reco::Candidate *) |
~EgammaEcalIsolation () | |
Private Attributes | |
const reco::BasicClusterCollection * | basicClusterCollection_ |
double | conesize |
double | etMin |
const reco::SuperClusterCollection * | superClusterCollection_ |
Definition at line 26 of file EgammaEcalIsolation.h.
EgammaEcalIsolation::EgammaEcalIsolation | ( | double | extRadius, | |
double | etLow, | |||
const reco::BasicClusterCollection * | basicClusterCollection, | |||
const reco::SuperClusterCollection * | superClusterCollection | |||
) |
Definition at line 23 of file EgammaEcalIsolation.cc.
00026 : 00027 etMin(etLow), 00028 conesize(extRadius), 00029 basicClusterCollection_(basicClusterCollection), 00030 superClusterCollection_(superClusterCollection) 00031 { 00032 }
EgammaEcalIsolation::~EgammaEcalIsolation | ( | ) |
double EgammaEcalIsolation::getEcalEtSum | ( | const reco::Candidate * | candidate | ) |
Definition at line 36 of file EgammaEcalIsolation.cc.
References reco::BasicCluster::algo(), basicClusterCollection_, reco::BasicCluster::chi2(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), conesize, reco::CaloCluster::energy(), reco::CaloCluster::eta(), etMin, funct::exp(), reco::Candidate::get(), edm::Ref< C, T, F >::get(), reco::CaloCluster::position(), reco::SuperCluster::seed(), funct::sin(), and superClusterCollection_.
Referenced by PhotonIDAlgo::calculateBasicClusterIso(), and EgammaEcalIsolationProducer::produce().
00036 { 00037 00038 00039 double ecalIsol=0.; 00040 reco::SuperClusterRef sc = candidate->get<reco::SuperClusterRef>(); 00041 math::XYZVector position(sc.get()->position().x(), 00042 sc.get()->position().y(), 00043 sc.get()->position().z()); 00044 00045 // match the photon hybrid supercluster with those with Algo==0 (island) 00046 double delta1=1000.; 00047 double deltacur=1000.; 00048 const reco::SuperCluster *matchedsupercluster=0; 00049 bool MATCHEDSC = false; 00050 00051 for(reco::SuperClusterCollection::const_iterator scItr = superClusterCollection_->begin(); scItr != superClusterCollection_->end(); ++scItr){ 00052 00053 const reco::SuperCluster *supercluster = &(*scItr); 00054 00055 math::XYZVector currentPosition(supercluster->position().x(), 00056 supercluster->position().y(), 00057 supercluster->position().z()); 00058 00059 00060 if(supercluster->seed()->algo() == 0){ 00061 deltacur = DeltaR(currentPosition, position); 00062 00063 if (deltacur < delta1) { 00064 delta1=deltacur; 00065 matchedsupercluster = supercluster; 00066 MATCHEDSC = true; 00067 } 00068 } 00069 } 00070 00071 const reco::BasicCluster *cluster= 0; 00072 00073 //loop over basic clusters 00074 for(reco::BasicClusterCollection::const_iterator cItr = basicClusterCollection_->begin(); cItr != basicClusterCollection_->end(); ++cItr){ 00075 00076 cluster = &(*cItr); 00077 double ebc_bcchi2 = cluster->chi2(); 00078 int ebc_bcalgo = cluster->algo(); 00079 double ebc_bce = cluster->energy(); 00080 double ebc_bceta = cluster->eta(); 00081 double ebc_bcet = ebc_bce*sin(2*atan(exp(ebc_bceta))); 00082 double newDelta = 0.; 00083 00084 00085 if (ebc_bcet > etMin && ebc_bcalgo == 0) { 00086 if (ebc_bcchi2 < 30.) { 00087 00088 if(MATCHEDSC){ 00089 bool inSuperCluster = false; 00090 00091 reco::basicCluster_iterator theEclust = matchedsupercluster->clustersBegin(); 00092 // loop over the basic clusters of the matched supercluster 00093 for(;theEclust != matchedsupercluster->clustersEnd(); 00094 theEclust++) { 00095 if ((**theEclust) == (*cluster) ) inSuperCluster = true; 00096 } 00097 if (!inSuperCluster) { 00098 00099 math::XYZVector basicClusterPosition(cluster->position().x(), 00100 cluster->position().y(), 00101 cluster->position().z()); 00102 newDelta=DeltaR(basicClusterPosition,position); 00103 if(newDelta < conesize) { 00104 ecalIsol+=ebc_bcet; 00105 } 00106 } 00107 } 00108 } // matches ebc_bcchi2 00109 } // matches ebc_bcet && ebc_bcalgo 00110 00111 } 00112 00113 // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl; 00114 return ecalIsol; 00115 00116 }
const reco::BasicClusterCollection* EgammaEcalIsolation::basicClusterCollection_ [private] |
double EgammaEcalIsolation::conesize [private] |
double EgammaEcalIsolation::etMin [private] |
const reco::SuperClusterCollection* EgammaEcalIsolation::superClusterCollection_ [private] |