CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
TemplatedSecondaryVertexProducer< IPTI, VTX > Class Template Reference
Inheritance diagram for TemplatedSecondaryVertexProducer< IPTI, VTX >:
edm::stream::EDProducer<>

Classes

struct  SVBuilder
 
struct  SVFilter
 

Public Types

typedef IPTI::input_container input_container
 
typedef IPTI::input_container::value_type input_item
 
typedef std::vector< TemplatedSecondaryVertexTagInfo< IPTI, VTX > > Product
 
typedef TemplatedSecondaryVertex< VTX > SecondaryVertex
 
typedef std::vector< reco::btag::IndexedTrackDataTrackDataVector
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

void produce (edm::Event &event, const edm::EventSetup &es) override
 
 TemplatedSecondaryVertexProducer (const edm::ParameterSet &params)
 
 ~TemplatedSecondaryVertexProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

enum  ConstraintType {
  CONSTRAINT_NONE = 0, CONSTRAINT_BEAMSPOT, CONSTRAINT_PV_BEAMSPOT_SIZE, CONSTRAINT_PV_BS_Z_ERRORS_SCALED,
  CONSTRAINT_PV_ERROR_SCALED, CONSTRAINT_PV_PRIMARIES_IN_FIT
}
 

Private Member Functions

void markUsedTracks (TrackDataVector &trackData, const input_container &trackRefs, const SecondaryVertex &sv, size_t idx)
 
template<>
void markUsedTracks (TrackDataVector &trackData, const input_container &trackRefs, const SecondaryVertex &sv, size_t idx)
 
template<>
void markUsedTracks (TrackDataVector &trackData, const input_container &trackRefs, const SecondaryVertex &sv, size_t idx)
 
void matchGroomedJets (const edm::Handle< edm::View< reco::Jet > > &jets, const edm::Handle< edm::View< reco::Jet > > &matchedJets, std::vector< int > &matchedIndices)
 
template<class CONTAINER >
void matchReclusteredJets (const edm::Handle< CONTAINER > &jets, const std::vector< fastjet::PseudoJet > &matchedJets, std::vector< int > &matchedIndices, const std::string &jetType="")
 
void matchSubjets (const edm::Handle< edm::View< reco::Jet > > &fatJets, const edm::Handle< std::vector< IPTI > > &subjets, std::vector< std::vector< int > > &matchedIndices)
 
void matchSubjets (const std::vector< int > &groomedIndices, const edm::Handle< edm::View< reco::Jet > > &groomedJets, const edm::Handle< std::vector< IPTI > > &subjets, std::vector< std::vector< int > > &matchedIndices)
 
const reco::JettoJet (const IPTI &j)
 
const reco::JettoJet (const reco::Jet &j)
 

Static Private Member Functions

static ConstraintType getConstraintType (const std::string &name)
 

Private Attributes

ConstraintType constraint
 
double constraintScaling
 
double extSVDeltaRToJet
 
ClusterSequencePtr fjClusterSeq
 
JetDefPtr fjJetDefinition
 
double ghostRescaling
 
std::string jetAlgorithm
 
double jetPtMin
 
double minTrackWeight
 
double relPtTolerance
 
double rParam
 
reco::btag::SortCriteria sortCriterium
 
edm::EDGetTokenT< reco::BeamSpottoken_BeamSpot
 
edm::EDGetTokenT< edm::View< VTX > > token_extSVCollection
 
edm::EDGetTokenT< edm::View< reco::Jet > > token_fatJets
 
edm::EDGetTokenT< edm::View< reco::Jet > > token_groomedFatJets
 
edm::EDGetTokenT< std::vector< IPTI > > token_trackIPTagInfo
 
edm::EDGetTokenT< edm::ValueMap< float > > token_weights
 
TrackSelector trackSelector
 
bool useExternalSV
 
bool useFatJets
 
bool useGhostTrack
 
bool useGroomedFatJets
 
bool useSVClustering
 
bool useSVMomentum
 
VertexFilter vertexFilter
 
VertexSorting< SecondaryVertexvertexSorting
 
edm::ParameterSet vtxRecoPSet
 
bool withPVError
 

Detailed Description

template<class IPTI, class VTX>
class TemplatedSecondaryVertexProducer< IPTI, VTX >

Definition at line 101 of file TemplatedSecondaryVertexProducer.cc.

Member Typedef Documentation

◆ input_container

template<class IPTI, class VTX>
typedef IPTI::input_container TemplatedSecondaryVertexProducer< IPTI, VTX >::input_container

Definition at line 108 of file TemplatedSecondaryVertexProducer.cc.

◆ input_item

template<class IPTI, class VTX>
typedef IPTI::input_container::value_type TemplatedSecondaryVertexProducer< IPTI, VTX >::input_item

Definition at line 109 of file TemplatedSecondaryVertexProducer.cc.

◆ Product

template<class IPTI, class VTX>
typedef std::vector<TemplatedSecondaryVertexTagInfo<IPTI, VTX> > TemplatedSecondaryVertexProducer< IPTI, VTX >::Product

Definition at line 106 of file TemplatedSecondaryVertexProducer.cc.

◆ SecondaryVertex

template<class IPTI, class VTX>
typedef TemplatedSecondaryVertex<VTX> TemplatedSecondaryVertexProducer< IPTI, VTX >::SecondaryVertex

Definition at line 107 of file TemplatedSecondaryVertexProducer.cc.

◆ TrackDataVector

template<class IPTI, class VTX>
typedef std::vector<reco::btag::IndexedTrackData> TemplatedSecondaryVertexProducer< IPTI, VTX >::TrackDataVector

Definition at line 110 of file TemplatedSecondaryVertexProducer.cc.

Member Enumeration Documentation

◆ ConstraintType

template<class IPTI, class VTX>
enum TemplatedSecondaryVertexProducer::ConstraintType
private
Enumerator
CONSTRAINT_NONE 
CONSTRAINT_BEAMSPOT 
CONSTRAINT_PV_BEAMSPOT_SIZE 
CONSTRAINT_PV_BS_Z_ERRORS_SCALED 
CONSTRAINT_PV_ERROR_SCALED 
CONSTRAINT_PV_PRIMARIES_IN_FIT 

Definition at line 133 of file TemplatedSecondaryVertexProducer.cc.

Constructor & Destructor Documentation

◆ TemplatedSecondaryVertexProducer()

template<class IPTI , class VTX >
TemplatedSecondaryVertexProducer< IPTI, VTX >::TemplatedSecondaryVertexProducer ( const edm::ParameterSet params)
explicit

Definition at line 242 of file TemplatedSecondaryVertexProducer.cc.

243  : sortCriterium(TrackSorting::getCriterium(params.getParameter<std::string>("trackSort"))),
244  trackSelector(params.getParameter<edm::ParameterSet>("trackSelection")),
245  constraint(getConstraintType(params.getParameter<std::string>("constraint"))),
246  constraintScaling(1.0),
247  vtxRecoPSet(params.getParameter<edm::ParameterSet>("vertexReco")),
248  useGhostTrack(vtxRecoPSet.getParameter<std::string>("finder") == "gtvr"),
249  withPVError(params.getParameter<bool>("usePVError")),
250  minTrackWeight(params.getParameter<double>("minimumTrackWeight")),
251  vertexFilter(params.getParameter<edm::ParameterSet>("vertexCuts")),
252  vertexSorting(params.getParameter<edm::ParameterSet>("vertexSelection")) {
253  token_trackIPTagInfo = consumes<std::vector<IPTI> >(params.getParameter<edm::InputTag>("trackIPTagInfos"));
255  constraintScaling = params.getParameter<double>("pvErrorScaling");
256 
259  token_BeamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpotTag"));
260  useExternalSV = false;
261  if (params.existsAs<bool>("useExternalSV"))
262  useExternalSV = params.getParameter<bool>("useExternalSV");
263  if (useExternalSV) {
264  token_extSVCollection = consumes<edm::View<VTX> >(params.getParameter<edm::InputTag>("extSVCollection"));
265  extSVDeltaRToJet = params.getParameter<double>("extSVDeltaRToJet");
266  }
267  useSVClustering = (params.existsAs<bool>("useSVClustering") ? params.getParameter<bool>("useSVClustering") : false);
268  useSVMomentum = (params.existsAs<bool>("useSVMomentum") ? params.getParameter<bool>("useSVMomentum") : false);
269  useFatJets = (useExternalSV && params.exists("fatJets"));
270  useGroomedFatJets = (useExternalSV && params.exists("groomedFatJets"));
271  if (useSVClustering) {
272  jetAlgorithm = params.getParameter<std::string>("jetAlgorithm");
273  rParam = params.getParameter<double>("rParam");
274  jetPtMin =
275  0.; // hardcoded to 0. since we simply want to recluster all input jets which already had some PtMin applied
277  (params.existsAs<double>("ghostRescaling") ? params.getParameter<double>("ghostRescaling") : 1e-18);
279  (params.existsAs<double>("relPtTolerance")
280  ? params.getParameter<double>("relPtTolerance")
281  : 1e-03); // 0.1% relative difference in Pt should be sufficient to detect possible misconfigurations
282 
283  // set jet algorithm
284  if (jetAlgorithm == "Kt")
285  fjJetDefinition = std::make_shared<fastjet::JetDefinition>(fastjet::kt_algorithm, rParam);
286  else if (jetAlgorithm == "CambridgeAachen")
287  fjJetDefinition = std::make_shared<fastjet::JetDefinition>(fastjet::cambridge_algorithm, rParam);
288  else if (jetAlgorithm == "AntiKt")
289  fjJetDefinition = std::make_shared<fastjet::JetDefinition>(fastjet::antikt_algorithm, rParam);
290  else
291  throw cms::Exception("InvalidJetAlgorithm") << "Jet clustering algorithm is invalid: " << jetAlgorithm
292  << ", use CambridgeAachen | Kt | AntiKt" << std::endl;
293  }
294  if (useFatJets) {
295  token_fatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("fatJets"));
296  }
297  edm::InputTag srcWeights = params.getParameter<edm::InputTag>("weights");
298  if (!srcWeights.label().empty())
300  if (useGroomedFatJets) {
301  token_groomedFatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("groomedFatJets"));
302  }
303  if (useFatJets && !useSVClustering)
304  rParam = params.getParameter<double>("rParam"); // will be used later as a dR cut
305 
306  produces<Product>();
307 }

