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 
50  //
52  //
53  // retrieve provenance
54  bool isPFlowPhoton() const {return this->photonCore()->isPFlowPhoton();}
55  bool isStandardPhoton() const {return this->photonCore()->isStandardPhoton();}
59  reco::SuperClusterRef parentSuperCluster() const {return this->photonCore()->parentSuperCluster();}
61  reco::ConversionRefVector conversions() const {return this->photonCore()->conversions() ;}
63  pflow=1,
64  both=2};
65 
67  reco::ConversionRefVector conversionsOneLeg() const {return this->photonCore()->conversionsOneLeg() ;}
69  bool hasConversionTracks() const { if (this->photonCore()->conversions().size() > 0 || this->photonCore()->conversionsOneLeg().size() > 0) return true; else return false;}
71  reco::ElectronSeedRefVector electronPixelSeeds() const {return this->photonCore()->electronPixelSeeds();}
73  bool hasPixelSeed() const { if ((this->photonCore()->electronPixelSeeds()).size() > 0 ) return true; else return false; }
74  int conversionTrackProvenance(const edm::RefToBase<reco::Track>& convTrack) const;
75 
76 
80  void setVertex(const Point & vertex);
82  bool isPhoton() const { return true ; }
83 
84 
85  //=======================================================
86  // Fiducial Flags
87  //=======================================================
89  {
90 
91  //Fiducial flags
92  bool isEB;//Photon is in EB
93  bool isEE;//Photon is in EE
94  bool isEBEtaGap;//Photon is in supermodule/supercrystal eta gap in EB
95  bool isEBPhiGap;//Photon is in supermodule/supercrystal phi gap in EB
96  bool isEERingGap;//Photon is in crystal ring gap in EE
97  bool isEEDeeGap;//Photon is in crystal dee gap in EE
98  bool isEBEEGap;//Photon is in border between EB and EE.
99 
101  isEB(false),
102  isEE(false),
103  isEBEtaGap(false),
104  isEBPhiGap(false),
106  isEEDeeGap(false),
108 
109  {}
110 
111 
112  };
113 
118  bool isEB() const{return fiducialFlagBlock_.isEB;}
119  // true if photon is in ECAL endcap
120  bool isEE() const{return fiducialFlagBlock_.isEE;}
122  bool isEBGap() const { return (isEBEtaGap() || isEBPhiGap()); }
126  bool isEEGap() const { return (isEERingGap() || isEEDeeGap()); }
130  bool isEBEEGap() const{return fiducialFlagBlock_.isEBEEGap;}
131 
132  //=======================================================
133  // Shower Shape Variables
134  //=======================================================
135 
136  struct ShowerShape
137  {
138  float sigmaEtaEta ;
140  float e1x5 ;
141  float e2x5 ;
142  float e3x3 ;
143  float e5x5 ;
144  float maxEnergyXtal ;
145  float hcalDepth1OverEcal ; // hcal over ecal energy using first hcal depth
146  float hcalDepth2OverEcal ; // hcal over ecal energy using 2nd hcal depth
149  std::vector<CaloTowerDetId> hcalTowersBehindClusters;
151  : sigmaEtaEta(std::numeric_limits<float>::infinity()),
152  sigmaIetaIeta(std::numeric_limits<float>::infinity()),
153  e1x5(0),
154  e2x5(0),
155  e3x3(0),
156  e5x5(0),
157  maxEnergyXtal(0),
162 
163  {}
164  } ;
172 
179  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShapeBlock_.hcalTowersBehindClusters ; }
180 
182  float e1x5() const {return showerShapeBlock_.e1x5;}
183  float e2x5() const {return showerShapeBlock_.e2x5;}
184  float e3x3() const {return showerShapeBlock_.e3x3;}
185  float e5x5() const {return showerShapeBlock_.e5x5;}
187  float sigmaEtaEta() const {return showerShapeBlock_.sigmaEtaEta;}
191  float r9 () const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
192 
193  //=======================================================
194  // Energy Determinations
195  //=======================================================
197 
213  scEcalEnergy(0.),
214  scEcalEnergyError(999.),
215  scEcalP4(0., 0., 0., 0.),
216  phoEcalEnergy(0.),
217  phoEcalEnergyError(999.),
218  phoEcalP4(0., 0., 0., 0.),
219  regression1Energy(0.),
221  regression1P4(0.,0.,0.,0.),
222  regression2Energy(0.),
224  regression2P4(0.,0.,0.,0.),
226  {}
227  };
228 
229  using RecoCandidate::setP4 ;
230  using RecoCandidate::p4 ;
231 
232  //sets both energy and its uncertainty
233  void setCorrectedEnergy( P4type type, float E, float dE, bool toCand=true );
234  void setP4( P4type type, const LorentzVector & p4, float p4Error, bool setToRecoCandidate ) ;
237 
238  float getCorrectedEnergy( P4type type) const;
239  float getCorrectedEnergyError( P4type type) const ;
241  const LorentzVector& p4( P4type type ) const ;
242  const EnergyCorrections & energyCorrections() const { return eCorrections_ ; }
243 
244  //=======================================================
245  // MIP Variables
246  //=======================================================
247 
249  {
250  float mipChi2;
252  float mipSlope;
255  bool mipIsHalo;
256 
258 
259  mipChi2(0),
260  mipTotEnergy(0),
261  mipSlope(0),
262  mipIntercept(0),
263  mipNhitCone(0),
264  mipIsHalo(false)
265  {}
266 
267  } ;
268 
270  float mipChi2() const {return mipVariableBlock_.mipChi2;}
272  float mipSlope() const {return mipVariableBlock_.mipSlope;}
275  bool mipIsHalo() const {return mipVariableBlock_.mipIsHalo;}
276 
278  void setMIPVariables ( const MIPVariables& mipVar) {mipVariableBlock_= mipVar;}
279 
280 
281 
282  //=======================================================
283  // Isolation Variables
284  //=======================================================
285 
287  {
288  //These are analysis quantities calculated in the PhotonIDAlgo class
289 
290  //EcalRecHit isolation
292  //HcalTower isolation
294  //HcalDepth1Tower isolation
296  //HcalDepth2Tower isolation
298  //HcalTower isolation subtracting the hadronic energy in towers behind the BCs in the SC
300  //HcalDepth1Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
302  //HcalDepth2Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
304  //Sum of track pT in a cone of dR
306  //Sum of track pT in a hollow cone of outer radius, inner radius
308  //Number of tracks in a cone of dR
310  //Number of tracks in a hollow cone of outer radius, inner radius
312 
314 
315  ecalRecHitSumEt(0),
316  hcalTowerSumEt(0),
319  hcalTowerSumEtBc(0),
324  nTrkSolidCone(0),
325  nTrkHollowCone(0)
326 
327  {}
328 
329 
330  };
331 
332 
334  void setIsolationVariables ( const IsolationVariables& isolInDr04, const IsolationVariables& isolInDr03) { isolationR04_ = isolInDr04 ; isolationR03_ = isolInDr03 ;}
335 
351  // Track pT sum
353  //As above, excluding the core at the center of the cone
355  //Returns number of tracks in a cone of dR
357  //As above, excluding the core at the center of the cone
359  //
374  // Track pT sum c
376  //As above, excluding the core at the center of the cone
378  //Returns number of tracks in a cone of dR
380  //As above, excluding the core at the center of the cone
382 
383 
384  //=======================================================
385  // PFlow based Isolation Variables
386  //=======================================================
387 
389  {
390 
391  float chargedHadronIso; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
392  float chargedHadronIsoWrongVtx; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
393  float neutralHadronIso; // equivalent to sumNeutralHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
394  float photonIso ; // equivalent to sumPhotonPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
395  float modFrixione ;
399  float sumPUPt;
400 
402 
403  chargedHadronIso(0),
405  neutralHadronIso(0),
406  photonIso(0),
407  modFrixione(0),
411  sumPUPt(0)
412  {}
413 
414 
415  };
416 
421  float photonIso() const {return pfIsolation_.photonIso;}
425  float sumPUPt() const {return pfIsolation_.sumPUPt;}
426 
429 
431  {
432 
435  float mva;
436 
438 
440  etOutsideMustache(-999999999.),
441  mva(-999999999.)
442 
443  {}
444  };
445 
446  // getters
448  float etOutsideMustache() const {return pfID_.etOutsideMustache;}
449  float pfMVA() const {return pfID_.mva;}
450  // setters
451  void setPflowIDVariables ( const PflowIDVariables& pfid ) { pfID_ = pfid;}
452 
453 
454  private:
456  virtual bool overlap( const Candidate & ) const;
461  //
463  //
472 
473 
474  };
475 
476 }
477 
478 #endif
MIPVariables mipVariableBlock_
Definition: Photon.h:469
type
Definition: HCALResponse.h:21
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:428
float hcalDepth1TowerSumEtBcConeDR03() const
Hcal-Depth1 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:371
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:340
void setMIPVariables(const MIPVariables &mipVar)
set mip Variables
Definition: Photon.h:278
float trkSumPtSolidConeDR03() const
Definition: Photon.h:375
float hcalDepth1TowerSumEtConeDR04() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:342
PflowIsolationVariables pfIsolation_
Definition: Photon.h:470
float hcalDepth1TowerSumEtConeDR03() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:365
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:149
bool isEE() const
Definition: Photon.h:120
bool isEEDeeGap() const
Definition: Photon.h:128
void setCandidateP4type(const P4type type)
Definition: Photon.h:236
const EnergyCorrections & energyCorrections() const
Definition: Photon.h:242
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
Definition: Photon.h:418
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: Photon.h:396
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
bool isEBGap() const
true if photon is in EB, and inside the boundaries in super crystals/modules
Definition: Photon.h:122
float neutralHadronIso() const
Definition: Photon.h:420
float e5x5() const
Definition: Photon.h:185
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
Definition: Photon.h:363
float sumPUPt() const
Definition: Photon.h:425
float sumNeutralHadronEtHighThreshold() const
Definition: Photon.h:423
reco::ConversionRefVector conversionsOneLeg() const
vector of references to one leg Conversion&#39;s
Definition: Photon.h:67
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
Definition: Photon.h:397
virtual const Point & vertex() const
vertex position (overwritten by PF...)
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: Photon.h:398
virtual Photon * clone() const
returns a clone of the candidate
Definition: Photon.cc:36
float trkSumPtSolidConeDR04() const
Definition: Photon.h:352
math::XYZTLorentzVector LorentzVector
int nTrkSolidConeDR03() const
Definition: Photon.h:379
float e1x5() const
Shower shape variables.
Definition: Photon.h:182
bool isEBEEGap() const
true if photon is in boundary between EB and EE
Definition: Photon.h:130
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:58
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:338
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:377
bool isPhoton() const
Implement Candidate method for particle species.
Definition: Photon.h:82
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
Definition: Photon.h:399
IsolationVariables isolationR03_
Definition: Photon.h:466
ConversionProvenance
Definition: Photon.h:62
float photonIso() const
Definition: Photon.h:421
Photon()
default constructor
Definition: Photon.h:31
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
Definition: Photon.h:171
float getCorrectedEnergy(P4type type) const
Definition: Photon.cc:123
float mipIntercept() const
Definition: Photon.h:273
math::XYZPointF caloPosition_
position of seed BasicCluster for shower depth of unconverted photon
Definition: Photon.h:458
float hadTowDepth1OverEm() const
the ration of hadronic energy in towers depth1 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:176
LorentzVector regression2P4
Definition: Photon.h:210
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
Definition: Photon.h:49
bool mipIsHalo() const
Definition: Photon.h:275
IsolationVariables isolationR04_
Definition: Photon.h:465
float hcalDepth2TowerSumEtBcConeDR04() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:350
reco::ConversionRefVector conversions() const
vector of references to Conversion&#39;s
Definition: Photon.h:61
float hcalTowerSumEtBcConeDR04() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:346
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition: Photon.cc:41
void setEnergyCorrections(const EnergyCorrections &e)
Definition: Photon.h:235
bool isStandardPhoton() const
Definition: Photon.h:55
bool isEBPhiGap() const
Definition: Photon.h:124
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:451
float sigmaIetaIeta() const
Definition: Photon.h:188
math::XYZPoint Point
EnergyCorrections eCorrections_
Definition: Photon.h:468
const double infinity
float hadTowDepth2OverEm() const
the ration of hadronic energy in towers depth2 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:178
void setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:165
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
Definition: Photon.cc:92
float e2x5() const
Definition: Photon.h:183
float sigmaEtaEta() const
Definition: Photon.h:187
float sumChargedParticlePt() const
Definition: Photon.h:422
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
Definition: Photon.h:174
int nTrkHollowConeDR04() const
Definition: Photon.h:358
float hcalDepth2TowerSumEtConeDR03() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:367
int nTrkHollowConeDR03() const
Definition: Photon.h:381
bool isPFlowPhoton() const
Retrieve photonCore attributes.
Definition: Photon.h:54
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:167
float getCorrectedEnergyError(P4type type) const
Definition: Photon.cc:143
float mipTotEnergy() const
Definition: Photon.h:271
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:78
float r1x5() const
Definition: Photon.h:189
float hcalTowerSumEtBcConeDR03() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:369
FiducialFlags fiducialFlagBlock_
Definition: Photon.h:464
P4type getCandidateP4type() const
Definition: Photon.h:240
float etOutsideMustache() const
Definition: Photon.h:448
void setP4(P4type type, const LorentzVector &p4, float p4Error, bool setToRecoCandidate)
Definition: Photon.cc:164
float hadronicDepth1OverEm() const
the hadronic release in depth1 over electromagnetic fraction
Definition: Photon.h:169
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size &gt;0.
Definition: Photon.h:69
bool pixelSeed_
Definition: Photon.h:462
LorentzVector regression1P4
Definition: Photon.h:207
float hcalDepth2TowerSumEtConeDR04() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:344
bool isEEGap() const
true if photon is in EE, and inside the boundaries in supercrystal/D
Definition: Photon.h:126
float e3x3() const
Definition: Photon.h:184
float chargedHadronIsoWrongVtx() const
Definition: Photon.h:419
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
Definition: Photon.h:73
float hcalDepth1TowerSumEtBcConeDR04() const
Hcal-Depth1 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:348
void setFiducialVolumeFlags(const FiducialFlags &a)
set flags for photons in the ECAL fiducial volume
Definition: Photon.h:115
float sumPhotonEtHighThreshold() const
Definition: Photon.h:424
int nTrkSolidConeDR04() const
Definition: Photon.h:356
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
bool isEERingGap() const
Definition: Photon.h:127
PflowIDVariables pfID_
Definition: Photon.h:471
bool isEB() const
Definition: Photon.h:118
float trkSumPtHollowConeDR04() const
Definition: Photon.h:354
float r2x5() const
Definition: Photon.h:190
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:361
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
double a
Definition: hdecay.h:121
int nClusterOutsideMustache() const
Definition: Photon.h:447
float r9() const
Definition: Photon.h:191
reco::ElectronSeedRefVector electronPixelSeeds() const
reference to electron Pixel seed
Definition: Photon.h:71
float hcalDepth2TowerSumEtBcConeDR03() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:373
virtual ~Photon()
destructor
Definition: Photon.cc:34
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: Photon.h:179
float mipSlope() const
Definition: Photon.h:272
int mipNhitCone() const
Definition: Photon.h:274
reco::SuperClusterRef parentSuperCluster() const
Ref to PFlow SuperCluster.
Definition: Photon.h:59
volatile std::atomic< bool > shutdown_flag false
float pfMVA() const
Definition: Photon.h:449
ShowerShape showerShapeBlock_
Definition: Photon.h:467
float mipChi2() const
MIP variables.
Definition: Photon.h:270
reco::PhotonCoreRef photonCore_
reference to the PhotonCore
Definition: Photon.h:460
void setIsolationVariables(const IsolationVariables &isolInDr04, const IsolationVariables &isolInDr03)
set relevant isolation variables
Definition: Photon.h:334
void setVertex(const Point &vertex)
set primary event vertex used to define photon direction
Definition: Photon.cc:49
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:30
int conversionTrackProvenance(const edm::RefToBase< reco::Track > &convTrack) const
Definition: Photon.cc:62
bool isEBEtaGap() const
Definition: Photon.h:123
float maxEnergyXtal() const
Definition: Photon.h:186