CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ggPFPhotons Class Reference

#include <ggPFPhotons.h>

Public Member Functions

std::pair< double, double > CalcRMS (vector< reco::CaloCluster > PFClust, reco::Photon PFPhoton)
 
bool EleVeto ()
 
void fillPFClusters ()
 
double getPFPhoECorr (std::vector< reco::CaloCluster >PFClusters, const GBRForest *ReaderLCEB, const GBRForest *ReaderLCEE)
 
 ggPFPhotons (reco::Photon phot, edm::Handle< reco::PhotonCollection > &pfPhotons, edm::Handle< reco::GsfElectronCollection > &pfElectrons, edm::Handle< PFCandidateCollection > &pfCandidates, edm::Handle< EcalRecHitCollection > &EBReducedRecHits, edm::Handle< EcalRecHitCollection > &EEReducedRecHits, edm::Handle< EcalRecHitCollection > &ESRecHits, const CaloSubdetectorGeometry *geomBar, const CaloSubdetectorGeometry *geomEnd, edm::Handle< BeamSpot > &beamSpotHandle)
 
bool hasSLConv ()
 
bool isConv ()
 
bool isPFEle ()
 
bool MatchPFReco ()
 
float MustE ()
 
float MustEOut ()
 
float MustEtOut ()
 
double PFClusRMSMust ()
 
double PFClusRMSTot ()
 
std::vector< reco::CaloClusterPFClusters ()
 
std::vector< reco::CaloClusterPFClustersSCFP ()
 
double PFdEta ()
 
double PFdPhi ()
 
bool PFElectronVeto (edm::Handle< reco::ConversionCollection > &convH, edm::Handle< reco::GsfElectronCollection > &gsfElectronsHandle)
 
float PFLowE ()
 
float PFPS1 ()
 
float PFPS2 ()
 
void PhotonPFCandMatch (reco::SuperCluster sc, std::vector< reco::PFCandidatePtr > &insideBox, edm::Handle< PFCandidateCollection > &pfCandidates, vector< reco::CaloCluster > &PFClust, std::vector< DetId > &MatchedRH)
 
std::vector< reco::CaloClusterrecoPhotonClusterLink (reco::Photon phot, edm::Handle< PFCandidateCollection > &pfCandidates)
 
std::pair< float, float > SLPoint ()
 
std::pair< double, double > SuperClusterSize (reco::Photon phot)
 
virtual ~ggPFPhotons ()
 

Static Public Member Functions

static void recoPhotonClusterLink (reco::SuperCluster sc, std::vector< reco::PFCandidatePtr > &insideMust, std::vector< reco::PFCandidatePtr > &outsideMust, edm::Handle< PFCandidateCollection > &pfCandidates, double etabound, double phibound)
 
static std::pair< double, double > SuperClusterSize (reco::SuperCluster sc, Handle< EcalRecHitCollection > &EBReducedRecHits, Handle< EcalRecHitCollection > &EEReducedRecHits, const CaloSubdetectorGeometry *geomBar, const CaloSubdetectorGeometry *geomEnd)
 

Private Attributes

Handle< BeamSpotbeamSpotHandle_
 
double dEtaLowestC_
 
double dPhiLowestC_
 
Handle< EcalRecHitCollectionEBReducedRecHits_
 
Handle< EcalRecHitCollectionEEReducedRecHits_
 
float EinMustache_
 
bool EleVeto_
 
Handle< EcalRecHitCollectionESRecHits_
 
const CaloSubdetectorGeometrygeomBar_
 
const CaloSubdetectorGeometrygeomEnd_
 
bool hasSLConv_
 
bool isConv_
 
bool isPFEle_
 
reco::Photon matchedPhot_
 
bool matchPFReco_
 
float MustacheEOut_
 
float MustacheEtOut_
 
double PFClPhiRMS_
 
double PFClPhiRMSMust_
 
std::vector< reco::CaloClusterPFClusters_
 
reco::GsfElectron PFElectron_
 
Handle
< reco::GsfElectronCollection
pfElectrons_
 
float PFLowClusE_
 
double PFPhoLocallyCorrE_
 
reco::Photon PFPhoton_
 
Handle< reco::PhotonCollectionpfPhotons_
 
float PFPreShower1_
 
float PFPreShower2_
 
std::vector< reco::CaloClusterPFSCFootprintClusters_
 

Detailed Description

Definition at line 17 of file ggPFPhotons.h.

Constructor & Destructor Documentation

ggPFPhotons::ggPFPhotons ( reco::Photon  phot,
edm::Handle< reco::PhotonCollection > &  pfPhotons,
edm::Handle< reco::GsfElectronCollection > &  pfElectrons,
edm::Handle< PFCandidateCollection > &  pfCandidates,
edm::Handle< EcalRecHitCollection > &  EBReducedRecHits,
edm::Handle< EcalRecHitCollection > &  EEReducedRecHits,
edm::Handle< EcalRecHitCollection > &  ESRecHits,
const CaloSubdetectorGeometry geomBar,
const CaloSubdetectorGeometry geomEnd,
edm::Handle< BeamSpot > &  beamSpotHandle 
)
explicit

Definition at line 8 of file ggPFPhotons.cc.

References abs, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, isPFEle_, matchedPhot_, matchPFReco_, PFElectron_, PFPhoton_, pfPhotons_, and reco::Photon::superCluster().

19  :
20  matchedPhot_(phot),
21  pfPhotons_(pfPhotons),
22  EBReducedRecHits_(EBReducedRecHits),
23  EEReducedRecHits_(EEReducedRecHits),
24  ESRecHits_(ESRecHits),
25  geomBar_(geomBar),
26  geomEnd_(geomEnd),
27  beamSpotHandle_(beamSpotHandle),
28  matchPFReco_(false),
29  isPFEle_(false),
30  EleVeto_(false),
31  isConv_(false),
32  hasSLConv_(false)
33 {
34  //do Matching:
35  //std::cout<<"HERE IN NEW CLASS "<<std::endl;
36 
37  reco::PhotonCollection::const_iterator pfphot=pfPhotons_->begin();
38  for(;pfphot!=pfPhotons_->end();++pfphot){
39  if(pfphot->superCluster()==matchedPhot_.superCluster()){
40  PFPhoton_= *(pfphot);
41  matchPFReco_=true;
42  break;
43  }
44  }
45  reco::GsfElectronCollection::const_iterator pfele=pfElectrons->begin();
46  for(;pfele!=pfElectrons->end();++pfele){
47  if(pfele->superCluster().isNull())continue;
48 
49  if(pfele->superCluster()==matchedPhot_.superCluster()){
50  if(pfele->pflowSuperCluster().isNull())continue;
51 
52  PFElectron_= *(pfele);
53 
54  matchPFReco_=true;
55  isPFEle_=true;
56  break;
57  }
58  for(PFCandidateCollection::const_iterator pfParticle =pfCandidates->begin(); pfParticle!=pfCandidates->end(); pfParticle++){
59  if(abs(pfParticle->pdgId())!=11)continue;
60  if(pfParticle->superClusterRef().isNull())continue;
61  double dR=deltaR(pfParticle->superClusterRef()->eta(),
62  pfParticle->superClusterRef()->phi(),
63  matchedPhot_.superCluster()->eta(),
64  matchedPhot_.superCluster()->phi());
65  if(pfele->superCluster()==pfParticle->superClusterRef() &&dR<0.1){
66  PFElectron_= *(pfele);
67  matchPFReco_=true;
68  isPFEle_=true;
69  break;
70  }
71  }
72  }
73 
74 }
bool hasSLConv_
Definition: ggPFPhotons.h:105
bool matchPFReco_
Definition: ggPFPhotons.h:101
reco::GsfElectron PFElectron_
Definition: ggPFPhotons.h:100
const CaloSubdetectorGeometry * geomBar_
Definition: ggPFPhotons.h:96
#define abs(x)
Definition: mlp_lapack.h:159
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
const CaloSubdetectorGeometry * geomEnd_
Definition: ggPFPhotons.h:97
Handle< BeamSpot > beamSpotHandle_
Definition: ggPFPhotons.h:98
reco::Photon matchedPhot_
Definition: ggPFPhotons.h:90
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
Handle< EcalRecHitCollection > ESRecHits_
Definition: ggPFPhotons.h:95
Handle< EcalRecHitCollection > EBReducedRecHits_
Definition: ggPFPhotons.h:93
Handle< reco::PhotonCollection > pfPhotons_
Definition: ggPFPhotons.h:91
reco::Photon PFPhoton_
Definition: ggPFPhotons.h:99
Handle< EcalRecHitCollection > EEReducedRecHits_
Definition: ggPFPhotons.h:94
ggPFPhotons::~ggPFPhotons ( )
virtual