References TemplatedSecondaryVertexProducer< IPTI, VTX >::constraint, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_BEAMSPOT, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_PV_BEAMSPOT_SIZE, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_PV_BS_Z_ERRORS_SCALED, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_PV_ERROR_SCALED, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_PV_PRIMARIES_IN_FIT, TemplatedSecondaryVertexProducer< IPTI, VTX >::constraintScaling, MillePedeFileConverter_cfg::e, Exception, TemplatedSecondaryVertexProducer< IPTI, VTX >::extSVDeltaRToJet, TemplatedSecondaryVertexProducer< IPTI, VTX >::fjJetDefinition, TemplatedSecondaryVertexProducer< IPTI, VTX >::ghostRescaling, TemplatedSecondaryVertexProducer< IPTI, VTX >::jetAlgorithm, TemplatedSecondaryVertexProducer< IPTI, VTX >::jetPtMin, CalibrationSummaryClient_cfi::params, TemplatedSecondaryVertexProducer< IPTI, VTX >::relPtTolerance, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, HLT_2018_cff::srcWeights, AlCaHLTBitMon_QueryRunRegistry::string, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_BeamSpot, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_extSVCollection, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_fatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_groomedFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_trackIPTagInfo, TemplatedSecondaryVertexProducer< IPTI, VTX >::token_weights, TemplatedSecondaryVertexProducer< IPTI, VTX >::useExternalSV, TemplatedSecondaryVertexProducer< IPTI, VTX >::useFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useGroomedFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVClustering, and TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVMomentum.

◆ ~TemplatedSecondaryVertexProducer()

template<class IPTI , class VTX >
TemplatedSecondaryVertexProducer< IPTI, VTX >::~TemplatedSecondaryVertexProducer ( )
override

Definition at line 309 of file TemplatedSecondaryVertexProducer.cc.

309 {}

Member Function Documentation

◆ fillDescriptions()

template<class IPTI , class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1213 of file TemplatedSecondaryVertexProducer.cc.

1213  {
1215  desc.add<double>("extSVDeltaRToJet", 0.3);
1216  desc.add<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"));
1217  {
1219  vertexReco.add<double>("primcut", 1.8);
1220  vertexReco.add<double>("seccut", 6.0);
1221  vertexReco.add<std::string>("finder", "avr");
1222  vertexReco.addOptionalNode(edm::ParameterDescription<double>("minweight", 0.5, true) and
1223  edm::ParameterDescription<double>("weightthreshold", 0.001, true) and
1224  edm::ParameterDescription<bool>("smoothing", false, true),
1225  true);
1226  vertexReco.addOptionalNode(
1227  edm::ParameterDescription<double>("maxFitChi2", 10.0, true) and
1228  edm::ParameterDescription<double>("mergeThreshold", 3.0, true) and
1229  edm::ParameterDescription<std::string>("fitType", "RefitGhostTrackWithVertices", true),
1230  true);
1231  desc.add<edm::ParameterSetDescription>("vertexReco", vertexReco);
1232  }
1233  {
1235  vertexSelection.add<std::string>("sortCriterium", "dist3dError");
1236  desc.add<edm::ParameterSetDescription>("vertexSelection", vertexSelection);
1237  }
1238  desc.add<std::string>("constraint", "BeamSpot");
1239  desc.add<edm::InputTag>("trackIPTagInfos", edm::InputTag("impactParameterTagInfos"));
1240  {
1242  vertexCuts.add<double>("distSig3dMax", 99999.9);
1243  vertexCuts.add<double>("fracPV", 0.65);
1244  vertexCuts.add<double>("distVal2dMax", 2.5);
1245  vertexCuts.add<bool>("useTrackWeights", true);
1246  vertexCuts.add<double>("maxDeltaRToJetAxis", 0.4);
1247  {
1249  v0Filter.add<double>("k0sMassWindow", 0.05);
1251  }
1252  vertexCuts.add<double>("distSig2dMin", 3.0);
1253  vertexCuts.add<unsigned int>("multiplicityMin", 2);
1254  vertexCuts.add<double>("distVal2dMin", 0.01);
1255  vertexCuts.add<double>("distSig2dMax", 99999.9);
1256  vertexCuts.add<double>("distVal3dMax", 99999.9);
1257  vertexCuts.add<double>("minimumTrackWeight", 0.5);
1258  vertexCuts.add<double>("distVal3dMin", -99999.9);
1259  vertexCuts.add<double>("massMax", 6.5);
1260  vertexCuts.add<double>("distSig3dMin", -99999.9);
1261  desc.add<edm::ParameterSetDescription>("vertexCuts", vertexCuts);
1262  }
1263  desc.add<bool>("useExternalSV", false);
1264  desc.add<double>("minimumTrackWeight", 0.5);
1265  desc.add<bool>("usePVError", true);
1266  {
1268  trackSelection.add<double>("b_pT", 0.3684);
1269  trackSelection.add<double>("max_pT", 500);
1270  trackSelection.add<bool>("useVariableJTA", false);
1271  trackSelection.add<double>("maxDecayLen", 99999.9);
1272  trackSelection.add<double>("sip3dValMin", -99999.9);
1273  trackSelection.add<double>("max_pT_dRcut", 0.1);
1274  trackSelection.add<double>("a_pT", 0.005263);
1275  trackSelection.add<unsigned int>("totalHitsMin", 8);
1276  trackSelection.add<double>("jetDeltaRMax", 0.3);
1277  trackSelection.add<double>("a_dR", -0.001053);
1278  trackSelection.add<double>("maxDistToAxis", 0.2);
1279  trackSelection.add<double>("ptMin", 1.0);
1280  trackSelection.add<std::string>("qualityClass", "any");
1281  trackSelection.add<unsigned int>("pixelHitsMin", 2);
1282  trackSelection.add<double>("sip2dValMax", 99999.9);
1283  trackSelection.add<double>("max_pT_trackPTcut", 3);
1284  trackSelection.add<double>("sip2dValMin", -99999.9);
1285  trackSelection.add<double>("normChi2Max", 99999.9);
1286  trackSelection.add<double>("sip3dValMax", 99999.9);
1287  trackSelection.add<double>("sip3dSigMin", -99999.9);
1288  trackSelection.add<double>("min_pT", 120);
1289  trackSelection.add<double>("min_pT_dRcut", 0.5);
1290  trackSelection.add<double>("sip2dSigMax", 99999.9);
1291  trackSelection.add<double>("sip3dSigMax", 99999.9);
1292  trackSelection.add<double>("sip2dSigMin", -99999.9);
1293  trackSelection.add<double>("b_dR", 0.6263);
1294  desc.add<edm::ParameterSetDescription>("trackSelection", trackSelection);
1295  }
1296  desc.add<std::string>("trackSort", "sip3dSig");
1297  desc.add<edm::InputTag>("extSVCollection", edm::InputTag("secondaryVertices"));
1298  desc.addOptionalNode(edm::ParameterDescription<bool>("useSVClustering", false, true) and
1299  edm::ParameterDescription<std::string>("jetAlgorithm", true) and
1300  edm::ParameterDescription<double>("rParam", true),
1301  true);
1302  desc.addOptional<bool>("useSVMomentum", false);
1303  desc.addOptional<double>("ghostRescaling", 1e-18);
1304  desc.addOptional<double>("relPtTolerance", 1e-03);
1305  desc.addOptional<edm::InputTag>("fatJets");
1306  desc.addOptional<edm::InputTag>("groomedFatJets");
1307  desc.add<edm::InputTag>("weights", edm::InputTag(""));
1308  descriptions.addDefault(desc);
1309 }

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::addOptionalNode(), MillePedeFileConverter_cfg::e, HLT_2018_cff::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, HLT_2018_cff::trackSelection, HLT_2018_cff::v0Filter, HLT_2018_cff::vertexCuts, HLT_2018_cff::vertexReco, and HiggsMonitoring_cfi::vertexSelection.

◆ getConstraintType()

template<class IPTI , class VTX >
TemplatedSecondaryVertexProducer< IPTI, VTX >::ConstraintType TemplatedSecondaryVertexProducer< IPTI, VTX >::getConstraintType ( const std::string &  name)
staticprivate

Definition at line 205 of file TemplatedSecondaryVertexProducer.cc.

205  {
206  if (name == "None")
207  return CONSTRAINT_NONE;
208  else if (name == "BeamSpot")
209  return CONSTRAINT_BEAMSPOT;
210  else if (name == "BeamSpot+PVPosition")
212  else if (name == "BeamSpotZ+PVErrorScaledXY")
214  else if (name == "PVErrorScaled")
216  else if (name == "BeamSpot+PVTracksInFit")
218  else
219  throw cms::Exception("InvalidArgument") << "TemplatedSecondaryVertexProducer: ``constraint'' parameter "
220  "value \""
221  << name << "\" not understood." << std::endl;
222 }

References Exception, and Skims_PA_cff::name.

◆ markUsedTracks() [1/3]

template<class IPTI, class VTX>
void TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private

◆ markUsedTracks() [2/3]

template<>
void TemplatedSecondaryVertexProducer< TrackIPTagInfo, reco::Vertex >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private

Definition at line 929 of file TemplatedSecondaryVertexProducer.cc.

