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