Definition at line 75 of file ggPFPhotons.cc.

75 {;}

Member Function Documentation

std::pair< double, double > ggPFPhotons::CalcRMS ( vector< reco::CaloCluster PFClust,
reco::Photon  PFPhoton 
)

Definition at line 198 of file ggPFPhotons.cc.

References trackerHits::c, funct::cos(), relval_parameters_module::energy, reco::LeafCandidate::eta(), eta(), phi, reco::LeafCandidate::phi(), and mathSSE::sqrt().

Referenced by fillPFClusters(), and recoPhotonClusterLink().

198  {
199  double delPhi2=0;
200  double delPhiSum=0;
201  double delEta2=0;
202  double delEtaSum=0;
203  double ClusSum=0;
204  float PFPhoPhi=PFPhoton.phi();
205  float PFPhoEta=PFPhoton.eta();
206 
207  float PFClusPhiRMS=0;
208  float PFClusEtaRMS=0;
209  std::pair<double, double> RMS;
210  for(unsigned int c=0; c<PFClust.size(); ++c){
211  delPhi2=(acos(cos(PFPhoPhi-PFClust[c].phi()))* acos(cos(PFPhoPhi-PFClust[c].phi())) )+delPhi2;
212  delPhiSum=delPhiSum+ acos(cos(PFPhoPhi-PFClust[c].phi()))*PFClust[c].energy();
213  delEta2=(PFPhoEta-PFClust[c].eta())*(PFPhoEta-PFClust[c].eta()) *PFClust[c].energy() + delEta2;
214  delEtaSum=delEtaSum+((PFPhoEta-PFClust[c].eta())*PFClust[c].energy());
215  ClusSum=ClusSum+PFClust[c].energy();
216  }
217  double meandPhi=delPhiSum/ClusSum;
218  PFClusPhiRMS=sqrt(fabs(delPhi2/ClusSum - (meandPhi*meandPhi)));
219  double meandEta=delEtaSum/ClusSum;
220  PFClusEtaRMS=sqrt(fabs(delEta2/ClusSum - (meandEta*meandEta)));
221  RMS.first=PFClusEtaRMS;
222  RMS.second=PFClusPhiRMS;
223  return RMS;
224 }
T eta() const
virtual double eta() const
momentum pseudorapidity
T sqrt(T t)
Definition: SSEVec.h:46
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual double phi() const
momentum azimuthal angle
Definition: DDAxes.h:10
bool ggPFPhotons::EleVeto ( )
inline

Definition at line 39 of file ggPFPhotons.h.

39 {return EleVeto_;}
void ggPFPhotons::fillPFClusters ( )

Definition at line 100 of file ggPFPhotons.cc.

References CalcRMS(), SiPixelRawToDigiRegional_cfi::deltaPhi, dEtaLowestC_, dPhiLowestC_, EBReducedRecHits_, EEReducedRecHits_, EinMustache_, relval_parameters_module::energy, ESRecHits_, reco::LeafCandidate::eta(), geomBar_, geomEnd_, ggPFClusters::getPFClusters(), ggPFESClusters::getPFESClusters(), ggPFClusters::getPFSuperclusterOverlap(), i, getHLTprescales::index, isPFEle_, matchedPhot_, reco::Mustache::MustacheClust(), MustacheEOut_, MustacheEtOut_, PFClPhiRMS_, PFClPhiRMSMust_, PFClusters_, PFElectron_, PFLowClusE_, reco::GsfElectron::pflowSuperCluster(), PFPhoton_, PFPreShower1_, PFPreShower2_, PFPS1(), PFPS2(), PFSCFootprintClusters_, reco::Photon::pfSuperCluster(), phi, reco::LeafCandidate::phi(), position, funct::sin(), reco::Photon::superCluster(), and theta().

Referenced by ggPFPhotonAnalyzer::analyze().