932  {
933  for (Vertex::trackRef_iterator iter = sv.tracks_begin(); iter != sv.tracks_end(); ++iter) {
934  if (sv.trackWeight(*iter) < minTrackWeight)
935  continue;
936 
937  typename input_container::const_iterator pos =
938  std::find(trackRefs.begin(), trackRefs.end(), iter->castTo<input_item>());
939 
940  if (pos == trackRefs.end()) {
941  if (!useExternalSV)
942  throw cms::Exception("TrackNotFound") << "Could not find track from secondary "
943  "vertex in original tracks."
944  << std::endl;
945  } else {
946  unsigned int index = pos - trackRefs.begin();
947  trackData[index].second.svStatus =
948  (btag::TrackData::Status)((unsigned int)btag::TrackData::trackAssociatedToVertex + idx);
949  }
950  }
951 }

References Exception, spr::find(), charmTagsComputerCvsB_cfi::idx, btagGenBb_cfi::Status, pfDeepBoostedJetPreprocessParams_cfi::sv, and HLT_2018_cff::useExternalSV.

◆ markUsedTracks() [3/3]

template<>
void TemplatedSecondaryVertexProducer< CandIPTagInfo, reco::VertexCompositePtrCandidate >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private

Definition at line 953 of file TemplatedSecondaryVertexProducer.cc.

954  {
955  for (typename input_container::const_iterator iter = sv.daughterPtrVector().begin();
956  iter != sv.daughterPtrVector().end();
957  ++iter) {
958  typename input_container::const_iterator pos = std::find(trackRefs.begin(), trackRefs.end(), *iter);
959 
960  if (pos != trackRefs.end()) {
961  unsigned int index = pos - trackRefs.begin();
962  trackData[index].second.svStatus =
963  (btag::TrackData::Status)((unsigned int)btag::TrackData::trackAssociatedToVertex + idx);
964  }
965  }
966 }

References spr::find(), charmTagsComputerCvsB_cfi::idx, btagGenBb_cfi::Status, and pfDeepBoostedJetPreprocessParams_cfi::sv.

◆ matchGroomedJets()

template<class IPTI , class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets ( const edm::Handle< edm::View< reco::Jet > > &  jets,
const edm::Handle< edm::View< reco::Jet > > &  matchedJets,
std::vector< int > &  matchedIndices 
)
private

Definition at line 1073 of file TemplatedSecondaryVertexProducer.cc.

1075  {
1076  std::vector<bool> jetLocks(jets->size(), false);
1077  std::vector<int> jetIndices;
1078 
1079  for (size_t gj = 0; gj < groomedJets->size(); ++gj) {
1080  double matchedDR2 = 1e9;
1081  int matchedIdx = -1;
1082 
1083  if (groomedJets->at(gj).pt() > 0.) // skip pathological cases of groomed jets with Pt=0
1084  {
1085  for (size_t j = 0; j < jets->size(); ++j) {
1086  if (jetLocks.at(j))
1087  continue; // skip jets that have already been matched
1088 
1089  double tempDR2 = Geom::deltaR2(
1090  jets->at(j).rapidity(), jets->at(j).phi(), groomedJets->at(gj).rapidity(), groomedJets->at(gj).phi());
1091  if (tempDR2 < matchedDR2) {
1092  matchedDR2 = tempDR2;
1093  matchedIdx = j;
1094  }
1095  }
1096  }
1097 
1098  if (matchedIdx >= 0) {
1099  if (matchedDR2 > rParam * rParam) {
1100  edm::LogWarning("MatchedJetsFarApart")
1101  << "Matched groomed jet " << gj << " and original jet " << matchedIdx
1102  << " are separated by dR=" << sqrt(matchedDR2) << " which is greater than the jet size R=" << rParam
1103  << ".\n"
1104  << "This is not expected so the matching of these two jets has been discarded. Please check that the two "
1105  "jet collections belong to each other.";
1106  matchedIdx = -1;
1107  } else
1108  jetLocks.at(matchedIdx) = true;
1109  }
1110  jetIndices.push_back(matchedIdx);
1111  }
1112 
1113  for (size_t j = 0; j < jets->size(); ++j) {
1114  std::vector<int>::iterator matchedIndex = std::find(jetIndices.begin(), jetIndices.end(), j);
1115 
1116  matchedIndices.push_back(matchedIndex != jetIndices.end() ? std::distance(jetIndices.begin(), matchedIndex) : -1);
1117  }
1118 }

References HLTMuonOfflineAnalyzer_cfi::deltaR2, HLT_2018_cff::distance, spr::find(), dqmiolumiharvest::j, singleTopDQM_cfi::jets, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, and mathSSE::sqrt().

◆ matchReclusteredJets()

template<class IPTI , class VTX >
template<class CONTAINER >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::matchReclusteredJets ( const edm::Handle< CONTAINER > &  jets,
const std::vector< fastjet::PseudoJet > &  matchedJets,
std::vector< int > &  matchedIndices,
const std::string &  jetType = "" 
)
private

Definition at line 1024 of file TemplatedSecondaryVertexProducer.cc.

1028  {
1029  std::string type = (!jetType.empty() ? jetType + " " : jetType);
1030 
1031  std::vector<bool> matchedLocks(reclusteredJets.size(), false);
1032 
1033  for (size_t j = 0; j < jets->size(); ++j) {
1034  double matchedDR2 = 1e9;
1035  int matchedIdx = -1;
1036 
1037  for (size_t rj = 0; rj < reclusteredJets.size(); ++rj) {
1038  if (matchedLocks.at(rj))
1039  continue; // skip jets that have already been matched
1040 
1041  double tempDR2 = Geom::deltaR2(toJet(jets->at(j))->rapidity(),
1042  toJet(jets->at(j))->phi(),
1043  reclusteredJets.at(rj).rapidity(),
1044  reclusteredJets.at(rj).phi_std());
1045  if (tempDR2 < matchedDR2) {
1046  matchedDR2 = tempDR2;
1047  matchedIdx = rj;
1048  }
1049  }
1050 
1051  if (matchedIdx >= 0) {
1052  if (matchedDR2 > rParam * rParam) {
1053  edm::LogError("JetMatchingFailed") << "Matched reclustered jet " << matchedIdx << " and original " << type
1054  << "jet " << j << " are separated by dR=" << sqrt(matchedDR2)
1055  << " which is greater than the jet size R=" << rParam << ".\n"
1056  << "This is not expected so please check that the jet algorithm and jet "
1057  "size match those used for the original "
1058  << type << "jet collection.";
1059  } else
1060  matchedLocks.at(matchedIdx) = true;
1061  } else
1062  edm::LogError("JetMatchingFailed")
1063  << "Matching reclustered to original " << type
1064  << "jets failed. Please check that the jet algorithm and jet size match those used for the original " << type
1065  << "jet collection.";
1066 
1067  matchedIndices.push_back(matchedIdx);
1068  }
1069 }

References HLTMuonOfflineAnalyzer_cfi::deltaR2, dqmiolumiharvest::j, singleTopDQM_cfi::jets, HLT_2018_cff::jetType, phi, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and TemplatedSecondaryVertexProducer< IPTI, VTX >::toJet().

◆ matchSubjets() [1/2]

template<class IPTI, class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::matchSubjets ( const edm::Handle< edm::View< reco::Jet > > &  fatJets,
const edm::Handle< std::vector< IPTI > > &  subjets,
std::vector< std::vector< int > > &  matchedIndices 
)
private

Definition at line 1154 of file TemplatedSecondaryVertexProducer.cc.

1156  {
1157  for (size_t fj = 0; fj < fatJets->size(); ++fj) {
1158  std::vector<int> subjetIndices;
1159  size_t nSubjetCollections = 0;
1160  size_t nSubjets = 0;
1161 
1162  const pat::Jet *fatJet = dynamic_cast<const pat::Jet *>(fatJets->ptrAt(fj).get());
1163 
1164  if (!fatJet) {
1165  if (fj == 0)
1166  edm::LogError("WrongJetType")
1167  << "Wrong jet type for input fat jets. Please check that the input fat jets are of the pat::Jet type.";
1168 
1169  matchedIndices.push_back(subjetIndices);
1170  continue;
1171  } else {
1172  nSubjetCollections = fatJet->subjetCollectionNames().size();
1173 
1174  if (nSubjetCollections > 0) {
1175  for (size_t coll = 0; coll < nSubjetCollections; ++coll) {
1176  const pat::JetPtrCollection &fatJetSubjets = fatJet->subjets(coll);
1177 
1178  for (size_t fjsj = 0; fjsj < fatJetSubjets.size(); ++fjsj) {
1179  ++nSubjets;
1180 
1181  for (size_t sj = 0; sj < subjets->size(); ++sj) {
1182  const pat::Jet *subJet = dynamic_cast<const pat::Jet *>(subjets->at(sj).jet().get());
1183 
1184  if (!subJet) {
1185  if (fj == 0 && coll == 0 && fjsj == 0 && sj == 0)
1186  edm::LogError("WrongJetType") << "Wrong jet type for input subjets. Please check that the input "
1187  "subjets are of the pat::Jet type.";
1188 
1189  break;
1190  } else {
1191  if (subJet->originalObjectRef() == fatJetSubjets.at(fjsj)->originalObjectRef()) {
1192  subjetIndices.push_back(sj);
1193  break;
1194  }
1195  }
1196  }
1197  }
1198  }
1199 
1200  if (subjetIndices.empty() && nSubjets > 0)
1201  edm::LogError("SubjetMatchingFailed") << "Matching subjets to fat jets failed. Please check that the fat jet "
1202  "and subjet collections belong to each other.";
1203 
1204  matchedIndices.push_back(subjetIndices);
1205  } else
1206  matchedIndices.push_back(subjetIndices);
1207  }
1208  }
1209 }

References pat::PATObject< ObjectType >::originalObjectRef(), pat::Jet::subjetCollectionNames(), and pat::Jet::subjets().

◆ matchSubjets() [2/2]

