CMS 3D CMS Logo

ConversionFinder.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaElectronAlgos_ConversionFinder_h
2 #define RecoEgamma_EgammaElectronAlgos_ConversionFinder_h
3 
17 
18 #include <iostream>
19 #include <optional>
20 
21 /*
22  Class Looks for oppositely charged track in the
23  track collection with the minimum delta cot(theta) between the track
24  and the electron's CTF track (if it doesn't exist, we use the electron's
25  GSF track). Calculate the dist, dcot, point of conversion and the
26  radius of conversion for this pair and fill the ConversionInfo
27 */
28 
29 namespace egamma::conv {
30 
31  struct ConversionInfo {
32  const float dist = -9999.;
33  const float dcot = -9999.;
34  const float radiusOfConversion = -9999.;
35  // if the partner track is found in the GSF track collection,
36  // this is a ref to the GSF partner track
37  const std::optional<int> conversionPartnerCtfTkIdx = std::nullopt;
38  // if the partner track is found in the CTF track collection,
39  // this is a ref to the CTF partner track
40  const std::optional<int> conversionPartnerGsfTkIdx = std::nullopt;
41  const int deltaMissingHits = -9999;
42  const int flag = -9999;
43 
44  // flag 0: Partner track found in the CTF collection using the electron's CTF track
45  // flag 1: Partner track found in the CTF collection using the electron's GSF track
46  // flag 2: Partner track found in the GSF collection using the electron's CTF track
47  // flag 3: Partner track found in the GSF collection using the electron's GSF track
48  };
49 
59 
60  std::vector<ConversionInfo> findConversions(const reco::GsfElectronCore& gsfElectron,
61  TrackTableView ctfTable,
62  TrackTableView gsfTable,
63  float bFieldAtOrigin,
64  float minFracSharedHits);
65 
66  //places different cuts on dist, dcot, delmissing hits and arbitration based on R = sqrt(dist*dist + dcot*dcot)
67  ConversionInfo findBestConversionMatch(const std::vector<ConversionInfo>& v_convCandidates);
68 
69  // returns the "best" conversion,
70  // bField has to be supplied in Tesla
72  TrackTableView ctfTable,
73  TrackTableView gsfTable,
74  float bFieldAtOrigin,
75  float minFracSharedHits = 0.45f) {
76  return findBestConversionMatch(findConversions(gsfElectron, ctfTable, gsfTable, bFieldAtOrigin, minFracSharedHits));
77  }
78 
79 } // namespace egamma::conv
80 
81 #endif
egamma::conv::ConversionInfo::conversionPartnerGsfTkIdx
const std::optional< int > conversionPartnerGsfTkIdx
Definition: ConversionFinder.h:40
GsfElectronCore.h
egamma::conv::findConversion
ConversionInfo findConversion(const reco::GsfElectronCore &gsfElectron, TrackTableView ctfTable, TrackTableView gsfTable, float bFieldAtOrigin, float minFracSharedHits=0.45f)
Definition: ConversionFinder.h:71
egamma::conv::TrackTable
edm::soa::AddColumns< edm::soa::PtEtaPhiTable, TrackTableSpecificColumns >::type TrackTable
Definition: ConversionFinder.h:56
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
egamma::conv
Definition: ConversionFinder.h:29
egamma::conv::ConversionInfo
Definition: ConversionFinder.h:31
edm::soa::ViewFromTable_t
typename ViewFromTable< T >::type ViewFromTable_t
Definition: TableView.h:104
edm::soa::col::D0
Definition: TrackSpecificColumns.h:11
edm::soa::AddColumns
Definition: Table.h:409
egamma::conv::TrackRowView
TrackTable::const_iterator::value_type TrackRowView
Definition: ConversionFinder.h:58
egamma::conv::ConversionInfo::conversionPartnerCtfTkIdx
const std::optional< int > conversionPartnerCtfTkIdx
Definition: ConversionFinder.h:37
edm::soa::col::MissingInnerHits
Definition: TrackSpecificColumns.h:13
egamma::conv::ConversionInfo::dcot
const float dcot
Definition: ConversionFinder.h:33
egamma::conv::TrackTableView
edm::soa::ViewFromTable_t< TrackTable > TrackTableView
Definition: ConversionFinder.h:57
edm::soa::col::NumberOfValidHits
Definition: TrackSpecificColumns.h:12
TrackSpecificColumns.h
edm::soa::col::Pz
Definition: KinematicColumns.h:18
reco::GsfElectronCore
Definition: GsfElectronCore.h:31
egamma::conv::findConversions
std::vector< ConversionInfo > findConversions(const reco::GsfElectronCore &gsfElectron, TrackTableView ctfTable, TrackTableView gsfTable, float bFieldAtOrigin, float minFracSharedHits)
Definition: ConversionFinder.cc:29
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
edm::soa::col::PtError
Definition: TrackSpecificColumns.h:10
egamma::conv::findBestConversionMatch
ConversionInfo findBestConversionMatch(const std::vector< ConversionInfo > &v_convCandidates)
Definition: ConversionFinder.cc:229
KinematicTables.h
egamma::conv::ConversionInfo::deltaMissingHits
const int deltaMissingHits
Definition: ConversionFinder.h:41
PixelTestBeamValidation_cfi.Charge
Charge
Definition: PixelTestBeamValidation_cfi.py:99
egamma::conv::ConversionInfo::radiusOfConversion
const float radiusOfConversion
Definition: ConversionFinder.h:34
egamma::conv::ConversionInfo::flag
const int flag
Definition: ConversionFinder.h:42
egamma::conv::ConversionInfo::dist
const float dist
Definition: ConversionFinder.h:32
egamma::conv::TrackTableSpecificColumns
std::tuple< edm::soa::col::Pz, edm::soa::col::PtError, edm::soa::col::MissingInnerHits, edm::soa::col::NumberOfValidHits, edm::soa::col::Charge, edm::soa::col::D0 > TrackTableSpecificColumns
Definition: ConversionFinder.h:55