100  {
101  //PFClusterCollection object with appropriate variables:
102 
104  //if(isPFEle_)cout<<"PFElectron "<<endl;
105  //else cout<<"PFPHoton "<<endl;
106  //fill PFClusters
108  else PFClusters_=PFClusterCollection.getPFClusters(*(PFPhoton_.pfSuperCluster()));
109  //fill PFClusters with Cluster energy from Rechits inside SC
110 
111  PFSCFootprintClusters_.clear();
112  for(unsigned int i=0; i<PFClusters_.size(); ++i){
113  float SCFootPrintE=PFClusterCollection.getPFSuperclusterOverlap(PFClusters_[i],matchedPhot_);
114  CaloCluster calo(SCFootPrintE, PFClusters_[i].position());
115  PFSCFootprintClusters_.push_back(calo);
116  }
117  //Mustache Variables:
118 
119 
120  Mustache Must;
121  std::vector<unsigned int> insideMust;
122  std::vector<unsigned int> outsideMust;
123  Must.MustacheClust(PFClusters_, insideMust, outsideMust);
124 
125  //Must.MustacheID(PFClusters_, insideMust, outsideMust);
126  // cout<<"Inside "<<insideMust.size()<<", Total"<<PFClusters_.size()<<endl;
127  //sum MustacheEnergy and order clusters by Energy:
128 
129  std::multimap<float, unsigned int>OrderedClust;
130  float MustacheE=0;
131  for(unsigned int i=0; i<insideMust.size(); ++i){
132  unsigned int index=insideMust[i];
133  OrderedClust.insert(make_pair(PFClusters_[index].energy(), index));
134  MustacheE=MustacheE+PFSCFootprintClusters_[index].energy();
135  }
136 
137  float MustacheEOut=0;
138  float MustacheEtOut=0;
139  for(unsigned int i=0; i<outsideMust.size(); ++i){
140  unsigned int index=outsideMust[i];
141  MustacheEOut=MustacheEOut+PFClusters_[index].energy();
142  MustacheEtOut=MustacheEtOut+PFClusters_[index].energy()*sin(PFClusters_[index].position().theta());
143  }
144  MustacheEOut_=MustacheEOut;
145  MustacheEtOut_=MustacheEtOut;
146  EinMustache_=MustacheE;
147 
148  //find lowest energy Cluster
149  std::multimap<float, unsigned int>::iterator it;
150  it=OrderedClust.begin();
151  unsigned int lowEindex=(*it).second;
152  PFLowClusE_=PFSCFootprintClusters_[lowEindex].energy();
153 
154  //dEta and dPhi to this Cluster:
157  //RMS Of All PFClusters inside SuperCluster:
158 
159  std::pair<double, double> RMS=CalcRMS(PFSCFootprintClusters_, PFPhoton_);
160  PFClPhiRMS_=RMS.second;
161  std::vector<CaloCluster>MustacheNLClust;
162  for(it=OrderedClust.begin(); it!=OrderedClust.end(); ++it){
163  unsigned int index=(*it).second;
164  if(index==lowEindex)continue; //skip lowest cluster which could be from PU
165  MustacheNLClust.push_back(PFSCFootprintClusters_[index]);
166  }
167  if(insideMust.size()>3){
168  std::pair<double, double> RMSMust=CalcRMS(MustacheNLClust, PFPhoton_);
169  PFClPhiRMSMust_=RMSMust.second;
170  }
171  if(insideMust.size()==2){
172  MustacheNLClust.push_back(PFSCFootprintClusters_[lowEindex]);
173  std::pair<double, double> RMSMust=CalcRMS(MustacheNLClust, PFPhoton_);
174  PFClPhiRMSMust_=RMSMust.second;
175  }
176  if(insideMust.size()==1){
179  }
180 
181  //fill ES Clusters
182 
183  ggPFESClusters PFPSClusterCollection(ESRecHits_, geomEnd_);
184  vector<reco::PreshowerCluster>PFPS;
185  if(isPFEle_)PFPS=PFPSClusterCollection.getPFESClusters(*((PFElectron_.pflowSuperCluster())));
186  else PFPS=PFPSClusterCollection.getPFESClusters(*(PFPhoton_.pfSuperCluster()));
187  float PFPS1=0;
188  float PFPS2=0;
189  for(unsigned int i=0; i<PFPS.size(); ++i){
190  if(PFPS[i].plane()==1)PFPS1=PFPS1+PFPS[i].energy();
191  if(PFPS[i].plane()==2)PFPS2=PFPS2+PFPS[i].energy();
192  }
195 
196 }
reco::SuperClusterRef pfSuperCluster() const
Ref to PFlow SuperCluster.
Definition: Photon.h:60
int i
Definition: DBlmapReader.cc:9
reco::GsfElectron PFElectron_
Definition: ggPFPhotons.h:100
const CaloSubdetectorGeometry * geomBar_
Definition: ggPFPhotons.h:96
float MustacheEOut_
Definition: ggPFPhotons.h:109
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float MustacheEtOut_
Definition: ggPFPhotons.h:110
Geom::Theta< T > theta() const
std::vector< reco::CaloCluster > PFClusters_
Definition: ggPFPhotons.h:106
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
float PFPreShower2_
Definition: ggPFPhotons.h:112
float PFPreShower1_
Definition: ggPFPhotons.h:111
virtual double eta() const
momentum pseudorapidity
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
const CaloSubdetectorGeometry * geomEnd_
Definition: ggPFPhotons.h:97
double PFClPhiRMS_
Definition: ggPFPhotons.h:116
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:124
float EinMustache_
Definition: ggPFPhotons.h:108
std::pair< double, double > CalcRMS(vector< reco::CaloCluster > PFClust, reco::Photon PFPhoton)
Definition: ggPFPhotons.cc:198
reco::Photon matchedPhot_
Definition: ggPFPhotons.h:90
double dPhiLowestC_
Definition: ggPFPhotons.h:115
double dEtaLowestC_
Definition: ggPFPhotons.h:114
Handle< EcalRecHitCollection > ESRecHits_
Definition: ggPFPhotons.h:95
float PFLowClusE_
Definition: ggPFPhotons.h:113
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
double PFClPhiRMSMust_
Definition: ggPFPhotons.h:117
Handle< EcalRecHitCollection > EBReducedRecHits_
Definition: ggPFPhotons.h:93
reco::Photon PFPhoton_
Definition: ggPFPhotons.h:99
virtual double phi() const
momentum azimuthal angle
SuperClusterRef pflowSuperCluster() const
Definition: GsfElectron.h:174
float PFPS1()
Definition: ggPFPhotons.h:40
float PFPS2()
Definition: ggPFPhotons.h:41
Handle< EcalRecHitCollection > EEReducedRecHits_
Definition: ggPFPhotons.h:94
std::vector< reco::CaloCluster > PFSCFootprintClusters_
Definition: ggPFPhotons.h:107
Definition: DDAxes.h:10
double ggPFPhotons::getPFPhoECorr ( std::vector< reco::CaloCluster PFClusters,
const GBRForest ReaderLCEB,
const GBRForest ReaderLCEE 
)

Definition at line 226 of file ggPFPhotons.cc.

References beamSpotHandle_, EBReducedRecHits_, EEReducedRecHits_, geomBar_, geomEnd_, ggPFClusters::getPFClusters(), i, getHLTprescales::index, isPFEle_, ggPFClusters::LocalEnergyCorrection(), reco::Mustache::MustacheClust(), PFClusters_, PFElectron_, reco::GsfElectron::pflowSuperCluster(), PFPhoLocallyCorrE_, PFPhoton_, and reco::Photon::pfSuperCluster().

Referenced by ggPFPhotonAnalyzer::analyze().

226  {
227  TVector3 bs(beamSpotHandle_->position().x(),beamSpotHandle_->position().y(),
228  beamSpotHandle_->position().z());
229  float beamspotZ=bs.Z();
230  //PFClusterCollection object with appropriate variables:
232  //fill PFClusters
233  PFClusters_.clear();
235  else PFClusters_=PFClusterCollection.getPFClusters(*(PFPhoton_.pfSuperCluster()));
236  Mustache Must;
237  std::vector<unsigned int> insideMust;
238  std::vector<unsigned int> outsideMust;
239  Must.MustacheClust(PFClusters_, insideMust, outsideMust);
240  float ECorr=0;
241  for(unsigned int i=0; i<insideMust.size();++i){
242  unsigned int index=insideMust[i];
243  ECorr=ECorr+PFClusterCollection.LocalEnergyCorrection(ReaderLCEB, ReaderLCEE, PFClusters_[index], beamspotZ);
244  }
245  PFPhoLocallyCorrE_=ECorr;
246 
247  return PFPhoLocallyCorrE_;
248 }
reco::SuperClusterRef pfSuperCluster() const
Ref to PFlow SuperCluster.
Definition: Photon.h:60
int i
Definition: DBlmapReader.cc:9
reco::GsfElectron PFElectron_
Definition: ggPFPhotons.h:100
const CaloSubdetectorGeometry * geomBar_
Definition: ggPFPhotons.h:96
std::vector< reco::CaloCluster > PFClusters_
Definition: ggPFPhotons.h:106
const CaloSubdetectorGeometry * geomEnd_
Definition: ggPFPhotons.h:97
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:124
Handle< BeamSpot > beamSpotHandle_
Definition: ggPFPhotons.h:98
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
double PFPhoLocallyCorrE_
Definition: ggPFPhotons.h:118
Handle< EcalRecHitCollection > EBReducedRecHits_
Definition: ggPFPhotons.h:93
reco::Photon PFPhoton_
Definition: ggPFPhotons.h:99
SuperClusterRef pflowSuperCluster() const
Definition: GsfElectron.h:174
Handle< EcalRecHitCollection > EEReducedRecHits_
Definition: ggPFPhotons.h:94
bool ggPFPhotons::hasSLConv ( )
inline

