CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Photon.h
Go to the documentation of this file.
1 #ifndef EgammaCandidates_Photon_h
2 #define EgammaCandidates_Photon_h
3 
18 
19 
20 namespace reco {
21 
22  class Photon : public RecoCandidate {
23  public:
25  struct FiducialFlags;
26  struct IsolationVariables;
27  struct ShowerShape;
28  struct MIPVariables;
29 
31  Photon() : RecoCandidate() { pixelSeed_=false; }
32 
34  Photon ( const Photon&);
35 
37  Photon( const LorentzVector & p4,
38  const Point& caloPos,
39  const PhotonCoreRef & core,
40  const Point & vtx = Point( 0, 0, 0 ) );
41 
43  virtual ~Photon();
44 
46  virtual Photon * clone() const;
47 
51 
52  //
54  //
55  // retrieve provenance
56  bool isPFlowPhoton() const {return this->photonCore()->isPFlowPhoton();}
57  bool isStandardPhoton() const {return this->photonCore()->isStandardPhoton();}
61  reco::SuperClusterRef parentSuperCluster() const {return this->photonCore()->parentSuperCluster();}
63  reco::ConversionRefVector conversions() const {return this->photonCore()->conversions() ;}
65  pflow=1,
66  both=2};
67 
69  reco::ConversionRefVector conversionsOneLeg() const {return this->photonCore()->conversionsOneLeg() ;}
71  bool hasConversionTracks() const { if (this->photonCore()->conversions().size() > 0 || this->photonCore()->conversionsOneLeg().size() > 0) return true; else return false;}
73  reco::ElectronSeedRefVector electronPixelSeeds() const {return this->photonCore()->electronPixelSeeds();}
75  bool hasPixelSeed() const { if ((this->photonCore()->electronPixelSeeds()).size() > 0 ) return true; else return false; }
76  int conversionTrackProvenance(const edm::RefToBase<reco::Track>& convTrack) const;
77 
78 
82  void setVertex(const Point & vertex);
84  bool isPhoton() const { return true ; }
85 
86 
87  //=======================================================
88  // Fiducial Flags
89  //=======================================================
91  {
92 
93  //Fiducial flags
94  bool isEB;//Photon is in EB
95  bool isEE;//Photon is in EE
96  bool isEBEtaGap;//Photon is in supermodule/supercrystal eta gap in EB
97  bool isEBPhiGap;//Photon is in supermodule/supercrystal phi gap in EB
98  bool isEERingGap;//Photon is in crystal ring gap in EE
99  bool isEEDeeGap;//Photon is in crystal dee gap in EE
100  bool isEBEEGap;//Photon is in border between EB and EE.
101 
103  isEB(false),
104  isEE(false),
105  isEBEtaGap(false),
106  isEBPhiGap(false),
108  isEEDeeGap(false),
110 
111  {}
112 
113 
114  };
115 
120  bool isEB() const{return fiducialFlagBlock_.isEB;}
121  // true if photon is in ECAL endcap
122  bool isEE() const{return fiducialFlagBlock_.isEE;}
124  bool isEBGap() const { return (isEBEtaGap() || isEBPhiGap()); }
128  bool isEEGap() const { return (isEERingGap() || isEEDeeGap()); }
132  bool isEBEEGap() const{return fiducialFlagBlock_.isEBEEGap;}
133 
134  //=======================================================
135  // Shower Shape Variables
136  //=======================================================
137 
138  struct ShowerShape
139  {
140  float sigmaEtaEta ;
142  float e1x5 ;
143  float e2x5 ;
144  float e3x3 ;
145  float e5x5 ;
146  float maxEnergyXtal ;
147  float hcalDepth1OverEcal ; // hcal over ecal energy using first hcal depth
148  float hcalDepth2OverEcal ; // hcal over ecal energy using 2nd hcal depth
151  std::vector<CaloTowerDetId> hcalTowersBehindClusters;
153  : sigmaEtaEta(std::numeric_limits<float>::max()),
154  sigmaIetaIeta(std::numeric_limits<float>::max()),
155  e1x5(0),
156  e2x5(0),
157  e3x3(0),
158  e5x5(0),
159  maxEnergyXtal(0),
164 
165  {}
166  } ;
169 
172 
179 
186  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShapeBlock_.hcalTowersBehindClusters ; }
187 
189  float e1x5() const {return showerShapeBlock_.e1x5;}
190  float e2x5() const {return showerShapeBlock_.e2x5;}
191  float e3x3() const {return showerShapeBlock_.e3x3;}
192  float e5x5() const {return showerShapeBlock_.e5x5;}
194  float sigmaEtaEta() const {return showerShapeBlock_.sigmaEtaEta;}
198  float r9 () const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
199 
210  float full5x5_r9 () const {return full5x5_showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
211 
212  //=======================================================
213  // Energy Determinations
214  //=======================================================
216 
232  scEcalEnergy(0.),
233  scEcalEnergyError(999.),
234  scEcalP4(0., 0., 0., 0.),
235  phoEcalEnergy(0.),
236  phoEcalEnergyError(999.),
237  phoEcalP4(0., 0., 0., 0.),
238  regression1Energy(0.),
240  regression1P4(0.,0.,0.,0.),
241  regression2Energy(0.),
243  regression2P4(0.,0.,0.,0.),
245  {}
246  };
247 
248  using RecoCandidate::setP4 ;
249  using RecoCandidate::p4 ;
250 
251  //sets both energy and its uncertainty
252  void setCorrectedEnergy( P4type type, float E, float dE, bool toCand=true );
253  void setP4( P4type type, const LorentzVector & p4, float p4Error, bool setToRecoCandidate ) ;
256 
257  float getCorrectedEnergy( P4type type) const;
258  float getCorrectedEnergyError( P4type type) const ;
260  const LorentzVector& p4( P4type type ) const ;
261  const EnergyCorrections & energyCorrections() const { return eCorrections_ ; }
262 
263  //=======================================================
264  // MIP Variables
265  //=======================================================
266 
268  {
269  float mipChi2;
271  float mipSlope;
274  bool mipIsHalo;
275 
277 
278  mipChi2(0),
279  mipTotEnergy(0),
280  mipSlope(0),
281  mipIntercept(0),
282  mipNhitCone(0),
283  mipIsHalo(false)
284  {}
285 
286  } ;
287 
289  float mipChi2() const {return mipVariableBlock_.mipChi2;}
291  float mipSlope() const {return mipVariableBlock_.mipSlope;}
294  bool mipIsHalo() const {return mipVariableBlock_.mipIsHalo;}
295 
297  void setMIPVariables ( const MIPVariables& mipVar) {mipVariableBlock_= mipVar;}
298 
299 
300 
301  //=======================================================
302  // Isolation Variables
303  //=======================================================
304 
306  {
307  //These are analysis quantities calculated in the PhotonIDAlgo class
308 
309  //EcalRecHit isolation
311  //HcalTower isolation
313  //HcalDepth1Tower isolation
315  //HcalDepth2Tower isolation
317  //HcalTower isolation subtracting the hadronic energy in towers behind the BCs in the SC
319  //HcalDepth1Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
321  //HcalDepth2Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
323  //Sum of track pT in a cone of dR
325  //Sum of track pT in a hollow cone of outer radius, inner radius
327  //Number of tracks in a cone of dR
329  //Number of tracks in a hollow cone of outer radius, inner radius
331 
333 
334  ecalRecHitSumEt(0),
335  hcalTowerSumEt(0),
338  hcalTowerSumEtBc(0),
343  nTrkSolidCone(0),
344  nTrkHollowCone(0)
345 
346  {}
347 
348 
349  };
350 
351 
353  void setIsolationVariables ( const IsolationVariables& isolInDr04, const IsolationVariables& isolInDr03) { isolationR04_ = isolInDr04 ; isolationR03_ = isolInDr03 ;}
354 
370  // Track pT sum
372  //As above, excluding the core at the center of the cone
374  //Returns number of tracks in a cone of dR
376  //As above, excluding the core at the center of the cone
378  //
393  // Track pT sum c
395  //As above, excluding the core at the center of the cone
397  //Returns number of tracks in a cone of dR
399  //As above, excluding the core at the center of the cone
401 
402 
403  //=======================================================
404  // PFlow based Isolation Variables
405  //=======================================================
406 
408  {
409 
410  float chargedHadronIso; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
411  float chargedHadronIsoWrongVtx; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
412  float neutralHadronIso; // equivalent to sumNeutralHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
413  float photonIso ; // equivalent to sumPhotonPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
414  float modFrixione ;
418  float sumPUPt;
419 
421 
422  chargedHadronIso(0),
424  neutralHadronIso(0),
425  photonIso(0),
426  modFrixione(0),
430  sumPUPt(0)
431  {}
432 
433 
434  };
435 
440  float photonIso() const {return pfIsolation_.photonIso;}
444  float sumPUPt() const {return pfIsolation_.sumPUPt;}
445 
448 
451 
453  {
454 
457  float mva;
458 
460 
462  etOutsideMustache(-999999999.),
463  mva(-999999999.)
464 
465  {}
466  };
467 
468  // getters
470  float etOutsideMustache() const {return pfID_.etOutsideMustache;}
471  float pfMVA() const {return pfID_.mva;}
472  // setters
473  void setPflowIDVariables ( const PflowIDVariables& pfid ) { pfID_ = pfid;}
474 
475 
476  private:
478  virtual bool overlap( const Candidate & ) const;
483  //
485  //
495 
496 
497  };
498 
499 }
500 
501 #endif
MIPVariables mipVariableBlock_
Definition: Photon.h:492
type
Definition: HCALResponse.h:21
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:450
virtual Photon * clone() const
returns a clone of the candidate
float hcalDepth1TowerSumEtBcConeDR03() const
Hcal-Depth1 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:390
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:359
void setMIPVariables(const MIPVariables &mipVar)
set mip Variables
Definition: Photon.h:297
float trkSumPtSolidConeDR03() const
Definition: Photon.h:394
float hcalDepth1TowerSumEtConeDR04() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:361
ShowerShape full5x5_showerShapeBlock_
Definition: Photon.h:490
void setVertex(const Point &vertex)
set primary event vertex used to define photon direction
PflowIsolationVariables pfIsolation_
Definition: Photon.h:493
float hcalDepth1TowerSumEtConeDR03() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:384
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:151
bool isEE() const
Definition: Photon.h:122
bool isEEDeeGap() const
Definition: Photon.h:130
void setCandidateP4type(const P4type type)
Definition: Photon.h:255
const EnergyCorrections & energyCorrections() const
Definition: Photon.h:261
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
Definition: Photon.h:437
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: Photon.h:415
bool isEBGap() const
true if photon is in EB, and inside the boundaries in super crystals/modules
Definition: Photon.h:124
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
float neutralHadronIso() const
Definition: Photon.h:439
float e5x5() const
Definition: Photon.h:192
float full5x5_r2x5() const
Definition: Photon.h:209
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
Definition: Photon.h:382
virtual ~Photon()
destructor
float sumPUPt() const
Definition: Photon.h:444
float sumNeutralHadronEtHighThreshold() const
Definition: Photon.h:442
reco::ConversionRefVector conversionsOneLeg() const
vector of references to one leg Conversion&#39;s
Definition: Photon.h:69
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
Definition: Photon.h:416
virtual const Point & vertex() const
vertex position (overwritten by PF...)
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: Photon.h:417
float trkSumPtSolidConeDR04() const
Definition: Photon.h:371
math::XYZTLorentzVector LorentzVector
int nTrkSolidConeDR03() const
Definition: Photon.h:398
float full5x5_e2x5() const
Definition: Photon.h:202
float e1x5() const
Shower shape variables.
Definition: Photon.h:189
bool isEBEEGap() const
true if photon is in boundary between EB and EE
Definition: Photon.h:132
virtual void setP4(const LorentzVector &p4)
set 4-momentum
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:357
float full5x5_r1x5() const
Definition: Photon.h:208
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
float trkSumPtHollowConeDR03() const
Definition: Photon.h:396
float full5x5_maxEnergyXtal() const
Definition: Photon.h:205
float full5x5_sigmaEtaEta() const
Definition: Photon.h:206
bool isPhoton() const
Implement Candidate method for particle species.
Definition: Photon.h:84
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
Definition: Photon.h:418
IsolationVariables isolationR03_
Definition: Photon.h:488
int conversionTrackProvenance(const edm::RefToBase< reco::Track > &convTrack) const
ConversionProvenance
Definition: Photon.h:64
float photonIso() const
Definition: Photon.h:440
Photon()
default constructor
Definition: Photon.h:31
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
Definition: Photon.h:178
float mipIntercept() const
Definition: Photon.h:292
math::XYZPointF caloPosition_
position of seed BasicCluster for shower depth of unconverted photon
Definition: Photon.h:480
float full5x5_e1x5() const
full5x5 Shower shape variables
Definition: Photon.h:201
float full5x5_e3x3() const
Definition: Photon.h:203
float hadTowDepth1OverEm() const
the ration of hadronic energy in towers depth1 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:183
float full5x5_r9() const
Definition: Photon.h:210
virtual bool overlap(const Candidate &) const
check overlap with another candidate
LorentzVector regression2P4
Definition: Photon.h:229
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
Definition: Photon.h:49
bool mipIsHalo() const
Definition: Photon.h:294
IsolationVariables isolationR04_
Definition: Photon.h:487
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
Definition: Photon.h:50
float full5x5_sigmaIetaIeta() const
Definition: Photon.h:207
float hcalDepth2TowerSumEtBcConeDR04() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:369
reco::ConversionRefVector conversions() const
vector of references to Conversion&#39;s
Definition: Photon.h:63
float hcalTowerSumEtBcConeDR04() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:365
void setEnergyCorrections(const EnergyCorrections &e)
Definition: Photon.h:254
bool isStandardPhoton() const
Definition: Photon.h:57
bool isEBPhiGap() const
Definition: Photon.h:126
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:473
float sigmaIetaIeta() const
Definition: Photon.h:195
math::XYZPoint Point
EnergyCorrections eCorrections_
Definition: Photon.h:491
float hadTowDepth2OverEm() const
the ration of hadronic energy in towers depth2 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:185
void setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:170
float e2x5() const
Definition: Photon.h:190
float sigmaEtaEta() const
Definition: Photon.h:194
float sumChargedParticlePt() const
Definition: Photon.h:441
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
Definition: Photon.h:181
int nTrkHollowConeDR04() const
Definition: Photon.h:377
float hcalDepth2TowerSumEtConeDR03() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:386
int nTrkHollowConeDR03() const
Definition: Photon.h:400
bool isPFlowPhoton() const
Retrieve photonCore attributes.
Definition: Photon.h:56
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:174
float mipTotEnergy() const
Definition: Photon.h:290
math::XYZPointF caloPosition() const
position in ECAL: this is th SC position if r9&lt;0.93. If r8&gt;0.93 is position of seed BasicCluster taki...
Definition: Photon.h:80
float r1x5() const
Definition: Photon.h:196
float hcalTowerSumEtBcConeDR03() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:388
FiducialFlags fiducialFlagBlock_
Definition: Photon.h:486
float getCorrectedEnergyError(P4type type) const
P4type getCandidateP4type() const
Definition: Photon.h:259
float etOutsideMustache() const
Definition: Photon.h:470
float hadronicDepth1OverEm() const
the hadronic release in depth1 over electromagnetic fraction
Definition: Photon.h:176
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size &gt;0.
Definition: Photon.h:71
bool pixelSeed_
Definition: Photon.h:484
LorentzVector regression1P4
Definition: Photon.h:226
float hcalDepth2TowerSumEtConeDR04() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:363
bool isEEGap() const
true if photon is in EE, and inside the boundaries in supercrystal/D
Definition: Photon.h:128
float e3x3() const
Definition: Photon.h:191
float chargedHadronIsoWrongVtx() const
Definition: Photon.h:438
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
Definition: Photon.h:75
float hcalDepth1TowerSumEtBcConeDR04() const
Hcal-Depth1 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:367
void setFiducialVolumeFlags(const FiducialFlags &a)
set flags for photons in the ECAL fiducial volume
Definition: Photon.h:117
float sumPhotonEtHighThreshold() const
Definition: Photon.h:443
int nTrkSolidConeDR04() const
Definition: Photon.h:375
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
bool isEERingGap() const
Definition: Photon.h:129
PflowIDVariables pfID_
Definition: Photon.h:494
float getCorrectedEnergy(P4type type) const
bool isEB() const
Definition: Photon.h:120
float trkSumPtHollowConeDR04() const
Definition: Photon.h:373
float r2x5() const
Definition: Photon.h:197
void full5x5_setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:171
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:380
const ShowerShape & full5x5_showerShapeVariables() const
Definition: Photon.h:168
double a
Definition: hdecay.h:121
int nClusterOutsideMustache() const
Definition: Photon.h:469
float r9() const
Definition: Photon.h:198
reco::ElectronSeedRefVector electronPixelSeeds() const
reference to electron Pixel seed
Definition: Photon.h:73
float hcalDepth2TowerSumEtBcConeDR03() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:392
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: Photon.h:186
float mipSlope() const
Definition: Photon.h:291
int mipNhitCone() const
Definition: Photon.h:293
reco::SuperClusterRef parentSuperCluster() const
Ref to PFlow SuperCluster.
Definition: Photon.h:61
volatile std::atomic< bool > shutdown_flag false
float pfMVA() const
Definition: Photon.h:471
ShowerShape showerShapeBlock_
Definition: Photon.h:489
const PflowIsolationVariables & getPflowIsolationVariables() const
Get Particle Flow Isolation variables block.
Definition: Photon.h:447
float mipChi2() const
MIP variables.
Definition: Photon.h:289
const ShowerShape & showerShapeVariables() const
Definition: Photon.h:167
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
reco::PhotonCoreRef photonCore_
reference to the PhotonCore
Definition: Photon.h:482
float full5x5_e5x5() const
Definition: Photon.h:204
void setIsolationVariables(const IsolationVariables &isolInDr04, const IsolationVariables &isolInDr03)
set relevant isolation variables
Definition: Photon.h:353
void setP4(P4type type, const LorentzVector &p4, float p4Error, bool setToRecoCandidate)
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
bool isEBEtaGap() const
Definition: Photon.h:125
float maxEnergyXtal() const
Definition: Photon.h:193