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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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 Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void produce (edm::Event &event, const edm::EventSetup &es) override
 
 TemplatedSecondaryVertexProducer (const edm::ParameterSet &params)
 
 ~TemplatedSecondaryVertexProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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 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)
 
void matchSubjets (const edm::Handle< edm::View< reco::Jet > > &fatJets, const edm::Handle< std::vector< IPTI > > &subjets, std::vector< std::vector< int > > &matchedIndices)
 
const reco::JettoJet (const reco::Jet &j)
 
const reco::JettoJet (const IPTI &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
 
TrackSelector trackSelector
 
bool useExternalSV
 
bool useFatJets
 
bool useGhostTrack
 
bool useGroomedFatJets
 
bool useSVClustering
 
bool useSVMomentum
 
VertexFilter vertexFilter
 
VertexSorting< SecondaryVertexvertexSorting
 
edm::ParameterSet vtxRecoPSet
 
bool withPVError
 

Additional Inherited Members

- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 106 of file TemplatedSecondaryVertexProducer.cc.

Member Typedef Documentation

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

Definition at line 113 of file TemplatedSecondaryVertexProducer.cc.

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

Definition at line 114 of file TemplatedSecondaryVertexProducer.cc.

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

Definition at line 111 of file TemplatedSecondaryVertexProducer.cc.

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

Definition at line 112 of file TemplatedSecondaryVertexProducer.cc.

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

Definition at line 115 of file TemplatedSecondaryVertexProducer.cc.

Member Enumeration Documentation

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

Constructor & Destructor Documentation

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

Definition at line 258 of file TemplatedSecondaryVertexProducer.cc.

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, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), TemplatedSecondaryVertexProducer< IPTI, VTX >::extSVDeltaRToJet, funct::false, TemplatedSecondaryVertexProducer< IPTI, VTX >::fjJetDefinition, edm::ParameterSet::getParameter(), TemplatedSecondaryVertexProducer< IPTI, VTX >::ghostRescaling, TemplatedSecondaryVertexProducer< IPTI, VTX >::jetAlgorithm, TemplatedSecondaryVertexProducer< IPTI, VTX >::jetPtMin, TemplatedSecondaryVertexProducer< IPTI, VTX >::relPtTolerance, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, 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 >::useExternalSV, TemplatedSecondaryVertexProducer< IPTI, VTX >::useFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useGroomedFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVClustering, and TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVMomentum.