Definition at line 37 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

37 {return hasSLConv_;}
bool hasSLConv_
Definition: ggPFPhotons.h:105
bool ggPFPhotons::isConv ( )
inline

Definition at line 36 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

36 { return isConv_;}
bool ggPFPhotons::isPFEle ( )
inline

Definition at line 38 of file ggPFPhotons.h.

38 {return isPFEle_;}
bool ggPFPhotons::MatchPFReco ( )
inline

Definition at line 35 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

35 { return matchPFReco_;}
bool matchPFReco_
Definition: ggPFPhotons.h:101
float ggPFPhotons::MustE ( )
inline

Definition at line 42 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

42 {return EinMustache_;}
float EinMustache_
Definition: ggPFPhotons.h:108
float ggPFPhotons::MustEOut ( )
inline

Definition at line 43 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

43 {return MustacheEOut_;}
float MustacheEOut_
Definition: ggPFPhotons.h:109
float ggPFPhotons::MustEtOut ( )
inline

Definition at line 44 of file ggPFPhotons.h.

44 {return MustacheEtOut_;}
float MustacheEtOut_
Definition: ggPFPhotons.h:110
double ggPFPhotons::PFClusRMSMust ( )
inline

Definition at line 49 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

49 {return PFClPhiRMSMust_;}
double PFClPhiRMSMust_
Definition: ggPFPhotons.h:117
double ggPFPhotons::PFClusRMSTot ( )
inline

Definition at line 48 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

48 {return PFClPhiRMS_;}
double PFClPhiRMS_
Definition: ggPFPhotons.h:116
std::vector<reco::CaloCluster> ggPFPhotons::PFClusters ( )
inline

Definition at line 50 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze(), and recoPhotonClusterLink().

50 {return PFClusters_;}
std::vector< reco::CaloCluster > PFClusters_
Definition: ggPFPhotons.h:106
std::vector<reco::CaloCluster> ggPFPhotons::PFClustersSCFP ( )
inline

Definition at line 51 of file ggPFPhotons.h.

51 {return PFSCFootprintClusters_;}//Electron Veto:
std::vector< reco::CaloCluster > PFSCFootprintClusters_
Definition: ggPFPhotons.h:107
double ggPFPhotons::PFdEta ( )
inline

Definition at line 46 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

46 {return dEtaLowestC_;}
double dEtaLowestC_
Definition: ggPFPhotons.h:114
double ggPFPhotons::PFdPhi ( )
inline

Definition at line 47 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

47 {return dPhiLowestC_;}
double dPhiLowestC_
Definition: ggPFPhotons.h:115
bool ggPFPhotons::PFElectronVeto ( edm::Handle< reco::ConversionCollection > &  convH,
edm::Handle< reco::GsfElectronCollection > &  gsfElectronsHandle 
)

Definition at line 77 of file ggPFPhotons.cc.

References beamSpotHandle_, ConversionTools::hasMatchedPromptElectron(), isPFEle_, PFElectron_, and reco::GsfElectron::superCluster().

77  {
78  bool isprompt=false;
79  if(!isPFEle_)return isprompt;
80  isprompt= ConversionTools::hasMatchedPromptElectron(PFElectron_.superCluster(), gsfElectronsHandle, convH, beamSpotHandle_->position());
81  return isprompt;
82 }
reco::GsfElectron PFElectron_
Definition: ggPFPhotons.h:100
static bool hasMatchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle< reco::GsfElectronCollection > &eleCol, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
Handle< BeamSpot > beamSpotHandle_
Definition: ggPFPhotons.h:98
float ggPFPhotons::PFLowE ( )
inline

Definition at line 45 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze().

45 {return PFLowClusE_;}
float PFLowClusE_
Definition: ggPFPhotons.h:113
float ggPFPhotons::PFPS1 ( )
inline

Definition at line 40 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze(), and fillPFClusters().

40 {return PFPreShower1_;}
float PFPreShower1_
Definition: ggPFPhotons.h:111
float ggPFPhotons::PFPS2 ( )
inline

Definition at line 41 of file ggPFPhotons.h.

Referenced by ggPFPhotonAnalyzer::analyze(), and fillPFClusters().

41 {return PFPreShower2_;}
float PFPreShower2_
Definition: ggPFPhotons.h:112
void ggPFPhotons::PhotonPFCandMatch ( reco::SuperCluster  sc,
std::vector< reco::PFCandidatePtr > &  insideBox,
edm::Handle< PFCandidateCollection > &  pfCandidates,
vector< reco::CaloCluster > &  PFClust,
std::vector< DetId > &  MatchedRH 
)

Definition at line 530 of file ggPFPhotons.cc.

References abs, ggPFClusters::BasicClusterPFCandLink(), trackerHits::c, reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), filterCSVwithJSON::copy, funct::cos(), deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, EBReducedRecHits_, EEReducedRecHits_, reco::tau::disc::Eta(), reco::CaloCluster::eta(), cropTnPTrees::frac, geomBar_, geomEnd_, i, getHLTprescales::index, reco::Photon::isEB(), reco::Photon::isEE(), matchedPhot_, benchmark_cfg::pdgId, colinearityKinematic::Phi, reco::CaloCluster::phi(), reco::CaloCluster::setEnergy(), reco::CaloCluster::setPosition(), mathSSE::sqrt(), SuperClusterSize(), x, reco::CaloCluster::x(), detailsBasic3DVector::y, reco::CaloCluster::y(), detailsBasic3DVector::z, and reco::CaloCluster::z().

Referenced by ggPFPhotonAnalyzer::analyze().

