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  } ;
174 
181  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShapeBlock_.hcalTowersBehindClusters ; }
182 
184  float e1x5() const {return showerShapeBlock_.e1x5;}
185  float e2x5() const {return showerShapeBlock_.e2x5;}
186  float e3x3() const {return showerShapeBlock_.e3x3;}
187  float e5x5() const {return showerShapeBlock_.e5x5;}
189  float sigmaEtaEta() const {return showerShapeBlock_.sigmaEtaEta;}
193  float r9 () const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}
194 
195  //=======================================================
196  // Energy Determinations
197  //=======================================================
199 
215  scEcalEnergy(0.),
216  scEcalEnergyError(999.),
217  scEcalP4(0., 0., 0., 0.),
218  phoEcalEnergy(0.),
219  phoEcalEnergyError(999.),
220  phoEcalP4(0., 0., 0., 0.),
221  regression1Energy(0.),
223  regression1P4(0.,0.,0.,0.),
224  regression2Energy(0.),
226  regression2P4(0.,0.,0.,0.),
228  {}
229  };
230 
231  using RecoCandidate::setP4 ;
232  using RecoCandidate::p4 ;
233 
234  //sets both energy and its uncertainty
235  void setCorrectedEnergy( P4type type, float E, float dE, bool toCand=true );
236  void setP4( P4type type, const LorentzVector & p4, float p4Error, bool setToRecoCandidate ) ;
239 
240  float getCorrectedEnergy( P4type type) const;
241  float getCorrectedEnergyError( P4type type) const ;
243  const LorentzVector& p4( P4type type ) const ;
244  const EnergyCorrections & energyCorrections() const { return eCorrections_ ; }
245 
246  //=======================================================
247  // MIP Variables
248  //=======================================================
249 
251  {
252  float mipChi2;
254  float mipSlope;
257  bool mipIsHalo;
258 
260 
261  mipChi2(0),
262  mipTotEnergy(0),
263  mipSlope(0),
264  mipIntercept(0),
265  mipNhitCone(0),
266  mipIsHalo(false)
267  {}
268 
269  } ;
270 
272  float mipChi2() const {return mipVariableBlock_.mipChi2;}
274  float mipSlope() const {return mipVariableBlock_.mipSlope;}
277  bool mipIsHalo() const {return mipVariableBlock_.mipIsHalo;}
278 
280  void setMIPVariables ( const MIPVariables& mipVar) {mipVariableBlock_= mipVar;}
281 
282 
283 
284  //=======================================================
285  // Isolation Variables
286  //=======================================================
287 
289  {
290  //These are analysis quantities calculated in the PhotonIDAlgo class
291 
292  //EcalRecHit isolation
294  //HcalTower isolation
296  //HcalDepth1Tower isolation
298  //HcalDepth2Tower isolation
300  //HcalTower isolation subtracting the hadronic energy in towers behind the BCs in the SC
302  //HcalDepth1Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
304  //HcalDepth2Tower isolation subtracting the hadronic energy in towers behind the BCs in the SC
306  //Sum of track pT in a cone of dR
308  //Sum of track pT in a hollow cone of outer radius, inner radius
310  //Number of tracks in a cone of dR
312  //Number of tracks in a hollow cone of outer radius, inner radius
314 
316 
317  ecalRecHitSumEt(0),
318  hcalTowerSumEt(0),
321  hcalTowerSumEtBc(0),
326  nTrkSolidCone(0),
327  nTrkHollowCone(0)
328 
329  {}
330 
331 
332  };
333 
334 
336  void setIsolationVariables ( const IsolationVariables& isolInDr04, const IsolationVariables& isolInDr03) { isolationR04_ = isolInDr04 ; isolationR03_ = isolInDr03 ;}
337 
353  // Track pT sum
355  //As above, excluding the core at the center of the cone
357  //Returns number of tracks in a cone of dR
359  //As above, excluding the core at the center of the cone
361  //
376  // Track pT sum c
378  //As above, excluding the core at the center of the cone
380  //Returns number of tracks in a cone of dR
382  //As above, excluding the core at the center of the cone
384 
385 
386  //=======================================================
387  // PFlow based Isolation Variables
388  //=======================================================
389 
391  {
392 
393  float chargedHadronIso; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
394  float chargedHadronIsoWrongVtx; // equivalent to sumChargedHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
395  float neutralHadronIso; // equivalent to sumNeutralHadronPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
396  float photonIso ; // equivalent to sumPhotonPt in DataFormats/MuonReco/interface/MuonPFIsolation.h
397  float modFrixione ;
401  float sumPUPt;
402 
404 
405  chargedHadronIso(0),
407  neutralHadronIso(0),
408  photonIso(0),
409  modFrixione(0),
413  sumPUPt(0)
414  {}
415 
416 
417  };
418 
423  float photonIso() const {return pfIsolation_.photonIso;}
427  float sumPUPt() const {return pfIsolation_.sumPUPt;}
428 
431 
433  {
434 
437  float mva;
438 
440 
442  etOutsideMustache(-999999999.),
443  mva(-999999999.)
444 
445  {}
446  };
447 
448  // getters
450  float etOutsideMustache() const {return pfID_.etOutsideMustache;}
451  float pfMVA() const {return pfID_.mva;}
452  // setters
453  void setPflowIDVariables ( const PflowIDVariables& pfid ) { pfID_ = pfid;}
454 
455 
456  private:
458  virtual bool overlap( const Candidate & ) const;
463  //
465  //
474 
475 
476  };
477 
478 }
479 
480 #endif
MIPVariables mipVariableBlock_
Definition: Photon.h:471
type
Definition: HCALResponse.h:21
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:430
float hcalDepth1TowerSumEtBcConeDR03() const
Hcal-Depth1 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:373
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:342
void setMIPVariables(const MIPVariables &mipVar)
set mip Variables
Definition: Photon.h:280
float trkSumPtSolidConeDR03() const
Definition: Photon.h:377
float hcalDepth1TowerSumEtConeDR04() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:344
PflowIsolationVariables pfIsolation_
Definition: Photon.h:472
float hcalDepth1TowerSumEtConeDR03() const
Hcal-Depth1 isolation sum.
Definition: Photon.h:367
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:238
const EnergyCorrections & energyCorrections() const
Definition: Photon.h:244
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
Definition: Photon.h:420
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: Photon.h:398
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:124
float neutralHadronIso() const
Definition: Photon.h:422
float e5x5() const
Definition: Photon.h:187
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
Definition: Photon.h:365
float sumPUPt() const
Definition: Photon.h:427
float sumNeutralHadronEtHighThreshold() const
Definition: Photon.h:425
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:399
virtual const Point & vertex() const
vertex position (overwritten by PF...)
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: Photon.h:400
virtual Photon * clone() const
returns a clone of the candidate
Definition: Photon.cc:36
float trkSumPtSolidConeDR04() const
Definition: Photon.h:354
int nTrkSolidConeDR03() const
Definition: Photon.h:381
float e1x5() const
Shower shape variables.
Definition: Photon.h:184
bool isEBEEGap() const
true if photon is in boundary between EB and EE
Definition: Photon.h:132
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:58
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:340
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:379
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:401
IsolationVariables isolationR03_
Definition: Photon.h:468
ConversionProvenance
Definition: Photon.h:64
float photonIso() const
Definition: Photon.h:423
Photon()
default constructor
Definition: Photon.h:31
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
Definition: Photon.h:173
float getCorrectedEnergy(P4type type) const
Definition: Photon.cc:123
float mipIntercept() const
Definition: Photon.h:275
math::XYZPointF caloPosition_
position of seed BasicCluster for shower depth of unconverted photon
Definition: Photon.h:460
float hadTowDepth1OverEm() const
the ration of hadronic energy in towers depth1 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:178
LorentzVector regression2P4
Definition: Photon.h:212
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
Definition: Photon.h:49
bool mipIsHalo() const
Definition: Photon.h:277
IsolationVariables isolationR04_
Definition: Photon.h:467
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
Definition: Photon.h:50
const T & max(const T &a, const T &b)
float hcalDepth2TowerSumEtBcConeDR04() const
Hcal-Depth2 isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:352
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:348
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition: Photon.cc:41
void setEnergyCorrections(const EnergyCorrections &e)
Definition: Photon.h:237
bool isStandardPhoton() const
Definition: Photon.h:57
bool isEBPhiGap() const
Definition: Photon.h:126
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:453
float sigmaIetaIeta() const
Definition: Photon.h:190
math::XYZPoint Point
EnergyCorrections eCorrections_
Definition: Photon.h:470
float hadTowDepth2OverEm() const
the ration of hadronic energy in towers depth2 behind the BCs in the SC and the SC energy ...
Definition: Photon.h:180
void setShowerShapeVariables(const ShowerShape &a)
Definition: Photon.h:167
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
Definition: Photon.cc:92
float e2x5() const
Definition: Photon.h:185
float sigmaEtaEta() const
Definition: Photon.h:189
float sumChargedParticlePt() const
Definition: Photon.h:424
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
Definition: Photon.h:176
int nTrkHollowConeDR04() const
Definition: Photon.h:360
float hcalDepth2TowerSumEtConeDR03() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:369
int nTrkHollowConeDR03() const
Definition: Photon.h:383
bool isPFlowPhoton() const
Retrieve photonCore attributes.
Definition: Photon.h:56
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:169
float getCorrectedEnergyError(P4type type) const
Definition: Photon.cc:143
float mipTotEnergy() const
Definition: Photon.h:273
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:191
float hcalTowerSumEtBcConeDR03() const
Hcal isolation sum subtracting the hadronic energy in towers behind the BCs in the SC...
Definition: Photon.h:371
FiducialFlags fiducialFlagBlock_
Definition: Photon.h:466
P4type getCandidateP4type() const
Definition: Photon.h:242
float etOutsideMustache() const
Definition: Photon.h:450
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:171
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:464
LorentzVector regression1P4
Definition: Photon.h:209
float hcalDepth2TowerSumEtConeDR04() const
Hcal-Depth2 isolation sum.
Definition: Photon.h:346
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:186
float chargedHadronIsoWrongVtx() const
Definition: Photon.h:421
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:350
void setFiducialVolumeFlags(const FiducialFlags &a)
set flags for photons in the ECAL fiducial volume
Definition: Photon.h:117
float sumPhotonEtHighThreshold() const
Definition: Photon.h:426
int nTrkSolidConeDR04() const
Definition: Photon.h:358
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
bool isEERingGap() const
Definition: Photon.h:129
PflowIDVariables pfID_
Definition: Photon.h:473
bool isEB() const
Definition: Photon.h:120
float trkSumPtHollowConeDR04() const
Definition: Photon.h:356
float r2x5() const
Definition: Photon.h:192
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
Definition: analysisEnums.h:9
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:363
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
double a
Definition: hdecay.h:121
int nClusterOutsideMustache() const
Definition: Photon.h:449
float r9() const
Definition: Photon.h:193
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:375
virtual ~Photon()
destructor
Definition: Photon.cc:34
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: Photon.h:181
float mipSlope() const
Definition: Photon.h:274
int mipNhitCone() const
Definition: Photon.h:276
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:451
ShowerShape showerShapeBlock_
Definition: Photon.h:469
float mipChi2() const
MIP variables.
Definition: Photon.h:272
reco::PhotonCoreRef photonCore_
reference to the PhotonCore
Definition: Photon.h:462
void setIsolationVariables(const IsolationVariables &isolInDr04, const IsolationVariables &isolInDr03)
set relevant isolation variables
Definition: Photon.h:336
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:32
int conversionTrackProvenance(const edm::RefToBase< reco::Track > &convTrack) const
Definition: Photon.cc:62
bool isEBEtaGap() const
Definition: Photon.h:125
float maxEnergyXtal() const
Definition: Photon.h:188