CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFRecoTauDiscriminationByFlightPathSignificance Class Reference
Inheritance diagram for PFRecoTauDiscriminationByFlightPathSignificance:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginEvent (const edm::Event &, const edm::EventSetup &)
 
double discriminate (const reco::PFTauRef &)
 
 PFRecoTauDiscriminationByFlightPathSignificance (const ParameterSet &iConfig)
 
 ~PFRecoTauDiscriminationByFlightPathSignificance ()
 
- Public Member Functions inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
virtual double discriminate (const TauRef &tau)=0
 
virtual void endEvent (edm::Event &evt)
 
void produce (edm::Event &, const edm::EventSetup &)
 
 TauDiscriminationProducerBase (const edm::ParameterSet &iConfig)
 
 TauDiscriminationProducerBase ()
 
virtual ~TauDiscriminationProducerBase ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

bool booleanOutput
 
double flightPathSig
 
const TransientTrackBuildertransientTrackBuilder
 
reco::tau::RecoTauVertexAssociator vertexAssociator_
 
bool withPVError
 

Additional Inherited Members

- Public Types inherited from TauDiscriminationProducerBase< TauType, TauDiscriminator >
typedef std::vector< TauType > TauCollection
 
typedef edm::Ref< TauCollectionTauRef
 
typedef edm::RefProd
< TauCollection
TauRefProd
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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::InputTag TauProducer_
 

Detailed Description

Definition at line 25 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

Constructor & Destructor Documentation

PFRecoTauDiscriminationByFlightPathSignificance::PFRecoTauDiscriminationByFlightPathSignificance ( const ParameterSet iConfig)
inlineexplicit

Definition at line 28 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::ParameterSet::getParameter().

31  vertexAssociator_(iConfig.getParameter<ParameterSet>("qualityCuts")) {
32  flightPathSig = iConfig.getParameter<double>("flightPathSig");
33  withPVError = iConfig.getParameter<bool>("UsePVerror");
34  booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
35  }
T getParameter(std::string const &) const
TauDiscriminationProducerBase< reco::PFTau, reco::PFTauDiscriminator > PFTauDiscriminationProducerBase
PFRecoTauDiscriminationByFlightPathSignificance::~PFRecoTauDiscriminationByFlightPathSignificance ( )
inline

Definition at line 37 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

37 {}

Member Function Documentation

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

Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.

Definition at line 55 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

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

56  {
57 
59 
60  // Transient Tracks
62  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
63  transientTrackBuilder = builder.product();
64 
65 }
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:62
double PFRecoTauDiscriminationByFlightPathSignificance::discriminate ( const reco::PFTauRef tau)
double PFRecoTauDiscriminationByFlightPathSignificance::threeProngFlightPathSig ( const PFTauRef tau)
private

Definition at line 73 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), TransientVertex::isValid(), reco::PFCandidate::trackRef(), and KalmanVertexFitter::vertex().

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

Definition at line 113 of file PFRecoTauDiscriminationByFlightPathSignificance.cc.

References reco::SecondaryVertex::computeDist3d(), and Measurement1D::significance().

114  {
115  return SecondaryVertex::computeDist3d(pv,sv,direction,withPVError).significance();
116 }

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