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<>

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 
- 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());
33  vertexAssociator_ = new reco::tau::RecoTauVertexAssociator(iConfig.getParameter<ParameterSet>("qualityCuts"),consumesCollector());
34  }
T getParameter(std::string const &) const
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:59
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:442
bool isNull() const
Checks for null.
Definition: Ref.h:250
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:480
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