CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConversionFinder.h
Go to the documentation of this file.
1 #ifndef EgammaTools_ConversionFinder_h
2 #define EgammaTools_ConversionFinder_h
3 
24 #include "Math/VectorUtil.h"
25 #include "ConversionInfo.h"
26 
27 
28 
29 /*
30  Class Looks for oppositely charged track in the
31  track collection with the minimum delta cot(theta) between the track
32  and the electron's CTF track (if it doesn't exist, we use the electron's
33  GSF track). Calculate the dist, dcot, point of conversion and the
34  radius of conversion for this pair and fill the ConversionInfo
35 */
36 
38  public:
41  //bField has to be supplied in Tesla
42 
43  //returns a vector of Conversion Infos.
44  //you have to decide which is the best
45  std::vector<ConversionInfo> getConversionInfos(const reco::GsfElectronCore&,
46  const edm::Handle<reco::TrackCollection>& ctftracks_h,
47  const edm::Handle<reco::GsfTrackCollection>& gsftracks_h,
48  const double bFieldAtOrigin,
49  const double minFracSharedHits = 0.45);
50 
51  //retruns the "best" Conversion Info after calling getConversionInfos
53  const edm::Handle<reco::TrackCollection>& ctftracks_h,
54  const edm::Handle<reco::GsfTrackCollection>& gsftracks_h,
55  const double bFieldAtOrigin,
56  const double minFracSharedHits = 0.45);
57 
58  //retruns the "best" Conversion Info after calling getConversionInfos
60  const edm::Handle<reco::TrackCollection>& ctftracks_h,
61  const edm::Handle<reco::GsfTrackCollection>& gsftracks_h,
62  const double bFieldAtOrigin,
63  const double minFracSharedHits = 0.45);
64 
65  //used internally, so call this only if you know what you're doing.
67  const reco::Track *candPartnerTk,
68  const double bFieldAtOrigin);
69 
70  const reco::Track* getElectronTrack(const reco::GsfElectron &, const float minFracSharedHits = 0.45);
71 
72  const reco::Track* getElectronTrack(const reco::GsfElectronCore &, const float minFracSharedHits = 0.45);
73 
74 
75  //takes in a vector of candidate conversion partners
76  //and arbitrates between them returning the one with the
77  //smallest R=sqrt(dist*dist + dcot*dcot)
78  ConversionInfo arbitrateConversionPartnersbyR(const std::vector<ConversionInfo>& v_convCandidates);
79 
80 
81  //places different cuts on dist, dcot, delmissing hits and arbitration based on R = sqrt(dist*dist + dcot*dcot)
82  ConversionInfo findBestConversionMatch(const std::vector<ConversionInfo>& v_convCandidates);
83 
84  //function below is only for backwards compatibility
85  static std::pair<double, double> getConversionInfo(math::XYZTLorentzVector trk1_p4,
86  int trk1_q, float trk1_d0,
88  int trk2_q, float trk2_d0,
89  float bFieldAtOrigin);
90 
91  //for backwards compatibility. Does not use the GSF track collection. This function will be
92  //deprecated soon
95  const double bFieldAtOrigin,
96  const double minFracSharedHits = 0.45);
97 
98 
99  // DEPRECATED
100  bool isFromConversion( const ConversionInfo &, double maxAbsDist = 0.02, double maxAbsDcot = 0.02);
101 
102  private:
103 
104 };
105 #endif
ConversionInfo findBestConversionMatch(const std::vector< ConversionInfo > &v_convCandidates)
const reco::Track * getElectronTrack(const reco::GsfElectron &, const float minFracSharedHits=0.45)
ConversionInfo getConversionInfo(const reco::GsfElectronCore &, const edm::Handle< reco::TrackCollection > &ctftracks_h, const edm::Handle< reco::GsfTrackCollection > &gsftracks_h, const double bFieldAtOrigin, const double minFracSharedHits=0.45)
bool isFromConversion(const ConversionInfo &, double maxAbsDist=0.02, double maxAbsDcot=0.02)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
ConversionInfo arbitrateConversionPartnersbyR(const std::vector< ConversionInfo > &v_convCandidates)
std::vector< ConversionInfo > getConversionInfos(const reco::GsfElectronCore &, const edm::Handle< reco::TrackCollection > &ctftracks_h, const edm::Handle< reco::GsfTrackCollection > &gsftracks_h, const double bFieldAtOrigin, const double minFracSharedHits=0.45)