template<class IPTI, class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::matchSubjets ( const std::vector< int > &  groomedIndices,
const edm::Handle< edm::View< reco::Jet > > &  groomedJets,
const edm::Handle< std::vector< IPTI > > &  subjets,
std::vector< std::vector< int > > &  matchedIndices 
)
private

Definition at line 1122 of file TemplatedSecondaryVertexProducer.cc.

1125  {
1126  for (size_t g = 0; g < groomedIndices.size(); ++g) {
1127  std::vector<int> subjetIndices;
1128 
1129  if (groomedIndices.at(g) >= 0) {
1130  for (size_t s = 0; s < groomedJets->at(groomedIndices.at(g)).numberOfDaughters(); ++s) {
1131  const edm::Ptr<reco::Candidate> &subjet = groomedJets->at(groomedIndices.at(g)).daughterPtr(s);
1132 
1133  for (size_t sj = 0; sj < subjets->size(); ++sj) {
1134  const edm::RefToBase<reco::Jet> &subjetRef = subjets->at(sj).jet();
1135  if (subjet == edm::Ptr<reco::Candidate>(subjetRef.id(), subjetRef.get(), subjetRef.key())) {
1136  subjetIndices.push_back(sj);
1137  break;
1138  }
1139  }
1140  }
1141 
1142  if (subjetIndices.empty())
1143  edm::LogError("SubjetMatchingFailed") << "Matching subjets to original fat jets failed. Please check that the "
1144  "groomed fat jet and subjet collections belong to each other.";
1145 
1146  matchedIndices.push_back(subjetIndices);
1147  } else
1148  matchedIndices.push_back(subjetIndices);
1149  }
1150 }

References g, edm::RefToBase< T >::get(), edm::RefToBase< T >::id(), edm::RefToBase< T >::key(), and alignCSCRings::s.

◆ produce()

template<class IPTI , class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 312 of file TemplatedSecondaryVertexProducer.cc.

