Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:02

0001 #ifndef RecoEgamma_EgammaTools_LowPtConversion_h
0002 #define RecoEgamma_EgammaTools_LowPtConversion_h
0003 
0004 #include "CommonTools/Statistics/interface/ChiSquaredProbability.h"
0005 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0006 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
0007 #include "DataFormats/Common/interface/Handle.h"
0008 #include "DataFormats/Common/interface/RefToBase.h"
0009 #include "DataFormats/Common/interface/View.h"
0010 #include "DataFormats/PatCandidates/interface/Electron.h"
0011 #include "DataFormats/TrackReco/interface/Track.h"
0012 
0013 class LowPtConversion {
0014 public:
0015   LowPtConversion() = default;
0016   ~LowPtConversion() = default;
0017 
0018   bool wpOpen() const;   // Matched to any conversion (without selections)
0019   bool wpLoose() const;  // Nancy's baseline selections for conversions
0020   bool wpTight() const;  // Nancy's selection for analysis of conversions
0021 
0022   void addUserVars(pat::Electron& ele) const;       // adds minimal set of flags to electron userData
0023   void addExtraUserVars(pat::Electron& ele) const;  // adds all variables to electron userData
0024 
0025   bool match(const reco::BeamSpot& beamSpot, const reco::ConversionCollection& conversions, const pat::Electron& ele);
0026 
0027   static float mee(float ipx1, float ipy1, float ipz1, float ipx2, float ipy2, float ipz2);
0028 
0029 private:
0030   // quality
0031   bool valid_ = false;
0032   float chi2prob_ = -1.;
0033   bool quality_high_purity_ = false;
0034   bool quality_high_efficiency_ = false;
0035 
0036   // tracks
0037   uint ntracks_ = 0;
0038   float min_trk_pt_ = -1.;
0039   int ilead_ = -1;
0040   int itrail_ = -1;
0041 
0042   // displacement
0043   float l_xy_ = -1.;
0044   float vtx_radius_ = -1.;
0045 
0046   // invariant mass
0047   float mass_from_conv_ = -1.;
0048   float mass_from_Pin_ = -1.;
0049   float mass_before_fit_ = -1.;
0050   float mass_after_fit_ = -1.;
0051 
0052   // hits before vertex
0053   uint lead_nhits_before_vtx_ = 0;
0054   uint trail_nhits_before_vtx_ = 0;
0055   uint max_nhits_before_vtx_ = 0;
0056   uint sum_nhits_before_vtx_ = 0;
0057   int delta_expected_nhits_inner_ = 0;
0058 
0059   // opening angle
0060   float delta_cot_from_Pin_ = -1.;
0061 
0062   // match?
0063   bool matched_ = false;
0064   edm::RefToBase<reco::Track> matched_lead_;
0065   edm::RefToBase<reco::Track> matched_trail_;
0066 };
0067 
0068 #endif  // RecoEgamma_EgammaTools_LowPtConversion_h