537 {
538  std::vector<reco::PFCandidatePtr>ChgHad;
539  std::vector<reco::PFCandidatePtr>PFPho;
540  std::pair<double, double>scSize=SuperClusterSize(matchedPhot_);
541  double etabound=scSize.first;
542  double phibound=scSize.second;
543  double dRbound=sqrt(etabound*etabound+phibound*phibound);
544  double seedEta=sc.eta();
545  double seedPhi=sc.phi();
546  for(PFCandidateCollection::const_iterator pfParticle =pfCandidates->begin(); pfParticle!=pfCandidates->end(); pfParticle++){
547  if(pfParticle->pdgId()==130)continue;
548  unsigned int index=pfParticle - pfCandidates->begin();
549  math::XYZVector photon_directionWrtVtx(sc.x() - pfParticle->vx(),
550  sc.y() - pfParticle->vy(),
551  sc.z() - pfParticle->vz());
552  seedEta= photon_directionWrtVtx.Eta();
553  seedPhi=photon_directionWrtVtx.Phi();
554  double dphi=acos(cos(seedPhi-pfParticle->momentum().Phi()));
555  double deta=fabs(seedEta-pfParticle->momentum().Eta());
556  if(deta<etabound && dphi<phibound && matchedPhot_.isEB()){
557  reco::PFCandidatePtr pfRef(pfCandidates,index);
558  insideBox.push_back(pfRef); //Fill PFCandidates in a box around SC
559  if(pfParticle->pdgId()==22)PFPho.push_back(pfRef);
560  if(abs(pfParticle->pdgId())==211)ChgHad.push_back(pfRef);
561  }
562  double dR=deltaR(seedEta,seedPhi, pfParticle->momentum().Eta(), pfParticle->momentum().Phi());
563  if(matchedPhot_.isEE() && dR<dRbound){
564  //if(dR<0.4){
565  reco::PFCandidatePtr pfRef(pfCandidates,index);
566  insideBox.push_back(pfRef); //Fill PFCandidates in a box around SC
567  if(pfParticle->pdgId()==22)PFPho.push_back(pfRef);
568  if(abs(pfParticle->pdgId())==211)ChgHad.push_back(pfRef);
569  }
570  }
571 
573  //Link PFCandidates to Basic Clusters
574  std::vector<reco::PFCandidatePtr>copy=insideBox;
575 
576  PFClusterCollection.BasicClusterPFCandLink(sc, insideBox, MatchedRH);
577  PFPho.clear();
578  ChgHad.clear();
579  for(unsigned int i=0; i<insideBox.size(); ++i){
580  if(insideBox[i]->pdgId()==22)PFPho.push_back(insideBox[i]);
581  if(abs(insideBox[i]->pdgId())==211)ChgHad.push_back(insideBox[i]);
582  }
583  //finally compute frac of shared ECal Energy between PFPhotons and PFChgHad
584  std::vector<unsigned int > orbitPho;
585  std::vector<unsigned int > overlapChgHad;
586  std::vector<float > fractionShared;
587  for(unsigned int c=0; c<ChgHad.size(); ++c){
588  bool satPho=false;
589  float frac=1.0;
590  CaloCluster calo;
591  float drmin=999;
593  math::XYZPointF positionvtx(ChgHad[c]->positionAtECALEntrance().x()-ChgHad[c]->vx(),
594  ChgHad[c]->positionAtECALEntrance().y()-ChgHad[c]->vy(),
595  ChgHad[c]->positionAtECALEntrance().z()-ChgHad[c]->vz());
596  for(; cit!=sc.clustersEnd(); ++cit){
597  float dR=deltaR((*cit)->eta(), (*cit)->phi(), positionvtx.eta(), positionvtx.phi());
598  if(dR<drmin){
599  calo.setPosition((*cit)->position());
600  drmin=dR;
601  }
602  }
603 
604  for(unsigned int ipho=0; ipho<PFPho.size(); ++ipho){
605  double deta=fabs(ChgHad[c]->positionAtECALEntrance().Eta()- PFPho[ipho]->positionAtECALEntrance().Eta());
606  double dphi=acos(cos(ChgHad[c]->positionAtECALEntrance().Phi()-PFPho[ipho]->positionAtECALEntrance().Phi()));
607 
608  if(deta<0.05 && dphi<0.07){
609  orbitPho.push_back(ipho);
610  frac=ChgHad[c]->ecalEnergy()/(PFPho[ipho]->ecalEnergy()+ChgHad[c]->ecalEnergy());
611  fractionShared.push_back(frac);
612  satPho=true;
613  }
614  }
615  if(satPho){
616  calo.setEnergy(frac*ChgHad[c]->rawEcalEnergy());
617  }
618  else{
619  calo.setEnergy(ChgHad[c]->rawEcalEnergy());
620  }
621  PFClust.push_back(calo); //pushBack PFClusters from Charged Hadrons
622  }
623  for(unsigned int ipho=0; ipho<PFPho.size(); ++ipho){
624  CaloCluster calo;
625  float frac=1.0;
626  math::XYZPoint caloPos(PFPho[ipho]->positionAtECALEntrance().x(),
627  PFPho[ipho]->positionAtECALEntrance().y(),
628  PFPho[ipho]->positionAtECALEntrance().z());
629  calo.setPosition(caloPos);
630  for(unsigned int i=0; i<orbitPho.size(); ++i){
631  if(ipho==orbitPho[i]){
632  frac=1-fractionShared[i];
633  break;
634  }
635  }
636  calo.setEnergy(frac*PFPho[ipho]->rawEcalEnergy());
637  PFClust.push_back(calo);//PFClusters from PFPhotons
638  }
639 }
int i
Definition: DBlmapReader.cc:9
bool isEE() const
Definition: Photon.h:120
const CaloSubdetectorGeometry * geomBar_
Definition: ggPFPhotons.h:96
std::pair< double, double > SuperClusterSize(reco::Photon phot)
Definition: ggPFPhotons.cc:358
void setPosition(const math::XYZPoint &p)
Definition: CaloCluster.h:111
#define abs(x)
Definition: mlp_lapack.h:159
void setEnergy(double energy)
Definition: CaloCluster.h:109
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:11
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:157
double double double z
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:160
const CaloSubdetectorGeometry * geomEnd_
Definition: ggPFPhotons.h:97
T sqrt(T t)
Definition: SSEVec.h:46
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:151
reco::Photon matchedPhot_
Definition: ggPFPhotons.h:90
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
bool isEB() const
Definition: Photon.h:118
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:65
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
Handle< EcalRecHitCollection > EBReducedRecHits_
Definition: ggPFPhotons.h:93
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:154
Definition: DDAxes.h:10
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:163
Handle< EcalRecHitCollection > EEReducedRecHits_
Definition: ggPFPhotons.h:94
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:68
std::vector< reco::CaloCluster > ggPFPhotons::recoPhotonClusterLink ( reco::Photon  phot,
edm::Handle< PFCandidateCollection > &  pfCandidates 
)

Definition at line 250 of file ggPFPhotons.cc.

References CalcRMS(), funct::cos(), SiPixelRawToDigiRegional_cfi::deltaPhi, dEtaLowestC_, dPhiLowestC_, EinMustache_, relval_parameters_module::energy, reco::LeafCandidate::eta(), i, getHLTprescales::index, matchedPhot_, reco::Mustache::MustacheClust(), MustacheEOut_, MustacheEtOut_, PFClPhiRMS_, PFClPhiRMSMust_, PFClusters_, PFLowClusE_, PFPhoton_, PFPreShower1_, PFPreShower2_, phi, reco::LeafCandidate::phi(), position, funct::sin(), reco::Photon::superCluster(), SuperClusterSize(), and theta().