312  {
313  // typedef std::map<TrackBaseRef, TransientTrack,
314  // RefToBaseLess<Track> > TransientTrackMap;
315  //How about good old pointers?
316  typedef std::map<const Track *, TransientTrack> TransientTrackMap;
317 
319  es.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
320 
322  event.getByToken(token_trackIPTagInfo, trackIPTagInfos);
323 
324  // External Sec Vertex collection (e.g. for IVF usage)
325  edm::Handle<edm::View<VTX> > extSecVertex;
326  if (useExternalSV)
327  event.getByToken(token_extSVCollection, extSecVertex);
328 
329  edm::Handle<edm::View<reco::Jet> > fatJetsHandle;
330  edm::Handle<edm::View<reco::Jet> > groomedFatJetsHandle;
331  if (useFatJets) {
332  event.getByToken(token_fatJets, fatJetsHandle);
333  if (useGroomedFatJets) {
334  event.getByToken(token_groomedFatJets, groomedFatJetsHandle);
335 
336  if (groomedFatJetsHandle->size() > fatJetsHandle->size())
337  edm::LogError("TooManyGroomedJets")
338  << "There are more groomed (" << groomedFatJetsHandle->size() << ") than original fat jets ("
339  << fatJetsHandle->size() << "). Please check that the two jet collections belong to each other.";
340  }
341  }
342  edm::Handle<edm::ValueMap<float> > weightsHandle;
344  event.getByToken(token_weights, weightsHandle);
345 
347  unsigned int bsCovSrc[7] = {
348  0,
349  };
350  double sigmaZ = 0.0, beamWidth = 0.0;
351  switch (constraint) {
353  event.getByToken(token_BeamSpot, beamSpot);
354  bsCovSrc[3] = bsCovSrc[4] = bsCovSrc[5] = bsCovSrc[6] = 1;
355  sigmaZ = beamSpot->sigmaZ();
356  beamWidth = beamSpot->BeamWidthX();
357  break;
358 
360  event.getByToken(token_BeamSpot, beamSpot);
361  bsCovSrc[0] = bsCovSrc[1] = 2;
362  bsCovSrc[3] = bsCovSrc[4] = bsCovSrc[5] = 1;
363  sigmaZ = beamSpot->sigmaZ();
364  break;
365 
367  bsCovSrc[0] = bsCovSrc[1] = bsCovSrc[2] = 2;
368  break;
369 
370  case CONSTRAINT_BEAMSPOT:
372  event.getByToken(token_BeamSpot, beamSpot);
373  break;
374 
375  default:
376  /* nothing */;
377  }
378 
379  // ------------------------------------ SV clustering START --------------------------------------------
380  std::vector<std::vector<int> > clusteredSVs(trackIPTagInfos->size(), std::vector<int>());
381  if (useExternalSV && useSVClustering && !trackIPTagInfos->empty()) {
382  // vector of constituents for reclustering jets and "ghost" SVs
383  std::vector<fastjet::PseudoJet> fjInputs;
384  // loop over all input jets and collect all their constituents
385  if (useFatJets) {
386  for (edm::View<reco::Jet>::const_iterator it = fatJetsHandle->begin(); it != fatJetsHandle->end(); ++it) {
387  std::vector<edm::Ptr<reco::Candidate> > constituents = it->getJetConstituents();
388  std::vector<edm::Ptr<reco::Candidate> >::const_iterator m;
389  for (m = constituents.begin(); m != constituents.end(); ++m) {
390  reco::CandidatePtr constit = *m;
391  if (constit->pt() == 0) {
392  edm::LogWarning("NullTransverseMomentum") << "dropping input candidate with pt=0";
393  continue;
394  }
395  if (it->isWeighted()) {
397  throw cms::Exception("MissingConstituentWeight")
398  << "TemplatedSecondaryVertexProducer: No weights (e.g. PUPPI) given for weighted jet collection"
399  << std::endl;
400  float w = (*weightsHandle)[constit];
401  fjInputs.push_back(
402  fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w));
403  } else {
404  fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy()));
405  }
406  }
407  }
408  } else {
409  for (typename std::vector<IPTI>::const_iterator it = trackIPTagInfos->begin(); it != trackIPTagInfos->end();
410  ++it) {
411  std::vector<edm::Ptr<reco::Candidate> > constituents = it->jet()->getJetConstituents();
412  std::vector<edm::Ptr<reco::Candidate> >::const_iterator m;
413  for (m = constituents.begin(); m != constituents.end(); ++m) {
414  reco::CandidatePtr constit = *m;
415  if (constit->pt() == 0) {
416  edm::LogWarning("NullTransverseMomentum") << "dropping input candidate with pt=0";
417  continue;
418  }
419  if (it->jet()->isWeighted()) {
421  throw cms::Exception("MissingConstituentWeight")
422  << "TemplatedSecondaryVertexProducer: No weights (e.g. PUPPI) given for weighted jet collection"
423  << std::endl;
424  float w = (*weightsHandle)[constit];
425  fjInputs.push_back(
426  fastjet::PseudoJet(constit->px() * w, constit->py() * w, constit->pz() * w, constit->energy() * w));
427  } else {
428  fjInputs.push_back(fastjet::PseudoJet(constit->px(), constit->py(), constit->pz(), constit->energy()));
429  }
430  }
431  }
432  }
433  // insert "ghost" SVs in the vector of constituents
434  for (typename edm::View<VTX>::const_iterator it = extSecVertex->begin(); it != extSecVertex->end(); ++it) {
435  const reco::Vertex &pv = *(trackIPTagInfos->front().primaryVertex());
437  dir = dir.unit();
438  fastjet::PseudoJet p(
439  dir.x(), dir.y(), dir.z(), dir.mag()); // using SV flight direction so treating SV as massless
440  if (useSVMomentum)
441  p = fastjet::PseudoJet(it->p4().px(), it->p4().py(), it->p4().pz(), it->p4().energy());
442  p *= ghostRescaling; // rescale SV direction/momentum
443  p.set_user_info(new VertexInfo(it - extSecVertex->begin()));
444  fjInputs.push_back(p);
445  }
446 
447  // define jet clustering sequence
448  fjClusterSeq = std::make_shared<fastjet::ClusterSequence>(fjInputs, *fjJetDefinition);
449  // recluster jet constituents and inserted "ghosts"
450  std::vector<fastjet::PseudoJet> inclusiveJets = fastjet::sorted_by_pt(fjClusterSeq->inclusive_jets(jetPtMin));
451 
452  if (useFatJets) {
453  if (inclusiveJets.size() < fatJetsHandle->size())
454  edm::LogError("TooFewReclusteredJets")
455  << "There are fewer reclustered (" << inclusiveJets.size() << ") than original fat jets ("
456  << fatJetsHandle->size()
457  << "). Please check that the jet algorithm and jet size match those used for the original jet collection.";
458 
459  // match reclustered and original fat jets
460  std::vector<int> reclusteredIndices;
461  matchReclusteredJets<edm::View<reco::Jet> >(fatJetsHandle, inclusiveJets, reclusteredIndices, "fat");
462 
463  // match groomed and original fat jets
464  std::vector<int> groomedIndices;
465  if (useGroomedFatJets)
466  matchGroomedJets(fatJetsHandle, groomedFatJetsHandle, groomedIndices);
467 
468  // match subjets and original fat jets
469  std::vector<std::vector<int> > subjetIndices;
470  if (useGroomedFatJets)
471  matchSubjets(groomedIndices, groomedFatJetsHandle, trackIPTagInfos, subjetIndices);
472  else
473  matchSubjets(fatJetsHandle, trackIPTagInfos, subjetIndices);
474 
475  // collect clustered SVs
476  for (size_t i = 0; i < fatJetsHandle->size(); ++i) {
477  if (reclusteredIndices.at(i) < 0)
478  continue; // continue if matching reclustered to original jets failed
479 
480  if (fatJetsHandle->at(i).pt() == 0) // continue if the original jet has Pt=0
481  {
482  edm::LogWarning("NullTransverseMomentum")
483  << "The original fat jet " << i << " has Pt=0. This is not expected so the jet will be skipped.";
484  continue;
485  }
486 
487  if (subjetIndices.at(i).empty())
488  continue; // continue if the original jet does not have subjets assigned
489 
490  // since the "ghosts" are extremely soft, the configuration and ordering of the reclustered and original fat jets should in principle stay the same
491  if ((std::abs(inclusiveJets.at(reclusteredIndices.at(i)).pt() - fatJetsHandle->at(i).pt()) /
492  fatJetsHandle->at(i).pt()) > relPtTolerance) {
493  if (fatJetsHandle->at(i).pt() < 10.) // special handling for low-Pt jets (Pt<10 GeV)
494  edm::LogWarning("JetPtMismatchAtLowPt")
495  << "The reclustered and original fat jet " << i << " have different Pt's ("
496  << inclusiveJets.at(reclusteredIndices.at(i)).pt() << " vs " << fatJetsHandle->at(i).pt()
497  << " GeV, respectively).\n"
498  << "Please check that the jet algorithm and jet size match those used for the original fat jet "
499  "collection and also make sure the original fat jets are uncorrected. In addition, make sure you "
500  "are not using CaloJets which are presently not supported.\n"
501  << "Since the mismatch is at low Pt, it is ignored and only a warning is issued.\n"
502  << "\nIn extremely rare instances the mismatch could be caused by a difference in the machine "
503  "precision in which case make sure the original jet collection is produced and reclustering is "
504  "performed in the same job.";
505  else
506  edm::LogError("JetPtMismatch")
507  << "The reclustered and original fat jet " << i << " have different Pt's ("
508  << inclusiveJets.at(reclusteredIndices.at(i)).pt() << " vs " << fatJetsHandle->at(i).pt()
509  << " GeV, respectively).\n"
510  << "Please check that the jet algorithm and jet size match those used for the original fat jet "
511  "collection and also make sure the original fat jets are uncorrected. In addition, make sure you "
512  "are not using CaloJets which are presently not supported.\n"
513  << "\nIn extremely rare instances the mismatch could be caused by a difference in the machine "
514  "precision in which case make sure the original jet collection is produced and reclustering is "
515  "performed in the same job.";
516  }
517 
518  // get jet constituents
519  std::vector<fastjet::PseudoJet> constituents = inclusiveJets.at(reclusteredIndices.at(i)).constituents();
520 
521  std::vector<int> svIndices;
522  // loop over jet constituents and try to find "ghosts"
523  for (std::vector<fastjet::PseudoJet>::const_iterator it = constituents.begin(); it != constituents.end();
524  ++it) {
525  if (!it->has_user_info())
526  continue; // skip if not a "ghost"
527 
528  svIndices.push_back(it->user_info<VertexInfo>().vertexIndex());
529  }
530 
531  // loop over clustered SVs and assign them to different subjets based on smallest dR
532  for (size_t sv = 0; sv < svIndices.size(); ++sv) {
533  const reco::Vertex &pv = *(trackIPTagInfos->front().primaryVertex());
534  const VTX &extSV = (*extSecVertex)[svIndices.at(sv)];
536  dir = dir.unit();
537  fastjet::PseudoJet p(
538  dir.x(), dir.y(), dir.z(), dir.mag()); // using SV flight direction so treating SV as massless
539  if (useSVMomentum)
540  p = fastjet::PseudoJet(extSV.p4().px(), extSV.p4().py(), extSV.p4().pz(), extSV.p4().energy());
541 
542  std::vector<double> dR2toSubjets;
543 
544  for (size_t sj = 0; sj < subjetIndices.at(i).size(); ++sj)
545  dR2toSubjets.push_back(Geom::deltaR2(p.rapidity(),
546  p.phi_std(),
547  trackIPTagInfos->at(subjetIndices.at(i).at(sj)).jet()->rapidity(),
548  trackIPTagInfos->at(subjetIndices.at(i).at(sj)).jet()->phi()));
549 
550  // find the closest subjet
551  int closestSubjetIdx =
552  std::distance(dR2toSubjets.begin(), std::min_element(dR2toSubjets.begin(), dR2toSubjets.end()));
553 
554  clusteredSVs.at(subjetIndices.at(i).at(closestSubjetIdx)).push_back(svIndices.at(sv));
555  }
556  }
557  } else {
558  if (inclusiveJets.size() < trackIPTagInfos->size())
559  edm::LogError("TooFewReclusteredJets")
560  << "There are fewer reclustered (" << inclusiveJets.size() << ") than original jets ("
561  << trackIPTagInfos->size()
562  << "). Please check that the jet algorithm and jet size match those used for the original jet collection.";
563 
564  // match reclustered and original jets
565  std::vector<int> reclusteredIndices;
566  matchReclusteredJets<std::vector<IPTI> >(trackIPTagInfos, inclusiveJets, reclusteredIndices);
567 
568  // collect clustered SVs
569  for (size_t i = 0; i < trackIPTagInfos->size(); ++i) {
570  if (reclusteredIndices.at(i) < 0)
571  continue; // continue if matching reclustered to original jets failed
572 
573  if (trackIPTagInfos->at(i).jet()->pt() == 0) // continue if the original jet has Pt=0
574  {
575  edm::LogWarning("NullTransverseMomentum")
576  << "The original jet " << i << " has Pt=0. This is not expected so the jet will be skipped.";
577  continue;
578  }
579 
580  // since the "ghosts" are extremely soft, the configuration and ordering of the reclustered and original jets should in principle stay the same
581  if ((std::abs(inclusiveJets.at(reclusteredIndices.at(i)).pt() - trackIPTagInfos->at(i).jet()->pt()) /
582  trackIPTagInfos->at(i).jet()->pt()) > relPtTolerance) {
583  if (trackIPTagInfos->at(i).jet()->pt() < 10.) // special handling for low-Pt jets (Pt<10 GeV)
584  edm::LogWarning("JetPtMismatchAtLowPt")
585  << "The reclustered and original jet " << i << " have different Pt's ("
586  << inclusiveJets.at(reclusteredIndices.at(i)).pt() << " vs " << trackIPTagInfos->at(i).jet()->pt()
587  << " GeV, respectively).\n"
588  << "Please check that the jet algorithm and jet size match those used for the original jet collection "
589  "and also make sure the original jets are uncorrected. In addition, make sure you are not using "
590  "CaloJets which are presently not supported.\n"
591  << "Since the mismatch is at low Pt, it is ignored and only a warning is issued.\n"
592  << "\nIn extremely rare instances the mismatch could be caused by a difference in the machine "
593  "precision in which case make sure the original jet collection is produced and reclustering is "
594  "performed in the same job.";
595  else
596  edm::LogError("JetPtMismatch")
597  << "The reclustered and original jet " << i << " have different Pt's ("
598  << inclusiveJets.at(reclusteredIndices.at(i)).pt() << " vs " << trackIPTagInfos->at(i).jet()->pt()
599  << " GeV, respectively).\n"
600  << "Please check that the jet algorithm and jet size match those used for the original jet collection "
601  "and also make sure the original jets are uncorrected. In addition, make sure you are not using "
602  "CaloJets which are presently not supported.\n"
603  << "\nIn extremely rare instances the mismatch could be caused by a difference in the machine "
604  "precision in which case make sure the original jet collection is produced and reclustering is "
605  "performed in the same job.";
606  }
607 
608  // get jet constituents
609  std::vector<fastjet::PseudoJet> constituents = inclusiveJets.at(reclusteredIndices.at(i)).constituents();
610 
611  // loop over jet constituents and try to find "ghosts"
612  for (std::vector<fastjet::PseudoJet>::const_iterator it = constituents.begin(); it != constituents.end();
613  ++it) {
614  if (!it->has_user_info())
615  continue; // skip if not a "ghost"
616  // push back clustered SV indices
617  clusteredSVs.at(i).push_back(it->user_info<VertexInfo>().vertexIndex());
618  }
619  }
620  }
621  }
622  // case where fat jets are used to associate SVs to subjets but no SV clustering is performed
623  else if (useExternalSV && !useSVClustering && !trackIPTagInfos->empty() && useFatJets) {
624  // match groomed and original fat jets
625  std::vector<int> groomedIndices;
626  if (useGroomedFatJets)
627  matchGroomedJets(fatJetsHandle, groomedFatJetsHandle, groomedIndices);
628 
629  // match subjets and original fat jets
630  std::vector<std::vector<int> > subjetIndices;
631  if (useGroomedFatJets)
632  matchSubjets(groomedIndices, groomedFatJetsHandle, trackIPTagInfos, subjetIndices);
633  else
634  matchSubjets(fatJetsHandle, trackIPTagInfos, subjetIndices);
635 
636  // loop over fat jets
637  for (size_t i = 0; i < fatJetsHandle->size(); ++i) {
638  if (fatJetsHandle->at(i).pt() == 0) // continue if the original jet has Pt=0
639  {
640  edm::LogWarning("NullTransverseMomentum")
641  << "The original fat jet " << i << " has Pt=0. This is not expected so the jet will be skipped.";
642  continue;
643  }
644 
645  if (subjetIndices.at(i).empty())
646  continue; // continue if the original jet does not have subjets assigned
647 
648  // loop over SVs, associate them to fat jets based on dR cone and
649  // then assign them to the closets subjet in dR
650  for (typename edm::View<VTX>::const_iterator it = extSecVertex->begin(); it != extSecVertex->end(); ++it) {
651  size_t sv = (it - extSecVertex->begin());
652 
653  const reco::Vertex &pv = *(trackIPTagInfos->front().primaryVertex());
654  const VTX &extSV = (*extSecVertex)[sv];
656  GlobalVector jetDir(fatJetsHandle->at(i).px(), fatJetsHandle->at(i).py(), fatJetsHandle->at(i).pz());
657  // skip SVs outside the dR cone
658  if (Geom::deltaR2(dir, jetDir) > rParam * rParam) // here using the jet clustering rParam as a dR cut
659  continue;
660 
661  dir = dir.unit();
662  fastjet::PseudoJet p(
663  dir.x(), dir.y(), dir.z(), dir.mag()); // using SV flight direction so treating SV as massless
664  if (useSVMomentum)
665  p = fastjet::PseudoJet(extSV.p4().px(), extSV.p4().py(), extSV.p4().pz(), extSV.p4().energy());
666 
667  std::vector<double> dR2toSubjets;
668 
669  for (size_t sj = 0; sj < subjetIndices.at(i).size(); ++sj)
670  dR2toSubjets.push_back(Geom::deltaR2(p.rapidity(),
671  p.phi_std(),
672  trackIPTagInfos->at(subjetIndices.at(i).at(sj)).jet()->rapidity(),
673  trackIPTagInfos->at(subjetIndices.at(i).at(sj)).jet()->phi()));
674 
675  // find the closest subjet
676  int closestSubjetIdx =
677  std::distance(dR2toSubjets.begin(), std::min_element(dR2toSubjets.begin(), dR2toSubjets.end()));
678 
679  clusteredSVs.at(subjetIndices.at(i).at(closestSubjetIdx)).push_back(sv);
680  }
681  }
682  }
683  // ------------------------------------ SV clustering END ----------------------------------------------
684 
685  std::unique_ptr<ConfigurableVertexReconstructor> vertexReco;
686  std::unique_ptr<GhostTrackVertexFinder> vertexRecoGT;
687  if (useGhostTrack)
688  vertexRecoGT.reset(
689  new GhostTrackVertexFinder(vtxRecoPSet.getParameter<double>("maxFitChi2"),
690  vtxRecoPSet.getParameter<double>("mergeThreshold"),
691  vtxRecoPSet.getParameter<double>("primcut"),
692  vtxRecoPSet.getParameter<double>("seccut"),
694  else
696 
697  TransientTrackMap primariesMap;
698 
699  // result secondary vertices
700 
701  auto tagInfos = std::make_unique<Product>();
702 
703  for (typename std::vector<IPTI>::const_iterator iterJets = trackIPTagInfos->begin();
704  iterJets != trackIPTagInfos->end();
705  ++iterJets) {
706  TrackDataVector trackData;
707  // std::cout << "Jet " << iterJets-trackIPTagInfos->begin() << std::endl;
708 
709  const Vertex &pv = *iterJets->primaryVertex();
710 
711  std::set<TransientTrack> primaries;
713  for (Vertex::trackRef_iterator iter = pv.tracks_begin(); iter != pv.tracks_end(); ++iter) {
714  TransientTrackMap::iterator pos = primariesMap.lower_bound(iter->get());
715 
716  if (pos != primariesMap.end() && pos->first == iter->get())
717  primaries.insert(pos->second);
718  else {
719  TransientTrack track = trackBuilder->build(iter->castTo<TrackRef>());
720  primariesMap.insert(pos, std::make_pair(iter->get(), track));
721  primaries.insert(track);
722  }
723  }
724  }
725 
726  edm::RefToBase<Jet> jetRef = iterJets->jet();
727 
728  GlobalVector jetDir(jetRef->momentum().x(), jetRef->momentum().y(), jetRef->momentum().z());
729 
730  std::vector<std::size_t> indices = iterJets->sortedIndexes(sortCriterium);
731 
732  input_container trackRefs = iterJets->sortedTracks(indices);
733 
734  const std::vector<reco::btag::TrackIPData> &ipData = iterJets->impactParameterData();
735 
736  // build transient tracks used for vertex reconstruction
737 
738  std::vector<TransientTrack> fitTracks;
739  std::vector<GhostTrackState> gtStates;
740  std::unique_ptr<GhostTrackPrediction> gtPred;
741  if (useGhostTrack)
742  gtPred.reset(new GhostTrackPrediction(*iterJets->ghostTrack()));
743 
744  for (unsigned int i = 0; i < indices.size(); i++) {
746 
747  const input_item &trackRef = trackRefs[i];
748 
749  trackData.push_back(IndexedTrackData());
750  trackData.back().first = indices[i];
751 
752  // select tracks for SV finder
753 
754  if (!trackSelector(
755  *reco::btag::toTrack(trackRef), ipData[indices[i]], *jetRef, RecoVertex::convertPos(pv.position()))) {
757  continue;
758  }
759 
760  TransientTrackMap::const_iterator pos = primariesMap.find(reco::btag::toTrack((trackRef)));
761  TransientTrack fitTrack;
762  if (pos != primariesMap.end()) {
763  primaries.erase(pos->second);
764  fitTrack = pos->second;
765  } else
766  fitTrack = trackBuilder->build(trackRef);
767  fitTracks.push_back(fitTrack);
768 
770 
771  if (useGhostTrack) {
772  GhostTrackState gtState(fitTrack);
773  GlobalPoint pos = ipData[indices[i]].closestToGhostTrack;
774  gtState.linearize(*gtPred, true, gtPred->lambda(pos));
775  gtState.setWeight(ipData[indices[i]].ghostTrackWeight);
776  gtStates.push_back(gtState);
777  }
778  }
779 
780  std::unique_ptr<GhostTrack> ghostTrack;
781  if (useGhostTrack)
782  ghostTrack.reset(new GhostTrack(
784  RecoVertex::convertPos(pv.position()),
785  RecoVertex::convertError(pv.error()),
786  GlobalVector(iterJets->ghostTrack()->px(), iterJets->ghostTrack()->py(), iterJets->ghostTrack()->pz()),
787  0.05),
788  *gtPred,
789  gtStates,
790  iterJets->ghostTrack()->chi2(),
791  iterJets->ghostTrack()->ndof()));
792 
793  // perform actual vertex finding
794 
795  std::vector<VTX> extAssoCollection;
796  std::vector<TransientVertex> fittedSVs;
797  std::vector<SecondaryVertex> SVs;
798  if (!useExternalSV) {
799  switch (constraint) {
800  case CONSTRAINT_NONE:
801  if (useGhostTrack)
802  fittedSVs = vertexRecoGT->vertices(pv, *ghostTrack);
803  else
804  fittedSVs = vertexReco->vertices(fitTracks);
805  break;
806 
807  case CONSTRAINT_BEAMSPOT:
808  if (useGhostTrack)
809  fittedSVs = vertexRecoGT->vertices(pv, *beamSpot, *ghostTrack);
810  else
811  fittedSVs = vertexReco->vertices(fitTracks, *beamSpot);
812  break;
813 
818  for (unsigned int i = 0; i < 7; i++) {
819  unsigned int covSrc = bsCovSrc[i];
820  for (unsigned int j = 0; j < 7; j++) {
821  double v = 0.0;
822  if (!covSrc || bsCovSrc[j] != covSrc)
823  v = 0.0;
824  else if (covSrc == 1)
825  v = beamSpot->covariance(i, j);
826  else if (j < 3 && i < 3)
827  v = pv.covariance(i, j) * constraintScaling;
828  cov(i, j) = v;
829  }
830  }
831 
832  BeamSpot bs(pv.position(),
833  sigmaZ,
834  beamSpot.isValid() ? beamSpot->dxdz() : 0.,
835  beamSpot.isValid() ? beamSpot->dydz() : 0.,
836  beamWidth,
837  cov,
839 
840  if (useGhostTrack)
841  fittedSVs = vertexRecoGT->vertices(pv, bs, *ghostTrack);
842  else
843  fittedSVs = vertexReco->vertices(fitTracks, bs);
844  } break;
845 
847  std::vector<TransientTrack> primaries_(primaries.begin(), primaries.end());
848  if (useGhostTrack)
849  fittedSVs = vertexRecoGT->vertices(pv, *beamSpot, primaries_, *ghostTrack);
850  else
851  fittedSVs = vertexReco->vertices(primaries_, fitTracks, *beamSpot);
852  } break;
853  }
854  // build combined SV information and filter
855  SVBuilder svBuilder(pv, jetDir, withPVError, minTrackWeight);
856  std::remove_copy_if(boost::make_transform_iterator(fittedSVs.begin(), svBuilder),
857  boost::make_transform_iterator(fittedSVs.end(), svBuilder),
858  std::back_inserter(SVs),
859  SVFilter(vertexFilter, pv, jetDir));
860 
861  } else {
862  if (useSVClustering || useFatJets) {
863  size_t jetIdx = (iterJets - trackIPTagInfos->begin());
864 
865  for (size_t iExtSv = 0; iExtSv < clusteredSVs.at(jetIdx).size(); iExtSv++) {
866  const VTX &extVertex = (*extSecVertex)[clusteredSVs.at(jetIdx).at(iExtSv)];
867  if (extVertex.p4().M() < 0.3)
868  continue;
869  extAssoCollection.push_back(extVertex);
870  }
871  } else {
872  for (size_t iExtSv = 0; iExtSv < extSecVertex->size(); iExtSv++) {
873  const VTX &extVertex = (*extSecVertex)[iExtSv];
874  if (Geom::deltaR2((position(extVertex) - pv.position()), (extSVDeltaRToJet > 0) ? jetDir : -jetDir) >
876  extVertex.p4().M() < 0.3)
877  continue;
878  extAssoCollection.push_back(extVertex);
879  }
880  }
881  // build combined SV information and filter
882  SVBuilder svBuilder(pv, jetDir, withPVError, minTrackWeight);
883  std::remove_copy_if(boost::make_transform_iterator(extAssoCollection.begin(), svBuilder),
884  boost::make_transform_iterator(extAssoCollection.end(), svBuilder),
885  std::back_inserter(SVs),
886  SVFilter(vertexFilter, pv, jetDir));
887  }
888  // clean up now unneeded collections
889  gtPred.reset();
890  ghostTrack.reset();
891  gtStates.clear();
892  fitTracks.clear();
893  fittedSVs.clear();
894  extAssoCollection.clear();
895 
896  // sort SVs by importance
897 
898  std::vector<unsigned int> vtxIndices = vertexSorting(SVs);
899 
900  std::vector<typename TemplatedSecondaryVertexTagInfo<IPTI, VTX>::VertexData> svData;
901 
902  svData.resize(vtxIndices.size());
903  for (unsigned int idx = 0; idx < vtxIndices.size(); idx++) {
904  const SecondaryVertex &sv = SVs[vtxIndices[idx]];
905 
906  svData[idx].vertex = sv;
907  svData[idx].dist1d = sv.dist1d();
908  svData[idx].dist2d = sv.dist2d();
909  svData[idx].dist3d = sv.dist3d();
910  svData[idx].direction = flightDirection(pv, sv);
911  // mark tracks successfully used in vertex fit
912  markUsedTracks(trackData, trackRefs, sv, idx);
913  }
914 
915  // fill result into tag infos
916 
918  trackData,
919  svData,
920  SVs.size(),
922  }
923 
924  event.put(std::move(tagInfos));
925 }

