#include <RecoTauTag/HLTProducers/interface/L2TauIsolationAlgs.h>
Public Member Functions | |
L2TauECALClustering (double) | |
L2TauECALClustering () | |
void | run (const math::PtEtaPhiELorentzVectorCollection &, const CaloJet &, L2TauIsolationInfo &) |
~L2TauECALClustering () | |
Private Member Functions | |
void | clusterize (const math::PtEtaPhiELorentzVectorCollection &) |
std::vector< double > | clusterSeperation (const CaloJet &) const |
Private Attributes | |
double | m_clusterRadius |
L2TauECALClusterCollection | m_clusters |
Definition at line 59 of file L2TauIsolationAlgs.h.
L2TauECALClustering::L2TauECALClustering | ( | ) |
Definition at line 49 of file L2TauIsolationAlgs.cc.
References m_clusterRadius.
00050 { 00051 m_clusterRadius=0.08; 00052 }
L2TauECALClustering::L2TauECALClustering | ( | double | radius | ) |
Definition at line 54 of file L2TauIsolationAlgs.cc.
References m_clusterRadius.
00055 { 00056 m_clusterRadius=radius; 00057 }
L2TauECALClustering::~L2TauECALClustering | ( | ) |
void L2TauECALClustering::clusterize | ( | const math::PtEtaPhiELorentzVectorCollection & | myRecHits | ) | [private] |
Definition at line 78 of file L2TauIsolationAlgs.cc.
References h, j, m_clusterRadius, m_clusters, and ptr.
Referenced by run().
00079 { 00080 //If we have Hits do Clustering 00081 if(myRecHits.size()>0) 00082 { 00083 //Create the first Cluster by maximum Crystal 00084 m_clusters.push_back(L2TauECALCluster(*(myRecHits.begin()))); 00085 00086 //Loop on The Clusters if there are at least two hits 00087 if(myRecHits.size()>=2) 00088 for(math::PtEtaPhiELorentzVectorCollection::const_iterator h = myRecHits.begin()+1;h!=myRecHits.end();++h) 00089 { 00090 //These vars are used to find the nearest clusters to this hits 00091 double dR_min=100; 00092 int ptr=0; 00093 int ptr_min=-1; 00094 00095 for(L2TauECALClusterIt j=m_clusters.begin()+1;j!=m_clusters.end();j++) 00096 { 00097 if(ROOT::Math::VectorUtil::DeltaR(*h,j->p4())<m_clusterRadius) 00098 { 00099 if(ROOT::Math::VectorUtil::DeltaR(*h,j->p4())<dR_min) 00100 { 00101 dR_min=ROOT::Math::VectorUtil::DeltaR(*h,j->p4()); 00102 ptr_min=ptr; 00103 } 00104 } 00105 ptr++; 00106 } 00107 00108 //If it does not belong to cluster add a new one else add the Crystal to the Cluster 00109 if(ptr_min==-1) 00110 m_clusters.push_back(L2TauECALCluster(*h)); 00111 else 00112 m_clusters[ptr_min].addCrystal(*h); 00113 00114 } 00115 00116 } 00117 00118 }
std::vector< double > L2TauECALClustering::clusterSeperation | ( | const CaloJet & | jet | ) | const [private] |
Definition at line 122 of file L2TauIsolationAlgs.cc.
References c, DeltaPhi(), reco::Particle::eta(), m_clusters, reco::Particle::p4(), and funct::pow().
Referenced by run().
00123 { 00124 double eta_rms=0.; 00125 double phi_rms=0.; 00126 double dr_rms=0.; 00127 00128 double sumpt = 0.; 00129 00130 std::vector<double> rmsVector; //declare the vector 00131 if(m_clusters.size()>0) 00132 { 00133 for(L2TauECALClusterIt c = m_clusters.begin();c!=m_clusters.end();++c) //loop on clusters 00134 { 00135 eta_rms+=c->p4().Pt()*pow(c->p4().Eta()-jet.eta(),2); 00136 phi_rms+=c->p4().Pt()*pow(ROOT::Math::VectorUtil::DeltaPhi(c->p4(),jet.p4().Vect()),2); 00137 dr_rms+=c->p4().Pt()*pow(ROOT::Math::VectorUtil::DeltaR(c->p4(),jet.p4().Vect()),2); 00138 sumpt+=c->p4().Pt(); 00139 } 00140 } 00141 else 00142 { 00143 eta_rms=0.; 00144 phi_rms=0.; 00145 dr_rms =0.; 00146 sumpt=1.; 00147 } 00148 00149 rmsVector.push_back(eta_rms/sumpt); 00150 rmsVector.push_back(phi_rms/sumpt); 00151 rmsVector.push_back(dr_rms/sumpt); 00152 00153 return rmsVector; 00154 }
void L2TauECALClustering::run | ( | const math::PtEtaPhiELorentzVectorCollection & | hits, | |
const CaloJet & | jet, | |||
L2TauIsolationInfo & | l2info | |||
) |
Definition at line 63 of file L2TauIsolationAlgs.cc.
References clusterize(), clusterSeperation(), reco::L2TauIsolationInfo::ECALClusterDRRMS, reco::L2TauIsolationInfo::ECALClusterEtaRMS, reco::L2TauIsolationInfo::ECALClusterNClusters, reco::L2TauIsolationInfo::ECALClusterPhiRMS, and m_clusters.
Referenced by L2TauNarrowConeIsolationProducer::produce(), and L2TauIsolationProducer::produce().
00064 { 00065 //Create Clusters 00066 clusterize(hits); 00067 00068 00069 //Fill info Class 00070 std::vector<double> rms = clusterSeperation(jet); 00071 l2info.ECALClusterNClusters=m_clusters.size(); 00072 l2info.ECALClusterEtaRMS=rms[0]; 00073 l2info.ECALClusterPhiRMS=rms[1]; 00074 l2info.ECALClusterDRRMS=rms[2]; 00075 }
double L2TauECALClustering::m_clusterRadius [private] |
Definition at line 75 of file L2TauIsolationAlgs.h.
Referenced by clusterize(), and L2TauECALClustering().
Definition at line 78 of file L2TauIsolationAlgs.h.
Referenced by clusterize(), clusterSeperation(), and run().