File indexing completed on 2024-04-06 12:24:46
0001 #ifndef RecoEgamma_EgammaElectronAlgos_ConversionFinder_h
0002 #define RecoEgamma_EgammaElectronAlgos_ConversionFinder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DataFormats/EgammaCandidates/interface/GsfElectronCore.h"
0015 #include "CommonTools/Utils/interface/KinematicTables.h"
0016 #include "CommonTools/Utils/interface/TrackSpecificColumns.h"
0017
0018 #include <iostream>
0019 #include <optional>
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 namespace egamma::conv {
0030
0031 struct ConversionInfo {
0032 const float dist = -9999.;
0033 const float dcot = -9999.;
0034 const float radiusOfConversion = -9999.;
0035
0036
0037 const std::optional<int> conversionPartnerCtfTkIdx = std::nullopt;
0038
0039
0040 const std::optional<int> conversionPartnerGsfTkIdx = std::nullopt;
0041 const int deltaMissingHits = -9999;
0042 const int flag = -9999;
0043
0044
0045
0046
0047
0048 };
0049
0050 using TrackTableSpecificColumns = std::tuple<edm::soa::col::Pz,
0051 edm::soa::col::PtError,
0052 edm::soa::col::MissingInnerHits,
0053 edm::soa::col::NumberOfValidHits,
0054 edm::soa::col::Charge,
0055 edm::soa::col::D0>;
0056 using TrackTable = edm::soa::AddColumns<edm::soa::PtEtaPhiTable, TrackTableSpecificColumns>::type;
0057 using TrackTableView = edm::soa::ViewFromTable_t<TrackTable>;
0058 using TrackRowView = TrackTable::const_iterator::value_type;
0059
0060 std::vector<ConversionInfo> findConversions(const reco::GsfElectronCore& gsfElectron,
0061 TrackTableView ctfTable,
0062 TrackTableView gsfTable,
0063 float bFieldAtOrigin,
0064 float minFracSharedHits);
0065
0066
0067 ConversionInfo findBestConversionMatch(const std::vector<ConversionInfo>& v_convCandidates);
0068
0069
0070
0071 inline ConversionInfo findConversion(const reco::GsfElectronCore& gsfElectron,
0072 TrackTableView ctfTable,
0073 TrackTableView gsfTable,
0074 float bFieldAtOrigin,
0075 float minFracSharedHits = 0.45f) {
0076 return findBestConversionMatch(findConversions(gsfElectron, ctfTable, gsfTable, bFieldAtOrigin, minFracSharedHits));
0077 }
0078
0079 }
0080
0081 #endif