259  :
261  trackSelector(params.getParameter<edm::ParameterSet>("trackSelection")),
262  constraint(getConstraintType(params.getParameter<std::string>("constraint"))),
263  constraintScaling(1.0),
264  vtxRecoPSet(params.getParameter<edm::ParameterSet>("vertexReco")),
265  useGhostTrack(vtxRecoPSet.getParameter<std::string>("finder") == "gtvr"),
266  withPVError(params.getParameter<bool>("usePVError")),
267  minTrackWeight(params.getParameter<double>("minimumTrackWeight")),
268  vertexFilter(params.getParameter<edm::ParameterSet>("vertexCuts")),
269  vertexSorting(params.getParameter<edm::ParameterSet>("vertexSelection"))
270 {
271  token_trackIPTagInfo = consumes<std::vector<IPTI> >(params.getParameter<edm::InputTag>("trackIPTagInfos"));
274  constraintScaling = params.getParameter<double>("pvErrorScaling");
275 
280  token_BeamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpotTag"));
281  useExternalSV = false;
282  if(params.existsAs<bool>("useExternalSV")) useExternalSV = params.getParameter<bool> ("useExternalSV");
283  if(useExternalSV) {
284  token_extSVCollection = consumes<edm::View<VTX> >(params.getParameter<edm::InputTag>("extSVCollection"));
285  extSVDeltaRToJet = params.getParameter<double>("extSVDeltaRToJet");
286  }
287  useSVClustering = ( params.existsAs<bool>("useSVClustering") ? params.getParameter<bool>("useSVClustering") : false );
288  useSVMomentum = ( params.existsAs<bool>("useSVMomentum") ? params.getParameter<bool>("useSVMomentum") : false );
289  useFatJets = ( useExternalSV && params.exists("fatJets") );
290  useGroomedFatJets = ( useExternalSV && params.exists("groomedFatJets") );
291  if( useSVClustering )
292  {
293  jetAlgorithm = params.getParameter<std::string>("jetAlgorithm");
294  rParam = params.getParameter<double>("rParam");
295  jetPtMin = 0.; // hardcoded to 0. since we simply want to recluster all input jets which already had some PtMin applied
296  ghostRescaling = ( params.existsAs<double>("ghostRescaling") ? params.getParameter<double>("ghostRescaling") : 1e-18 );
297  relPtTolerance = ( params.existsAs<double>("relPtTolerance") ? params.getParameter<double>("relPtTolerance") : 1e-03); // 0.1% relative difference in Pt should be sufficient to detect possible misconfigurations
298 
299  // set jet algorithm
300  if (jetAlgorithm=="Kt")
301  fjJetDefinition = JetDefPtr( new fastjet::JetDefinition(fastjet::kt_algorithm, rParam) );
302  else if (jetAlgorithm=="CambridgeAachen")
303  fjJetDefinition = JetDefPtr( new fastjet::JetDefinition(fastjet::cambridge_algorithm, rParam) );
304  else if (jetAlgorithm=="AntiKt")
305  fjJetDefinition = JetDefPtr( new fastjet::JetDefinition(fastjet::antikt_algorithm, rParam) );
306  else
307  throw cms::Exception("InvalidJetAlgorithm") << "Jet clustering algorithm is invalid: " << jetAlgorithm << ", use CambridgeAachen | Kt | AntiKt" << std::endl;
308  }
309  if( useFatJets )
310  token_fatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("fatJets"));
311  if( useGroomedFatJets )
312  token_groomedFatJets = consumes<edm::View<reco::Jet> >(params.getParameter<edm::InputTag>("groomedFatJets"));
313  if( useFatJets && !useSVClustering )
314  rParam = params.getParameter<double>("rParam"); // will be used later as a dR cut
315 
316  produces<Product>();
317 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Jet > > token_fatJets
reco::btag::SortCriteria getCriterium(const std::string &name)
Definition: TrackSorting.cc:11
boost::shared_ptr< fastjet::JetDefinition > JetDefPtr
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< std::vector< IPTI > > token_trackIPTagInfo
VertexSorting< SecondaryVertex > vertexSorting
static ConstraintType getConstraintType(const std::string &name)
edm::EDGetTokenT< edm::View< VTX > > token_extSVCollection
edm::EDGetTokenT< edm::View< reco::Jet > > token_groomedFatJets
template<class IPTI , class VTX >
TemplatedSecondaryVertexProducer< IPTI, VTX >::~TemplatedSecondaryVertexProducer ( )

Definition at line 319 of file TemplatedSecondaryVertexProducer.cc.

320 {
321 }

Member Function Documentation

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

Definition at line 1221 of file TemplatedSecondaryVertexProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::addOptionalNode(), MillePedeFileConverter_cfg::e, AlCaHLTBitMon_QueryRunRegistry::string, trackSelection_cff::trackSelection, bVertexFilter_cfi::v0Filter, vertexCuts_cff::vertexCuts, ghostTrackVertexReco_cff::vertexReco, and vertexSelection_cff::vertexSelection.

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

Definition at line 219 of file TemplatedSecondaryVertexProducer.cc.

References Exception.

220 {
221  if (name == "None")
222  return CONSTRAINT_NONE;
223  else if (name == "BeamSpot")
224  return CONSTRAINT_BEAMSPOT;
225  else if (name == "BeamSpot+PVPosition")
227  else if (name == "BeamSpotZ+PVErrorScaledXY")
229  else if (name == "PVErrorScaled")
231  else if (name == "BeamSpot+PVTracksInFit")
233  else
234  throw cms::Exception("InvalidArgument")
235  << "TemplatedSecondaryVertexProducer: ``constraint'' parameter "
236  "value \"" << name << "\" not understood."
237  << std::endl;
238 }
template<class IPTI, class VTX>
void TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private
template<>
void TemplatedSecondaryVertexProducer< TrackIPTagInfo, reco::Vertex >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private

Definition at line 916 of file TemplatedSecondaryVertexProducer.cc.

References Exception, spr::find(), training_settings::idx, diffTreeTool::index, TemplatedSecondaryVertexProducer< IPTI, VTX >::minTrackWeight, btagGenBb_cfi::Status, and TemplatedSecondaryVertexProducer< IPTI, VTX >::useExternalSV.