References funct::abs(), pwdgSkimBPark_cfi::beamSpot, cms::cuda::bs, TransientTrackBuilder::build(), HLT_2018_cff::constraint, RecoVertex::convertError(), RecoVertex::convertPos(), HLTMuonOfflineAnalyzer_cfi::deltaR2, DeadROC_duringRun::dir, HLT_2018_cff::distance, reco::Candidate::energy(), HLT_2018_cff::extSVDeltaRToJet, flightDirection(), edm::EventSetup::get(), get, getGhostTrackFitType(), AK4PFJetsMCFlavourInfos_cfi::ghostRescaling, mps_fire::i, charmTagsComputerCvsB_cfi::idx, bTagCombinedSVVariables_cff::indices, dqmiolumiharvest::j, metsig::jet, electrons_cff::jetIdx, pdwgLeptonRecoSkim_cfi::jetPtMin, reco::GhostTrackState::linearize(), visualization-live-secondInstance_cfg::m, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, position(), DiDispStaMuonMonitor_cfi::pt, reco::Candidate::pt(), MetAnalyzer::pv(), reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), HLT_2018_cff::rParam, reco::GhostTrackState::setWeight(), fftjetvertexadder_cfi::sigmaZ, HLT_2018_cff::sortCriterium, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, HLT_2018_cff::tagInfos, reco::btag::toTrack(), HLT_2018_cff::track, HLT_2018_cff::trackIPTagInfos, MinBiasPDSkim_cfg::trackSelector, reco::Unknown, HLT_2018_cff::useExternalSV, findQualityFiles::v, bVertexFilter_cfi::vertexFilter, HLT_2018_cff::vertexReco, and w.