252  {
253  PFClusters_.clear();
254  //initialize variables:
255  EinMustache_=0;
256  MustacheEOut_=0;
257  MustacheEtOut_=0;
258  PFPreShower1_=0;
259  PFPreShower2_=0;
260  PFLowClusE_=0;
261  dEtaLowestC_=0;
262  dPhiLowestC_=0;
263  PFClPhiRMS_=0;
264  PFClPhiRMSMust_=0;
265  //find SC boundaries from RecHits:
266  std::pair<double,double>Boundary=SuperClusterSize(phot);
267  double etabound=Boundary.first;
268  double phibound=Boundary.second;
269  double seedEta=phot.superCluster()->seed()->eta();
270  double seedPhi=phot.superCluster()->seed()->phi();
271  for (PFCandidateCollection::const_iterator pfParticle =pfCandidates->begin(); pfParticle!=pfCandidates->end(); pfParticle++){
272  if(pfParticle->pdgId()!=22) continue; //if photon
273  //use a box about superCluster Width:
274  float dphi=acos(cos(seedPhi-pfParticle->phi()));
275  float deta=fabs(seedEta-pfParticle->eta());
276  PFPreShower1_=0;
277  PFPreShower2_=0;
278  if(deta<etabound && dphi<phibound){
279  //hard coded size for now but will make it more dynamic
280  //based on SuperCluster Shape
281  math::XYZPoint position(pfParticle->positionAtECALEntrance().X(), pfParticle->positionAtECALEntrance().Y(), pfParticle->positionAtECALEntrance().Z()) ;
282  CaloCluster calo(pfParticle->rawEcalEnergy() ,position );
283  PFClusters_.push_back(calo);
284  PFPreShower1_=PFPreShower1_+pfParticle->pS1Energy();
285  PFPreShower2_=PFPreShower2_+pfParticle->pS2Energy();
286  }
287  }
288 
289  //Mustache Variables:
290 
291  if(PFClusters_.size()>0){
292  Mustache Must;
293  std::vector<unsigned int> insideMust;
294  std::vector<unsigned int> outsideMust;
295  Must.MustacheClust(PFClusters_, insideMust, outsideMust);
296  //sum MustacheEnergy and order clusters by Energy:
297 
298  std::multimap<float, unsigned int>OrderedClust;
299  float MustacheE=0;
300  for(unsigned int i=0; i<insideMust.size(); ++i){
301  unsigned int index=insideMust[i];
302  OrderedClust.insert(make_pair(PFClusters_[index].energy(), index));
303  MustacheE=MustacheE+PFClusters_[index].energy();
304  }
305 
306  float MustacheEOut=0;
307  float MustacheEtOut=0;
308  for(unsigned int i=0; i<outsideMust.size(); ++i){
309  unsigned int index=outsideMust[i];
310  MustacheEOut=MustacheEOut+PFClusters_[index].energy();
311  MustacheEtOut=MustacheEtOut+PFClusters_[index].energy()*sin(PFClusters_[index].position().theta());
312  }
313  MustacheEOut_=MustacheEOut;
314  MustacheEtOut_=MustacheEtOut;
315  EinMustache_=MustacheE;
316 
317  //find lowest energy Cluster
318  std::multimap<float, unsigned int>::iterator it;
319  it=OrderedClust.begin();
320  unsigned int lowEindex=(*it).second;
321  PFLowClusE_=PFClusters_[lowEindex].energy();
322  //dEta and dPhi to this Cluster:
323  dEtaLowestC_=PFClusters_[lowEindex].eta()-PFPhoton_.eta();
325  //RMS Of All PFClusters inside SuperCluster:
326  if(insideMust.size()==1){
327  PFLowClusE_=0;
328  dEtaLowestC_=0;
329  dPhiLowestC_=0;
330  }
331  std::pair<double, double> RMS=CalcRMS(PFClusters_, PFPhoton_);
332  PFClPhiRMS_=RMS.second;
333  std::vector<CaloCluster>MustacheNLClust;
334  for(it=OrderedClust.begin(); it!=OrderedClust.end(); ++it){
335  unsigned int index=(*it).second;
336  if(index==lowEindex)continue; //skip lowest cluster which could be from PU
337  MustacheNLClust.push_back(PFClusters_[index]);
338  }
339  if(insideMust.size()>3){
340  std::pair<double, double> RMSMust=CalcRMS(MustacheNLClust, PFPhoton_);
341  PFClPhiRMSMust_=RMSMust.second;
342  }
343  if(insideMust.size()==2){
344  MustacheNLClust.push_back(PFClusters_[lowEindex]);
345  std::pair<double, double> RMSMust=CalcRMS(MustacheNLClust, PFPhoton_);
346  PFClPhiRMSMust_=RMSMust.second;
347  }
348  if(insideMust.size()==1){
351  }
352 
353  }
354  return PFClusters_;
355 
356 }
int i
Definition: DBlmapReader.cc:9
std::pair< double, double > SuperClusterSize(reco::Photon phot)
Definition: ggPFPhotons.cc:358
float MustacheEOut_
Definition: ggPFPhotons.h:109
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
float MustacheEtOut_
Definition: ggPFPhotons.h:110
std::vector< reco::CaloCluster > PFClusters_
Definition: ggPFPhotons.h:106
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
float PFPreShower2_
Definition: ggPFPhotons.h:112
float PFPreShower1_
Definition: ggPFPhotons.h:111
virtual double eta() const
momentum pseudorapidity
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
double PFClPhiRMS_
Definition: ggPFPhotons.h:116
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:124
float EinMustache_
Definition: ggPFPhotons.h:108
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::pair< double, double > CalcRMS(vector< reco::CaloCluster > PFClust, reco::Photon PFPhoton)
Definition: ggPFPhotons.cc:198
reco::Photon matchedPhot_
Definition: ggPFPhotons.h:90
double dPhiLowestC_
Definition: ggPFPhotons.h:115
double dEtaLowestC_
Definition: ggPFPhotons.h:114
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
float PFLowClusE_
Definition: ggPFPhotons.h:113
double PFClPhiRMSMust_
Definition: ggPFPhotons.h:117
reco::Photon PFPhoton_
Definition: ggPFPhotons.h:99
virtual double phi() const
momentum azimuthal angle
Definition: DDAxes.h:10
void ggPFPhotons::recoPhotonClusterLink ( reco::SuperCluster  sc,
std::vector< reco::PFCandidatePtr > &  insideMust,
std::vector< reco::PFCandidatePtr > &  outsideMust,
edm::Handle< PFCandidateCollection > &  pfCandidates,
double  etabound,
double  phibound 
)
static

Definition at line 416 of file ggPFPhotons.cc.

References funct::cos(), i, getHLTprescales::index, reco::Mustache::MustacheClust(), PFClusters(), position, and reco::SuperCluster::seed().

