00001 #ifndef ParticleFlowCandidate_PFCandidate_h
00002 #define ParticleFlowCandidate_PFCandidate_h
00003
00009 #include <iostream>
00010
00011 #include "DataFormats/Math/interface/Point3D.h"
00012
00013 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
00014 #include "DataFormats/ParticleFlowReco/interface/PFBlockFwd.h"
00015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00016 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00017 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00018 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
00019
00020
00021 #include "DataFormats/VertexReco/interface/NuclearInteractionFwd.h"
00022 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00023
00024 namespace reco {
00031 class PFCandidate : public CompositeCandidate {
00032
00033 public:
00034
00036 enum ParticleType {
00037 X=0,
00038 h,
00039 e,
00040 mu,
00041 gamma,
00042 h0,
00043 h_HF,
00044 egamma_HF
00045 };
00046
00048 PFCandidate();
00049
00051 PFCandidate( const PFCandidatePtr& sourcePtr );
00052
00053
00054
00055
00056
00057 PFCandidate( Charge q,
00058 const LorentzVector & p4,
00059 ParticleType particleId );
00060
00062 virtual ~PFCandidate() {}
00063
00065 virtual PFCandidate * clone() const;
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 void setSourcePtr(const PFCandidatePtr& ptr) { sourcePtr_ = ptr; }
00078
00079 size_t numberOfSourceCandidatePtrs() const {
00080 return 1;
00081 }
00082
00083 CandidatePtr sourceCandidatePtr( size_type i ) const {
00084 return sourcePtr_;
00085 }
00086
00090 int translateTypeToPdgId( ParticleType type ) const;
00091
00093 void setParticleType( ParticleType type );
00094
00095
00097
00098
00100 void addElementInBlock( const reco::PFBlockRef& blockref,
00101 unsigned elementIndex );
00102
00104 void setTrackRef(const reco::TrackRef& ref);
00105
00108 reco::TrackRef trackRef() const { return trackRef_; }
00109
00111 void setGsfTrackRef(const reco::GsfTrackRef& ref);
00112
00115 reco::GsfTrackRef gsfTrackRef() const { return gsfTrackRef_; }
00116
00118 void setMuonRef(const reco::MuonRef& ref);
00119
00122 reco::MuonRef muonRef() const { return muonRef_; }
00123
00125 void setNuclearRef(const reco::NuclearInteractionRef& ref);
00126
00129 reco::NuclearInteractionRef nuclearRef() const { return nuclearRef_; }
00130
00132 void setConversionRef(const reco::ConversionRef& ref);
00133
00135 reco::ConversionRef conversionRef() const { return conversionRef_; }
00136
00138 void setEcalEnergy( float ee ) {ecalEnergy_ = ee;}
00139
00141 double ecalEnergy() const { return ecalEnergy_;}
00142
00144 void setHcalEnergy( float eh ) {hcalEnergy_ = eh;}
00145
00147 double hcalEnergy() const { return hcalEnergy_;}
00148
00150 void setRawEcalEnergy( float ee ) {rawEcalEnergy_ = ee;}
00151
00153 double rawEcalEnergy() const { return rawEcalEnergy_;}
00154
00156 void setRawHcalEnergy( float eh ) {rawHcalEnergy_ = eh;}
00157
00159 double rawHcalEnergy() const { return rawHcalEnergy_;}
00160
00162 void setPs1Energy( float e1 ) {ps1Energy_ = e1;}
00163
00165 double pS1Energy() const { return ps1Energy_;}
00166
00168 void setPs2Energy( float e2 ) {ps2Energy_ = e2;}
00169
00171 double pS2Energy() const { return ps2Energy_;}
00172
00174 void rescaleMomentum( double rescaleFactor );
00175
00176 enum Flags {
00177 NORMAL=0,
00178 E_PHI_SMODULES,
00179 E_ETA_0,
00180 E_ETA_MODULES,
00181 E_BARREL_ENDCAP,
00182 E_PRESHOWER_EDGE,
00183 E_PRESHOWER,
00184 E_ENDCAP_EDGE,
00185 H_ETA_0,
00186 H_BARREL_ENDCAP,
00187 H_ENDCAP_VFCAL,
00188 H_VFCAL_EDGE,
00189 T_TO_NUCLINT,
00190 T_FROM_NUCLINT,
00191 T_FROM_V0,
00192 T_FROM_GAMMACONV,
00193 GAMMA_TO_GAMMACONV
00194 };
00195
00197 void setFlag(Flags theFlag, bool value);
00198
00200 bool flag(Flags theFlag) const;
00201
00203 void setDeltaP(double dp ) {deltaP_ = dp;}
00204
00206 double deltaP() const { return deltaP_;}
00207
00208
00214 void set_mva_e_pi( float mva ) { mva_e_pi_ = mva; }
00215
00217 float mva_e_pi() const { return mva_e_pi_;}
00218
00219
00221 void set_mva_e_mu( float mva ) { mva_e_mu_ = mva; }
00222
00224 float mva_e_mu() const { return mva_e_mu_;}
00225
00226
00228 void set_mva_pi_mu( float mva ) { mva_pi_mu_ = mva; }
00229
00231 float mva_pi_mu() const { return mva_pi_mu_;}
00232
00233
00235 void set_mva_nothing_gamma( float mva ) { mva_nothing_gamma_ = mva; }
00236
00238 float mva_nothing_gamma() const { return mva_nothing_gamma_;}
00239
00240
00242 void set_mva_nothing_nh( float mva ) { mva_nothing_nh_ = mva; }
00243
00245 float mva_nothing_nh() const { return mva_nothing_nh_;}
00246
00247
00249 void set_mva_gamma_nh( float mva ) { mva_gamma_nh_ = mva; }
00250
00252 float mva_gamma_nh() const { return mva_gamma_nh_;}
00253
00255 void setPositionAtECALEntrance(const math::XYZPointF& pos) {
00256 positionAtECALEntrance_ = pos;
00257 }
00258
00260 const math::XYZPointF& positionAtECALEntrance() const {
00261 return positionAtECALEntrance_;
00262 }
00263
00266 virtual ParticleType particleId() const { return particleId_;}
00267
00268
00270
00271
00272
00274
00275
00276
00278 typedef std::pair<reco::PFBlockRef, unsigned> ElementInBlock;
00279
00280 typedef std::vector< ElementInBlock > ElementsInBlocks;
00281 const ElementsInBlocks& elementsInBlocks() const {
00282 return elementsInBlocks_;
00283 }
00284
00285
00286
00287 static const float bigMva_;
00288
00289 friend std::ostream& operator<<( std::ostream& out,
00290 const PFCandidate& c );
00291
00292 private:
00293 void setFlag(unsigned shift, unsigned flag, bool value);
00294
00295 bool flag(unsigned shift, unsigned flag) const;
00296
00298 ParticleType particleId_;
00299
00300
00301 ElementsInBlocks elementsInBlocks_;
00302
00304
00305 PFCandidatePtr sourcePtr_;
00306
00307 reco::TrackRef trackRef_;
00308
00309 reco::GsfTrackRef gsfTrackRef_;
00310
00311 reco::MuonRef muonRef_;
00312
00313 reco::NuclearInteractionRef nuclearRef_;
00314
00315 reco::ConversionRef conversionRef_;
00316
00318 float ecalEnergy_;
00319
00321 float hcalEnergy_;
00322
00324 float rawEcalEnergy_;
00325
00327 float rawHcalEnergy_;
00328
00330 float ps1Energy_;
00331
00333 float ps2Energy_;
00334
00336 unsigned flags_;
00337
00339 double deltaP_;
00340
00342 float mva_e_pi_;
00343
00345 float mva_e_mu_;
00346
00348 float mva_pi_mu_;
00349
00351 float mva_nothing_gamma_;
00352
00354 float mva_nothing_nh_;
00355
00357 float mva_gamma_nh_;
00358
00360 math::XYZPointF positionAtECALEntrance_;
00361
00362 };
00363
00365 struct PFParticleIdTag { };
00366
00369
00370
00373 GET_CANDIDATE_COMPONENT( PFCandidate, PFCandidate::ParticleType, particleId, PFParticleIdTag );
00374
00375 }
00376
00377 #endif