◆ toJet() [1/2]

template<class IPTI, class VTX>
const reco::Jet* TemplatedSecondaryVertexProducer< IPTI, VTX >::toJet ( const IPTI &  j)
inlineprivate

Definition at line 131 of file TemplatedSecondaryVertexProducer.cc.

131 { return &(*(j.jet())); }

References dqmiolumiharvest::j.

◆ toJet() [2/2]

template<class IPTI, class VTX>
const reco::Jet* TemplatedSecondaryVertexProducer< IPTI, VTX >::toJet ( const reco::Jet j)
inlineprivate

Member Data Documentation

◆ constraint

template<class IPTI, class VTX>
ConstraintType TemplatedSecondaryVertexProducer< IPTI, VTX >::constraint
private

◆ constraintScaling

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::constraintScaling
private

◆ extSVDeltaRToJet

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::extSVDeltaRToJet
private

◆ fjClusterSeq

template<class IPTI, class VTX>
ClusterSequencePtr TemplatedSecondaryVertexProducer< IPTI, VTX >::fjClusterSeq
private

Definition at line 171 of file TemplatedSecondaryVertexProducer.cc.

◆ fjJetDefinition

template<class IPTI, class VTX>
JetDefPtr TemplatedSecondaryVertexProducer< IPTI, VTX >::fjJetDefinition
private

◆ ghostRescaling

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::ghostRescaling
private

◆ jetAlgorithm

template<class IPTI, class VTX>
std::string TemplatedSecondaryVertexProducer< IPTI, VTX >::jetAlgorithm
private

◆ jetPtMin

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::jetPtMin
private

◆ minTrackWeight

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::minTrackWeight
private

◆ relPtTolerance

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::relPtTolerance
private

◆ rParam

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam
private

◆ sortCriterium

template<class IPTI, class VTX>
reco::btag::SortCriteria TemplatedSecondaryVertexProducer< IPTI, VTX >::sortCriterium
private

Definition at line 145 of file TemplatedSecondaryVertexProducer.cc.

◆ token_BeamSpot

template<class IPTI, class VTX>
edm::EDGetTokenT<reco::BeamSpot> TemplatedSecondaryVertexProducer< IPTI, VTX >::token_BeamSpot
private

◆ token_extSVCollection

template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<VTX> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_extSVCollection
private

◆ token_fatJets

template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<reco::Jet> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_fatJets
private

◆ token_groomedFatJets

template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<reco::Jet> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_groomedFatJets
private

◆ token_trackIPTagInfo

template<class IPTI, class VTX>
edm::EDGetTokenT<std::vector<IPTI> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_trackIPTagInfo
private

◆ token_weights

template<class IPTI, class VTX>
edm::EDGetTokenT<edm::ValueMap<float> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_weights
private

◆ trackSelector

template<class IPTI, class VTX>
TrackSelector TemplatedSecondaryVertexProducer< IPTI, VTX >::trackSelector
private

Definition at line 146 of file TemplatedSecondaryVertexProducer.cc.

◆ useExternalSV

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useExternalSV
private

◆ useFatJets

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useFatJets
private

◆ useGhostTrack

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useGhostTrack
private

Definition at line 150 of file TemplatedSecondaryVertexProducer.cc.

◆ useGroomedFatJets

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useGroomedFatJets
private

◆ useSVClustering

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVClustering
private

◆ useSVMomentum

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVMomentum
private

◆ vertexFilter

template<class IPTI, class VTX>
VertexFilter TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexFilter
private

Definition at line 153 of file TemplatedSecondaryVertexProducer.cc.

◆ vertexSorting

template<class IPTI, class VTX>
VertexSorting<SecondaryVertex> TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexSorting
private

Definition at line 154 of file TemplatedSecondaryVertexProducer.cc.

◆ vtxRecoPSet

template<class IPTI, class VTX>
edm::ParameterSet TemplatedSecondaryVertexProducer< IPTI, VTX >::vtxRecoPSet
private

Definition at line 149 of file TemplatedSecondaryVertexProducer.cc.