425  {
426  std::vector<reco::CaloCluster>PFClusters;
427  std::vector<reco::PFCandidatePtr>PFCand;
428  double seedEta=sc.seed()->eta();
429  double seedPhi=sc.seed()->phi();
430  for(PFCandidateCollection::const_iterator pfParticle =pfCandidates->begin(); pfParticle!=pfCandidates->end(); pfParticle++){
431  unsigned int index=pfParticle - pfCandidates->begin();
432  if(pfParticle->pdgId()!=22) continue; //if photon
433  //use a box about superCluster Width:
434  float dphi=acos(cos(seedPhi-pfParticle->phi()));
435  float deta=fabs(seedEta-pfParticle->eta());
436  if(deta<etabound && dphi<phibound){
437  //hard coded size for now but will make it more dynamic
438  //based on SuperCluster Shape
439  math::XYZPoint position(pfParticle->positionAtECALEntrance().X(), pfParticle->positionAtECALEntrance().Y(), pfParticle->positionAtECALEntrance().Z()) ;
440  CaloCluster calo(pfParticle->rawEcalEnergy() ,position );
441  PFClusters.push_back(calo);
442  reco::PFCandidatePtr pfRef(pfCandidates,index);
443  PFCand.push_back(pfRef);
444  }
445 
446  }
447  Mustache Must;
448  std::vector<unsigned int> insideMustindex;
449  std::vector<unsigned int> outsideMustindex;
450  Must.MustacheClust(PFClusters, insideMustindex, outsideMustindex);
451  for(unsigned int i=0; i<insideMustindex.size(); ++i){
452  unsigned int index=insideMustindex[i];
453  insideMust.push_back(PFCand[index]);
454  }
455  for(unsigned int i=0; i<outsideMustindex.size(); ++i){
456  unsigned int index=outsideMustindex[i];
457  outsideMust.push_back(PFCand[index]);
458  }
459 
460 }
int i
Definition: DBlmapReader.cc:9
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
std::vector< reco::CaloCluster > PFClusters()
Definition: ggPFPhotons.h:50
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
Definition: Mustache.cc:124
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:62
std::pair< float, float > ggPFPhotons::SLPoint ( )

Definition at line 85 of file ggPFPhotons.cc.

References beamSpotHandle_, ggPFTracks::gsfElectronProj(), hasSLConv_, ggPFTracks::isConv(), isConv_, isPFEle_, PFElectron_, PFPhoton_, and ggPFTracks::SLCombZVtx().

Referenced by ggPFPhotonAnalyzer::analyze().

85  {
87  std::pair<float, float> SLPoint(0,0);
88  TVector3 bs(beamSpotHandle_->position().x(),beamSpotHandle_->position().y(),
89  beamSpotHandle_->position().z());
90  if(isPFEle_){
91  isConv_=true;
92  SLPoint=pfTks.gsfElectronProj(PFElectron_);
93  return SLPoint;
94  }
95  SLPoint=pfTks.SLCombZVtx(PFPhoton_, hasSLConv_);
96  isConv_=pfTks.isConv();//bool to flag if there are conv tracks
97  return SLPoint;
98 }
bool hasSLConv_
Definition: ggPFPhotons.h:105
reco::GsfElectron PFElectron_
Definition: ggPFPhotons.h:100
std::pair< float, float > SLPoint()
Definition: ggPFPhotons.cc:85
Handle< BeamSpot > beamSpotHandle_
Definition: ggPFPhotons.h:98
reco::Photon PFPhoton_
Definition: ggPFPhotons.h:99
std::pair< double, double > ggPFPhotons::SuperClusterSize ( reco::Photon  phot)

Definition at line 358 of file ggPFPhotons.cc.

References funct::cos(), deltaR(), dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, EBReducedRecHits_, EEReducedRecHits_, PV3DBase< T, PVType, FrameType >::eta(), eta(), geomBar_, geomEnd_, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), i, reco::Photon::isEB(), step1_ZMM_7Tev::MaxEta, ecalTB2006H4_GenSimDigiReco_cfg::MaxPhi, phi, PV3DBase< T, PVType, FrameType >::phi(), and reco::Photon::superCluster().

Referenced by PhotonPFCandMatch(), and recoPhotonClusterLink().

360  {
361  std::pair<double, double>SCsize(0.1,0.4);//Eta, Phi
362  //find maximum distance between SuperCluster Seed and Rec Hits
363  SuperClusterRef recoSC=phot.superCluster();
364  reco::CaloCluster_iterator cit=recoSC->clustersBegin();
365  double seedeta=recoSC->seed()->eta();
366  double seedphi=recoSC->seed()->phi();
369  double MaxEta=-99;
370  double MaxPhi=-99;
371  double MaxR=-99;
372  for(;cit!=recoSC->clustersEnd();++cit){
373  std::vector< std::pair<DetId, float> >bcCells=(*cit)->hitsAndFractions();
374  if(phot.isEB()){
375  for(unsigned int i=0; i<bcCells.size(); ++i){
376  for(eb=EBReducedRecHits_->begin();eb!= EBReducedRecHits_->end();++eb){
377  if(eb->id().rawId()==bcCells[i].first.rawId()){
378  DetId id=bcCells[i].first;
379  float eta=geomBar_->getGeometry(id)->getPosition().eta();
380  float dEta = fabs(seedeta-eta);
381  if(dEta>MaxEta){
382  MaxEta=dEta;
383  float phi=geomBar_->getGeometry(id)->getPosition().phi();
384  float dPhi = acos(cos( seedphi-phi));
385  if(dPhi>MaxPhi){
386  MaxPhi=dPhi;
387  }
388  }
389  }
390  }
391 
392  }
393  }
394  else{
395  for(unsigned int i=0; i<bcCells.size(); ++i){
396  for(ee=EEReducedRecHits_->begin();ee!= EEReducedRecHits_->end();++ee){
397  if(ee->id().rawId()==bcCells[i].first.rawId()){
398  DetId id=bcCells[i].first;
399  float eta=geomEnd_->getGeometry(id)->getPosition().eta();
400  float phi=geomEnd_->getGeometry(id)->getPosition().phi();
401  float dR=deltaR(eta, phi, seedeta, seedphi);
402  if(dR>MaxR){
403  MaxR=dR;
404  MaxEta=fabs(seedeta-eta);
405  MaxPhi= acos(cos(seedphi-phi));
406  }
407  }
408  }
409  }
410  }
411  }
412  SCsize.first=MaxEta; SCsize.second=MaxPhi;
413  return SCsize;
414 }
int i
Definition: DBlmapReader.cc:9
const CaloSubdetectorGeometry * geomBar_
Definition: ggPFPhotons.h:96
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
std::vector< EcalRecHit >::const_iterator const_iterator
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
T eta() const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const CaloSubdetectorGeometry * geomEnd_
Definition: ggPFPhotons.h:97
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
Definition: DetId.h:20
bool isEB() const
Definition: Photon.h:118
T eta() const
Definition: PV3DBase.h:75
Handle< EcalRecHitCollection > EBReducedRecHits_
Definition: ggPFPhotons.h:93
Handle< EcalRecHitCollection > EEReducedRecHits_
Definition: ggPFPhotons.h:94
Definition: DDAxes.h:10
std::pair< double, double > ggPFPhotons::SuperClusterSize ( reco::SuperCluster  sc,
Handle< EcalRecHitCollection > &  EBReducedRecHits,
Handle< EcalRecHitCollection > &  EEReducedRecHits,
const CaloSubdetectorGeometry geomBar,
const CaloSubdetectorGeometry geomEnd 
)
static

