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;
152  float effSigmaRR;
155  float e2nd;
156  float eTop;
157  float eLeft;
158  float eRight;
159  float eBottom;
160  float e1x3;
161  float e2x2;
162  float e2x5Max;
163  float e2x5Left;
164  float e2x5Right;
165  float e2x5Top;
166  float e2x5Bottom;
168  : sigmaEtaEta(std::numeric_limits<float>::max()),
169  sigmaIetaIeta(std::numeric_limits<float>::max()),
170  e1x5(0.f),
171  e2x5(0.f),
172  e3x3(0.f),
173  e5x5(0.f),
174  maxEnergyXtal(0.f),
179  effSigmaRR(std::numeric_limits<float>::max()),
180  sigmaIetaIphi(std::numeric_limits<float>::max()),
181  sigmaIphiIphi(std::numeric_limits<float>::max()),
182  e2nd(0.f),
183  eTop(0.f),
184  eLeft(0.f),
185  eRight(0.f),
186  eBottom(0.f),
187  e1x3(0.f),
188  e2x2(0.f),
189  e2x5Max(0.f),
190  e2x5Left(0.f),
191  e2x5Right(0.f),
192  e2x5Top(0.f),
193  e2x5Bottom(0.f)
194  {}
195  } ;
198 
201 
208 
215  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShapeBlock_.hcalTowersBehindClusters ; }
216 
218  float e1x5() const {return showerShapeBlock_.e1x5;}
219  float e2x5() const {return showerShapeBlock_.e2x5;}
220  float e3x3() const {return showerShapeBlock_.e3x3;}
221  float e5x5() const {return showerShapeBlock_.e5x5;}
223  float sigmaEtaEta() const {return showerShapeBlock_.sigmaEtaEta;}
227  float r9 () const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
228 
239  float full5x5_r9 () const {return full5x5_showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
240 
241  //=======================================================
242  // Energy Determinations
243  //=======================================================
245 
261  scEcalEnergy(0.),
262  scEcalEnergyError(999.),
263  scEcalP4(0., 0., 0., 0.),
264  phoEcalEnergy(0.),
265  phoEcalEnergyError(999.),
266  phoEcalP4(0., 0., 0., 0.),
267  regression1Energy(0.),
269  regression1P4(0.,0.,0.,0.),
270  regression2Energy(0.),
272  regression2P4(0.,0.,0.,0.),
274  {}
275  };
276 
277  using RecoCandidate::setP4 ;
278  using RecoCandidate::p4 ;
279 
280  //sets both energy and its uncertainty
281  void setCorrectedEnergy( P4type type, float E, float dE, bool toCand=true );
282  void setP4( P4type type, const LorentzVector & p4, float p4Error, bool setToRecoCandidate ) ;
285 
286  float getCorrectedEnergy( P4type type) const;
287  float getCorrectedEnergyError( P4type type) const ;
289  const LorentzVector& p4( P4type type ) const ;
290  const EnergyCorrections & energyCorrections() const { return eCorrections_ ; }
291 
292  //=======================================================
293  // MIP Variables
294  //=======================================================
295 
297  {
298  float mipChi2;
300  float mipSlope;
303  bool mipIsHalo;
304 
306 
307  mipChi2(0),
308  mipTotEnergy(0),
309  mipSlope(0),
310  mipIntercept(0),
311  mipNhitCone(0),
312  mipIsHalo(false)
313  {}
314 
315  } ;
316 
318  float mipChi2() const {return mipVariableBlock_.mipChi2;}
320  float mipSlope() const {return mipVariableBlock_.mipSlope;}
323  bool mipIsHalo() const {return mipVariableBlock_.mipIsHalo;}
324 
326  void setMIPVariables ( const MIPVariables& mipVar) {mipVariableBlock_= mipVar;}
327 
328 
329 
330  //=======================================================
331  // Isolation Variables
332  //=======================================================
333 
335  {
336  //These are analysis quantities calculated in the PhotonIDAlgo class
337 
338  //EcalRecHit isolation
340  //HcalTower isolation
342  //HcalDepth1Tower isolation
344  //HcalDepth2Tower isolation
346  //HcalTower isolation subtracting the hadronic energy in towers behind the BCs in the SC
348  //HcalDepth1Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
350  //HcalDepth2Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
352  //Sum of track pT in a cone of dR
354  //Sum of track pT in a hollow cone of outer radius, inner radius
356  //Number of tracks in a cone of dR
358  //Number of tracks in a hollow cone of outer radius, inner radius
360 
362 
363  ecalRecHitSumEt(0),
364  hcalTowerSumEt(0),
367  hcalTowerSumEtBc(0),
372  nTrkSolidCone(0),
373  nTrkHollowCone(0)
374 
375  {}
376 
377 
378  };
379 
380 
382  void setIsolationVariables ( const IsolationVariables& isolInDr04, const IsolationVariables& isolInDr03) { isolationR04_ = isolInDr04 ; isolationR03_ = isolInDr03 ;}
383 
399  // Track pT sum
401  //As above, excluding the core at the center of the cone
403  //Returns number of tracks in a cone of dR
405  //As above, excluding the core at the center of the cone
407  //
422  // Track pT sum c
424  //As above, excluding the core at the center of the cone
426  //Returns number of tracks in a cone of dR
428  //As above, excluding the core at the center of the cone
430 
431 
432  //=======================================================
433  // PFlow based Isolation Variables
434  //=======================================================
435 
437  {
438 
439  float chargedHadronIso; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
440  float chargedHadronIsoWrongVtx; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
441  float neutralHadronIso; // equivalent to sumNeutralHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
442  float photonIso ; // equivalent to sumPhotonPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
443  float modFrixione ;
447  float sumPUPt;
448 
450 
451  chargedHadronIso(0),
453  neutralHadronIso(0),
454  photonIso(0),
455  modFrixione(0),
459  sumPUPt(0)
460  {}
461 
462 
463  };
464 
469  float photonIso() const {return pfIsolation_.photonIso;}
473  float sumPUPt() const {return pfIsolation_.sumPUPt;}
474 
477 
480 
482  {
483 
486  float mva;
487 
489 
491  etOutsideMustache(-999999999.),
492  mva(-999999999.)
493 
494  {}
495  };
496 
497  // getters
499  float etOutsideMustache() const {return pfID_.etOutsideMustache;}
500  float pfMVA() const {return pfID_.mva;}
501  // setters
502  void setPflowIDVariables ( const PflowIDVariables& pfid ) { pfID_ = pfid;}
503 
504  private:
506  virtual bool overlap( const Candidate & ) const;
511  //
513  //
523  };
524 
525 }
526 
527 #endif
MIPVariables mipVariableBlock_
Definition: Photon.h:520
type
Definition: HCALResponse.h:21
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:479
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:419
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:388
void setMIPVariables(const MIPVariables &mipVar)
set mip Variables
Definition: Photon.h:326
float trkSumPtSolidConeDR03() const
Definition: Photon.h:423
float hcalDepth1TowerSumEtConeDR04() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:390
ShowerShape full5x5_showerShapeBlock_
Definition: Photon.h:518
void setVertex(const Point &vertex)
set primary event vertex used to define photon direction
PflowIsolationVariables pfIsolation_
Definition: Photon.h:521
float hcalDepth1TowerSumEtConeDR03() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:413
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:284
const EnergyCorrections & energyCorrections() const
Definition: Photon.h:290
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
Definition: Photon.h:466
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: Photon.h:444
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:468
float e5x5() const
Definition: Photon.h:221
float full5x5_r2x5() const
Definition: Photon.h:238
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
Definition: Photon.h:411
virtual ~Photon()
destructor
float sumPUPt() const
Definition: Photon.h:473
float sumNeutralHadronEtHighThreshold() const
Definition: Photon.h:471
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:445
virtual const Point & vertex() const
vertex position (overwritten by PF...)
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: Photon.h:446
float trkSumPtSolidConeDR04() const
Definition: Photon.h:400
math::XYZTLorentzVector LorentzVector
int nTrkSolidConeDR03() const
Definition: Photon.h:427
float full5x5_e2x5() const
Definition: Photon.h:231
float e1x5() const
Shower shape variables.
Definition: Photon.h:218
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:386
float full5x5_r1x5() const
Definition: Photon.h:237
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:425
float full5x5_maxEnergyXtal() const
Definition: Photon.h:234
float full5x5_sigmaEtaEta() const
Definition: Photon.h:235
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:447
IsolationVariables isolationR03_
Definition: Photon.h:516
int conversionTrackProvenance(const edm::RefToBase< reco::Track > &convTrack) const
ConversionProvenance
Definition: Photon.h:64
float photonIso() const
Definition: Photon.h:469
Photon()
default constructor
Definition: Photon.h:31
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
Definition: Photon.h:207
float mipIntercept() const
Definition: Photon.h:321
math::XYZPointF caloPosition_
position of seed BasicCluster for shower depth of unconverted photon
Definition: Photon.h:508
float full5x5_e1x5() const
full5x5 Shower shape variables
Definition: Photon.h:230
float full5x5_e3x3() const
Definition: Photon.h:232
float hadTowDepth1OverEm() const
the ration of hadronic energy in towers depth1 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:212
float full5x5_r9() const
Definition: Photon.h:239
virtual bool overlap(const Candidate &) const
check overlap with another candidate
LorentzVector regression2P4
Definition: Photon.h:258
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
Definition: Photon.h:49
bool mipIsHalo() const
Definition: Photon.h:323
IsolationVariables isolationR04_
Definition: Photon.h:515
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
Definition: Photon.h:50
float full5x5_sigmaIetaIeta() const
Definition: Photon.h:236
float hcalDepth2TowerSumEtBcConeDR04() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:398
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:394
void setEnergyCorrections(const EnergyCorrections &e)
Definition: Photon.h:283
bool isStandardPhoton() const
Definition: Photon.h:57
bool isEBPhiGap() const
Definition: Photon.h:126
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:502
float sigmaIetaIeta() const
Definition: Photon.h:224
math::XYZPoint Point
EnergyCorrections eCorrections_
Definition: Photon.h:519
float hadTowDepth2OverEm() const
the ration of hadronic energy in towers depth2 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:214
void setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:199
float e2x5() const
Definition: Photon.h:219
double f[11][100]
float sigmaEtaEta() const
Definition: Photon.h:223
float sumChargedParticlePt() const
Definition: Photon.h:470
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
Definition: Photon.h:210
int nTrkHollowConeDR04() const
Definition: Photon.h:406
float hcalDepth2TowerSumEtConeDR03() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:415
int nTrkHollowConeDR03() const
Definition: Photon.h:429
bool isPFlowPhoton() const
Retrieve photonCore attributes.
Definition: Photon.h:56
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:203
float mipTotEnergy() const
Definition: Photon.h:319
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:225
float hcalTowerSumEtBcConeDR03() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:417
FiducialFlags fiducialFlagBlock_
Definition: Photon.h:514
float getCorrectedEnergyError(P4type type) const
P4type getCandidateP4type() const
Definition: Photon.h:288
float etOutsideMustache() const
Definition: Photon.h:499
float hadronicDepth1OverEm() const
the hadronic release in depth1 over electromagnetic fraction
Definition: Photon.h:205
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:512
LorentzVector regression1P4
Definition: Photon.h:255
float hcalDepth2TowerSumEtConeDR04() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:392
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:220
float chargedHadronIsoWrongVtx() const
Definition: Photon.h:467
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:396
void setFiducialVolumeFlags(const FiducialFlags &a)
set flags for photons in the ECAL fiducial volume
Definition: Photon.h:117
float sumPhotonEtHighThreshold() const
Definition: Photon.h:472
int nTrkSolidConeDR04() const
Definition: Photon.h:404
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
bool isEERingGap() const
Definition: Photon.h:129
PflowIDVariables pfID_
Definition: Photon.h:522
float getCorrectedEnergy(P4type type) const
bool isEB() const
Definition: Photon.h:120
float trkSumPtHollowConeDR04() const
Definition: Photon.h:402
float r2x5() const
Definition: Photon.h:226
void full5x5_setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:200
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
const ShowerShape & full5x5_showerShapeVariables() const
Definition: Photon.h:197
double a
Definition: hdecay.h:121
int nClusterOutsideMustache() const
Definition: Photon.h:498
float r9() const
Definition: Photon.h:227
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:421
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: Photon.h:215
float mipSlope() const
Definition: Photon.h:320
int mipNhitCone() const
Definition: Photon.h:322
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:500
ShowerShape showerShapeBlock_
Definition: Photon.h:517
const PflowIsolationVariables & getPflowIsolationVariables() const
Get Particle Flow Isolation variables block.
Definition: Photon.h:476
float mipChi2() const
MIP variables.
Definition: Photon.h:318
const ShowerShape & showerShapeVariables() const
Definition: Photon.h:196
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
reco::PhotonCoreRef photonCore_
reference to the PhotonCore
Definition: Photon.h:510
float full5x5_e5x5() const
Definition: Photon.h:233
void setIsolationVariables(const IsolationVariables &isolInDr04, const IsolationVariables &isolInDr03)
set relevant isolation variables
Definition: Photon.h:382
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:222