◆ withPVError

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::withPVError
private
Vector3DBase
Definition: Vector3DBase.h:8
reco::Candidate::energy
virtual double energy() const =0
energy
bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
TemplatedSecondaryVertexProducer::useFatJets
bool useFatJets
Definition: TemplatedSecondaryVertexProducer.cc:165
HLT_2018_cff.trackSelection
trackSelection
Definition: HLT_2018_cff.py:5407
TemplatedSecondaryVertexProducer::token_weights
edm::EDGetTokenT< edm::ValueMap< float > > token_weights
Definition: TemplatedSecondaryVertexProducer.cc:169
HLT_2018_cff.tagInfos
tagInfos
Definition: HLT_2018_cff.py:51519
flightDirection
GlobalVector flightDirection(const reco::Vertex &pv, const reco::Vertex &sv)
Definition: TemplatedSecondaryVertexProducer.cc:91
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
TemplatedSecondaryVertexProducer::constraintScaling
double constraintScaling
Definition: TemplatedSecondaryVertexProducer.cc:148
TemplatedSecondaryVertexProducer::minTrackWeight
double minTrackWeight
Definition: TemplatedSecondaryVertexProducer.cc:152
TemplatedSecondaryVertexProducer::vertexFilter
VertexFilter vertexFilter
Definition: TemplatedSecondaryVertexProducer.cc:153
TemplatedSecondaryVertexProducer::useExternalSV
bool useExternalSV
Definition: TemplatedSecondaryVertexProducer.cc:155
edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
pat::Jet::subjets
pat::JetPtrCollection const & subjets(unsigned int index=0) const
Access to subjet list.
HiggsMonitoring_cfi.vertexSelection
vertexSelection
Definition: HiggsMonitoring_cfi.py:107
TemplatedSecondaryVertexProducer::toJet
const reco::Jet * toJet(const reco::Jet &j)
Definition: TemplatedSecondaryVertexProducer.cc:130
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
TemplatedSecondaryVertexProducer::markUsedTracks
void markUsedTracks(TrackDataVector &trackData, const input_container &trackRefs, const SecondaryVertex &sv, size_t idx)
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
reco::btag::toTrack
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
TemplatedSecondaryVertexProducer::trackSelector
TrackSelector trackSelector
Definition: TemplatedSecondaryVertexProducer.cc:146
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
reco::TemplatedSecondaryVertexTagInfo
Definition: TemplatedSecondaryVertexTagInfo.h:47
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::Candidate::pt
virtual double pt() const =0
transverse momentum
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
reco::Unknown
Definition: MuonSimInfo.h:32
TemplatedSecondaryVertexProducer::useGroomedFatJets
bool useGroomedFatJets
Definition: TemplatedSecondaryVertexProducer.cc:166
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
position
const math::XYZPoint & position(const reco::Vertex &sv)
Definition: TemplatedSecondaryVertexProducer.cc:97
findQualityFiles.v
v
Definition: findQualityFiles.py:179
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
btagGenBb_cfi.Status
Status
Definition: btagGenBb_cfi.py:4
TemplatedSecondaryVertexProducer::token_groomedFatJets
edm::EDGetTokenT< edm::View< reco::Jet > > token_groomedFatJets
Definition: TemplatedSecondaryVertexProducer.cc:168
edm::Handle
Definition: AssociativeIterator.h:50
TemplatedSecondaryVertexProducer::token_BeamSpot
edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
Definition: TemplatedSecondaryVertexProducer.cc:143
TemplatedSecondaryVertexProducer::getConstraintType
static ConstraintType getConstraintType(const std::string &name)
Definition: TemplatedSecondaryVertexProducer.cc:205
edm::Ref< TrackCollection >
reco::GhostTrackState
Definition: GhostTrackState.h:21
HLT_2018_cff.vertexReco
vertexReco
Definition: HLT_2018_cff.py:50395
TemplatedSecondaryVertexProducer::extSVDeltaRToJet
double extSVDeltaRToJet
Definition: TemplatedSecondaryVertexProducer.cc:156
reco::btag::IndexedTrackData
std::pair< unsigned int, TrackData > IndexedTrackData
Definition: TemplatedSecondaryVertexTagInfo.h:43
TemplatedSecondaryVertexProducer::input_item
IPTI::input_container::value_type input_item
Definition: TemplatedSecondaryVertexProducer.cc:109
TemplatedSecondaryVertexProducer::matchSubjets
void matchSubjets(const std::vector< int > &groomedIndices, const edm::Handle< edm::View< reco::Jet > > &groomedJets, const edm::Handle< std::vector< IPTI > > &subjets, std::vector< std::vector< int > > &matchedIndices)
Definition: TemplatedSecondaryVertexProducer.cc:1122
TemplatedSecondaryVertexProducer::vtxRecoPSet
edm::ParameterSet vtxRecoPSet
Definition: TemplatedSecondaryVertexProducer.cc:149
reco::Candidate::pz
virtual double pz() const =0
z coordinate of momentum vector
alignCSCRings.s
s
Definition: alignCSCRings.py:92
cms::cuda::bs
bs
Definition: HistoContainer.h:127
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TemplatedSecondaryVertexProducer::sortCriterium
reco::btag::SortCriteria sortCriterium
Definition: TemplatedSecondaryVertexProducer.cc:145
w
const double w
Definition: UKUtility.cc:23
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
TemplatedSecondaryVertexProducer::CONSTRAINT_BEAMSPOT
Definition: TemplatedSecondaryVertexProducer.cc:135
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
reco::BeamSpot
Definition: BeamSpot.h:21
TransientTrackRecord
Definition: TransientTrackRecord.h:11
TemplatedSecondaryVertexProducer::token_trackIPTagInfo
edm::EDGetTokenT< std::vector< IPTI > > token_trackIPTagInfo
Definition: TemplatedSecondaryVertexProducer.cc:144
edm::ESHandle< TransientTrackBuilder >
TemplatedSecondaryVertexProducer::useSVMomentum
bool useSVMomentum
Definition: TemplatedSecondaryVertexProducer.cc:159
TemplatedSecondaryVertexProducer::CONSTRAINT_PV_ERROR_SCALED
Definition: TemplatedSecondaryVertexProducer.cc:138
reco::TemplatedSecondaryVertexTagInfo::IndexedTrackData
reco::btag::IndexedTrackData IndexedTrackData
Definition: TemplatedSecondaryVertexTagInfo.h:50
Point3DBase< float, GlobalTag >
TemplatedSecondaryVertexProducer::rParam
double rParam
Definition: TemplatedSecondaryVertexProducer.cc:161
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
HLT_2018_cff.srcWeights
srcWeights
Definition: HLT_2018_cff.py:7335
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TemplatedSecondaryVertexProducer::fjClusterSeq
ClusterSequencePtr fjClusterSeq
Definition: TemplatedSecondaryVertexProducer.cc:171
edm::LogWarning
Definition: MessageLogger.h:141
reco::Candidate::py
virtual double py() const =0
y coordinate of momentum vector
pat::PATObject::originalObjectRef
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
Definition: PATObject.h:542
HLT_2018_cff.vertexCuts
vertexCuts
Definition: HLT_2018_cff.py:50468
pat::Jet::subjetCollectionNames
std::vector< std::string > const & subjetCollectionNames() const
Subjet collection names.
Definition: Jet.h:566
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
TemplatedSecondaryVertexProducer::ghostRescaling
double ghostRescaling
Definition: TemplatedSecondaryVertexProducer.cc:163
edm::ParameterSet
Definition: ParameterSet.h:36
electrons_cff.jetIdx
jetIdx
Definition: electrons_cff.py:356
edm::LogError
Definition: MessageLogger.h:183
TemplatedSecondaryVertexProducer::useGhostTrack
bool useGhostTrack
Definition: TemplatedSecondaryVertexProducer.cc:150
RecoVertex::convertError
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
TemplatedSecondaryVertexProducer::constraint
ConstraintType constraint
Definition: TemplatedSecondaryVertexProducer.cc:147
TemplatedSecondaryVertexProducer::input_container
IPTI::input_container input_container
Definition: TemplatedSecondaryVertexProducer.cc:108
TemplatedSecondaryVertexProducer::vertexSorting
VertexSorting< SecondaryVertex > vertexSorting
Definition: TemplatedSecondaryVertexProducer.cc:154
TemplatedSecondaryVertexProducer::CONSTRAINT_PV_BEAMSPOT_SIZE
Definition: TemplatedSecondaryVertexProducer.cc:136
TemplatedSecondaryVertexProducer::withPVError
bool withPVError
Definition: TemplatedSecondaryVertexProducer.cc:151
reco::GhostTrack
Definition: GhostTrack.h:16
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
TemplatedSecondaryVertexProducer::useSVClustering
bool useSVClustering
Definition: TemplatedSecondaryVertexProducer.cc:158
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
TemplatedSecondaryVertexProducer::jetAlgorithm
std::string jetAlgorithm
Definition: TemplatedSecondaryVertexProducer.cc:160
TemplatedSecondaryVertexProducer::relPtTolerance
double relPtTolerance
Definition: TemplatedSecondaryVertexProducer.cc:164
get
#define get
edm::Ptr< reco::Candidate >
edm::RefToBase::id
ProductID id() const
Definition: RefToBase.h:214
HLT_2018_cff.v0Filter
v0Filter
Definition: HLT_2018_cff.py:50476
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TemplatedSecondaryVertexProducer::CONSTRAINT_PV_BS_Z_ERRORS_SCALED
Definition: TemplatedSecondaryVertexProducer.cc:137
TemplatedSecondaryVertexProducer::matchGroomedJets
void matchGroomedJets(const edm::Handle< edm::View< reco::Jet > > &jets, const edm::Handle< edm::View< reco::Jet > > &matchedJets, std::vector< int > &matchedIndices)
Definition: TemplatedSecondaryVertexProducer.cc:1073
type
type
Definition: HCALResponse.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLT_2018_cff.jetType
jetType
Definition: HLT_2018_cff.py:7318
reco::TransientTrack
Definition: TransientTrack.h:19
reco::GhostTrackVertexFinder
Definition: GhostTrackVertexFinder.h:29
TemplatedSecondaryVertexProducer::TrackDataVector
std::vector< reco::btag::IndexedTrackData > TrackDataVector
Definition: TemplatedSecondaryVertexProducer.cc:110
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition: HLTMuonOfflineAnalyzer_cfi.py:105
reco::Candidate::px
virtual double px() const =0
x coordinate of momentum vector
TemplatedSecondaryVertexProducer::token_fatJets
edm::EDGetTokenT< edm::View< reco::Jet > > token_fatJets
Definition: TemplatedSecondaryVertexProducer.cc:167
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ValueMap< float >
Exception
Definition: hltDiff.cc:246
TemplatedSecondaryVertexProducer::token_extSVCollection
edm::EDGetTokenT< edm::View< VTX > > token_extSVCollection
Definition: TemplatedSecondaryVertexProducer.cc:157
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::RefToBase< reco::Jet >
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
RecoVertex::convertPos
reco::Vertex::Point convertPos(const GlobalPoint &p)
Definition: ConvertToFromReco.h:7
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
reco::GhostTrackPrediction
Definition: GhostTrackPrediction.h:21
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TemplatedSecondaryVertexProducer::CONSTRAINT_NONE
Definition: TemplatedSecondaryVertexProducer.cc:134
getGhostTrackFitType
static GhostTrackVertexFinder::FitType getGhostTrackFitType(const std::string &name)
Definition: TemplatedSecondaryVertexProducer.cc:224
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TemplatedSecondaryVertexProducer::CONSTRAINT_PV_PRIMARIES_IN_FIT
Definition: TemplatedSecondaryVertexProducer.cc:139
fftjetvertexadder_cfi.sigmaZ
sigmaZ
Definition: fftjetvertexadder_cfi.py:32
event
Definition: event.py:1
TrackSorting::getCriterium
reco::btag::SortCriteria getCriterium(const std::string &name)
Definition: TrackSorting.cc:11
TemplatedSecondaryVertexProducer::fjJetDefinition
JetDefPtr fjJetDefinition
Definition: TemplatedSecondaryVertexProducer.cc:172
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::ParameterDescription
Definition: ParameterDescription.h:110
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
reco::TemplatedSecondaryVertex
Definition: TemplatedSecondaryVertex.h:11
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
ConfigurableVertexReconstructor
Definition: ConfigurableVertexReconstructor.h:13
TemplatedSecondaryVertexProducer::jetPtMin
double jetPtMin
Definition: TemplatedSecondaryVertexProducer.cc:162
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
pat::JetPtrCollection
std::vector< edm::Ptr< pat::Jet > > JetPtrCollection
Definition: Jet.h:75
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HLT_2018_cff.trackIPTagInfos
trackIPTagInfos
Definition: HLT_2018_cff.py:50467