917 {
918  for(Vertex::trackRef_iterator iter = sv.tracks_begin(); iter != sv.tracks_end(); ++iter) {
919  if (sv.trackWeight(*iter) < minTrackWeight)
920  continue;
921 
922  typename input_container::const_iterator pos =
923  std::find(trackRefs.begin(), trackRefs.end(),
924  iter->castTo<input_item>());
925 
926  if (pos == trackRefs.end() ) {
927  if(!useExternalSV)
928  throw cms::Exception("TrackNotFound")
929  << "Could not find track from secondary "
930  "vertex in original tracks."
931  << std::endl;
932  } else {
933  unsigned int index = pos - trackRefs.begin();
934  trackData[index].second.svStatus =
936  ((unsigned int)btag::TrackData::trackAssociatedToVertex + idx);
937  }
938  }
939 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
IPTI::input_container::value_type input_item
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37
template<>
void TemplatedSecondaryVertexProducer< CandIPTagInfo, reco::VertexCompositePtrCandidate >::markUsedTracks ( TrackDataVector trackData,
const input_container trackRefs,
const SecondaryVertex sv,
size_t  idx 
)
private

Definition at line 941 of file TemplatedSecondaryVertexProducer.cc.

References spr::find(), training_settings::idx, diffTreeTool::index, and btagGenBb_cfi::Status.

942 {
943  for(typename input_container::const_iterator iter = sv.daughterPtrVector().begin(); iter != sv.daughterPtrVector().end(); ++iter)
944  {
945  typename input_container::const_iterator pos =
946  std::find(trackRefs.begin(), trackRefs.end(), *iter);
947 
948  if (pos != trackRefs.end() )
949  {
950  unsigned int index = pos - trackRefs.begin();
951  trackData[index].second.svStatus =
953  ((unsigned int)btag::TrackData::trackAssociatedToVertex + idx);
954  }
955  }
956 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
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 1064 of file TemplatedSecondaryVertexProducer.cc.

References reco::deltaR2(), SoftLeptonByDistance_cfi::distance, spr::find(), fwrapper::jets, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, and mathSSE::sqrt().

Referenced by TemplatedSecondaryVertexProducer< IPTI, VTX >::produce().

1067 {
1068  std::vector<bool> jetLocks(jets->size(),false);
1069  std::vector<int> jetIndices;
1070 
1071  for(size_t gj=0; gj<groomedJets->size(); ++gj)
1072  {
1073  double matchedDR2 = 1e9;
1074  int matchedIdx = -1;
1075 
1076  if( groomedJets->at(gj).pt()>0. ) // skip pathological cases of groomed jets with Pt=0
1077  {
1078  for(size_t j=0; j<jets->size(); ++j)
1079  {
1080  if( jetLocks.at(j) ) continue; // skip jets that have already been matched
1081 
1082  double tempDR2 = Geom::deltaR2( jets->at(j).rapidity(), jets->at(j).phi(), groomedJets->at(gj).rapidity(), groomedJets->at(gj).phi() );
1083  if( tempDR2 < matchedDR2 )
1084  {
1085  matchedDR2 = tempDR2;
1086  matchedIdx = j;
1087  }
1088  }
1089  }
1090 
1091  if( matchedIdx>=0 )
1092  {
1093  if ( matchedDR2 > rParam*rParam )
1094  {
1095  edm::LogWarning("MatchedJetsFarApart") << "Matched groomed jet " << gj << " and original jet " << matchedIdx <<" are separated by dR=" << sqrt(matchedDR2) << " which is greater than the jet size R=" << rParam << ".\n"
1096  << "This is not expected so the matching of these two jets has been discarded. Please check that the two jet collections belong to each other.";
1097  matchedIdx = -1;
1098  }
1099  else
1100  jetLocks.at(matchedIdx) = true;
1101  }
1102  jetIndices.push_back(matchedIdx);
1103  }
1104 
1105  for(size_t j=0; j<jets->size(); ++j)
1106  {
1107  std::vector<int>::iterator matchedIndex = std::find( jetIndices.begin(), jetIndices.end(), j );
1108 
1109  matchedIndices.push_back( matchedIndex != jetIndices.end() ? std::distance(jetIndices.begin(),matchedIndex) : -1 );
1110  }
1111 }
size_type size() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
T sqrt(T t)
Definition: SSEVec.h:18
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
const_reference at(size_type pos) const
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 1019 of file TemplatedSecondaryVertexProducer.cc.

References reco::deltaR2(), objects.autophobj::jetType, phi, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and TemplatedSecondaryVertexProducer< IPTI, VTX >::toJet().

1023 {
1024  std::string type = ( jetType!="" ? jetType + " " : jetType );
1025 
1026  std::vector<bool> matchedLocks(reclusteredJets.size(),false);
1027 
1028  for(size_t j=0; j<jets->size(); ++j)
1029  {
1030  double matchedDR2 = 1e9;
1031  int matchedIdx = -1;
1032 
1033  for(size_t rj=0; rj<reclusteredJets.size(); ++rj)
1034  {
1035  if( matchedLocks.at(rj) ) continue; // skip jets that have already been matched
1036 
1037  double tempDR2 = Geom::deltaR2( toJet(jets->at(j))->rapidity(), toJet(jets->at(j))->phi(), reclusteredJets.at(rj).rapidity(), reclusteredJets.at(rj).phi_std() );
1038  if( tempDR2 < matchedDR2 )
1039  {
1040  matchedDR2 = tempDR2;
1041  matchedIdx = rj;
1042  }
1043  }
1044 
1045  if( matchedIdx>=0 )
1046  {
1047  if ( matchedDR2 > rParam*rParam )
1048  {
1049  edm::LogError("JetMatchingFailed") << "Matched reclustered jet " << matchedIdx << " and original " << type << "jet " << j <<" are separated by dR=" << sqrt(matchedDR2) << " which is greater than the jet size R=" << rParam << ".\n"
1050  << "This is not expected so please check that the jet algorithm and jet size match those used for the original " << type << "jet collection.";
1051  }
1052  else
1053  matchedLocks.at(matchedIdx) = true;
1054  }
1055  else
1056  edm::LogError("JetMatchingFailed") << "Matching reclustered to original " << type << "jets failed. Please check that the jet algorithm and jet size match those used for the original " << type << "jet collection.";
1057 
1058  matchedIndices.push_back(matchedIdx);
1059  }
1060 }
type
Definition: HCALResponse.h:21
T sqrt(T t)
Definition: SSEVec.h:18
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
const reco::Jet * toJet(const reco::Jet &j)
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 1115 of file TemplatedSecondaryVertexProducer.cc.

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

Referenced by TemplatedSecondaryVertexProducer< IPTI, VTX >::produce().

1119 {
1120  for(size_t g=0; g<groomedIndices.size(); ++g)
1121  {
1122  std::vector<int> subjetIndices;
1123 
1124  if( groomedIndices.at(g)>=0 )
1125  {
1126  for(size_t s=0; s<groomedJets->at(groomedIndices.at(g)).numberOfDaughters(); ++s)
1127  {
1128  const edm::Ptr<reco::Candidate> & subjet = groomedJets->at(groomedIndices.at(g)).daughterPtr(s);
1129 
1130  for(size_t sj=0; sj<subjets->size(); ++sj)
1131  {
1132  const edm::RefToBase<reco::Jet> &subjetRef = subjets->at(sj).jet();
1133  if( subjet == edm::Ptr<reco::Candidate>( subjetRef.id(), subjetRef.get(), subjetRef.key() ) )
1134  {
1135  subjetIndices.push_back(sj);
1136  break;
1137  }
1138  }
1139  }
1140 
1141  if( subjetIndices.size() == 0 )
1142  edm::LogError("SubjetMatchingFailed") << "Matching subjets to original fat jets failed. Please check that the groomed fat jet and subjet collections belong to each other.";
1143 
1144  matchedIndices.push_back(subjetIndices);
1145  }
1146  else
1147  matchedIndices.push_back(subjetIndices);
1148  }
1149 }
value_type const * get() const
Definition: RefToBase.h:234
ProductID id() const
Definition: RefToBase.h:242
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
size_t key() const
Definition: RefToBase.h:250
const_reference at(size_type pos) const
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 1153 of file TemplatedSecondaryVertexProducer.cc.

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

1156 {
1157  for(size_t fj=0; fj<fatJets->size(); ++fj)
1158  {
1159  std::vector<int> subjetIndices;
1160  size_t nSubjetCollections = 0;
1161  size_t nSubjets = 0;
1162 
1163  const pat::Jet * fatJet = dynamic_cast<const pat::Jet *>( fatJets->ptrAt(fj).get() );
1164 
1165  if( !fatJet )
1166  {
1167  if( fj==0 ) edm::LogError("WrongJetType") << "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  }
1172  else
1173  {
1174  nSubjetCollections = fatJet->subjetCollectionNames().size();
1175 
1176  if( nSubjetCollections>0 )
1177  {
1178  for(size_t coll=0; coll<nSubjetCollections; ++coll)
1179  {
1180  const pat::JetPtrCollection & fatJetSubjets = fatJet->subjets(coll);
1181 
1182  for(size_t fjsj=0; fjsj<fatJetSubjets.size(); ++fjsj)
1183  {
1184  ++nSubjets;
1185 
1186  for(size_t sj=0; sj<subjets->size(); ++sj)
1187  {
1188  const pat::Jet * subJet = dynamic_cast<const pat::Jet *>( subjets->at(sj).jet().get() );
1189 
1190  if( !subJet )
1191  {
1192  if( fj==0 && coll==0 && fjsj==0 && sj==0 ) edm::LogError("WrongJetType") << "Wrong jet type for input subjets. Please check that the input subjets are of the pat::Jet type.";
1193 
1194  break;
1195  }
1196  else
1197  {
1198  if( subJet->originalObjectRef() == fatJetSubjets.at(fjsj)->originalObjectRef() )
1199  {
1200  subjetIndices.push_back(sj);
1201  break;
1202  }
1203  }
1204  }
1205  }
1206  }
1207 
1208  if( subjetIndices.size() == 0 && nSubjets > 0)
1209  edm::LogError("SubjetMatchingFailed") << "Matching subjets to fat jets failed. Please check that the fat jet and subjet collections belong to each other.";
1210 
1211  matchedIndices.push_back(subjetIndices);
1212  }
1213  else
1214  matchedIndices.push_back(subjetIndices);
1215  }
1216  }
1217 }
Ptr< value_type > ptrAt(size_type i) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:159
size_type size() const
std::vector< edm::Ptr< pat::Jet > > JetPtrCollection
Definition: Jet.h:75
std::vector< std::string > const & subjetCollectionNames() const
Subjet collection names.
Definition: Jet.h:511
const edm::Ptr< reco::Candidate > & originalObjectRef() const
reference to original object. Returns a null reference if not available
Definition: PATObject.h:500
JetCorrectorParametersCollection coll
Definition: classes.h:10
Analysis-level calorimeter jet class.
Definition: Jet.h:78
pat::JetPtrCollection const & subjets(unsigned int index=0) const
Access to subjet list.
template<class IPTI , class VTX >
void TemplatedSecondaryVertexProducer< IPTI, VTX >::produce ( edm::Event event,
const edm::EventSetup es 
)
overridevirtual

Definition at line 324 of file TemplatedSecondaryVertexProducer.cc.

References funct::abs(), ecalDrivenElectronSeedsParameters_cff::beamSpot, reco::BeamSpot::BeamWidthX(), TransientTrackBuilder::build(), TemplatedSecondaryVertexProducer< IPTI, VTX >::constraint, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_BEAMSPOT, TemplatedSecondaryVertexProducer< IPTI, VTX >::CONSTRAINT_NONE, 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, RecoVertex::convertError(), RecoVertex::convertPos(), reco::BeamSpot::covariance(), reco::Vertex::covariance(), reco::deltaR2(), dir, reco::TemplatedSecondaryVertex< SV >::dist1d(), reco::TemplatedSecondaryVertex< SV >::dist2d(), reco::TemplatedSecondaryVertex< SV >::dist3d(), SoftLeptonByDistance_cfi::distance, reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), reco::Candidate::energy(), reco::Vertex::error(), TemplatedSecondaryVertexProducer< IPTI, VTX >::extSVDeltaRToJet, TemplatedSecondaryVertexProducer< IPTI, VTX >::fjClusterSeq, TemplatedSecondaryVertexProducer< IPTI, VTX >::fjJetDefinition, flightDirection(), edm::EventSetup::get(), getGhostTrackFitType(), edm::ParameterSet::getParameter(), TemplatedSecondaryVertexProducer< IPTI, VTX >::ghostRescaling, mps_fire::i, training_settings::idx, edm::HandleBase::isValid(), metsig::jet, TemplatedSecondaryVertexProducer< IPTI, VTX >::jetPtMin, reco::GhostTrackState::linearize(), funct::m, PV3DBase< T, PVType, FrameType >::mag(), TemplatedSecondaryVertexProducer< IPTI, VTX >::markUsedTracks(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchGroomedJets(), TemplatedSecondaryVertexProducer< IPTI, VTX >::matchSubjets(), TemplatedSecondaryVertexProducer< IPTI, VTX >::minTrackWeight, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, position(), reco::Vertex::position(), EnergyCorrector::pt, reco::Candidate::pt(), MetAnalyzer::pv(), reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), TemplatedSecondaryVertexProducer< IPTI, VTX >::relPtTolerance, TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam, reco::GhostTrackState::setWeight(), fftjetvertexadder_cfi::sigmaZ, reco::BeamSpot::sigmaZ(), TemplatedSecondaryVertexProducer< IPTI, VTX >::sortCriterium, AlCaHLTBitMon_QueryRunRegistry::string, combinedMVAV2BJetTags_cfi::tagInfos, 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, reco::btag::toTrack(), HiIsolationCommonParameters_cff::track, pfInclusiveSecondaryVertexFinderAK8TagInfos_cfi::trackIPTagInfos, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), TemplatedSecondaryVertexProducer< IPTI, VTX >::trackSelector, Vector3DBase< T, FrameTag >::unit(), Unknown, TemplatedSecondaryVertexProducer< IPTI, VTX >::useExternalSV, TemplatedSecondaryVertexProducer< IPTI, VTX >::useFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useGhostTrack, TemplatedSecondaryVertexProducer< IPTI, VTX >::useGroomedFatJets, TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVClustering, TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVMomentum, findQualityFiles::v, TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexFilter, ghostTrackVertexReco_cff::vertexReco, TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexSorting, TemplatedSecondaryVertexProducer< IPTI, VTX >::vtxRecoPSet, TemplatedSecondaryVertexProducer< IPTI, VTX >::withPVError, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

Definition at line 136 of file TemplatedSecondaryVertexProducer.cc.

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

Member Data Documentation

template<class IPTI, class VTX>
ConstraintType TemplatedSecondaryVertexProducer< IPTI, VTX >::constraint
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::constraintScaling
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::extSVDeltaRToJet
private
template<class IPTI, class VTX>
ClusterSequencePtr TemplatedSecondaryVertexProducer< IPTI, VTX >::fjClusterSeq
private
template<class IPTI, class VTX>
JetDefPtr TemplatedSecondaryVertexProducer< IPTI, VTX >::fjJetDefinition
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::ghostRescaling
private
template<class IPTI, class VTX>
std::string TemplatedSecondaryVertexProducer< IPTI, VTX >::jetAlgorithm
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::jetPtMin
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::minTrackWeight
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::relPtTolerance
private
template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::rParam
private
template<class IPTI, class VTX>
reco::btag::SortCriteria TemplatedSecondaryVertexProducer< IPTI, VTX >::sortCriterium
private
template<class IPTI, class VTX>
edm::EDGetTokenT<reco::BeamSpot> TemplatedSecondaryVertexProducer< IPTI, VTX >::token_BeamSpot
private
template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<VTX> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_extSVCollection
private
template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<reco::Jet> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_fatJets
private
template<class IPTI, class VTX>
edm::EDGetTokenT<edm::View<reco::Jet> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_groomedFatJets
private
template<class IPTI, class VTX>
edm::EDGetTokenT<std::vector<IPTI> > TemplatedSecondaryVertexProducer< IPTI, VTX >::token_trackIPTagInfo
private
template<class IPTI, class VTX>
TrackSelector TemplatedSecondaryVertexProducer< IPTI, VTX >::trackSelector
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useExternalSV
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useFatJets
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useGhostTrack
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useGroomedFatJets
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVClustering
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::useSVMomentum
private
template<class IPTI, class VTX>
VertexFilter TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexFilter
private
template<class IPTI, class VTX>
VertexSorting<SecondaryVertex> TemplatedSecondaryVertexProducer< IPTI, VTX >::vertexSorting
private
template<class IPTI, class VTX>
edm::ParameterSet TemplatedSecondaryVertexProducer< IPTI, VTX >::vtxRecoPSet
private
template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::withPVError
private