CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFRecoTauDiscriminationByFlightPathSignificance Class Reference
Inheritance diagram for PFRecoTauDiscriminationByFlightPathSignificance:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &) override
 
double discriminate (const reco::PFTauRef &) const override
 
 PFRecoTauDiscriminationByFlightPathSignificance (const ParameterSet &iConfig)
 
 ~PFRecoTauDiscriminationByFlightPathSignificance () override
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau) const =0
 
virtual void endEvent (edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
 ~TauDiscriminationProducerBase () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies 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)
 

Private Member Functions

double threeProngFlightPathSig (const PFTauRef &) const
 
double vertexSignificance (reco::Vertex const &, reco::Vertex const &, GlobalVector const &) const
 

Private Attributes

bool booleanOutput
 
double flightPathSig
 
const TransientTrackBuildertransientTrackBuilder
 
reco::tau::RecoTauVertexAssociatorvertexAssociator_
 
bool withPVError
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd< TauCollectionTauRefProd
 
- 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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 
- Protected Attributes inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
std::string moduleLabel_
 
double prediscriminantFailValue_
 
edm::EDGetTokenT< TauCollectionTau_token
 
size_t tauIndex_
 
edm::InputTag TauProducer_
 

Detailed Description

Definition at line 24 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByFlightPathSignificance::PFRecoTauDiscriminationByFlightPathSignificance ( const ParameterSet iConfig)
inlineexplicit

Definition at line 27 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References CaloRecoTauDiscriminationByFlightPathSignificance_cfi::flightPathSig, and edm::ParameterSet::getParameter().

29  flightPathSig = iConfig.getParameter<double>("flightPathSig");
30  withPVError = iConfig.getParameter<bool>("UsePVerror");
31  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
32  // edm::ConsumesCollector iC(consumesCollector());
34  }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationByFlightPathSignificance::~PFRecoTauDiscriminationByFlightPathSignificance ( )
inlineoverride

Definition at line 36 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

36 {}

Member Function Documentation

void PFRecoTauDiscriminationByFlightPathSignificance::beginEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 54 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::EventSetup::get(), and edm::ESHandle< T >::product().

55  {
56 
57  vertexAssociator_->setEvent(iEvent);
58 
59  // Transient Tracks
61  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
62  transientTrackBuilder = builder.product();
63 
64 }
void setEvent(const edm::Event &evt)
Load the vertices from the event.
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
double PFRecoTauDiscriminationByFlightPathSignificance::discriminate ( const reco::PFTauRef tau) const
override
double PFRecoTauDiscriminationByFlightPathSignificance::threeProngFlightPathSig ( const PFTauRef tau) const
private

Definition at line 72 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References reco::PFCandidate::gsfTrackRef(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), TransientVertex::isValid(), impactParameterTagInfos_cfi::primaryVertex, reco::PFCandidate::trackRef(), and KalmanVertexFitter::vertex().

73  {
74  double flightPathSignificance = 0;
75 
77 
78  if (primaryVertex.isNull()) {
79  edm::LogError("FlightPathSignficance") << "Could not get vertex associated"
80  << " to tau, returning -999!" << std::endl;
81  return -999;
82  }
83 
84  //Secondary vertex
85  const vector<PFCandidatePtr>& pfSignalCandidates = tau->signalPFChargedHadrCands();
86  vector<TransientTrack> transientTracks;
87  vector<PFCandidatePtr>::const_iterator iTrack;
88  for(iTrack = pfSignalCandidates.begin(); iTrack!= pfSignalCandidates.end(); iTrack++){
89  const PFCandidate& pfCand = *(iTrack->get());
90  if(pfCand.trackRef().isNonnull()){
91  const TransientTrack transientTrack = transientTrackBuilder->build(pfCand.trackRef());
92  transientTracks.push_back(transientTrack);
93  }
94  else if(pfCand.gsfTrackRef().isNonnull()){
95  const TransientTrack transientTrack = transientTrackBuilder->build(pfCand.gsfTrackRef());
96  transientTracks.push_back(transientTrack);
97  }
98  }
99  if(transientTracks.size() > 1){
100  KalmanVertexFitter kvf(true);
101  TransientVertex tv = kvf.vertex(transientTracks);
102 
103  if(tv.isValid()){
104  GlobalVector tauDir(tau->px(),
105  tau->py(),
106  tau->pz());
107  Vertex secVer = tv;
108  // We have to un-const the PV for some reason
109  reco::Vertex primaryVertexNonConst = *primaryVertex;
110  flightPathSignificance = vertexSignificance(primaryVertexNonConst,secVer,tauDir);
111  }
112  }
113  return flightPathSignificance;
114 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
double vertexSignificance(reco::Vertex const &, reco::Vertex const &, GlobalVector const &) const
reco::VertexRef associatedVertex(const PFJet &jet) const
reco::TransientTrack build(const reco::Track *p) const
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:438
bool isNull() const
Checks for null.
Definition: Ref.h:250
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:476
bool isValid() const
double PFRecoTauDiscriminationByFlightPathSignificance::vertexSignificance ( reco::Vertex const &  pv,
reco::Vertex const &  sv,
GlobalVector const &  direction 
) const
private

Member Data Documentation

bool PFRecoTauDiscriminationByFlightPathSignificance::booleanOutput
private
double PFRecoTauDiscriminationByFlightPathSignificance::flightPathSig
private
const TransientTrackBuilder* PFRecoTauDiscriminationByFlightPathSignificance::transientTrackBuilder
private
reco::tau::RecoTauVertexAssociator* PFRecoTauDiscriminationByFlightPathSignificance::vertexAssociator_
private
bool PFRecoTauDiscriminationByFlightPathSignificance::withPVError
private