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 
19 
20 
21 namespace reco {
22 
23  class Photon : public RecoCandidate {
24  public:
26  struct FiducialFlags;
27  struct IsolationVariables;
28  struct ShowerShape;
29  struct MIPVariables;
30 
32  Photon() : RecoCandidate() { pixelSeed_=false; }
33 
35  Photon ( const Photon&);
36 
38  Photon( const LorentzVector & p4,
39  Point caloPos,
40  const PhotonCoreRef & core,
41  const Point & vtx = Point( 0, 0, 0 ) );
42 
44  virtual ~Photon();
45 
47  virtual Photon * clone() const;
48 
51  //
53  //
54  // retrieve provenance
55  bool isPFlowPhoton() const {return this->photonCore()->isPFlowPhoton();}
56  bool isStandardPhoton() const {return this->photonCore()->isStandardPhoton();}
60  reco::SuperClusterRef pfSuperCluster() const {return this->photonCore()->pfSuperCluster();}
62  reco::ConversionRefVector conversions() const {return this->photonCore()->conversions() ;}
64  pflow=1,
65  both=2};
66 
68  reco::ConversionRefVector conversionsOneLeg() const {return this->photonCore()->conversionsOneLeg() ;}
70  bool hasConversionTracks() const { if (this->photonCore()->conversions().size() > 0 || this->photonCore()->conversionsOneLeg().size() > 0) return true; else return false;}
72  reco::ElectronSeedRefVector electronPixelSeeds() const {return this->photonCore()->electronPixelSeeds();}
74  bool hasPixelSeed() const { if ((this->photonCore()->electronPixelSeeds()).size() > 0 ) return true; else return false; }
75  int conversionTrackProvenance(const edm::RefToBase<reco::Track>& convTrack) const;
76 
77 
81  void setVertex(const Point & vertex);
83  bool isPhoton() const { return true ; }
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 
393  float photonIso ;
394  float modFrixione ;
395 
397 
398  chargedHadronIso(0),
399  neutralHadronIso(0),
400  photonIso(0),
401  modFrixione(0)
402 
403  {}
404 
405 
406  };
407 
411  float photonIso() const {return pfIsolation_.photonIso;}
412 
415 
417  {
418 
421  float mva;
422 
424 
426  etOutsideMustache(-999999999.),
427  mva(-999999999.)
428 
429  {}
430  };
431 
432  // getters
434  float etOutsideMustache() const {return pfID_.etOutsideMustache;}
435  float pfMVA() const {return pfID_.mva;}
436  // setters
437  void setPflowIDVariables ( const PflowIDVariables& pfid ) { pfID_ = pfid;}
438 
439 
440  private:
442  virtual bool overlap( const Candidate & ) const;
447  //
449  //
458 
459 
460  };
461 
462 }
463 
464 #endif
MIPVariables mipVariableBlock_
Definition: Photon.h:455
reco::SuperClusterRef pfSuperCluster() const
Ref to PFlow SuperCluster.
Definition: Photon.h:60
type
Definition: HCALResponse.h:22
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:414
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:456
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:409
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:410
float e5x5() const
Definition: Photon.h:185
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
Definition: Photon.h:363
reco::ConversionRefVector conversionsOneLeg() const
vector of references to one leg Conversion&#39;s
Definition: Photon.h:68
virtual const Point & vertex() const
vertex position
virtual Photon * clone() const
returns a clone of the candidate
Definition: Photon.cc:37
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
virtual void setP4(const LorentzVector &p4)
set 4-momentum
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
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:11
float trkSumPtHollowConeDR03() const
Definition: Photon.h:377
bool isPhoton() const
Implement Candidate method for particle species.
Definition: Photon.h:83
IsolationVariables isolationR03_
Definition: Photon.h:452
ConversionProvenance
Definition: Photon.h:63
float photonIso() const
Definition: Photon.h:411
Photon()
default constructor
Definition: Photon.h:32
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
Definition: Photon.h:171
float getCorrectedEnergy(P4type type) const
Definition: Photon.cc:124
float mipIntercept() const
Definition: Photon.h:273
math::XYZPointF caloPosition_
position of seed BasicCluster for shower depth of unconverted photon
Definition: Photon.h:444
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:50
bool mipIsHalo() const
Definition: Photon.h:275
IsolationVariables isolationR04_
Definition: Photon.h:451
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:62
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:42
void setEnergyCorrections(const EnergyCorrections &e)
Definition: Photon.h:235
bool isStandardPhoton() const
Definition: Photon.h:56
bool isEBPhiGap() const
Definition: Photon.h:124
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:437
float sigmaIetaIeta() const
Definition: Photon.h:188
math::XYZPoint Point
EnergyCorrections eCorrections_
Definition: Photon.h:454
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:93
float e2x5() const
Definition: Photon.h:183
float sigmaEtaEta() const
Definition: Photon.h:187
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:55
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:167
float getCorrectedEnergyError(P4type type) const
Definition: Photon.cc:144
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:79
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:450
P4type getCandidateP4type() const
Definition: Photon.h:240
float etOutsideMustache() const
Definition: Photon.h:434
void setP4(P4type type, const LorentzVector &p4, float p4Error, bool setToRecoCandidate)
Definition: Photon.cc:165
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:70
bool pixelSeed_
Definition: Photon.h:448
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
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
Definition: Photon.h:74
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
int nTrkSolidConeDR04() const
Definition: Photon.h:356
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:38
bool isEERingGap() const
Definition: Photon.h:127
PflowIDVariables pfID_
Definition: Photon.h:457
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
double a
Definition: hdecay.h:121
int nClusterOutsideMustache() const
Definition: Photon.h:433
float r9() const
Definition: Photon.h:191
reco::ElectronSeedRefVector electronPixelSeeds() const
reference to electron Pixel seed
Definition: Photon.h:72
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:35
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: Photon.h:179
float mipSlope() const
Definition: Photon.h:272
int mipNhitCone() const
Definition: Photon.h:274
float pfMVA() const
Definition: Photon.h:435
ShowerShape showerShapeBlock_
Definition: Photon.h:453
float mipChi2() const
MIP variables.
Definition: Photon.h:270
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
reco::PhotonCoreRef photonCore_
reference to the PhotonCore
Definition: Photon.h:446
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:50
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:29
int conversionTrackProvenance(const edm::RefToBase< reco::Track > &convTrack) const
Definition: Photon.cc:63
bool isEBEtaGap() const
Definition: Photon.h:123
float maxEnergyXtal() const
Definition: Photon.h:186