Definition at line 461 of file ggPFPhotons.cc.

References reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), funct::cos(), dPhi(), PV3DBase< T, PVType, FrameType >::eta(), reco::CaloCluster::eta(), eta(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), i, step1_ZMM_7Tev::MaxEta, ecalTB2006H4_GenSimDigiReco_cfg::MaxPhi, phi, PV3DBase< T, PVType, FrameType >::phi(), reco::CaloCluster::phi(), and DetId::subdetId().

466  {
467  std::pair<double, double>SCsize(0.1,0.4);//Eta, Phi
468  //find maximum distance between SuperCluster Seed and Rec Hits
470  double seedeta=sc.eta();
471  double seedphi=sc.phi();
474  double MaxEta=-99;
475  double MaxPhi=-99;
476  for(;cit!=sc.clustersEnd();++cit){
477  std::vector< std::pair<DetId, float> >bcCells=(*cit)->hitsAndFractions();
478  DetId seedXtalId = bcCells[0].first ;
479  int detector = seedXtalId.subdetId(); //use Seed to check if EB or EE
480  bool isEb;
481  if(detector==1)isEb=true;
482  else isEb=false;
483  if(isEb){
484  for(unsigned int i=0; i<bcCells.size(); ++i){
485  for(eb=EBReducedRecHits->begin();eb!= EBReducedRecHits->end();++eb){
486  if(eb->id().rawId()==bcCells[i].first.rawId()){
487  DetId id=bcCells[i].first;
488  float eta=geomBar->getGeometry(id)->getPosition().eta();
489  float dEta = fabs(seedeta-eta);
490  if(dEta>MaxEta){
491  MaxEta=dEta;
492  float phi=geomBar->getGeometry(id)->getPosition().phi();
493  float dPhi = acos(cos( seedphi-phi));
494  if(dPhi>MaxPhi){
495  MaxPhi=dPhi;
496  }
497  }
498  }
499  }
500 
501  }
502  }
503  else{
504  for(unsigned int i=0; i<bcCells.size(); ++i){
505  for(ee=EEReducedRecHits->begin();ee!= EEReducedRecHits->end();++ee){
506  if(ee->id().rawId()==bcCells[i].first.rawId()){
507  DetId id=bcCells[i].first;
508  float eta=geomEnd->getGeometry(id)->getPosition().eta();
509  float dEta = fabs(seedeta-eta);
510  if(dEta>MaxEta){
511  MaxEta=dEta;
512  }
513  float phi=geomEnd->getGeometry(id)->getPosition().phi();
514  float dPhi = acos(cos(seedphi-phi));
515  if(dPhi>MaxPhi){
516  MaxPhi=dPhi;
517  }
518  }
519  }
520 
521  }
522  }
523  }
524  SCsize.first=MaxEta; SCsize.second=MaxPhi;
525  return SCsize;
526 
527 
528 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
std::vector< EcalRecHit >::const_iterator const_iterator
T eta() const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:160
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
T eta() const
Definition: PV3DBase.h:75
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:65
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:163
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:68
Definition: DDAxes.h:10

Member Data Documentation

Handle<BeamSpot> ggPFPhotons::beamSpotHandle_
private

Definition at line 98 of file ggPFPhotons.h.

Referenced by getPFPhoECorr(), PFElectronVeto(), and SLPoint().

double ggPFPhotons::dEtaLowestC_
private

Definition at line 114 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

double ggPFPhotons::dPhiLowestC_
private

Definition at line 115 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

Handle<EcalRecHitCollection> ggPFPhotons::EBReducedRecHits_
private

Definition at line 93 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), PhotonPFCandMatch(), and SuperClusterSize().

Handle<EcalRecHitCollection> ggPFPhotons::EEReducedRecHits_
private

Definition at line 94 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), PhotonPFCandMatch(), and SuperClusterSize().

float ggPFPhotons::EinMustache_
private

Definition at line 108 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

bool ggPFPhotons::EleVeto_
private

Definition at line 103 of file ggPFPhotons.h.

Handle<EcalRecHitCollection> ggPFPhotons::ESRecHits_
private

Definition at line 95 of file ggPFPhotons.h.

Referenced by fillPFClusters().

const CaloSubdetectorGeometry* ggPFPhotons::geomBar_
private

Definition at line 96 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), PhotonPFCandMatch(), and SuperClusterSize().

const CaloSubdetectorGeometry* ggPFPhotons::geomEnd_
private

Definition at line 97 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), PhotonPFCandMatch(), and SuperClusterSize().

bool ggPFPhotons::hasSLConv_
private

Definition at line 105 of file ggPFPhotons.h.

Referenced by SLPoint().

bool ggPFPhotons::isConv_
private

Definition at line 104 of file ggPFPhotons.h.

Referenced by SLPoint().

bool ggPFPhotons::isPFEle_
private

Definition at line 102 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), ggPFPhotons(), PFElectronVeto(), and SLPoint().

reco::Photon ggPFPhotons::matchedPhot_
private
bool ggPFPhotons::matchPFReco_
private

Definition at line 101 of file ggPFPhotons.h.

Referenced by ggPFPhotons().

float ggPFPhotons::MustacheEOut_
private

Definition at line 109 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

float ggPFPhotons::MustacheEtOut_
private

Definition at line 110 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

double ggPFPhotons::PFClPhiRMS_
private

Definition at line 116 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

double ggPFPhotons::PFClPhiRMSMust_
private

Definition at line 117 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

std::vector<reco::CaloCluster> ggPFPhotons::PFClusters_
private

Definition at line 106 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), and recoPhotonClusterLink().

reco::GsfElectron ggPFPhotons::PFElectron_
private

Definition at line 100 of file ggPFPhotons.h.

Referenced by fillPFClusters(), getPFPhoECorr(), ggPFPhotons(), PFElectronVeto(), and SLPoint().

Handle<reco::GsfElectronCollection> ggPFPhotons::pfElectrons_
private

Definition at line 92 of file ggPFPhotons.h.

float ggPFPhotons::PFLowClusE_
private

Definition at line 113 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

double ggPFPhotons::PFPhoLocallyCorrE_
private

Definition at line 118 of file ggPFPhotons.h.

Referenced by getPFPhoECorr().

reco::Photon ggPFPhotons::PFPhoton_
private
Handle<reco::PhotonCollection> ggPFPhotons::pfPhotons_
private

Definition at line 91 of file ggPFPhotons.h.

Referenced by ggPFPhotons().

float ggPFPhotons::PFPreShower1_
private

Definition at line 111 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

float ggPFPhotons::PFPreShower2_
private

Definition at line 112 of file ggPFPhotons.h.

Referenced by fillPFClusters(), and recoPhotonClusterLink().

std::vector<reco::CaloCluster> ggPFPhotons::PFSCFootprintClusters_
private

Definition at line 107 of file ggPFPhotons.h.

Referenced by fillPFClusters().